gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
ui::TransparencyMap Struct Reference

A basic image that is a single color when not transparent. More...

#include <transparency_map.hpp>

Inheritance diagram for ui::TransparencyMap:
ui::Renderable ui::CompressedTransparencyMap

Public Member Functions

 TransparencyMap (const Size &size, color_t color, uint8_t *const mask)
 Construct a transparency map image from static data.
 
Size getSize () const override
 Get the size of the transparency map.
 
void renderAt (const Coords &coords, const shader_t &shader=0) const override
 Display the image directly onto the screen.
 

Public Attributes

Size size
 The size of the image in pixels.
 
color_t color
 The color of non-transparent pixels.
 
uint8_t *const mask
 The transparency mask.
 

Detailed Description

A basic image that is a single color when not transparent.

Constructor & Destructor Documentation

◆ TransparencyMap()

ui::TransparencyMap::TransparencyMap ( const Size size,
color_t  color,
uint8_t *const  mask 
)

Construct a transparency map image from static data.

Parameters
sizeThe size of the image.
colorThe color of non-transparent pixels.
maskThe transparency mask for the image.

Member Function Documentation

◆ getSize()

Size ui::TransparencyMap::getSize ( ) const
overridevirtual

Get the size of the transparency map.

Returns
The size of the transparency map in pixels.

Implements ui::Renderable.

◆ renderAt()

void ui::TransparencyMap::renderAt ( const Coords coords,
const shader_t shader = 0 
) const
overridevirtual

Display the image directly onto the screen.

Parameters
coordsThe coordinages to render the first pixel [0,0] of the transparency map.
shaderAn optional pixel shader to apply to each pixel of the transparency map.
Note
Shaders will only be applied to non-transparent pixels.

Implements ui::Renderable.

Member Data Documentation

◆ mask

uint8_t* const ui::TransparencyMap::mask

The transparency mask.

Each bit represents its respective pixel's transparency, with 1 being fully opaque and 0 being fully transparent.


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