OpenTTD Source: src/gfx_type.h Source File

OpenTTD Source 15.0-RC2

gfx_type.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef GFX_TYPE_H
11#define GFX_TYPE_H
12
13#include "core/enum_type.hpp"
14#include "core/geometry_type.hpp"
15#include "zoom_type.h"
16
17 typedef uint32_t SpriteID;
18 typedef uint32_t PaletteID;
19 typedef uint32_t CursorID;
20
22 struct PalSpriteID {
23 SpriteID sprite{};
24 PaletteID pal{};
25
26 auto operator<=>(const PalSpriteID&) const = default;
27};
28
29 enum WindowKeyCodes : uint16_t {
30 WKC_SHIFT = 0x8000,
31 WKC_CTRL = 0x4000,
32 WKC_ALT = 0x2000,
33 WKC_META = 0x1000,
34
35 WKC_GLOBAL_HOTKEY = 0x0800,
36
37 WKC_SPECIAL_KEYS = WKC_SHIFT | WKC_CTRL | WKC_ALT | WKC_META | WKC_GLOBAL_HOTKEY,
38
39 /* Special ones */
40 WKC_NONE = 0,
41 WKC_ESC = 1,
42 WKC_BACKSPACE = 2,
43 WKC_INSERT = 3,
44 WKC_DELETE = 4,
45
46 WKC_PAGEUP = 5,
47 WKC_PAGEDOWN = 6,
48 WKC_END = 7,
49 WKC_HOME = 8,
50
51 /* Arrow keys */
52 WKC_LEFT = 9,
53 WKC_UP = 10,
54 WKC_RIGHT = 11,
55 WKC_DOWN = 12,
56
57 /* Return & tab */
58 WKC_RETURN = 13,
59 WKC_TAB = 14,
60
61 /* Space */
62 WKC_SPACE = 32,
63
64 /* Function keys */
65 WKC_F1 = 33,
66 WKC_F2 = 34,
67 WKC_F3 = 35,
68 WKC_F4 = 36,
69 WKC_F5 = 37,
70 WKC_F6 = 38,
71 WKC_F7 = 39,
72 WKC_F8 = 40,
73 WKC_F9 = 41,
74 WKC_F10 = 42,
75 WKC_F11 = 43,
76 WKC_F12 = 44,
77
78 /* Backquote is the key left of "1"
79 * we only store this key here, no matter what character is really mapped to it
80 * on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) */
81 WKC_BACKQUOTE = 45,
82 WKC_PAUSE = 46,
83
84 /* 0-9 are mapped to 48-57
85 * A-Z are mapped to 65-90
86 * a-z are mapped to 97-122 */
87
88 /* Numerical keyboard */
89 WKC_NUM_DIV = 138,
90 WKC_NUM_MUL = 139,
91 WKC_NUM_MINUS = 140,
92 WKC_NUM_PLUS = 141,
93 WKC_NUM_ENTER = 142,
94 WKC_NUM_DECIMAL = 143,
95
96 /* Other keys */
97 WKC_SLASH = 144,
98 WKC_SEMICOLON = 145,
99 WKC_EQUALS = 146,
100 WKC_L_BRACKET = 147,
101 WKC_BACKSLASH = 148,
102 WKC_R_BRACKET = 149,
103 WKC_SINGLEQUOTE = 150,
104 WKC_COMMA = 151,
105 WKC_PERIOD = 152,
106 WKC_MINUS = 153,
107};
108
110 struct AnimCursor {
111 CursorID sprite;
112 uint8_t display_time;
113};
114
115 struct CursorSprite {
116 PalSpriteID image;
117 Point pos;
118
119 constexpr CursorSprite(SpriteID spr, PaletteID pal, int x, int y) : image({spr, pal}), pos({x, y}) {}
120};
121
123 struct CursorVars {
124 /* Logical mouse position */
125 Point pos;
126 Point delta;
127 int wheel;
128 bool fix_at;
129
130 /* 2D wheel scrolling for moving around the map */
131 bool wheel_moved;
132 float v_wheel;
133 float h_wheel;
134
135 /* Mouse appearance */
136 std::vector<CursorSprite> sprites;
137 Point total_offs, total_size;
138
139 Point draw_pos, draw_size;
140
141 std::span<const AnimCursor> animate_list{};
142 std::span<const AnimCursor>::iterator animate_cur = std::end(animate_list);
143 uint animate_timeout;
144
145 bool visible;
146 bool dirty;
147 bool in_window;
148
149 /* Drag data */
150 bool vehchain;
151
152 void UpdateCursorPositionRelative(int delta_x, int delta_y);
153 bool UpdateCursorPosition(int x, int y);
154};
155
157 struct DrawPixelInfo {
158 void *dst_ptr;
159 int left, top, width, height;
160 int pitch;
161 ZoomLevel zoom;
162};
163
165 union ColourRGBA {
166 uint32_t data;
167 struct {
168 uint8_t r, g, b, a;
169 };
170
178 constexpr ColourRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0xFF) : r(r), g(g), b(b), a(a) { }
179
184 constexpr ColourRGBA(uint data = 0) : data(data) { }
185
186 bool operator==(const ColourRGBA &other) const { return this->data == other.data; };
187};
188
190 union ColourARGB {
191 uint32_t data;
192 struct {
193 uint8_t a, r, g, b;
194 };
195
203 constexpr ColourARGB(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0xFF) : a(a), r(r), g(g), b(b) { }
204
209 constexpr ColourARGB(uint data = 0) : data(data) { }
210
211 bool operator==(const ColourARGB &other) const { return this->data == other.data; };
212};
213
215 union ColourBGRA {
216 uint32_t data;
217 struct {
218 uint8_t b, g, r, a;
219 };
220
228 constexpr ColourBGRA(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 0xFF) : b(b), g(g), r(r), a(a) { }
229
234 constexpr ColourBGRA(uint data = 0) : data(data) { }
235
236 bool operator==(const ColourBGRA &other) const { return this->data == other.data; };
237};
238
239#if defined(__EMSCRIPTEN__)
240using Colour = ColourRGBA;
241#else
242using Colour = std::conditional_t<std::endian::native == std::endian::little, ColourBGRA, ColourARGB>;
243#endif /* defined(__EMSCRIPTEN__) */
244
245static_assert(sizeof(Colour) == sizeof(uint32_t));
246
248 enum FontSize : uint8_t {
249 FS_NORMAL,
250 FS_SMALL,
251 FS_LARGE,
252 FS_MONO,
253 FS_END,
254
255 FS_BEGIN = FS_NORMAL,
256};
257 DECLARE_INCREMENT_DECREMENT_OPERATORS(FontSize)
258
259using FontSizes = EnumBitSet<FontSize, uint8_t>;
260
262 constexpr FontSizes FONTSIZES_ALL{FS_NORMAL, FS_SMALL, FS_LARGE, FS_MONO};
264 constexpr FontSizes FONTSIZES_REQUIRED{FS_NORMAL, FS_SMALL, FS_LARGE};
265
266inline std::string_view FontSizeToName(FontSize fs)
267{
268 static const std::string_view SIZE_TO_NAME[] = { "medium", "small", "large", "mono" };
269 assert(fs < FS_END);
270 return SIZE_TO_NAME[fs];
271}
272
278 struct SubSprite {
279 int left, top, right, bottom;
280};
281
282enum Colours : uint8_t {
283 COLOUR_BEGIN,
284 COLOUR_DARK_BLUE = COLOUR_BEGIN,
285 COLOUR_PALE_GREEN,
286 COLOUR_PINK,
287 COLOUR_YELLOW,
288 COLOUR_RED,
289 COLOUR_LIGHT_BLUE,
290 COLOUR_GREEN,
291 COLOUR_DARK_GREEN,
292 COLOUR_BLUE,
293 COLOUR_CREAM,
294 COLOUR_MAUVE,
295 COLOUR_PURPLE,
296 COLOUR_ORANGE,
297 COLOUR_BROWN,
298 COLOUR_GREY,
299 COLOUR_WHITE,
300 COLOUR_END,
301 INVALID_COLOUR = 0xFF,
302};
303 DECLARE_INCREMENT_DECREMENT_OPERATORS(Colours)
304 DECLARE_ENUM_AS_ADDABLE(Colours)
305
306
307enum TextColour : uint16_t {
308 TC_BEGIN = 0x00,
309 TC_FROMSTRING = 0x00,
310 TC_BLUE = 0x00,
311 TC_SILVER = 0x01,
312 TC_GOLD = 0x02,
313 TC_RED = 0x03,
314 TC_PURPLE = 0x04,
315 TC_LIGHT_BROWN = 0x05,
316 TC_ORANGE = 0x06,
317 TC_GREEN = 0x07,
318 TC_YELLOW = 0x08,
319 TC_DARK_GREEN = 0x09,
320 TC_CREAM = 0x0A,
321 TC_BROWN = 0x0B,
322 TC_WHITE = 0x0C,
323 TC_LIGHT_BLUE = 0x0D,
324 TC_GREY = 0x0E,
325 TC_DARK_BLUE = 0x0F,
326 TC_BLACK = 0x10,
327 TC_END,
328 TC_INVALID = 0xFF,
329
330 TC_IS_PALETTE_COLOUR = 0x100,
331 TC_NO_SHADE = 0x200,
332 TC_FORCED = 0x400,
333
334 TC_COLOUR_MASK = 0xFF,
335 TC_FLAGS_MASK = 0x700,
336};
337 DECLARE_ENUM_AS_BIT_SET(TextColour)
338
339/* A few values that are related to animations using palette changes */
340static constexpr uint8_t PALETTE_ANIM_SIZE = 28;
341static constexpr uint8_t PALETTE_ANIM_START = 227;
342
344enum FillRectMode : uint8_t {
345 FILLRECT_OPAQUE,
346 FILLRECT_CHECKER,
347 FILLRECT_RECOLOUR,
348};
349
351 enum PaletteType : uint8_t {
352 PAL_DOS,
353 PAL_WINDOWS,
354};
355
357 enum class SpriteType : uint8_t {
358 Normal = 0,
359 MapGen = 1,
360 Font = 2,
361 Recolour = 3,
362 Invalid = 4,
363};
364
370 static const uint MILLISECONDS_PER_TICK = 27;
371
373 struct Palette {
374 Colour palette[256];
375 int first_dirty;
376 int count_dirty;
377};
378
380 enum Support8bpp : uint8_t {
381 S8BPP_NONE = 0,
382 S8BPP_SYSTEM,
383 S8BPP_HARDWARE,
384};
385
387 enum StringAlignment : uint8_t {
388 SA_LEFT = 0 << 0,
389 SA_HOR_CENTER = 1 << 0,
390 SA_RIGHT = 2 << 0,
391 SA_HOR_MASK = 3 << 0,
392
393 SA_TOP = 0 << 2,
394 SA_VERT_CENTER = 1 << 2,
395 SA_BOTTOM = 2 << 2,
396 SA_VERT_MASK = 3 << 2,
397
398 SA_CENTER = SA_HOR_CENTER | SA_VERT_CENTER,
399
400 SA_FORCE = 1 << 4,
401};
402 DECLARE_ENUM_AS_BIT_SET(StringAlignment)
403
404
405struct PixelColour {
406 uint8_t p;
407
408 constexpr PixelColour() : p(0) {}
409 explicit constexpr PixelColour(uint8_t p) : p(p) {}
410
411 constexpr inline TextColour ToTextColour() const { return static_cast<TextColour>(this->p) | TC_IS_PALETTE_COLOUR; }
412};
413
414#endif /* GFX_TYPE_H */
EnumBitSet
Enum-as-bit-set wrapper.
Definition enum_type.hpp:177
Font
Container with information about a font.
Definition gfx_layout.h:97
enum_type.hpp
Type (helpers) for enums.
DECLARE_ENUM_AS_BIT_SET
#define DECLARE_ENUM_AS_BIT_SET(enum_type)
Operators to allow to work with enum as with type safe bit set in C++.
Definition enum_type.hpp:119
DECLARE_ENUM_AS_ADDABLE
#define DECLARE_ENUM_AS_ADDABLE(EnumType)
Operator that allows this enumeration to be added to any other enumeration.
Definition enum_type.hpp:129
DECLARE_INCREMENT_DECREMENT_OPERATORS
#define DECLARE_INCREMENT_DECREMENT_OPERATORS(enum_type)
For some enums it is useful to have pre/post increment/decrement operators.
Definition enum_type.hpp:63
geometry_type.hpp
All geometry types in OpenTTD.
SpriteID
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
Support8bpp
Support8bpp
Modes for 8bpp support.
Definition gfx_type.h:380
S8BPP_HARDWARE
@ S8BPP_HARDWARE
Full 8bpp support by OS and hardware.
Definition gfx_type.h:383
S8BPP_NONE
@ S8BPP_NONE
No support for 8bpp by OS or hardware, force 32bpp blitters.
Definition gfx_type.h:381
S8BPP_SYSTEM
@ S8BPP_SYSTEM
No 8bpp support by hardware, do not try to use 8bpp video modes or hardware palettes.
Definition gfx_type.h:382
SpriteType
SpriteType
Types of sprites that might be loaded.
Definition gfx_type.h:357
SpriteType::Recolour
@ Recolour
Recolour sprite.
SpriteType::MapGen
@ MapGen
Special sprite for the map generator.
SpriteType::Invalid
@ Invalid
Pseudosprite or other unusable sprite, used only internally.
SpriteType::Normal
@ Normal
The most basic (normal) sprite.
PALETTE_ANIM_SIZE
static constexpr uint8_t PALETTE_ANIM_SIZE
number of animated colours
Definition gfx_type.h:340
FontSize
FontSize
Available font sizes.
Definition gfx_type.h:248
FS_MONO
@ FS_MONO
Index of the monospaced font in the font tables.
Definition gfx_type.h:252
FS_SMALL
@ FS_SMALL
Index of the small font in the font tables.
Definition gfx_type.h:250
FS_BEGIN
@ FS_BEGIN
First font.
Definition gfx_type.h:255
FS_NORMAL
@ FS_NORMAL
Index of the normal font in the font tables.
Definition gfx_type.h:249
FS_LARGE
@ FS_LARGE
Index of the large font in the font tables.
Definition gfx_type.h:251
CursorID
uint32_t CursorID
The number of the cursor (sprite)
Definition gfx_type.h:19
StringAlignment
StringAlignment
How to align the to-be drawn text.
Definition gfx_type.h:387
SA_TOP
@ SA_TOP
Top align the text.
Definition gfx_type.h:393
SA_LEFT
@ SA_LEFT
Left align the text.
Definition gfx_type.h:388
SA_HOR_MASK
@ SA_HOR_MASK
Mask for horizontal alignment.
Definition gfx_type.h:391
SA_RIGHT
@ SA_RIGHT
Right align the text (must be a single bit).
Definition gfx_type.h:390
SA_HOR_CENTER
@ SA_HOR_CENTER
Horizontally center the text.
Definition gfx_type.h:389
SA_VERT_MASK
@ SA_VERT_MASK
Mask for vertical alignment.
Definition gfx_type.h:396
SA_FORCE
@ SA_FORCE
Force the alignment, i.e. don't swap for RTL languages.
Definition gfx_type.h:400
SA_BOTTOM
@ SA_BOTTOM
Bottom align the text.
Definition gfx_type.h:395
SA_CENTER
@ SA_CENTER
Center both horizontally and vertically.
Definition gfx_type.h:398
SA_VERT_CENTER
@ SA_VERT_CENTER
Vertically center the text.
Definition gfx_type.h:394
FONTSIZES_ALL
constexpr FontSizes FONTSIZES_ALL
Mask of all possible font sizes.
Definition gfx_type.h:262
PaletteType
PaletteType
Palettes OpenTTD supports.
Definition gfx_type.h:351
PAL_DOS
@ PAL_DOS
Use the DOS palette.
Definition gfx_type.h:352
PAL_WINDOWS
@ PAL_WINDOWS
Use the Windows palette.
Definition gfx_type.h:353
PaletteID
uint32_t PaletteID
The number of the palette.
Definition gfx_type.h:18
PALETTE_ANIM_START
static constexpr uint8_t PALETTE_ANIM_START
Index in the _palettes array from which all animations are taking places (table/palettes....
Definition gfx_type.h:341
TextColour
TextColour
Colour of the strings, see _string_colourmap in table/string_colours.h or docs/ottd-colourtext-palett...
Definition gfx_type.h:307
TC_FORCED
@ TC_FORCED
Ignore colour changes from strings.
Definition gfx_type.h:332
TC_FLAGS_MASK
@ TC_FLAGS_MASK
Mask to test if TextColour (with flags) is within limits.
Definition gfx_type.h:335
TC_NO_SHADE
@ TC_NO_SHADE
Do not add shading to this text colour.
Definition gfx_type.h:331
TC_IS_PALETTE_COLOUR
@ TC_IS_PALETTE_COLOUR
Colour value is already a real palette colour index, not an index of a StringColour.
Definition gfx_type.h:330
TC_COLOUR_MASK
@ TC_COLOUR_MASK
Mask to test if TextColour (without flags) is within limits.
Definition gfx_type.h:334
FillRectMode
FillRectMode
Define the operation GfxFillRect performs.
Definition gfx_type.h:344
FILLRECT_CHECKER
@ FILLRECT_CHECKER
Draw only every second pixel, used for greying-out.
Definition gfx_type.h:346
FILLRECT_OPAQUE
@ FILLRECT_OPAQUE
Fill rectangle with a single colour.
Definition gfx_type.h:345
FILLRECT_RECOLOUR
@ FILLRECT_RECOLOUR
Apply a recolour sprite to the screen content.
Definition gfx_type.h:347
MILLISECONDS_PER_TICK
static const uint MILLISECONDS_PER_TICK
The number of milliseconds per game tick.
Definition gfx_type.h:370
FONTSIZES_REQUIRED
constexpr FontSizes FONTSIZES_REQUIRED
Mask of font sizes required to be present.
Definition gfx_type.h:264
WindowKeyCodes
WindowKeyCodes
Definition gfx_type.h:29
WKC_BACKSLASH
@ WKC_BACKSLASH
\ Backslash
Definition gfx_type.h:101
WKC_MINUS
@ WKC_MINUS
Definition gfx_type.h:106
WKC_COMMA
@ WKC_COMMA
, Comma
Definition gfx_type.h:104
WKC_PERIOD
@ WKC_PERIOD
. Period
Definition gfx_type.h:105
WKC_EQUALS
@ WKC_EQUALS
= Equals
Definition gfx_type.h:99
WKC_SLASH
@ WKC_SLASH
/ Forward slash
Definition gfx_type.h:97
WKC_SINGLEQUOTE
@ WKC_SINGLEQUOTE
' Single quote
Definition gfx_type.h:103
WKC_R_BRACKET
@ WKC_R_BRACKET
] Right square bracket
Definition gfx_type.h:102
WKC_L_BRACKET
@ WKC_L_BRACKET
[ Left square bracket
Definition gfx_type.h:100
WKC_GLOBAL_HOTKEY
@ WKC_GLOBAL_HOTKEY
Fake keycode bit to indicate global hotkeys.
Definition gfx_type.h:35
WKC_SEMICOLON
@ WKC_SEMICOLON
; Semicolon
Definition gfx_type.h:98
AnimCursor
A single sprite of a list of animated cursors.
Definition gfx_type.h:110
AnimCursor::display_time
uint8_t display_time
Amount of ticks this sprite will be shown.
Definition gfx_type.h:112
AnimCursor::sprite
CursorID sprite
Must be set to LAST_ANIM when it is the last sprite of the loop.
Definition gfx_type.h:111
Coord2D< int >
CursorSprite
Definition gfx_type.h:115
CursorSprite::pos
Point pos
Relative position.
Definition gfx_type.h:117
CursorSprite::image
PalSpriteID image
Image.
Definition gfx_type.h:116
CursorVars
Collection of variables for cursor-display and -animation.
Definition gfx_type.h:123
CursorVars::visible
bool visible
cursor is visible
Definition gfx_type.h:145
CursorVars::UpdateCursorPosition
bool UpdateCursorPosition(int x, int y)
Update cursor position on mouse movement.
Definition gfx.cpp:1745
CursorVars::animate_timeout
uint animate_timeout
in case of animated cursor, number of ticks to show the current cursor
Definition gfx_type.h:143
CursorVars::sprites
std::vector< CursorSprite > sprites
Sprites comprising cursor.
Definition gfx_type.h:136
CursorVars::fix_at
bool fix_at
mouse is moving, but cursor is not (used for scrolling)
Definition gfx_type.h:128
CursorVars::pos
Point pos
logical mouse position
Definition gfx_type.h:125
CursorVars::UpdateCursorPositionRelative
void UpdateCursorPositionRelative(int delta_x, int delta_y)
Update cursor position based on a relative change.
Definition gfx.cpp:1731
CursorVars::animate_cur
std::span< constAnimCursor >::iterator animate_cur
in case of animated cursor, current frame
Definition gfx_type.h:142
CursorVars::vehchain
bool vehchain
vehicle chain is dragged
Definition gfx_type.h:150
CursorVars::in_window
bool in_window
mouse inside this window, determines drawing logic
Definition gfx_type.h:147
CursorVars::wheel
int wheel
mouse wheel movement
Definition gfx_type.h:127
CursorVars::total_size
Point total_size
union of sprite properties
Definition gfx_type.h:137
CursorVars::dirty
bool dirty
the rect occupied by the mouse is dirty (redraw)
Definition gfx_type.h:146
CursorVars::draw_size
Point draw_size
position and size bounding-box for drawing
Definition gfx_type.h:139
CursorVars::delta
Point delta
relative mouse movement in this tick
Definition gfx_type.h:126
CursorVars::animate_list
std::span< const AnimCursor > animate_list
in case of animated cursor, list of frames
Definition gfx_type.h:141
DrawPixelInfo
Data about how and where to blit pixels.
Definition gfx_type.h:157
PalSpriteID
Combination of a palette sprite and a 'real' sprite.
Definition gfx_type.h:22
PalSpriteID::sprite
SpriteID sprite
The 'real' sprite.
Definition gfx_type.h:23
PalSpriteID::pal
PaletteID pal
The palette (use PAL_NONE) if not needed)
Definition gfx_type.h:24
Palette
Information about the currently used palette.
Definition gfx_type.h:373
Palette::first_dirty
int first_dirty
The first dirty element.
Definition gfx_type.h:375
Palette::count_dirty
int count_dirty
The number of dirty elements.
Definition gfx_type.h:376
Palette::palette
Colour palette[256]
Current palette. Entry 0 has to be always fully transparent!
Definition gfx_type.h:374
PixelColour
Colour for pixel/line drawing.
Definition gfx_type.h:405
PixelColour::p
uint8_t p
Palette index.
Definition gfx_type.h:406
SubSprite
Used to only draw a part of the sprite.
Definition gfx_type.h:278
ColourARGB
Packed colour union to access the alpha, red, green, and blue channels from a 32 bit number for big-e...
Definition gfx_type.h:190
ColourARGB::data
uint32_t data
Conversion of the channel information to a 32 bit number.
Definition gfx_type.h:191
ColourARGB::ColourARGB
constexpr ColourARGB(uint data=0)
Create a new colour.
Definition gfx_type.h:209
ColourARGB::ColourARGB
constexpr ColourARGB(uint8_t r, uint8_t g, uint8_t b, uint8_t a=0xFF)
Create a new colour.
Definition gfx_type.h:203
ColourARGB::b
uint8_t b
colour channels in BE order
Definition gfx_type.h:193
ColourBGRA
Packed colour union to access the alpha, red, green, and blue channels from a 32 bit number for littl...
Definition gfx_type.h:215
ColourBGRA::ColourBGRA
constexpr ColourBGRA(uint8_t r, uint8_t g, uint8_t b, uint8_t a=0xFF)
Create a new colour.
Definition gfx_type.h:228
ColourBGRA::data
uint32_t data
Conversion of the channel information to a 32 bit number.
Definition gfx_type.h:216
ColourBGRA::a
uint8_t a
colour channels in LE order
Definition gfx_type.h:218
ColourBGRA::ColourBGRA
constexpr ColourBGRA(uint data=0)
Create a new colour.
Definition gfx_type.h:234
ColourRGBA
Packed colour union to access the alpha, red, green, and blue channels from a 32 bit number for Emscr...
Definition gfx_type.h:165
ColourRGBA::a
uint8_t a
colour channels as used in browsers
Definition gfx_type.h:168
ColourRGBA::data
uint32_t data
Conversion of the channel information to a 32 bit number.
Definition gfx_type.h:166
ColourRGBA::ColourRGBA
constexpr ColourRGBA(uint8_t r, uint8_t g, uint8_t b, uint8_t a=0xFF)
Create a new colour.
Definition gfx_type.h:178
ColourRGBA::ColourRGBA
constexpr ColourRGBA(uint data=0)
Create a new colour.
Definition gfx_type.h:184
zoom_type.h
Types related to zooming in and out.
ZoomLevel
ZoomLevel
All zoom levels we know.
Definition zoom_type.h:20