11#ifndef TCMENU_DRAWING_PRIMITIVES_H
12#define TCMENU_DRAWING_PRIMITIVES_H
14#include <PlatformDetermination.h>
21#define DRAW_NO_MASK 0xff
24#ifdef NEED_32BIT_COLOR_T_ALPHA
31#define RGB(r, g, b) (uint32_t)( 0xff000000UL | ((r)<<16UL) | ((g)<<8UL) | (b) )
39#define RGB(r, g, b) (uint16_t)( (((r)>>3)<<11) | (((g)>>2)<<5) | ((b)>>3) )
70 top = bottom = right = left =
equalAll;
84 padding.right = right;
85 padding.bottom = bottom;
111 bool areAllBordersEqual()
const {
112 return (top == left) && (left == right) && (right == bottom);
115 bool isBorderOff()
const {
116 return areAllBordersEqual() && top == 0;
120#ifndef TC_COORD_DEFINED
121#define TC_COORD_DEFINED
229 return (
selected && selectedIcon !=
nullptr) ? selectedIcon : normalIcon;
258 void setFromValues(
const Coord &size,
IconType ty,
const uint8_t *normal,
const uint8_t *selected =
nullptr) {
259 this->dimensions = size;
261 this->normalIcon = normal;
262 this->selectedIcon = selected;
uint32_t color_t
Definition DrawingPrimitives.h:29
void makePadding(MenuPadding &padding, int top, int right, int bottom, int left)
Definition DrawingPrimitives.h:82
Definition DrawingPrimitives.h:152
const color_t * getPalette() const
Definition DrawingPrimitives.h:236
DrawableIcon(uint16_t id, const Coord &size, IconType ty, const uint8_t *normal, const uint8_t *selected=nullptr)
Definition DrawingPrimitives.h:205
MemoryLocation
Definition DrawingPrimitives.h:168
@ STORED_IN_RAM
Definition DrawingPrimitives.h:172
@ STORED_IN_ROM
Definition DrawingPrimitives.h:170
@ LOAD_FROM_STORAGE
Definition DrawingPrimitives.h:174
Coord getDimensions() const
Definition DrawingPrimitives.h:243
DrawableIcon(const DrawableIcon &other)=default
DrawableIcon(uint16_t id, const Coord &size, IconType ty, const color_t *paletteEntries, const uint8_t *normal, const uint8_t *selected=nullptr)
Definition DrawingPrimitives.h:218
const uint8_t * getIcon(bool selected) const
Definition DrawingPrimitives.h:228
DrawableIcon()
Definition DrawingPrimitives.h:188
IconType getIconType() const
Definition DrawingPrimitives.h:250
IconType
Definition DrawingPrimitives.h:154
@ ICON_NATIVE
Definition DrawingPrimitives.h:166
@ ICON_XBITMAP
Definition DrawingPrimitives.h:156
@ ICON_MONO
Definition DrawingPrimitives.h:158
@ ICON_PALLETE_2BPP
Definition DrawingPrimitives.h:161
@ ICON_PALLETE_4BPP
Definition DrawingPrimitives.h:164
Definition DrawingPrimitives.h:123
Coord()
Definition DrawingPrimitives.h:125
Coord(int x, int y)
Definition DrawingPrimitives.h:134