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

A basic image with no compression or transparency. More...

#include <bitmap.hpp>

Inheritance diagram for ui::Bitmap:
ui::Renderable ui::TransparentBitmap

Public Member Functions

 Bitmap (const Size &size, color_t *const data)
 Construct a bitmap image from static data.
 
void renderAt (const Coords &coords, const shader_t &shader=0) const override
 Display the bitmap directly onto the screen.
 
Size getSize () const override
 Get the size of the bitmap.
 
virtual color_t averageColor () const
 Get the average color of the bitmap.
 

Public Attributes

Size size
 The size of the image in pixels.
 
color_t *const data
 The list of pixels in the image.
 

Detailed Description

A basic image with no compression or transparency.

Constructor & Destructor Documentation

◆ Bitmap()

ui::Bitmap::Bitmap ( const Size size,
color_t *const  data 
)

Construct a bitmap image from static data.

Parameters
sizeThe size of the image.
dataThe list of pixels in the image.

Member Function Documentation

◆ averageColor()

virtual color_t ui::Bitmap::averageColor ( ) const
virtual

Get the average color of the bitmap.

Returns
A calculated average of the color from all pixels in the bitmap.
Note
This performs a fast, naive average (mean) of the raw pixel data, without accounting for human perception.

Reimplemented in ui::TransparentBitmap.

◆ getSize()

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

Get the size of the bitmap.

Returns
The size of the bitmap in pixels.

Implements ui::Renderable.

◆ renderAt()

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

Display the bitmap directly onto the screen.

Parameters
coordsThe coordinates to render the first pixel [0,0] of the bitmap.
shaderAn optional pixel shader to apply to each pixel of the bitmap.

Implements ui::Renderable.

Reimplemented in ui::TransparentBitmap.


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