FastUIDraw
Public Types | Public Member Functions | Public Attributes | List of all members
fastuidraw::PainterItemMatrix Class Reference

A PainterItemMatrix holds the value for the transformation from item coordinates to the coordinates in which the clipping rectangle applies. More...

#include <painter_item_matrix.hpp>

Public Types

enum  item_matrix_data_offset_t {
  matrix_row0_col0_offset, matrix_row0_col1_offset, matrix_row0_col2_offset, matrix_row1_col0_offset,
  matrix_row1_col1_offset, matrix_row1_col2_offset, matrix_row2_col0_offset, matrix_row2_col1_offset,
  matrix_row2_col2_offset, normalized_translate_x, normalized_translate_y, matrix_data_size,
  matrix_col0_row0_offset = matrix_row0_col0_offset, matrix_col0_row1_offset = matrix_row1_col0_offset, matrix_col0_row2_offset = matrix_row2_col0_offset, matrix_col1_row0_offset = matrix_row0_col1_offset,
  matrix_col1_row1_offset = matrix_row1_col1_offset, matrix_col1_row2_offset = matrix_row2_col1_offset, matrix_col2_row0_offset = matrix_row0_col2_offset, matrix_col2_row1_offset = matrix_row1_col2_offset,
  matrix_col2_row2_offset = matrix_row2_col2_offset
}
 Enumeration that provides offsets for the item matrix from the location of that data (item_matrix_offset) in units of uint32_t. More...
 

Public Member Functions

 PainterItemMatrix (const float3x3 &m, const vec2 &t=vec2(0.0f, 0.0f))
 
 PainterItemMatrix (const vec2 &t=vec2(0.0f, 0.0f))
 
unsigned int data_size (void) const
 
void pack_data (c_array< uvec4 > dst) const
 

Public Attributes

float3x3 m_item_matrix
 
vec2 m_normalized_translate
 

Detailed Description

A PainterItemMatrix holds the value for the transformation from item coordinates to the coordinates in which the clipping rectangle applies.

Definition at line 40 of file painter_item_matrix.hpp.

Member Enumeration Documentation

◆ item_matrix_data_offset_t

Enumeration that provides offsets for the item matrix from the location of that data (item_matrix_offset) in units of uint32_t.

Enumerator
matrix_row0_col0_offset 

offset of m_item_matrix(0, 0) (packed as float)

matrix_row0_col1_offset 

offset of m_item_matrix(0, 1) (packed as float)

matrix_row0_col2_offset 

offset of m_item_matrix(0, 2) (packed as float)

matrix_row1_col0_offset 

offset of m_item_matrix(1, 0) (packed as float)

matrix_row1_col1_offset 

offset of m_item_matrix(1, 1) (packed as float)

matrix_row1_col2_offset 

offset of m_item_matrix(1, 2) (packed as float)

matrix_row2_col0_offset 

offset of m_item_matrix(2, 0) (packed as float)

matrix_row2_col1_offset 

offset of m_item_matrix(2, 1) (packed as float)

matrix_row2_col2_offset 

offset of m_item_matrix(2, 2) (packed as float)

normalized_translate_x 

offset of m_normalized_translate.x()

normalized_translate_y 

offset of m_normalized_translate.y()

matrix_data_size 

Size of the data for the item matrix

matrix_col0_row0_offset 

alias of matrix_row0_col0_offset

matrix_col0_row1_offset 

alias of matrix_row1_col0_offset

matrix_col0_row2_offset 

alias of matrix_row2_col0_offset

matrix_col1_row0_offset 

alias of matrix_row0_col1_offset

matrix_col1_row1_offset 

alias of matrix_row1_col1_offset

matrix_col1_row2_offset 

alias of matrix_row2_col1_offset

matrix_col2_row0_offset 

alias of matrix_row0_col2_offset

matrix_col2_row1_offset 

alias of matrix_row1_col2_offset

matrix_col2_row2_offset 

alias of matrix_row2_col2_offset

Definition at line 50 of file painter_item_matrix.hpp.

Constructor & Destructor Documentation

◆ PainterItemMatrix() [1/2]

fastuidraw::PainterItemMatrix::PainterItemMatrix ( const float3x3 m,
const vec2 t = vec2(0.0f, 0.0f) 
)
inlineexplicit

Ctor from a float3x3

Parameters
mvalue with which to initailize m_item_matrix
tvalue with which to initailize m_normalized_translate

Definition at line 84 of file painter_item_matrix.hpp.

◆ PainterItemMatrix() [2/2]

fastuidraw::PainterItemMatrix::PainterItemMatrix ( const vec2 t = vec2(0.0f, 0.0f))
inline

Ctor, initializes m_item_matrix as the identity matrix

Parameters
tvalue with which to initailize m_normalized_translate

Definition at line 93 of file painter_item_matrix.hpp.

Member Function Documentation

◆ data_size()

unsigned int fastuidraw::PainterItemMatrix::data_size ( void  ) const
inline

Returns the length of the data needed to encode the data. Data is padded to be multiple of 4.

Definition at line 102 of file painter_item_matrix.hpp.

◆ pack_data()

void fastuidraw::PainterItemMatrix::pack_data ( c_array< uvec4 dst) const

Pack the values of this PainterItemMatrix

Parameters
dstplace to which to pack data

Member Data Documentation

◆ m_item_matrix

float3x3 fastuidraw::PainterItemMatrix::m_item_matrix

The 3x3 matrix tranforming from item coordinate to the coordinates of the clipping rectange.

Definition at line 118 of file painter_item_matrix.hpp.

◆ m_normalized_translate

vec2 fastuidraw::PainterItemMatrix::m_normalized_translate

The translation in normalized device coordinates to apply to all vertices. For various internal implementation details, it is more efficient to have them seperate here instead of concating it to m_item_matrix

Definition at line 127 of file painter_item_matrix.hpp.


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