gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
bitmap.hpp
Go to the documentation of this file.
1
2#pragma once
3
4#include "../renderable.hpp"
5
6namespace ui {
7
11struct Bitmap : public Renderable {
15 color_t *const data;
16
22 Bitmap(const Size &size, color_t *const data);
23
29 void renderAt(const Coords &coords, const shader_t &shader = 0) const override;
30
35 Size getSize() const override;
36
42 virtual color_t averageColor() const;
43};
44
45} // namespace ui
uint16_t color_t
An RGB565 color value. 5 bits red, 6 bits green, 5 bits blue.
Definition color.hpp:13
shader_animated_t shader_t
A pixel shader that may or may not update based on the current time.
Definition renderable.hpp:48
A basic image with no compression or transparency.
Definition bitmap.hpp:11
void renderAt(const Coords &coords, const shader_t &shader=0) const override
Display the bitmap directly onto the screen.
Size size
The size of the image in pixels.
Definition bitmap.hpp:13
color_t *const data
The list of pixels in the image.
Definition bitmap.hpp:15
Size getSize() const override
Get the size of the bitmap.
Bitmap(const Size &size, color_t *const data)
Construct a bitmap image from static data.
virtual color_t averageColor() const
Get the average color of the bitmap.
A struct for storing the pixel coordinates of various UI elements.
Definition coords.hpp:17
An abstract interface for arbitrary renderable objects.
Definition renderable.hpp:55
A struct that holds the number of pixels that a widget would take up on the screen.
Definition size.hpp:17