memoryformat: Add a debug helper

I need this often enough that I'll just put it here.
This commit is contained in:
Matthias Clasen 2024-08-07 08:21:01 -04:00
parent f2ccba0988
commit fd78bd3eaf
2 changed files with 9 additions and 0 deletions

View File

@ -1524,6 +1524,14 @@ gdk_memory_format_get_depth (GdkMemoryFormat format,
return depth;
}
const char *
gdk_memory_depth_get_name (GdkMemoryDepth depth)
{
const char *names[] = { "none", "u8", "u8-srgb", "u16", "f16", "f32" };
return names[depth];
}
/*<private>
* gdk_memory_depth_merge:
* @depth1: the first depth

View File

@ -66,6 +66,7 @@ GdkMemoryDepth gdk_memory_depth_merge (GdkMemoryDepth
GdkMemoryDepth depth2) G_GNUC_CONST;
GdkMemoryFormat gdk_memory_depth_get_format (GdkMemoryDepth depth) G_GNUC_CONST;
GdkMemoryFormat gdk_memory_depth_get_alpha_format (GdkMemoryDepth depth) G_GNUC_CONST;
const char * gdk_memory_depth_get_name (GdkMemoryDepth depth);
void gdk_memory_format_gl_format (GdkMemoryFormat format,
gboolean gles,
GLint *out_internal_format,