gigawidgets 0.3.55
A wxWidgets-style UI library for the Arduino Giga Display Shield.
 
Loading...
Searching...
No Matches
display.hpp
Go to the documentation of this file.
1
3#pragma once
4
5#include <Arduino.h>
6#include <cinttypes>
7
8#include "color.hpp"
9#include "coords.hpp"
10#include "event.hpp"
11#include "radius.hpp"
12#include "rotation.hpp"
13#include "size.hpp"
14
15namespace ui {
16
21void begin(bool require_touch = false);
22
27void setRotation(rotation_t rotation);
28
34
40
45
52void drawPixel(coord_t x, coord_t y, color_t color);
53
58void fillScreen(color_t color);
59
68
77
81void endWrite();
82
89
94void setTextSize(uint8_t size);
95
101
106void setTextWrap(bool wrap);
107
112void print(const String &str);
113
119
125
131
141void fillRoundRect(coord_t x, coord_t y, coord_t width, coord_t height, radius_t radius, color_t color);
142
151void drawRect(coord_t x, coord_t y, coord_t width, coord_t height, color_t color);
152
162void drawBitmap(coord_t x, coord_t y, uint8_t *bitmap, coord_t w, coord_t h, color_t color);
163
173
183void drawRGBBitmap(coord_t x, coord_t y, color_t *bitmap, uint8_t *mask, coord_t w, coord_t h);
184
193void drawLine(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color);
194
203void drawCircle(coord_t x, coord_t y, radius_t radius, color_t color, bool fill);
204
214void drawEllipse(coord_t x, coord_t y, radius_t radius1, radius_t radius2, color_t color, bool fill);
215
216} // namespace ui
uint16_t color_t
An RGB565 color value. 5 bits red, 6 bits green, 5 bits blue.
Definition color.hpp:13
int16_t coord_t
A pixel coordinate on the screen. This can be negative or otherwise off-screen.
Definition coords.hpp:12
void setTextWrap(bool wrap)
Set whether text wraps.
void drawPixel(coord_t x, coord_t y, color_t color)
Render a pixel to the screen, accounting for rotation.
void drawRect(coord_t x, coord_t y, coord_t width, coord_t height, color_t color)
Draw a rectangle.
void finalizeRotation()
After a render cycle has completed, set the screen rotation to not changed.
void drawRGBBitmap(coord_t x, coord_t y, color_t *bitmap, coord_t w, coord_t h)
Draw an RGB bitmap without transparency.
rotation_t getRotation()
Get the current screen rotation.
void setTextColor(color_t color)
Set the color of rendered text.
void drawCircle(coord_t x, coord_t y, radius_t radius, color_t color, bool fill)
Draw a circle.
void print(const String &str)
Write text to the screen.
bool rotationChanged()
Check if the screen rotation has changed since the last render cycle.
uisize_t width()
Get the screen width, adjusted for rotation.
void drawLine(coord_t x0, coord_t y0, coord_t x1, coord_t y1, color_t color)
Draw an arbitrary single-pixel line.
void fillRoundRect(coord_t x, coord_t y, coord_t width, coord_t height, radius_t radius, color_t color)
Draw a filled rectangle with rounded corners.
void endWrite()
Flush data to the screen.
uisize_t height()
Get the screen height, adjusted for rotation.
void drawBitmap(coord_t x, coord_t y, uint8_t *bitmap, coord_t w, coord_t h, color_t color)
Draw a single-color bitmap.
void drawFastHLine(coord_t x, coord_t y, coord_t w, color_t color)
Draw a hardware-accelerated horizontal line.
void setTextSize(uint8_t size)
Set the scaling factor for rendering text.
void begin(bool require_touch=false)
Initialize the screen.
void drawFastVLine(coord_t x, coord_t y, coord_t h, color_t color)
Draw a hardware-accelerated vertical line.
void setRotation(rotation_t rotation)
Set the screen rotation.
void setCursor(coord_t x, coord_t y)
Set the current position for rendering text.
void drawEllipse(coord_t x, coord_t y, radius_t radius1, radius_t radius2, color_t color, bool fill)
Draw an ellipse.
Event getTouchEvent()
Check for a touchscreen event.
void fillScreen(color_t color)
Fill the screen with a color.
uint16_t radius_t
A non-negative size for the pixel radius of curved shapes.
Definition radius.hpp:12
rotation_t
The four possible screen rotations.
Definition rotation.hpp:9
uint16_t uisize_t
A non-negative size for UI widgets.
Definition size.hpp:12
A touchscreen event.
Definition event.hpp:26