#include <Pt/Gfx/Brush.h>
Fill description for shapes and text. More...
Public Types | |
| enum | FillStyle |
| Identifies the fill source used by the brush. | |
| enum | PositionMode |
| Identifies how brush coordinates are interpreted. | |
| enum | GradientStyle |
| Identifies the gradient variant used by the brush. | |
| enum | TextureMode |
| Identifies how image texture coordinates are interpreted. | |
Public Member Functions | |
| Brush () | |
| Contructs a null brush. | |
| Brush (const Color &color) | |
| Constructs a solid brush. | |
| FillStyle | fillStyle () const |
| Returns the brushes fill style. | |
| PositionMode | positionMode () const |
| Returns how brush coordinates are interpreted. | |
| void | setColor (const Color &color) |
| Sets the solid fill color. | |
| const Color & | color () const |
| Returns the solid or first gradient color. | |
| GradientStyle | gradient () const |
| Returns the gradient style. | |
| const Color & | gradientColor () const |
| Returns the legacy secondary gradient color. | |
| const ColorStops & | gradientStops () const |
| Color stops of a gradient. | |
| const PointF & | gradientBegin () const |
| Begin of a linear or radial gradient. | |
| float | gradientBeginRadius () const |
| Radius of a radial gradient begin circle. | |
| const PointF & | gradientEnd () const |
| End of a linear or radial gradient. | |
| float | gradientEndRadius () const |
| Radius of a radial gradient end circle. | |
| TextureMode | textureMode () const |
| Returns how the texture origin is interpreted. | |
| const Image & | texture () const |
| Returns the texture image. | |
| const PointF & | textureOrigin () const |
| Returns the texture pattern origin. More... | |
| bool | isGradient () const |
| Returns true if the brush uses a gradient. | |
| bool | isTexture () const |
| Returns true if the brush uses a texture. | |
| bool | isNull () const |
| Returns true if the brush is null. | |
Static Public Member Functions | |
| static Brush | imageTexture (const Image &image, const Gfx::PointF &origin=Gfx::PointF()) |
| Constructs an image texture brush. More... | |
| static Brush | verticalGradient (const Color &from, const Color &to) |
| Constructs a vertical gradient brush from two colors. | |
| static Brush | horizontalGradient (const Color &from, const Color &to) |
| Constructs a horizontal gradient brush from two colors. | |
| static Brush | verticalGradient (const ColorStops &colorStops) |
| Constructs a vertical gradient brush from color stops. | |
| static Brush | horizontalGradient (const ColorStops &colorStops) |
| Constructs a horizontal gradient brush from color stops. | |
| static Brush | linearGradient (const PointF &begin, const PointF &end, const ColorStops &colorStops) |
| Constructs an absolute positioned linear gradient. | |
| static Brush | linearGradient (float beginX, float beginY, float endX, float endY, const ColorStops &colorStops) |
| Constructs a relative positioned linear gradient. | |
| static Brush | radialGradient (const PointF &begin, float beginRadius, const PointF &end, float endRadius, const ColorStops &colorStops) |
| Constructs an absolute positioned radial gradient. | |
| static Brush | radialGradient (float beginX, float beginY, float beginRadius, float endX, float endY, float endRadius, const ColorStops &colorStops) |
| Constructs a relative positioned radial gradient. | |
Brush describes how closed geometry is filled. It can represent solid colors, textures and gradients with absolute or relative coordinates so that painters can reuse the same fill definition across targets.
|
static |
The texture origin is expressed in source image pixel coordinates.
| image | The source image used as the repeating tile. |
| origin | The texture pattern origin in source pixel coordinates. |
| const PointF& textureOrigin | ( | ) | const |
The coordinates are expressed in the space identified by Brush::textureMode().