14static constexpr MimeLookup MIME_LOOKUP_TABLE[] = {
15#ifdef USE_RUNTIME_IMAGE_BMP
18#ifdef USE_RUNTIME_IMAGE_JPEG
21#ifdef USE_RUNTIME_IMAGE_PNG
24#ifdef USE_RUNTIME_IMAGE_QOI
30 for (
const auto &entry : MIME_LOOKUP_TABLE) {
31 if (entry.format ==
format) {
32 return entry.mime_type;
39 for (
const auto &entry : MIME_LOOKUP_TABLE) {
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.
bool str_contains_ignore_case(const char *haystack, const char *needle)
Case-insensitive check if needle string is contained in haystack (no heap allocation).