FastUIDraw
Classes | Public Types | Public Member Functions | List of all members
fastuidraw::PainterBrush Class Reference

A PainterBrush defines a brush for painting via Painter. More...

#include <painter_brush.hpp>

Inheritance diagram for fastuidraw::PainterBrush:
Inheritance graph
[legend]

Public Types

enum  feature_bits {
  image_num_bits = PainterImageBrushShader::number_bits, gradient_num_bits = 4, image_bit0 = 0, gradient_bit0 = image_bit0 + image_num_bits,
  repeat_window_bit = gradient_bit0 + gradient_num_bits, repeat_window_x_spread_type_bit0, repeat_window_y_spread_type_bit0 = repeat_window_x_spread_type_bit0 + PainterGradientBrushShader::spread_type_num_bits, transformation_translation_bit = repeat_window_y_spread_type_bit0 + PainterGradientBrushShader::spread_type_num_bits,
  transformation_matrix_bit, number_feature_bits = transformation_matrix_bit + 1
}
 Enumeration describing the roles of the bits for features(). More...
 
enum  feature_masks {
  image_mask = FASTUIDRAW_MASK(image_bit0, image_num_bits), gradient_mask = FASTUIDRAW_MASK(gradient_bit0, gradient_num_bits), repeat_window_mask = FASTUIDRAW_MASK(repeat_window_bit, 1), repeat_window_x_spread_type_mask,
  repeat_window_y_spread_type_mask, repeat_window_spread_type_mask = repeat_window_x_spread_type_mask | repeat_window_y_spread_type_mask, transformation_translation_mask = FASTUIDRAW_MASK(transformation_translation_bit, 1), transformation_matrix_mask = FASTUIDRAW_MASK(transformation_matrix_bit, 1)
}
 Masks generated from feature_bits, use these masks on the return value of features() to get what features are active on the brush. More...
 
enum  header_offset_t { features_offset, header_red_green_offset, header_blue_alpha_offset, header_data_size }
 enumerations for offsets to color values More...
 
enum  packing_order_t {
  header_packing, repeat_window_packing, transformation_translation_packing, transformation_matrix_packing,
  image_packing, gradient_packing
}
 Enumeration giving the packing order for data of a brush. Each enumeration is an entry and when data is packed each entry starts on a multiple of the 4. More...
 
enum  repeat_window_offset_t {
  repeat_window_x_offset, repeat_window_y_offset, repeat_window_width_offset, repeat_window_height_offset,
  repeat_window_data_size
}
 Enumeration that provides offset from the start of repeat window packing to data for repeat window data. More...
 
enum  transformation_matrix_offset_t {
  transformation_matrix_row0_col0_offset, transformation_matrix_row0_col1_offset, transformation_matrix_row1_col0_offset, transformation_matrix_row1_col1_offset,
  transformation_matrix_data_size, transformation_matrix_col0_row0_offset = transformation_matrix_row0_col0_offset, transformation_matrix_col0_row1_offset = transformation_matrix_row1_col0_offset, transformation_matrix_col1_row0_offset = transformation_matrix_row0_col1_offset,
  transformation_matrix_col1_row1_offset = transformation_matrix_row1_col1_offset
}
 Enumeration that provides offset from the start of repeat transformation matrix to data for the transformation matrix data. More...
 
enum  transformation_translation_offset_t { transformation_translation_x_offset = 0, transformation_translation_y_offset, transformation_translation_data_size }
 Enumeration that provides offset from the start of repeat transformation translation to data for the transformation translation data. More...
 
- 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
}
 

Public Member Functions

 PainterBrush (void)
 
 PainterBrush (const PainterBrush &obj)
 
 PainterBrush (const vec4 &pcolor)
 
PainterBrushapply_matrix (const float2x2 &m)
 
PainterBrushapply_rotate (float angle)
 
PainterBrushapply_shear (float sx, float sy)
 
PainterBrushapply_translate (const vec2 &p)
 
c_array< const reference_counted_ptr< const Image > > bind_images (void) const override
 
PainterBrushcolor (const vec4 &color)
 
PainterBrushcolor (float r, float g, float b, float a=1.0f)
 
const vec4color (void) const
 
const reference_counted_ptr< const ColorStopSequence > & color_stops (void) const
 
unsigned int data_size (void) const override
 
uint32_t features (void) const
 
enum gradient_type_t gradient_type (void) const
 
PainterBrushimage (const reference_counted_ptr< const Image > &im, enum filter_t f=filter_linear, enum mipmap_t mipmap_filtering=apply_mipmapping)
 
const reference_counted_ptr< const Image > & image (void) const
 
PainterBrushlinear_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &start_p, const vec2 &end_p, enum spread_type_t spread)
 
PainterBrushno_gradient (void)
 
PainterBrushno_image (void)
 
PainterBrushno_repeat_window (void)
 
PainterBrushno_transformation (void)
 
PainterBrushno_transformation_matrix (void)
 
PainterBrushno_transformation_translation (void)
 
unsigned int number_resources (void) const override
 
PainterBrushoperator= (const PainterBrush &obj)
 
void pack_data (c_array< uvec4 > dst) const override
 
PainterBrushradial_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &start_p, float start_r, const vec2 &end_p, float end_r, enum spread_type_t spread)
 
PainterBrushradial_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &p, float r, enum spread_type_t spread)
 
PainterBrushrepeat_window (const vec2 &pos, const vec2 &size, enum spread_type_t x_mode=spread_repeat, enum spread_type_t y_mode=spread_repeat)
 
bool repeat_window (vec2 *pos, vec2 *size) const
 
enum spread_type_t repeat_window_x_spread_type (void) const
 
enum spread_type_t repeat_window_y_spread_type (void) const
 
PainterBrushreset (void)
 
void save_resources (c_array< reference_counted_ptr< const resource_base > > dst) const override
 
PainterBrushsub_image (const reference_counted_ptr< const Image > &im, uvec2 xy, uvec2 wh, enum filter_t f=filter_linear, enum mipmap_t mipmap_filtering=apply_mipmapping)
 
PainterBrushsweep_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &p, float theta, float F, enum spread_type_t spread)
 
PainterBrushsweep_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &p, float theta, enum PainterEnums::screen_orientation orientation, enum PainterEnums::rotation_orientation_t rotation_orientation, float F, enum spread_type_t spread)
 
PainterBrushsweep_gradient (const reference_counted_ptr< const ColorStopSequence > &cs, const vec2 &p, float theta, enum PainterEnums::screen_orientation orientation, enum PainterEnums::rotation_orientation_t rotation_orientation, enum spread_type_t spread)
 
PainterBrushtransformation (const vec2 &p, const float2x2 &m)
 
PainterBrushtransformation_matrix (const float2x2 &m)
 
const float2x2transformation_matrix (void) const
 
PainterBrushtransformation_translate (const vec2 &p)
 
const vec2transformation_translate (void) const
 

Detailed Description

A PainterBrush defines a brush for painting via Painter.

The brush applies, in the following order:

  1. a constant color, specified by color()
  2. optionally modulates by an image, specified by image() or sub_image() and no_image()
  3. optionally modulates by a gradient, see linear_gradient(), radial_gradient(), sweep_gradient() and no_gradient().

An item shader's vertex stage provides the coordinate fed to the brush. That coordinate is procesed in the following order before it is fed to the image and gradient:

  1. an optional 2x2 matrix is applied, see transformation_matrix(), apply_matrix() apply_shear(), apply_rotate() and no_transformation_matrix()
  2. an optional translation is applied specified, see transformation_translate(), apply_matrix() apply_translate() and no_transformation_translation()
  3. an optional repeat window is applied, see repeat_window() and no_repeat_window().

Definition at line 68 of file painter_brush.hpp.

Member Enumeration Documentation

◆ feature_bits

Enumeration describing the roles of the bits for features().

Enumerator
image_num_bits 

Number of bits needed to encode if and how an Image is sourced from.

gradient_num_bits 

Number of bits used to encode the gradient type, see PainterBrushEnums::gradient_type_t

image_bit0 

First bit to encode if and how the brush sources from an Image

gradient_bit0 

first bit used to encode the PainterBrushEnums::gradient_type_t

repeat_window_bit 

Bit up if the brush has a repeat window

transformation_translation_bit 

Bit up if transformation 2x2 matrix is present

transformation_matrix_bit 

Bit up is translation is present

number_feature_bits 

Must be last enum, gives number of bits needed to hold feature bits of a PainterBrush.

Definition at line 78 of file painter_brush.hpp.

◆ feature_masks

Masks generated from feature_bits, use these masks on the return value of features() to get what features are active on the brush.

Enumerator
image_mask 

mask generated from image_bit0 and image_num_bits

gradient_mask 

mask generated from gradient_bit0 and gradient_num_bits

repeat_window_mask 

mask generated from repeat_window_bit

repeat_window_x_spread_type_mask 

mask generated from repeat_window_x_spread_type and PainterGradientBrushShader::spread_type_num_bits

repeat_window_y_spread_type_mask 

mask generated from repeat_window_y_spread_type and PainterGradientBrushShader::spread_type_num_bits

repeat_window_spread_type_mask 

mask of repeat_window_x_spread_type_mask and repeat_window_y_spread_type bitwise or'd together

transformation_translation_mask 

mask generated from transformation_translation_bit

transformation_matrix_mask 

mask generated from transformation_matrix_bit

Definition at line 141 of file painter_brush.hpp.

◆ header_offset_t

enumerations for offsets to color values

Enumerator
features_offset 

offset to value of features() (packed as uint)

header_red_green_offset 

offset for color red and green value (packed as fp16 pair)

header_blue_alpha_offset 

offset for color blue and alpha value (packed as fp16 pair)

header_data_size 

number of elements to pack color

Definition at line 240 of file painter_brush.hpp.

◆ packing_order_t

Enumeration giving the packing order for data of a brush. Each enumeration is an entry and when data is packed each entry starts on a multiple of the 4.

Enumerator
header_packing 

Color packed first, see header_offset_t for the offsets for the individual fields

repeat_window_packing 

repeat window packing, see repeat_window_offset_t for the offsets for the individual fields

transformation_translation_packing 

transformation_translation, see transformation_translation_offset_t for the offsets of the individual fields

transformation_matrix_packing 

transformation_matrix, see transformation_matrix_offset_t for the offsets of the individual fields

image_packing 

image packing as packed by PainterImageBrushShaderData

gradient_packing 

gradient packing, as packed by PainterGradientBrushShaderData

Definition at line 195 of file painter_brush.hpp.

◆ repeat_window_offset_t

Enumeration that provides offset from the start of repeat window packing to data for repeat window data.

Enumerator
repeat_window_x_offset 

offset for the x-position of the repeat window (packed at float)

repeat_window_y_offset 

offset for the y-position of the repeat window (packed at float)

repeat_window_width_offset 

offset for the width of the repeat window (packed at float)

repeat_window_height_offset 

offset for the height of the repeat window (packed at float)

repeat_window_data_size 

size of data for repeat window

Definition at line 254 of file painter_brush.hpp.

◆ transformation_matrix_offset_t

Enumeration that provides offset from the start of repeat transformation matrix to data for the transformation matrix data.

Enumerator
transformation_matrix_row0_col0_offset 

offset for float2x2(0, 0) (packed at float)

transformation_matrix_row0_col1_offset 

offset for float2x2(0, 1) (packed at float)

transformation_matrix_row1_col0_offset 

offset for float2x2(1, 0) (packed at float)

transformation_matrix_row1_col1_offset 

offset for float2x2(1, 1) (packed at float)

transformation_matrix_data_size 

size of data for transformation matrix

transformation_matrix_col0_row0_offset 

alias of transformation_matrix_row0_col0_offset

transformation_matrix_col0_row1_offset 

alias of transformation_matrix_row1_col0_offset

transformation_matrix_col1_row0_offset 

alias of transformation_matrix_row0_col1_offset

transformation_matrix_col1_row1_offset 

alias of transformation_matrix_row1_col1_offset

Definition at line 269 of file painter_brush.hpp.

◆ transformation_translation_offset_t

Enumeration that provides offset from the start of repeat transformation translation to data for the transformation translation data.

Enumerator
transformation_translation_x_offset 

offset for x-coordinate of translation (packed at float)

transformation_translation_y_offset 

offset for y-coordinate of translation (packed at float)

transformation_translation_data_size 

size of data for transformation translation (packed at float)

Definition at line 289 of file painter_brush.hpp.

Constructor & Destructor Documentation

◆ PainterBrush() [1/3]

fastuidraw::PainterBrush::PainterBrush ( void  )
inline

Ctor. Initializes the brush to have no image, no gradient, no repeat window and no transformation with the color as (1.0, 1.0, 1.0, 1.0) which is solid white.

Definition at line 301 of file painter_brush.hpp.

◆ PainterBrush() [2/3]

fastuidraw::PainterBrush::PainterBrush ( const PainterBrush obj)
inline

Copy ctor.

Definition at line 307 of file painter_brush.hpp.

◆ PainterBrush() [3/3]

fastuidraw::PainterBrush::PainterBrush ( const vec4 pcolor)
inline

Ctor. Initializes the brush to have no image, no gradient, no repeat window and no transformation with the given color color.

Parameters
pcolorinital color

Definition at line 317 of file painter_brush.hpp.

Member Function Documentation

◆ apply_matrix()

PainterBrush& fastuidraw::PainterBrush::apply_matrix ( const float2x2 m)
inline

Apply a shear to the transformation of the brush.

Parameters
mmatrix to which to apply

Definition at line 610 of file painter_brush.hpp.

◆ apply_rotate()

PainterBrush& fastuidraw::PainterBrush::apply_rotate ( float  angle)
inline

Apply a rotation to the transformation of the brush.

Parameters
anglein radians by which to rotate

Definition at line 638 of file painter_brush.hpp.

◆ apply_shear()

PainterBrush& fastuidraw::PainterBrush::apply_shear ( float  sx,
float  sy 
)
inline

Apply a shear to the transformation of the brush.

Parameters
sxscale factor in x-direction
syscale factor in y-direction

Definition at line 623 of file painter_brush.hpp.

◆ apply_translate()

PainterBrush& fastuidraw::PainterBrush::apply_translate ( const vec2 p)
inline

Apply a translation to the transformation of the brush.

Definition at line 657 of file painter_brush.hpp.

◆ bind_images()

c_array<const reference_counted_ptr<const Image> > fastuidraw::PainterBrush::bind_images ( void  ) const
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 857 of file painter_brush.hpp.

◆ color() [1/3]

PainterBrush& fastuidraw::PainterBrush::color ( const vec4 color)
inline

Set the color to the color, default value is (1.0, 1.0, 1.0, 1.0).

Definition at line 343 of file painter_brush.hpp.

◆ color() [2/3]

PainterBrush& fastuidraw::PainterBrush::color ( float  r,
float  g,
float  b,
float  a = 1.0f 
)
inline

Set the color to the color, default value is (1.0, 1.0, 1.0, 1.0).

Definition at line 353 of file painter_brush.hpp.

◆ color() [3/3]

const vec4& fastuidraw::PainterBrush::color ( void  ) const
inline

Returns the current color-color.

Definition at line 362 of file painter_brush.hpp.

◆ color_stops()

const reference_counted_ptr<const ColorStopSequence>& fastuidraw::PainterBrush::color_stops ( void  ) const
inline

Returns the value of the handle to the ColorStopSequence that the brush is set to use.

Definition at line 832 of file painter_brush.hpp.

◆ data_size()

unsigned int fastuidraw::PainterBrush::data_size ( void  ) const
overridevirtual

To be implemented by a derived class to return the number of uvec4 blocks needed to pack the data.

Implements fastuidraw::PainterBrushShaderData.

◆ features()

uint32_t fastuidraw::PainterBrush::features ( void  ) const

Returns the brush features which when tested against the bit masks from feature_masks tells what features are active in the brush; features() is decoded as follows:

◆ gradient_type()

enum gradient_type_t fastuidraw::PainterBrush::gradient_type ( void  ) const
inline

Return the gradient_type_t that the brush applies.

Definition at line 558 of file painter_brush.hpp.

◆ image() [1/2]

PainterBrush& fastuidraw::PainterBrush::image ( const reference_counted_ptr< const Image > &  im,
enum filter_t  f = filter_linear,
enum mipmap_t  mipmap_filtering = apply_mipmapping 
)

Sets the brush to have an image.

Parameters
imhandle to image to use. If handle is invalid, then sets brush to not have an image.
ffilter to apply to image, only has effect if im is non-nullptr
mipmap_filteringspecifies if to apply mipmap filtering

◆ image() [2/2]

const reference_counted_ptr<const Image>& fastuidraw::PainterBrush::image ( void  ) const
inline

Returns a reference to the Image that the brush is set to use; if there is no such image, returns nullptr.

Definition at line 821 of file painter_brush.hpp.

◆ linear_gradient()

PainterBrush& fastuidraw::PainterBrush::linear_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 start_p,
const vec2 end_p,
enum spread_type_t  spread 
)
inline

Sets the brush to have a linear gradient.

Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
start_pstart position of gradient
end_pend position of gradient.
spreadspecifies the gradient spread type

Definition at line 412 of file painter_brush.hpp.

◆ no_gradient()

PainterBrush& fastuidraw::PainterBrush::no_gradient ( void  )
inline

Sets the brush to not have a gradient.

Definition at line 547 of file painter_brush.hpp.

◆ no_image()

PainterBrush& fastuidraw::PainterBrush::no_image ( void  )
inline

Sets the brush to not have an image.

Definition at line 398 of file painter_brush.hpp.

◆ no_repeat_window()

PainterBrush& fastuidraw::PainterBrush::no_repeat_window ( void  )
inline

Sets the brush to not have a repeat window

Definition at line 783 of file painter_brush.hpp.

◆ no_transformation()

PainterBrush& fastuidraw::PainterBrush::no_transformation ( void  )
inline

Sets the brush to have no transformation.

Definition at line 704 of file painter_brush.hpp.

◆ no_transformation_matrix()

PainterBrush& fastuidraw::PainterBrush::no_transformation_matrix ( void  )
inline

Sets the brush to have no matrix in its transformation.

Definition at line 693 of file painter_brush.hpp.

◆ no_transformation_translation()

PainterBrush& fastuidraw::PainterBrush::no_transformation_translation ( void  )
inline

Sets the brush to have no translation in its transformation.

Definition at line 682 of file painter_brush.hpp.

◆ number_resources()

unsigned int fastuidraw::PainterBrush::number_resources ( void  ) const
inlineoverridevirtual

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.

Definition at line 851 of file painter_brush.hpp.

◆ operator=()

PainterBrush& fastuidraw::PainterBrush::operator= ( const PainterBrush obj)
inline

Assignment operator.

Parameters
objvalue from which to copy

Definition at line 327 of file painter_brush.hpp.

◆ pack_data()

void fastuidraw::PainterBrush::pack_data ( c_array< uvec4 dst) const
overridevirtual

To be implemented by a derived class to pack the data.

Parameters
dstlocation to which to pack the data

Implements fastuidraw::PainterBrushShaderData.

◆ radial_gradient() [1/2]

PainterBrush& fastuidraw::PainterBrush::radial_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 start_p,
float  start_r,
const vec2 end_p,
float  end_r,
enum spread_type_t  spread 
)
inline

Sets the brush to have a radial gradient.

Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
start_pstart position of gradient
start_rstarting radius of radial gradient
end_pend position of gradient.
end_rending radius of radial gradient
spreadspecifies the gradient spread type

Definition at line 432 of file painter_brush.hpp.

◆ radial_gradient() [2/2]

PainterBrush& fastuidraw::PainterBrush::radial_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 p,
float  r,
enum spread_type_t  spread 
)
inline

Sets the brush to have a radial gradient. Provided as a conveniance, equivalent to

radial_gradient(cs, p, 0.0f, p, r, repeat);
Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
pstart and end position of gradient
rending radius of radial gradient
spreadspecifies the gradient spread type

Definition at line 455 of file painter_brush.hpp.

◆ repeat_window() [1/2]

PainterBrush& fastuidraw::PainterBrush::repeat_window ( const vec2 pos,
const vec2 size,
enum spread_type_t  x_mode = spread_repeat,
enum spread_type_t  y_mode = spread_repeat 
)
inline

Sets the brush to have a repeat window

Parameters
poslocation of repeat window
sizeof repeat window
x_modespread mode for x-coordinate
y_modespread mode for y-coordinate

Definition at line 719 of file painter_brush.hpp.

◆ repeat_window() [2/2]

bool fastuidraw::PainterBrush::repeat_window ( vec2 pos,
vec2 size 
) const
inline

Returns true if a repeat window is applied to the brush and writes out the position and size of the repeat window as well.

Definition at line 742 of file painter_brush.hpp.

◆ repeat_window_x_spread_type()

enum spread_type_t fastuidraw::PainterBrush::repeat_window_x_spread_type ( void  ) const
inline

Returns the x-coordinate spread type. Return value is undefined if the repeat_window() is not active.

Definition at line 755 of file painter_brush.hpp.

◆ repeat_window_y_spread_type()

enum spread_type_t fastuidraw::PainterBrush::repeat_window_y_spread_type ( void  ) const
inline

Returns the y-coordinate spread type. Return value is undefined if the repeat_window() is not active.

Definition at line 770 of file painter_brush.hpp.

◆ reset()

PainterBrush& fastuidraw::PainterBrush::reset ( void  )

Reset the brush to initial conditions.

◆ save_resources()

void fastuidraw::PainterBrush::save_resources ( c_array< reference_counted_ptr< const resource_base > >  dst) const
inlineoverridevirtual

To be optionally implemented by a derived class to save references to resources that need to be resident after packing. Default implementation does nothing.

Parameters
dstlocation to which to save resources.

Reimplemented from fastuidraw::PainterBrushShaderData.

Definition at line 844 of file painter_brush.hpp.

◆ sub_image()

PainterBrush& fastuidraw::PainterBrush::sub_image ( const reference_counted_ptr< const Image > &  im,
uvec2  xy,
uvec2  wh,
enum filter_t  f = filter_linear,
enum mipmap_t  mipmap_filtering = apply_mipmapping 
)

Set the brush to source from a sub-rectangle of an image

Parameters
imhandle to image to use
xymin-corner of sub-rectangle of image to use
whwidth and height of sub-rectangle of image to use
ffilter to apply to image, only has effect if im is non-nullptr
mipmap_filteringspecifies if to apply mipmap filtering

◆ sweep_gradient() [1/3]

PainterBrush& fastuidraw::PainterBrush::sweep_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 p,
float  theta,
float  F,
enum spread_type_t  spread 
)
inline

Sets the brush to have a sweep gradient (directly).

Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
pposition of gradient
thetastart angle of the sweep gradient, this value should be in the range [-PI, PI]
Fthe repeat factor applied to the interpolate, the sign of F is used to determine the sign of the sweep gradient.
spreadspecifies the gradient spread type

Definition at line 476 of file painter_brush.hpp.

◆ sweep_gradient() [2/3]

PainterBrush& fastuidraw::PainterBrush::sweep_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 p,
float  theta,
enum PainterEnums::screen_orientation  orientation,
enum PainterEnums::rotation_orientation_t  rotation_orientation,
float  F,
enum spread_type_t  spread 
)
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.

Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
pposition of gradient
thetaangle of the sweep gradient, this value should be in the range [-PI, PI]
Fthe repeat factor applied to the interpolate, a negative reverses the orientation of the sweep.
orientationorientation of the screen
rotation_orientationorientation of the sweep
spreadspecifies the gradient spread type

Definition at line 501 of file painter_brush.hpp.

◆ sweep_gradient() [3/3]

PainterBrush& fastuidraw::PainterBrush::sweep_gradient ( const reference_counted_ptr< const ColorStopSequence > &  cs,
const vec2 p,
float  theta,
enum PainterEnums::screen_orientation  orientation,
enum PainterEnums::rotation_orientation_t  rotation_orientation,
enum spread_type_t  spread 
)
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

sweep_gradient(cs, p, theta, orientation, rotation_orientation, 1.0f, repeat);
Parameters
cscolor stops for gradient. If handle is invalid, then sets brush to not have a gradient.
pposition of gradient
thetaangle of the sweep gradient, this value should be in the range [-PI, PI]
orientationorientation of the screen
rotation_orientationorientation of the sweep
spreadspecifies the gradient spread type

Definition at line 531 of file painter_brush.hpp.

◆ transformation()

PainterBrush& fastuidraw::PainterBrush::transformation ( const vec2 p,
const float2x2 m 
)
inline

Sets the brush to have a matrix and translation in its transformation

Parameters
ptranslation value for brush transformation
mmatrix value for brush transformation

Definition at line 671 of file painter_brush.hpp.

◆ transformation_matrix() [1/2]

PainterBrush& fastuidraw::PainterBrush::transformation_matrix ( const float2x2 m)
inline

Sets the brush to have a matrix in its transformation.

Parameters
mmatrix value for brush transformation

Definition at line 589 of file painter_brush.hpp.

◆ transformation_matrix() [2/2]

const float2x2& fastuidraw::PainterBrush::transformation_matrix ( void  ) const
inline

Returns the matrix of the transformation of the brush.

Definition at line 600 of file painter_brush.hpp.

◆ transformation_translate() [1/2]

PainterBrush& fastuidraw::PainterBrush::transformation_translate ( const vec2 p)
inline

Sets the brush to have a translation in its transformation.

Parameters
ptranslation value for brush transformation

Definition at line 568 of file painter_brush.hpp.

◆ transformation_translate() [2/2]

const vec2& fastuidraw::PainterBrush::transformation_translate ( void  ) const
inline

Returns the translation of the transformation of the brush.

Definition at line 579 of file painter_brush.hpp.


The documentation for this class was generated from the following file: