FastUIDraw
|
A PainterGradientBrushShader represents a set of brush shaders to to perform a gradient. Internally it containts four generic parent shaders: More...
#include <painter_gradient_brush_shader.hpp>
Public Types | |
enum | sub_shader_bits { spread_type_num_bits = 2, gradient_type_num_bits = 2, spread_type_bit0 = 0, gradient_type_bit0 = spread_type_bit0 + spread_type_num_bits, number_bits = gradient_type_bit0 + gradient_type_num_bits, number_sub_shaders_of_generic_gradient = 1u << number_bits, number_sub_shaders_of_specific_gradient = 1u << spread_type_num_bits } |
Enumeration describing the roles of the bits for the sub-shader ID's. More... | |
enum | sub_shader_masks { gradient_spread_type_mask = FASTUIDRAW_MASK(spread_type_bit0, spread_type_num_bits), gradient_type_mask = FASTUIDRAW_MASK(gradient_type_bit0, gradient_type_num_bits) } |
Public Types inherited from fastuidraw::PainterBrushEnums | |
enum | filter_t { filter_nearest = 1, filter_linear = 2, filter_cubic = 3 } |
Enumeration specifying what filter to apply to an image. More... | |
enum | gradient_type_t { gradient_non = 0, gradient_linear, gradient_radial, gradient_sweep, number_gradient_types } |
enum | mipmap_t { apply_mipmapping, dont_apply_mipmapping } |
enum | spread_type_t { spread_clamp, spread_mirror, spread_repeat, spread_mirror_repeat, number_spread_types } |
Static Public Member Functions | |
static uint32_t | sub_shader_id (enum spread_type_t, enum gradient_type_t) |
static uint32_t | sub_shader_id (enum spread_type_t) |
Static Public Member Functions inherited from fastuidraw::reference_counted_base< T, Counter > | |
static void | add_reference (const reference_counted_base< T, Counter > *p) |
static void | remove_reference (const reference_counted_base< T, Counter > *p) |
A PainterGradientBrushShader represents a set of brush shaders to to perform a gradient. Internally it containts four generic parent shaders:
Definition at line 43 of file painter_gradient_brush_shader.hpp.
Enumeration describing the roles of the bits for the sub-shader ID's.
Enumerator | |
---|---|
spread_type_num_bits | Number of bits used to encode a spread_type_t |
gradient_type_num_bits | Number of bits used to encode the gradient type, see PainterBrushEnums::gradient_type_t |
spread_type_bit0 | first bit used to encode the spread_type_t |
gradient_type_bit0 | first bit used to encode the PainterBrushEnums::gradient_type_t |
number_bits | The total number of bits needed to specify the sub-shader IDs. |
number_sub_shaders_of_generic_gradient | the total number of sub-shaders that the generic parent shader has. |
number_sub_shaders_of_specific_gradient | the total number of sub-shaders that a parent shader for a specific gradient type has. |
Definition at line 53 of file painter_gradient_brush_shader.hpp.
Various bit-mask values derived from sub_shader_bits
Enumerator | |
---|---|
gradient_spread_type_mask | mask generated from spread_type_bit0 and spread_type_num_bits |
gradient_type_mask | mask generated from gradient_type_bit0 and gradient_type_num_bits |
Definition at line 97 of file painter_gradient_brush_shader.hpp.
fastuidraw::PainterGradientBrushShader::PainterGradientBrushShader | ( | const reference_counted_ptr< PainterBrushShader > & | generic, |
const reference_counted_ptr< PainterBrushShader > & | linear, | ||
const reference_counted_ptr< PainterBrushShader > & | radial, | ||
const reference_counted_ptr< PainterBrushShader > & | sweep, | ||
const reference_counted_ptr< PainterBrushShader > & | white | ||
) |
Ctor.
generic | PainterBrushShader that supports all gradient and sweep types via its sub-shaders which are indexed by sub_shader_id(enum spread_type_t, enum gradient_type_t) |
linear | PainterBrushShader that performs linear gradient that supports all sweep types via its sub-shaders which are indexed by sub_shader_id(enum spread_type_t) |
radial | PainterBrushShader that performs radial gradient that supports all sweep types via its sub-shaders which are indexed by sub_shader_id(enum spread_type_t) |
sweep | PainterBrushShader that performs sweep gradient that supports all sweep types via its sub-shaders which are indexed by sub_shader_id(enum spread_type_t) |
white | PainterBrushShader that applied solid white for the brush |
PainterCustomBrush fastuidraw::PainterGradientBrushShader::create_brush | ( | PainterPackedValuePool & | pool, |
const PainterGradientBrushShaderData & | brush_data, | ||
enum spread_type_t | spread | ||
) | const |
Create a PainterCustomBrush from a PainterGradientBrushShaderData
pool | PainterPackedValuePool used to create the packed value |
brush_data | PainterGradientBrushShaderData specifing gradient |
spread | spread pattern for gradient |
const reference_counted_ptr<PainterBrushShader>& fastuidraw::PainterGradientBrushShader::linear_sub_shader | ( | enum | spread_type_t | ) | const |
Returns the sub-shader of the linear gradient parent shader for a specified spread_type_t value.
const reference_counted_ptr<PainterBrushShader>& fastuidraw::PainterGradientBrushShader::radial_sub_shader | ( | enum | spread_type_t | ) | const |
Returns the sub-shader of the radial gradient parent shader for a specified spread_type_t value.
const reference_counted_ptr<PainterBrushShader>& fastuidraw::PainterGradientBrushShader::sub_shader | ( | enum | spread_type_t, |
enum | gradient_type_t | ||
) | const |
Returns the sub-shader of the generic parent shader for specified gradient_type_t and spread_type_t values.
|
static |
The sub-shader to take from the generic parent shader for specified gradient_type_t and spread_type_t values.
|
static |
The sub-shader to take from the linear, radial or sweep parent shader for a specified spread_type_t value.
const reference_counted_ptr<PainterBrushShader>& fastuidraw::PainterGradientBrushShader::sweep_sub_shader | ( | enum | spread_type_t | ) | const |
Returns the sub-shader of the sweep gradient parent shader for a specified spread_type_t value.
const reference_counted_ptr<PainterBrushShader>& fastuidraw::PainterGradientBrushShader::white_shader | ( | void | ) | const |
Returns the white shader, i.e. the shader that is solid white to the brush.