JUCE  v5.4.1-191-g0ab5e696f
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::FillType Class Referencefinal

Represents a colour or fill pattern to use for rendering paths. More...

#include <juce_FillType.h>

Collaboration diagram for juce::FillType:

Public Member Functions

 FillType () noexcept
 Creates a default fill type, of solid black. More...
 
 FillType (Colour colour) noexcept
 Creates a fill type of a solid colour. More...
 
 FillType (const ColourGradient &gradient)
 Creates a gradient fill type. More...
 
 FillType (ColourGradient &&gradient)
 Creates a gradient fill type. More...
 
 FillType (const Image &image, const AffineTransform &transform) noexcept
 Creates a tiled image fill type. More...
 
 FillType (const FillType &)
 Creates a copy of another FillType. More...
 
 FillType (FillType &&) noexcept
 Move constructor. More...
 
 ~FillType () noexcept
 Destructor. More...
 
float getOpacity () const noexcept
 Returns the current opacity to be applied to the colour, gradient, or image. More...
 
bool isColour () const noexcept
 Returns true if this is a solid colour fill, and not a gradient or image. More...
 
bool isGradient () const noexcept
 Returns true if this is a gradient fill. More...
 
bool isInvisible () const noexcept
 Returns true if this fill type is completely transparent. More...
 
bool isTiledImage () const noexcept
 Returns true if this is a tiled image pattern fill. More...
 
bool operator!= (const FillType &) const
 
FillTypeoperator= (const FillType &)
 Makes a copy of another FillType. More...
 
FillTypeoperator= (FillType &&) noexcept
 Move assignment operator. More...
 
bool operator== (const FillType &) const
 
void setColour (Colour newColour) noexcept
 Turns this object into a solid colour fill. More...
 
void setGradient (const ColourGradient &newGradient)
 Turns this object into a gradient fill. More...
 
void setOpacity (float newOpacity) noexcept
 Changes the opacity that should be used. More...
 
void setTiledImage (const Image &image, const AffineTransform &transform) noexcept
 Turns this object into a tiled image fill type. More...
 
FillType transformed (const AffineTransform &transform) const
 Returns a copy of this fill, adding the specified transform applied to the existing transform. More...
 

Public Attributes

Colour colour
 The solid colour being used. More...
 
std::unique_ptr< ColourGradientgradient
 Returns the gradient that should be used for filling. More...
 
Image image
 The image that should be used for tiling. More...
 
AffineTransform transform
 The transform that should be applied to the image or gradient that's being drawn. More...
 

Detailed Description

Represents a colour or fill pattern to use for rendering paths.

This is used by the Graphics and DrawablePath classes as a way to encapsulate a brush type. It can either be a solid colour, a gradient, or a tiled image.

See also
Graphics::setFillType, DrawablePath::setFill

{Graphics}

Constructor & Destructor Documentation

◆ FillType() [1/7]

juce::FillType::FillType ( )
noexcept

Creates a default fill type, of solid black.

◆ FillType() [2/7]

juce::FillType::FillType ( Colour  colour)
noexcept

Creates a fill type of a solid colour.

See also
setColour

◆ FillType() [3/7]

juce::FillType::FillType ( const ColourGradient gradient)

Creates a gradient fill type.

See also
setGradient

◆ FillType() [4/7]

juce::FillType::FillType ( ColourGradient &&  gradient)

Creates a gradient fill type.

See also
setGradient

◆ FillType() [5/7]

juce::FillType::FillType ( const Image image,
const AffineTransform transform 
)
noexcept

Creates a tiled image fill type.

The transform allows you to set the scaling, offset and rotation of the pattern.

See also
setTiledImage

◆ FillType() [6/7]

juce::FillType::FillType ( const FillType )

Creates a copy of another FillType.

◆ FillType() [7/7]

juce::FillType::FillType ( FillType &&  )
noexcept

Move constructor.

◆ ~FillType()

juce::FillType::~FillType ( )
noexcept

Destructor.

Member Function Documentation

◆ getOpacity()

float juce::FillType::getOpacity ( ) const
inlinenoexcept

Returns the current opacity to be applied to the colour, gradient, or image.

See also
setOpacity

References juce::Colour::getFloatAlpha().

◆ isColour()

bool juce::FillType::isColour ( ) const
inlinenoexcept

Returns true if this is a solid colour fill, and not a gradient or image.

References juce::Image::isNull().

◆ isGradient()

bool juce::FillType::isGradient ( ) const
inlinenoexcept

Returns true if this is a gradient fill.

◆ isInvisible()

bool juce::FillType::isInvisible ( ) const
noexcept

Returns true if this fill type is completely transparent.

◆ isTiledImage()

bool juce::FillType::isTiledImage ( ) const
inlinenoexcept

Returns true if this is a tiled image pattern fill.

References juce::Image::isValid().

◆ operator!=()

bool juce::FillType::operator!= ( const FillType ) const

◆ operator=() [1/2]

FillType& juce::FillType::operator= ( const FillType )

Makes a copy of another FillType.

◆ operator=() [2/2]

FillType& juce::FillType::operator= ( FillType &&  )
noexcept

Move assignment operator.

◆ operator==()

bool juce::FillType::operator== ( const FillType ) const

◆ setColour()

void juce::FillType::setColour ( Colour  newColour)
noexcept

Turns this object into a solid colour fill.

If the object was an image or gradient, those fields will no longer be valid.

◆ setGradient()

void juce::FillType::setGradient ( const ColourGradient newGradient)

Turns this object into a gradient fill.

◆ setOpacity()

void juce::FillType::setOpacity ( float  newOpacity)
noexcept

Changes the opacity that should be used.

If the fill is a solid colour, this just changes the opacity of that colour. For gradients and image tiles, it changes the opacity that will be used for them.

◆ setTiledImage()

void juce::FillType::setTiledImage ( const Image image,
const AffineTransform transform 
)
noexcept

Turns this object into a tiled image fill type.

The transform allows you to set the scaling, offset and rotation of the pattern.

◆ transformed()

FillType juce::FillType::transformed ( const AffineTransform transform) const

Returns a copy of this fill, adding the specified transform applied to the existing transform.

Member Data Documentation

◆ colour

Colour juce::FillType::colour

The solid colour being used.

If the fill type is not a solid colour, the alpha channel of this colour indicates the opacity that should be used for the fill, and the RGB channels are ignored.

◆ gradient

std::unique_ptr<ColourGradient> juce::FillType::gradient

Returns the gradient that should be used for filling.

This will be zero if the object is some other type of fill. If a gradient is active, the overall opacity with which it should be applied is indicated by the alpha channel of the colour variable.

◆ image

Image juce::FillType::image

The image that should be used for tiling.

If an image fill is active, the overall opacity with which it should be applied is indicated by the alpha channel of the colour variable.

◆ transform

AffineTransform juce::FillType::transform

The transform that should be applied to the image or gradient that's being drawn.


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