|
CeresEngine 0.2.0
A game development framework
|
A class that encapsulates a 2D paint object. More...
#include <CeresEngine/Graphics/Shape.hpp>
Classes | |
| struct | BoxGradient |
| A structure that describes a box gradient. More... | |
| struct | LinearGradient |
| A structure that describes a linear gradient. More... | |
| struct | RadialGradient |
| A structure that describes a radial gradient. More... | |
Public Member Functions | |
| Paint () | |
| Creates a new default color paint. | |
| Paint (const Color &solidColor) | |
| Create a new solid color paint. | |
| Paint (const Color &startingColor, const Color &endingColor, const Point2 &startingPosition={0, 0}, const Point2 &endingPosition={1, 1}) | |
| Creates a new linear gradient paint. | |
| Paint (const Color &startingColor, const Color &endingColor, const Rect2 &box={0, 0, 1, 1}, double radius=0.0, double feather=1.0) | |
| Creates a new linear gradient paint. | |
| Paint (const Color &startingColor, const Color &endingColor, const Point2 ¢er={0, 0}, double innerRadius=0.0, double outerRadius=1.0) | |
| Creates a new linear gradient paint. | |
| Paint (const Paint &)=default | |
| Creates a new paint by copying another. | |
| Paint & | operator= (const Paint &)=default |
| Assigns the paint object by copying from another. | |
| bool | isColor () const noexcept |
| Checks if the paint holds a solid color. | |
| const Color & | asColor () const |
| Gets the paint solid color value. | |
| bool | isLinearGradient () const noexcept |
| Checks if the paint holds a linear gradient. | |
| const LinearGradient & | asLinearGradient () const |
| Gets the paint linear gradient value. | |
| bool | isBoxGradient () const noexcept |
| Checks if the paint holds a box gradient. | |
| const BoxGradient & | asBoxGradient () const |
| Gets the paint box gradient value. | |
| bool | isRadialGradient () const noexcept |
| Checks if the paint holds a radial gradient. | |
| const RadialGradient & | asRadialGradient () const |
| Gets the paint radial gradient value. | |
| void | transform (const AffineTransform &aTransform) |
| Transforms all coordinates in the paint object with the specified transform. | |
| Paint | transformed (const AffineTransform &aTransform) const |
| Transforms all coordinates in the paint object with the specified transform. | |
| Paint & | tint (const Color &color, double factor=0.5) |
| Applies a tint color to the paint. | |
| Paint | tinted (const Color &color, const double factor=0.5) const |
| Applies a tint color to the paint. | |
| Paint & | operator*= (const Color &color) |
| Applies a tint color to the paint. | |
| Paint | operator* (const Color &color) const |
| Applies a tint color to the paint. | |
Private Types | |
| using | Variant = Variant< Color, LinearGradient, BoxGradient, RadialGradient > |
| A variant used to store the concrete paint implementation structure. | |
Private Attributes | |
| Variant | mData |
| The storage for the concrete paint implementation structure. | |
A class that encapsulates a 2D paint object.
|
private |
A variant used to store the concrete paint implementation structure.
|
inline |
Creates a new default color paint.
|
inline |
Creates a new linear gradient paint.
| startingColor | The gradient starting color at startingPosition. |
| endingColor | The gradient ending color at endingPosition. |
| startingPosition | The gradient starting position. By default, {0, 0}. |
| endingPosition | The gradient ending position. By default, {1, 1}. |
|
inline |
Creates a new linear gradient paint.
| startingColor | The gradient starting color at startingPosition. |
| endingColor | The gradient ending color at endingPosition. |
| box | Defines the box in which the gradient should be drawn. |
| radius | Defines the corner radius. |
| feather | Defines how blurry the border of the rectangle is. |
|
inline |
Creates a new linear gradient paint.
| startingColor | The gradient starting color at startingPosition. |
| endingColor | The gradient ending color at endingPosition. |
| center | The center of the radial gradient. |
| innerRadius | The gradient inner radius. |
| outerRadius | The gradient outer radius. |
|
inline |
Gets the paint box gradient value.
If this paint does not hold a box gradient value, an exception is thrown.
Gets the paint solid color value.
If this paint does not hold a solid color value, an exception is thrown.
|
inline |
Gets the paint linear gradient value.
If this paint does not hold a linear gradient value, an exception is thrown.
|
inline |
Gets the paint radial gradient value.
If this paint does not hold a radial gradient value, an exception is thrown.
|
inlinenoexcept |
Checks if the paint holds a box gradient.
|
inlinenoexcept |
Checks if the paint holds a solid color.
|
inlinenoexcept |
Checks if the paint holds a linear gradient.
|
inlinenoexcept |
Checks if the paint holds a radial gradient.
Applies a tint color to the paint.
The tint color is applied with a mixing factor of factor.
Applies a tint color to the paint.
The tint color is applied with a mixing factor of factor.
Assigns the paint object by copying from another.
Applies a tint color to the paint.
The tint color is applied with a mixing factor of factor.
Applies a tint color to the paint.
The tint color is applied with a mixing factor of factor.
Transforms all coordinates in the paint object with the specified transform.
This method returns the transformed paint object.
| aTransform | The transform to apply to the paint. |
Transforms all coordinates in the paint object with the specified transform.
This method returns the transformed paint object.
| aTransform | The transform to apply to the paint. |
|
private |
The storage for the concrete paint implementation structure.