JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::Direct2DGraphicsContext Class Referenceabstract

#include <juce_Direct2DGraphicsContext_windows.h>

Inheritance diagram for juce::Direct2DGraphicsContext:
Collaboration diagram for juce::Direct2DGraphicsContext:

Classes

class  PendingClipList
 
struct  Pimpl
 
struct  ScopedTransform
 

Public Member Functions

 Direct2DGraphicsContext ()
 
 ~Direct2DGraphicsContext () override
 
void addTransform (const AffineTransform &) override
 
void beginTransparencyLayer (float opacity) override
 
bool clipRegionIntersects (const Rectangle< int > &) override
 
void clipToImageAlpha (const Image &, const AffineTransform &) override
 
void clipToPath (const Path &, const AffineTransform &) override
 
bool clipToRectangle (const Rectangle< int > &) override
 
bool clipToRectangleList (const RectangleList< int > &) override
 
virtual Image createSnapshot () const
 
void drawEllipse (const Rectangle< float > &area, float lineThickness) override
 
void drawGlyphs (Span< const uint16_t >, Span< const Point< float > >, const AffineTransform &) override
 Uses the current font to draw the provided glyph numbers.
 
void drawImage (const Image &sourceImage, const AffineTransform &) override
 
void drawLine (const Line< float > &) override
 
void drawLineWithThickness (const Line< float > &, float) override
 
void drawRect (const Rectangle< float > &, float) override
 
void drawRoundedRectangle (const Rectangle< float > &area, float cornerSize, float lineThickness) override
 
void endFrame ()
 
void endTransparencyLayer () override
 
void excludeClipRectangle (const Rectangle< int > &) override
 
virtual void fillAll ()
 
void fillEllipse (const Rectangle< float > &area) override
 
void fillPath (const Path &, const AffineTransform &) override
 
void fillRect (const Rectangle< float > &) override
 
void fillRect (const Rectangle< int > &, bool replaceExistingContents) override
 
void fillRectList (const RectangleList< float > &) override
 
void fillRoundedRectangle (const Rectangle< float > &area, float cornerSize) override
 
Rectangle< int > getClipBounds () const override
 
const FontgetFont () override
 
uint64_t getFrameId () const override
 Returns an integer that uniquely identifies the current frame.
 
float getPhysicalPixelScaleFactor () const override
 
std::unique_ptr< ImageTypegetPreferredImageTypeForTemporaryImages () const override
 Returns the optimal ImageType for creating temporary images in this GraphicsContext.
 
bool isClipEmpty () const override
 
bool isVectorDevice () const override
 Returns true if this device is vector-based, e.g.
 
void restoreState () override
 
void saveState () override
 
void setFill (const FillType &) override
 
void setFont (const Font &) override
 
void setInterpolationQuality (Graphics::ResamplingQuality) override
 
void setOpacity (float) override
 
void setOrigin (Point< int >) override
 Moves the origin to a new position.
 
bool startFrame (float dpiScale)
 
void strokePath (const Path &, const PathStrokeType &strokeType, const AffineTransform &) override
 

Public Attributes

Direct2DMetrics::Ptr metrics
 

Protected Member Functions

void applyPendingClipList ()
 
virtual void clearTargetBuffer ()=0
 
virtual PimplgetPimpl () const noexcept=0
 
template<typename Shape , typename Fn >
void paintPrimitive (const Shape &shape, Fn &&primitiveOp)
 
void resetPendingClipList ()
 

Static Protected Member Functions

static Line< floatoffsetShape (Line< float > a, Point< float > b)
 
static Rectangle< floatoffsetShape (Rectangle< float > a, Point< float > b)
 
static RectangleList< floatoffsetShape (RectangleList< float > a, Point< float > b)
 

Protected Attributes

SavedState * currentState = nullptr
 
uint64_t frame = 0
 
PendingClipList pendingClipList
 

Constructor & Destructor Documentation

◆ Direct2DGraphicsContext()

juce::Direct2DGraphicsContext::Direct2DGraphicsContext ( )

◆ ~Direct2DGraphicsContext()

juce::Direct2DGraphicsContext::~Direct2DGraphicsContext ( )
override

Member Function Documentation

◆ addTransform()

void juce::Direct2DGraphicsContext::addTransform ( const AffineTransform )
overridevirtual

◆ applyPendingClipList()

void juce::Direct2DGraphicsContext::applyPendingClipList ( )
protected

◆ beginTransparencyLayer()

void juce::Direct2DGraphicsContext::beginTransparencyLayer ( float  opacity)
overridevirtual

◆ clearTargetBuffer()

virtual void juce::Direct2DGraphicsContext::clearTargetBuffer ( )
protectedpure virtual

◆ clipRegionIntersects()

bool juce::Direct2DGraphicsContext::clipRegionIntersects ( const Rectangle< int > &  )
overridevirtual

◆ clipToImageAlpha()

void juce::Direct2DGraphicsContext::clipToImageAlpha ( const Image ,
const AffineTransform  
)
overridevirtual

◆ clipToPath()

void juce::Direct2DGraphicsContext::clipToPath ( const Path ,
const AffineTransform  
)
overridevirtual

◆ clipToRectangle()

bool juce::Direct2DGraphicsContext::clipToRectangle ( const Rectangle< int > &  )
overridevirtual

◆ clipToRectangleList()

bool juce::Direct2DGraphicsContext::clipToRectangleList ( const RectangleList< int > &  )
overridevirtual

◆ createSnapshot()

virtual Image juce::Direct2DGraphicsContext::createSnapshot ( ) const
inlinevirtual

Reimplemented in juce::Direct2DHwndContext.

◆ drawEllipse()

void juce::Direct2DGraphicsContext::drawEllipse ( const Rectangle< float > &  area,
float  lineThickness 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ drawGlyphs()

void juce::Direct2DGraphicsContext::drawGlyphs ( Span< const uint16_t >  ,
Span< const Point< float > >  ,
const AffineTransform  
)
overridevirtual

Uses the current font to draw the provided glyph numbers.

Implements juce::LowLevelGraphicsContext.

◆ drawImage()

void juce::Direct2DGraphicsContext::drawImage ( const Image sourceImage,
const AffineTransform  
)
overridevirtual

◆ drawLine()

void juce::Direct2DGraphicsContext::drawLine ( const Line< float > &  )
overridevirtual

◆ drawLineWithThickness()

void juce::Direct2DGraphicsContext::drawLineWithThickness ( const Line< float > &  ,
float   
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ drawRect()

void juce::Direct2DGraphicsContext::drawRect ( const Rectangle< float > &  ,
float   
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ drawRoundedRectangle()

void juce::Direct2DGraphicsContext::drawRoundedRectangle ( const Rectangle< float > &  area,
float  cornerSize,
float  lineThickness 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ endFrame()

void juce::Direct2DGraphicsContext::endFrame ( )

◆ endTransparencyLayer()

void juce::Direct2DGraphicsContext::endTransparencyLayer ( )
overridevirtual

◆ excludeClipRectangle()

void juce::Direct2DGraphicsContext::excludeClipRectangle ( const Rectangle< int > &  )
overridevirtual

◆ fillAll()

virtual void juce::LowLevelGraphicsContext::fillAll ( )
inlinevirtualinherited

Reimplemented in juce::CoreGraphicsContext.

◆ fillEllipse()

void juce::Direct2DGraphicsContext::fillEllipse ( const Rectangle< float > &  area)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ fillPath()

void juce::Direct2DGraphicsContext::fillPath ( const Path ,
const AffineTransform  
)
overridevirtual

◆ fillRect() [1/2]

void juce::Direct2DGraphicsContext::fillRect ( const Rectangle< float > &  )
overridevirtual

◆ fillRect() [2/2]

void juce::Direct2DGraphicsContext::fillRect ( const Rectangle< int > &  ,
bool  replaceExistingContents 
)
overridevirtual

◆ fillRectList()

void juce::Direct2DGraphicsContext::fillRectList ( const RectangleList< float > &  )
overridevirtual

◆ fillRoundedRectangle()

void juce::Direct2DGraphicsContext::fillRoundedRectangle ( const Rectangle< float > &  area,
float  cornerSize 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ getClipBounds()

Rectangle< int > juce::Direct2DGraphicsContext::getClipBounds ( ) const
overridevirtual

◆ getFont()

const Font & juce::Direct2DGraphicsContext::getFont ( )
overridevirtual

◆ getFrameId()

uint64_t juce::Direct2DGraphicsContext::getFrameId ( ) const
inlineoverridevirtual

Returns an integer that uniquely identifies the current frame.

Useful for debugging/logging.

Implements juce::LowLevelGraphicsContext.

References frame.

Referenced by juce::Direct2DGraphicsContext::Pimpl::getFrameId().

◆ getPhysicalPixelScaleFactor()

float juce::Direct2DGraphicsContext::getPhysicalPixelScaleFactor ( ) const
overridevirtual

◆ getPimpl()

virtual Pimpl * juce::Direct2DGraphicsContext::getPimpl ( ) const
protectedpure virtualnoexcept

◆ getPreferredImageTypeForTemporaryImages()

std::unique_ptr< ImageType > juce::Direct2DGraphicsContext::getPreferredImageTypeForTemporaryImages ( ) const
inlineoverridevirtual

Returns the optimal ImageType for creating temporary images in this GraphicsContext.

While this typically matches the GraphicsContext's native ImageType, certain scenarios may benefit from using a different format for temporary operations (e.g., for performance, memory efficiency, or specific rendering requirements).

Returns
A unique_ptr to the recommended ImageType instance for temporary images

Implements juce::LowLevelGraphicsContext.

◆ isClipEmpty()

bool juce::Direct2DGraphicsContext::isClipEmpty ( ) const
overridevirtual

◆ isVectorDevice()

bool juce::Direct2DGraphicsContext::isVectorDevice ( ) const
inlineoverridevirtual

Returns true if this device is vector-based, e.g.

a printer.

Implements juce::LowLevelGraphicsContext.

◆ offsetShape() [1/3]

static Line< float > juce::Direct2DGraphicsContext::offsetShape ( Line< float a,
Point< float b 
)
staticprotected

◆ offsetShape() [2/3]

static Rectangle< float > juce::Direct2DGraphicsContext::offsetShape ( Rectangle< float a,
Point< float b 
)
staticprotected

◆ offsetShape() [3/3]

static RectangleList< float > juce::Direct2DGraphicsContext::offsetShape ( RectangleList< float a,
Point< float b 
)
staticprotected

◆ paintPrimitive()

template<typename Shape , typename Fn >
void juce::Direct2DGraphicsContext::paintPrimitive ( const Shape &  shape,
Fn &&  primitiveOp 
)
protected

◆ resetPendingClipList()

void juce::Direct2DGraphicsContext::resetPendingClipList ( )
protected

◆ restoreState()

void juce::Direct2DGraphicsContext::restoreState ( )
overridevirtual

◆ saveState()

void juce::Direct2DGraphicsContext::saveState ( )
overridevirtual

◆ setFill()

void juce::Direct2DGraphicsContext::setFill ( const FillType )
overridevirtual

◆ setFont()

void juce::Direct2DGraphicsContext::setFont ( const Font )
overridevirtual

◆ setInterpolationQuality()

void juce::Direct2DGraphicsContext::setInterpolationQuality ( Graphics::ResamplingQuality  )
overridevirtual

◆ setOpacity()

void juce::Direct2DGraphicsContext::setOpacity ( float  )
overridevirtual

◆ setOrigin()

void juce::Direct2DGraphicsContext::setOrigin ( Point< int >  )
overridevirtual

Moves the origin to a new position.

The coordinates are relative to the current origin, and indicate the new position of (0, 0).

Implements juce::LowLevelGraphicsContext.

◆ startFrame()

bool juce::Direct2DGraphicsContext::startFrame ( float  dpiScale)

◆ strokePath()

void juce::Direct2DGraphicsContext::strokePath ( const Path ,
const PathStrokeType strokeType,
const AffineTransform  
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

Member Data Documentation

◆ currentState

SavedState* juce::Direct2DGraphicsContext::currentState = nullptr
protected

◆ frame

uint64_t juce::Direct2DGraphicsContext::frame = 0
protected

Referenced by getFrameId().

◆ metrics

Direct2DMetrics::Ptr juce::Direct2DGraphicsContext::metrics

◆ pendingClipList

PendingClipList juce::Direct2DGraphicsContext::pendingClipList
protected

The documentation for this class was generated from the following file: