JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::CoreGraphicsContext Class Reference

#include <juce_CoreGraphicsContext_mac.h>

Inheritance diagram for juce::CoreGraphicsContext:
Collaboration diagram for juce::CoreGraphicsContext:

Public Member Functions

 CoreGraphicsContext (CGContextRef context, float flipHeight)
 
 ~CoreGraphicsContext () 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
 
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 > &line, float lineThickness) override
 
virtual void drawRect (const Rectangle< float > &rect, float lineThickness)
 
void drawRoundedRectangle (const Rectangle< float > &r, float cornerSize, float lineThickness) override
 
void endTransparencyLayer () override
 
void excludeClipRectangle (const Rectangle< int > &) override
 
void fillAll () override
 
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 > &r, 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.
 
void strokePath (const Path &path, const PathStrokeType &strokeType, const AffineTransform &transform) override
 

Private Member Functions

void applyTransform (const AffineTransform &) const
 
bool clipToRectangleListWithoutTest (const RectangleList< float > &)
 
template<class RectType >
CGRect convertToCGRectFlipped (RectType r) const noexcept
 
void createPath (const Path &, const AffineTransform &) const
 
void drawCurrentPath (CGPathDrawingMode mode)
 
void drawGradient ()
 
void drawImage (const Image &, const AffineTransform &, bool fillEntireClipAsTiles)
 
void fillCGRect (const CGRect &, bool replaceExistingContents)
 
void flip () const
 
void setContextClipToCurrentPath (bool useNonZeroWinding)
 

Private Attributes

detail::ContextPtr context
 
const CGFloat flipHeight
 
detail::ColorSpacePtr greyColourSpace
 
std::optional< Rectangle< int > > lastClipRect
 
detail::ColorSpacePtr rgbColourSpace
 
std::unique_ptr< SavedState > state
 
OwnedArray< SavedState > stateStack
 

Constructor & Destructor Documentation

◆ CoreGraphicsContext()

juce::CoreGraphicsContext::CoreGraphicsContext ( CGContextRef  context,
float  flipHeight 
)

◆ ~CoreGraphicsContext()

juce::CoreGraphicsContext::~CoreGraphicsContext ( )
override

Member Function Documentation

◆ addTransform()

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

◆ applyTransform()

void juce::CoreGraphicsContext::applyTransform ( const AffineTransform ) const
private

◆ beginTransparencyLayer()

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

◆ clipRegionIntersects()

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

◆ clipToImageAlpha()

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

◆ clipToPath()

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

◆ clipToRectangle()

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

◆ clipToRectangleList()

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

◆ clipToRectangleListWithoutTest()

bool juce::CoreGraphicsContext::clipToRectangleListWithoutTest ( const RectangleList< float > &  )
private

◆ convertToCGRectFlipped()

template<class RectType >
CGRect juce::CoreGraphicsContext::convertToCGRectFlipped ( RectType  r) const
privatenoexcept

◆ createPath()

void juce::CoreGraphicsContext::createPath ( const Path ,
const AffineTransform  
) const
private

◆ drawCurrentPath()

void juce::CoreGraphicsContext::drawCurrentPath ( CGPathDrawingMode  mode)
private

◆ drawEllipse()

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

Reimplemented from juce::LowLevelGraphicsContext.

◆ drawGlyphs()

void juce::CoreGraphicsContext::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.

◆ drawGradient()

void juce::CoreGraphicsContext::drawGradient ( )
private

◆ drawImage() [1/2]

void juce::CoreGraphicsContext::drawImage ( const Image ,
const AffineTransform ,
bool  fillEntireClipAsTiles 
)
private

◆ drawImage() [2/2]

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

◆ drawLine()

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

◆ drawLineWithThickness()

void juce::CoreGraphicsContext::drawLineWithThickness ( const Line< float > &  line,
float  lineThickness 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ drawRect()

virtual void juce::LowLevelGraphicsContext::drawRect ( const Rectangle< float > &  rect,
float  lineThickness 
)
inlinevirtualinherited

◆ drawRoundedRectangle()

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

Reimplemented from juce::LowLevelGraphicsContext.

◆ endTransparencyLayer()

void juce::CoreGraphicsContext::endTransparencyLayer ( )
overridevirtual

◆ excludeClipRectangle()

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

◆ fillAll()

void juce::CoreGraphicsContext::fillAll ( )
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ fillCGRect()

void juce::CoreGraphicsContext::fillCGRect ( const CGRect &  ,
bool  replaceExistingContents 
)
private

◆ fillEllipse()

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

Reimplemented from juce::LowLevelGraphicsContext.

◆ fillPath()

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

◆ fillRect() [1/2]

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

◆ fillRect() [2/2]

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

◆ fillRectList()

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

◆ fillRoundedRectangle()

void juce::CoreGraphicsContext::fillRoundedRectangle ( const Rectangle< float > &  r,
float  cornerSize 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

◆ flip()

void juce::CoreGraphicsContext::flip ( ) const
private

◆ getClipBounds()

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

◆ getFont()

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

◆ getFrameId()

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

Returns an integer that uniquely identifies the current frame.

Useful for debugging/logging.

Implements juce::LowLevelGraphicsContext.

◆ getPhysicalPixelScaleFactor()

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

◆ getPreferredImageTypeForTemporaryImages()

std::unique_ptr< ImageType > juce::CoreGraphicsContext::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::CoreGraphicsContext::isClipEmpty ( ) const
overridevirtual

◆ isVectorDevice()

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

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

a printer.

Implements juce::LowLevelGraphicsContext.

◆ restoreState()

void juce::CoreGraphicsContext::restoreState ( )
overridevirtual

◆ saveState()

void juce::CoreGraphicsContext::saveState ( )
overridevirtual

◆ setContextClipToCurrentPath()

void juce::CoreGraphicsContext::setContextClipToCurrentPath ( bool  useNonZeroWinding)
private

◆ setFill()

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

◆ setFont()

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

◆ setInterpolationQuality()

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

◆ setOpacity()

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

◆ setOrigin()

void juce::CoreGraphicsContext::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.

◆ strokePath()

void juce::CoreGraphicsContext::strokePath ( const Path path,
const PathStrokeType strokeType,
const AffineTransform transform 
)
overridevirtual

Reimplemented from juce::LowLevelGraphicsContext.

Member Data Documentation

◆ context

detail::ContextPtr juce::CoreGraphicsContext::context
private

◆ flipHeight

const CGFloat juce::CoreGraphicsContext::flipHeight
private

◆ greyColourSpace

detail::ColorSpacePtr juce::CoreGraphicsContext::greyColourSpace
private

◆ lastClipRect

std::optional<Rectangle<int> > juce::CoreGraphicsContext::lastClipRect
mutableprivate

◆ rgbColourSpace

detail::ColorSpacePtr juce::CoreGraphicsContext::rgbColourSpace
private

◆ state

std::unique_ptr<SavedState> juce::CoreGraphicsContext::state
private

◆ stateStack

OwnedArray<SavedState> juce::CoreGraphicsContext::stateStack
private

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