feat(gx): add static conversion tables to CGxFormat

This commit is contained in:
fallenoak 2025-11-16 20:30:39 -06:00
parent 940205d934
commit 2596911617
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 27 additions and 0 deletions

23
src/gx/CGxFormat.cpp Normal file
View File

@ -0,0 +1,23 @@
#include "gx/CGxFormat.hpp"
const char* CGxFormat::formatToBitsString[] = {
"16", // Fmt_Rgb565
"24", // Fmt_ArgbX888
"24", // Fmt_Argb8888
"30", // Fmt_Argb2101010
"16", // Fmt_Ds160
"24", // Fmt_Ds24X
"24", // Fmt_Ds248
"32", // Fmt_Ds320
};
int32_t CGxFormat::formatToBitsUint[] = {
16, // Fmt_Rgb565
24, // Fmt_ArgbX888
24, // Fmt_Argb8888
30, // Fmt_Argb2101010
16, // Fmt_Ds160
24, // Fmt_Ds24X
24, // Fmt_Ds248
32, // Fmt_Ds320
};

View File

@ -19,6 +19,10 @@ class CGxFormat {
Formats_Last = 8
};
// Static variables
static int32_t formatToBitsUint[Formats_Last];
static const char* formatToBitsString[Formats_Last];
// Member variables
bool hwTnL;
int8_t window;