From 25969116173bb67ac7925e743383aebe55232e59 Mon Sep 17 00:00:00 2001 From: fallenoak Date: Sun, 16 Nov 2025 20:30:39 -0600 Subject: [PATCH] feat(gx): add static conversion tables to CGxFormat --- src/gx/CGxFormat.cpp | 23 +++++++++++++++++++++++ src/gx/CGxFormat.hpp | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 src/gx/CGxFormat.cpp diff --git a/src/gx/CGxFormat.cpp b/src/gx/CGxFormat.cpp new file mode 100644 index 0000000..e23ea93 --- /dev/null +++ b/src/gx/CGxFormat.cpp @@ -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 +}; diff --git a/src/gx/CGxFormat.hpp b/src/gx/CGxFormat.hpp index cd64faa..d9c184a 100644 --- a/src/gx/CGxFormat.hpp +++ b/src/gx/CGxFormat.hpp @@ -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;