Represents a colour or fill pattern to use for rendering paths. More...
Public Member Functions | |
| FillType () noexcept | |
| Creates a default fill type, of solid black. | |
| FillType (const Colour &colour) noexcept | |
| Creates a fill type of a solid colour. | |
| FillType (const ColourGradient &gradient) | |
| Creates a gradient fill type. | |
| FillType (const Image &image, const AffineTransform &transform) noexcept | |
| Creates a tiled image fill type. | |
| FillType (const FillType &other) | |
| Creates a copy of another FillType. | |
| FillType & | operator= (const FillType &other) |
| Makes a copy of another FillType. | |
| ~FillType () noexcept | |
| Destructor. | |
| bool | isColour () const noexcept |
| Returns true if this is a solid colour fill, and not a gradient or image. | |
| bool | isGradient () const noexcept |
| Returns true if this is a gradient fill. | |
| bool | isTiledImage () const noexcept |
| Returns true if this is a tiled image pattern fill. | |
| void | setColour (const Colour &newColour) noexcept |
| Turns this object into a solid colour fill. | |
| void | setGradient (const ColourGradient &newGradient) |
| Turns this object into a gradient fill. | |
| void | setTiledImage (const Image &image, const AffineTransform &transform) noexcept |
| Turns this object into a tiled image fill type. | |
| void | setOpacity (float newOpacity) noexcept |
| Changes the opacity that should be used. | |
| float | getOpacity () const noexcept |
| Returns the current opacity to be applied to the colour, gradient, or image. | |
| bool | isInvisible () const noexcept |
| Returns true if this fill type is completely transparent. | |
| bool | operator== (const FillType &other) const |
| bool | operator!= (const FillType &other) const |
Public Attributes | |
| Colour | colour |
| The solid colour being used. | |
| ScopedPointer< ColourGradient > | gradient |
| Returns the gradient that should be used for filling. | |
| Image | image |
| The image that should be used for tiling. | |
| AffineTransform | transform |
| The transform that should be applied to the image or gradient that's being drawn. | |
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.
| FillType::FillType | ( | ) |
Creates a default fill type, of solid black.
| FillType::FillType | ( | const Colour & | colour ) |
Creates a fill type of a solid colour.
| FillType::FillType | ( | const ColourGradient & | gradient ) |
Creates a gradient fill type.
| FillType::FillType | ( | const Image & | image, |
| const AffineTransform & | transform | ||
| ) |
Creates a tiled image fill type.
The transform allows you to set the scaling, offset and rotation of the pattern.
| FillType::~FillType | ( | ) |
Destructor.
| bool FillType::isColour | ( | ) | const |
Returns true if this is a solid colour fill, and not a gradient or image.
References Image::isNull().
| bool FillType::isGradient | ( | ) | const |
Returns true if this is a gradient fill.
| bool FillType::isTiledImage | ( | ) | const |
Returns true if this is a tiled image pattern fill.
References Image::isValid().
| void FillType::setColour | ( | const Colour & | newColour ) |
Turns this object into a solid colour fill.
If the object was an image or gradient, those fields will no longer be valid.
| void FillType::setGradient | ( | const ColourGradient & | newGradient ) |
Turns this object into a gradient fill.
| void FillType::setTiledImage | ( | const Image & | image, |
| const AffineTransform & | transform | ||
| ) |
Turns this object into a tiled image fill type.
The transform allows you to set the scaling, offset and rotation of the pattern.
| void FillType::setOpacity | ( | float | newOpacity ) |
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.
| float FillType::getOpacity | ( | ) | const |
Returns the current opacity to be applied to the colour, gradient, or image.
References Colour::getFloatAlpha().
| bool FillType::isInvisible | ( | ) | const |
Returns true if this fill type is completely transparent.
| bool FillType::operator== | ( | const FillType & | other ) | const |
| bool FillType::operator!= | ( | const FillType & | other ) | const |
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.
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.
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.
The transform that should be applied to the image or gradient that's being drawn.