FastUIDraw
|
A PainterGradientBrushShaderData defines the PainterBrushShaderData that the shaders of a PainterGradientBrushShader consume. It specifies what ColorStopSequence to use together with the geometric properties of the gradient. More...
#include <painter_gradient_brush_shader_data.hpp>
A PainterGradientBrushShaderData defines the PainterBrushShaderData that the shaders of a PainterGradientBrushShader consume. It specifies what ColorStopSequence to use together with the geometric properties of the gradient.
Definition at line 42 of file painter_gradient_brush_shader_data.hpp.
Bit encoding for packing ColorStopSequence::texel_location()
Enumerator | |
---|---|
color_stop_x_num_bits | number bits to encode ColorStopSequence::texel_location().x() |
color_stop_y_num_bits | number bits to encode ColorStopSequence::texel_location().y() |
color_stop_x_bit0 | where ColorStopSequence::texel_location().x() is encoded |
color_stop_y_bit0 | where ColorStopSequence::texel_location().y() is encoded |
Definition at line 51 of file painter_gradient_brush_shader_data.hpp.
Enumeration that provides offset, in units of uint32_t, of the packing of the gradient data.
Enumerator | |
---|---|
p0_x_offset | Offset to x-coordinate of starting point of both linear and radial gradients (packed at float) |
p0_y_offset | Offset to y-coordinate of starting point of both linear and radial gradients (packed at float) |
p1_x_offset | Offset to x-coordinate of ending point of both linear and radial gradients (packed at float) |
p1_y_offset | Offset to y-coordinate of ending point of both linear and radial gradients (packed at float) |
color_stop_xy_offset | Offset to the x and y-location of the color stops. The offset is stored as a uint32 packed as according in the enumeration color_stop_xy_encoding |
color_stop_length_offset | Offset to the length of the color stop in -texels-, i.e. ColorStopSequence::width(), packed as a uint32 |
linear_data_size | Size of the data for linear gradients. |
start_radius_offset | Offset to starting radius of gradient (packed at float) (radial gradient only) |
end_radius_offset | Offset to ending radius of gradient (packed at float) (radial gradient only) |
radial_data_size | Size of the data for radial gradients. |
sweep_p_x_offset | Offset to the x-coordinate of the point of a sweep gradient. |
sweep_p_y_offset | Offset to the y-coordinate of the point of a sweep gradient. |
sweep_angle_offset | Offset to the angle of a sweep gradient. |
sweep_sign_factor_offset | Offset to the sign-factor of the sweep gradient. The sign of the value is the sign of the sweep gradient and the magnitude is the repeat factor of the gradient. |
sweep_data_size | Size of the data for sweep gradients. |
Definition at line 65 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Ctor. Initializes the brush to have no gradient.
Definition at line 160 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Copy ctor.
Definition at line 166 of file painter_gradient_brush_shader_data.hpp.
|
inlineoverridevirtual |
To be implemented by a derived class to return a c_array of references to Image objects whose Image::type() value is Image::context_texture2d. The i'th entry in the returned array will be bound to the i'th external texture slot of the backend via the PainterDrawBreakAction objected returned by PainterBackend::bind_image(). Default implementation is to return an empty array.
Reimplemented from fastuidraw::PainterBrushShaderData.
Definition at line 360 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Returns the value of the handle to the ColorStopSequence that the brush is set to use.
Definition at line 207 of file painter_gradient_brush_shader_data.hpp.
|
overridevirtual |
To be implemented by a derived class to return the number of uvec4 blocks needed to pack the data.
Implements fastuidraw::PainterBrushShaderData.
|
inline |
Sets the brush to have a linear gradient.
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
start_p | start position of gradient |
end_p | end position of gradient. |
Definition at line 220 of file painter_gradient_brush_shader_data.hpp.
|
overridevirtual |
To be optionally implemented by a derived class to return the number of resources that need to be resident after packing. Default implementation returns 0.
Reimplemented from fastuidraw::PainterBrushShaderData.
|
inline |
Assignment operator.
obj | value from which to copy |
Definition at line 175 of file painter_gradient_brush_shader_data.hpp.
|
overridevirtual |
To be implemented by a derived class to pack the data.
dst | location to which to pack the data |
Implements fastuidraw::PainterBrushShaderData.
|
inline |
Sets the brush to have a radial gradient.
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
start_p | start position of gradient |
start_r | starting radius of radial gradient |
end_p | end position of gradient. |
end_r | ending radius of radial gradient |
Definition at line 240 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Sets the brush to have a radial gradient. Provided as a conveniance, equivalent to
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
p | start and end position of gradient |
r | ending radius of radial gradient |
Definition at line 265 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Reset the brush to initial conditions.
Definition at line 185 of file painter_gradient_brush_shader_data.hpp.
|
overridevirtual |
To be optionally implemented by a derived class to save references to resources that need to be resident after packing. Default implementation does nothing.
dst | location to which to save resources. |
Reimplemented from fastuidraw::PainterBrushShaderData.
|
inline |
Sets the brush to have a sweep gradient (directly).
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
p | position of gradient |
theta | start angle of the sweep gradient, this value should be in the range [-PI, PI] |
F | the repeat factor applied to the interpolate, the sign of F is used to determine the sign of the sweep gradient. |
Definition at line 283 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Sets the brush to have a sweep gradient where the sign is determined by a PainterEnums::screen_orientation and a PainterEnums::rotation_orientation_t.
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
p | position of gradient |
theta | angle of the sweep gradient, this value should be in the range [-PI, PI] |
F | the repeat factor applied to the interpolate, a negative reverses the orientation of the sweep. |
orientation | orientation of the screen |
rotation_orientation | orientation of the sweep |
Definition at line 308 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Sets the brush to have a sweep gradient with a repeat factor of 1.0 and where the sign is determined by a PainterEnums::screen_orientation and a PainterEnums::rotation_orientation_t. Equivalent to
cs | color stops for gradient. If handle is invalid, then sets brush to not have a gradient. |
p | position of gradient |
theta | angle of the sweep gradient, this value should be in the range [-PI, PI] |
orientation | orientation of the screen |
rotation_orientation | orientation of the sweep |
Definition at line 339 of file painter_gradient_brush_shader_data.hpp.
|
inline |
Returns the type of gradient the data specifies.
Definition at line 196 of file painter_gradient_brush_shader_data.hpp.