Files
pti-ledy/structs.h
T
2026-02-06 09:51:22 +01:00

93 lines
1.8 KiB
C

#ifndef STRUCTS_H
#define STRUCTS_H
#include "config.h"
struct Cursor
{
short x;
short y;
Cursor() : x(0), y(0) {}
};
struct Pixel
{
unsigned short x;
unsigned short y;
uint32_t color;
};
struct TextNode
{
char content[TEXT_MAX_LENGTH];
uint32_t color;
struct CharacterSize
{
unsigned short height;
unsigned short width;
} characterSize;
short pos_x;
short pos_y;
unsigned char character_count;
unsigned char scroll_slowness;
unsigned char scroll_progress;
short disappear_time;
bool is_scrolling;
TextNode() : color(0), pos_x(0), pos_y(0), character_count(0), scroll_slowness(0), scroll_progress(0), characterSize({7,5}), disappear_time(0), is_scrolling(true) {}
};
struct RGB
{
unsigned char r;
unsigned char g;
unsigned char b;
RGB() : r(0), g(0), b(0) {}
};
struct RGBWithIndex
{
unsigned char r;
unsigned char g;
unsigned char b;
unsigned char start_index;
RGBWithIndex() : r(0), g(0), b(0), start_index(0) {}
RGBWithIndex(unsigned char r, unsigned char g, unsigned char b, unsigned char start_index) : r(r), g(g), b(b), start_index(start_index) {}
};
struct MultiColorTextNode
{
char content[TEXT_MAX_LENGTH];
RGBWithIndex colors[4];
struct CharacterSize
{
unsigned short height;
unsigned short width;
} characterSize;
short pos_x;
short pos_y;
unsigned char color_count;
unsigned char character_count;
unsigned char scroll_slowness;
unsigned char scroll_progress;
short disappear_time;
bool is_scrolling;
MultiColorTextNode() : pos_x(0), pos_y(0), character_count(0), scroll_slowness(0), scroll_progress(0), characterSize({7,5}), disappear_time(0), is_scrolling(true), color_count(0) {}
};
struct Image
{
RGB pixels[PANEL_PIXEL_COUNT][DISPLAY_MAX_X + 1];
unsigned short width;
unsigned short height;
};
#endif // STRUCTS_H