KiCad PCB EDA Suite
Loading...
Searching...
No Matches
RHI_INSTANCE Struct Reference

Per-instance data for instanced 2D rendering, packed into 40 bytes. More...

#include <rhi_instance.h>

Public Member Functions

void SetPosition (float aX, float aY)
 
void SetRotation (float aRadians)
 
void SetDepth (float aNormalized)
 
void SetColor (uint8_t aR, uint8_t aG, uint8_t aB, uint8_t aA=255)
 
void SetParam (int aIndex, float aValue)
 
void SetFlag (RHI_INSTANCE_FLAG aFlag)
 
void ClearFlag (RHI_INSTANCE_FLAG aFlag)
 
bool HasFlag (RHI_INSTANCE_FLAG aFlag) const
 

Public Attributes

float x = 0.0f
 
float y = 0.0f
 
uint16_t rotation = 0
 
uint16_t scaleX = glm::packHalf1x16( 1.0f )
 
uint16_t scaleY = glm::packHalf1x16( 1.0f )
 
uint16_t depth = 0
 
float params [4] = { 0.0f, 0.0f, 0.0f, 0.0f }
 
uint8_t r = 255
 
uint8_t g = 255
 
uint8_t b = 255
 
uint8_t a = 255
 
uint16_t flags = 0
 
uint16_t pixelPad = 0
 extra stroke width in sixteenths of a pixel
 

Detailed Description

Per-instance data for instanced 2D rendering, packed into 40 bytes.

Params are float32 because float16 tops out at 65504 nm. Rotation, scale and depth are float16 so they share one FLOAT16X4 attribute.

Definition at line 53 of file rhi_instance.h.

Member Function Documentation

◆ ClearFlag()

void RHI_INSTANCE::ClearFlag ( RHI_INSTANCE_FLAG aFlag)
inline

Definition at line 90 of file rhi_instance.h.

References flags.

Referenced by KIGFX::GAL_MODERN::ChangeGroupUndimmed().

◆ HasFlag()

◆ SetColor()

void RHI_INSTANCE::SetColor ( uint8_t aR,
uint8_t aG,
uint8_t aB,
uint8_t aA = 255 )
inline

◆ SetDepth()

void RHI_INSTANCE::SetDepth ( float aNormalized)
inline

Definition at line 73 of file rhi_instance.h.

References depth.

Referenced by KIGFX::GAL_MODERN::drawBitmapGlyphs(), and KIGFX::GAL_MODERN::makeInstance().

◆ SetFlag()

◆ SetParam()

void RHI_INSTANCE::SetParam ( int aIndex,
float aValue )
inline

◆ SetPosition()

void RHI_INSTANCE::SetPosition ( float aX,
float aY )
inline

◆ SetRotation()

void RHI_INSTANCE::SetRotation ( float aRadians)
inline

Member Data Documentation

◆ a

uint8_t RHI_INSTANCE::a = 255

◆ b

uint8_t RHI_INSTANCE::b = 255

Definition at line 64 of file rhi_instance.h.

Referenced by SetColor().

◆ depth

uint16_t RHI_INSTANCE::depth = 0

◆ flags

uint16_t RHI_INSTANCE::flags = 0

Definition at line 66 of file rhi_instance.h.

Referenced by ClearFlag(), HasFlag(), and SetFlag().

◆ g

uint8_t RHI_INSTANCE::g = 255

Definition at line 63 of file rhi_instance.h.

Referenced by SetColor().

◆ params

float RHI_INSTANCE::params[4] = { 0.0f, 0.0f, 0.0f, 0.0f }

Definition at line 61 of file rhi_instance.h.

Referenced by KIGFX::RhiInstanceReach(), KIGFX::RhiInstanceRun(), and SetParam().

◆ pixelPad

uint16_t RHI_INSTANCE::pixelPad = 0

extra stroke width in sixteenths of a pixel

Definition at line 67 of file rhi_instance.h.

Referenced by KIGFX::GAL_MODERN::makeInstance(), and KIGFX::RhiInstanceReach().

◆ r

uint8_t RHI_INSTANCE::r = 255

Definition at line 62 of file rhi_instance.h.

Referenced by SetColor().

◆ rotation

uint16_t RHI_INSTANCE::rotation = 0

Definition at line 57 of file rhi_instance.h.

Referenced by SetRotation().

◆ scaleX

uint16_t RHI_INSTANCE::scaleX = glm::packHalf1x16( 1.0f )

Definition at line 58 of file rhi_instance.h.

Referenced by deadInstance(), and KIGFX::RhiInstanceReach().

◆ scaleY

uint16_t RHI_INSTANCE::scaleY = glm::packHalf1x16( 1.0f )

Definition at line 59 of file rhi_instance.h.

Referenced by deadInstance(), and KIGFX::RhiInstanceReach().

◆ x

float RHI_INSTANCE::x = 0.0f

Definition at line 55 of file rhi_instance.h.

Referenced by SetPosition().

◆ y

float RHI_INSTANCE::y = 0.0f

Definition at line 56 of file rhi_instance.h.

Referenced by SetPosition().


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