FastUIDraw
Public Types | Public Member Functions | Static Public Member Functions | List of all members
fastuidraw::PainterStrokeParams Class Reference

Class to specify stroking parameters, data is packed as according to PainterStrokeParams::stroke_data_offset_t. More...

#include <painter_stroke_params.hpp>

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

Public Types

enum  stroke_data_offset_t { stroke_radius_offset, stroke_miter_limit_offset, stroking_units_offset, stroke_data_size }
 Enumeration that provides offsets for the stroking parameters. More...
 
enum  stroking_units_t { path_stroking_units, pixel_stroking_units }
 Enumeration to specify the units of the stroking radius. More...
 

Public Member Functions

 PainterStrokeParams (void)
 
 PainterStrokeParams (const PainterStrokeParams &obj)
 
unsigned int data_size (void) const override
 
float miter_limit (void) const
 
PainterStrokeParamsmiter_limit (float f)
 
PainterStrokeParamsoperator= (const PainterStrokeParams &obj)
 
void pack_data (c_array< uvec4 > dst) const override
 
float radius (void) const
 
PainterStrokeParamsradius (float f)
 
enum stroking_units_t stroking_units (void) const
 
PainterStrokeParamsstroking_units (enum stroking_units_t)
 
void swap (PainterStrokeParams &obj)
 
float width (void) const
 
PainterStrokeParamswidth (float f)
 
- Public Member Functions inherited from fastuidraw::PainterShaderData
virtual unsigned int number_resources (void) const
 
virtual void save_resources (c_array< reference_counted_ptr< const resource_base > > dst) const
 

Static Public Member Functions

static reference_counted_ptr< const StrokingDataSelectorBasestroking_data_selector (bool pixel_arc_stroking_possible)
 

Detailed Description

Class to specify stroking parameters, data is packed as according to PainterStrokeParams::stroke_data_offset_t.

Definition at line 36 of file painter_stroke_params.hpp.

Member Enumeration Documentation

◆ stroke_data_offset_t

Enumeration that provides offsets for the stroking parameters.

Enumerator
stroke_radius_offset 

Offset to stroke radius (packed as float)

stroke_miter_limit_offset 

offset to stroke miter limit (packed as float)

stroking_units_offset 

Offset to stroking units (packed as uint)

stroke_data_size 

size of data for stroking

Definition at line 62 of file painter_stroke_params.hpp.

◆ stroking_units_t

Enumeration to specify the units of the stroking radius.

Enumerator
path_stroking_units 

Indicates that the stroking units is in local coordinates of the Path being stroking

pixel_stroking_units 

Indicates that the stroking units are in pixels

Definition at line 43 of file painter_stroke_params.hpp.

Constructor & Destructor Documentation

◆ PainterStrokeParams() [1/2]

fastuidraw::PainterStrokeParams::PainterStrokeParams ( void  )

Ctor.

◆ PainterStrokeParams() [2/2]

fastuidraw::PainterStrokeParams::PainterStrokeParams ( const PainterStrokeParams obj)

Copy ctor.

Member Function Documentation

◆ data_size()

unsigned int fastuidraw::PainterStrokeParams::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::PainterShaderData.

◆ miter_limit() [1/2]

float fastuidraw::PainterStrokeParams::miter_limit ( void  ) const

The miter limit for miter joins. Default value is 15.0.

◆ miter_limit() [2/2]

PainterStrokeParams& fastuidraw::PainterStrokeParams::miter_limit ( float  f)

Set the value of miter_limit(void) const; value is clamped to be non-negative.

◆ operator=()

PainterStrokeParams& fastuidraw::PainterStrokeParams::operator= ( const PainterStrokeParams obj)

Assignment operator.

Parameters
objvalue from which to copy

◆ pack_data()

void fastuidraw::PainterStrokeParams::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::PainterShaderData.

◆ radius() [1/2]

float fastuidraw::PainterStrokeParams::radius ( void  ) const

The stroking radius, equivalent to

width() * 0.5

Default value is 1.0.

◆ radius() [2/2]

PainterStrokeParams& fastuidraw::PainterStrokeParams::radius ( float  f)

Set the value of radius(void) const, equivalent to

width(2.0 * f)

◆ stroking_data_selector()

static reference_counted_ptr<const StrokingDataSelectorBase> fastuidraw::PainterStrokeParams::stroking_data_selector ( bool  pixel_arc_stroking_possible)
static

Returns a StrokingDataSelectorBase suitable for PainterStrokeParams.

Parameters
pixel_arc_stroking_possibleif true, will inform that arc-stroking width in pixel_stroking_units is possible.

◆ stroking_units() [1/2]

enum stroking_units_t fastuidraw::PainterStrokeParams::stroking_units ( void  ) const

Returns the units of the stroking, default value is path_stroking_units

◆ stroking_units() [2/2]

PainterStrokeParams& fastuidraw::PainterStrokeParams::stroking_units ( enum  stroking_units_t)

Set the value of stroking_units(void) const

◆ swap()

void fastuidraw::PainterStrokeParams::swap ( PainterStrokeParams obj)

Swap operation

Parameters
objobject with which to swap

◆ width() [1/2]

float fastuidraw::PainterStrokeParams::width ( void  ) const

The stroking width, always non-negative. Default value is 2.0.

◆ width() [2/2]

PainterStrokeParams& fastuidraw::PainterStrokeParams::width ( float  f)

Set the value of width(void) const, values are clamped to be non-negative.


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