15static constexpr MimeLookup MIME_LOOKUP_TABLE[] = {
16#ifdef USE_RUNTIME_IMAGE_BMP
19#ifdef USE_RUNTIME_IMAGE_JPEG
22#ifdef USE_RUNTIME_IMAGE_PNG
25#ifdef USE_RUNTIME_IMAGE_QOI
33 for (
const auto &entry : MIME_LOOKUP_TABLE) {
34 if (entry.format ==
format) {
35 return entry.mime_type;
42 for (
const auto &entry : MIME_LOOKUP_TABLE) {
51 return ImageFormatStrings::get_log_str(
static_cast<uint8_t
>(
format), ImageFormatStrings::LAST_INDEX);
const char * get_mime_type_for_format(ImageFormat format)
Canonical MIME type for a format; "image/*" for AUTO/unknown.
std::optional< ImageFormat > get_format_for_mime_type(const char *mime_type)
Case-insensitive substring match of known media types; nullopt if none found.
ImageFormat
Image format types that can be decoded dynamically.
const LogString * get_format_name(ImageFormat format)
Human-readable name for a format; "UNKNOWN" if not recognized.
PROGMEM_STRING_TABLE(ImageFormatStrings, "AUTO", "BMP", "JPEG", "PNG", "QOI", "UNKNOWN")
bool str_contains_ignore_case(const char *haystack, const char *needle)
Case-insensitive check if needle string is contained in haystack (no heap allocation).