13 #include <OpenGL/CGLMacro.h>
18 "title" :
"Image Color Depth",
19 "description" :
"An image's color bit-depth",
23 "VuoList_VuoImageColorDepth",
46 if (baseFormat == GL_RGB
47 || baseFormat == GL_BGR
48 || baseFormat == GL_YCBCR_422_APPLE)
50 if (imageColorDepth == VuoImageColorDepth_16)
52 if (imageColorDepth == VuoImageColorDepth_32)
56 else if (baseFormat == GL_RGBA
57 || baseFormat == GL_BGRA)
59 if (imageColorDepth == VuoImageColorDepth_16)
60 return GL_RGBA16F_ARB;
61 if (imageColorDepth == VuoImageColorDepth_32)
62 return GL_RGBA32F_ARB;
65 else if (baseFormat == GL_LUMINANCE)
67 if (imageColorDepth == VuoImageColorDepth_16)
68 return GL_LUMINANCE16F_ARB;
69 if (imageColorDepth == VuoImageColorDepth_32)
70 return GL_LUMINANCE32F_ARB;
73 else if (baseFormat == GL_LUMINANCE_ALPHA)
75 if (imageColorDepth == VuoImageColorDepth_16)
76 return GL_LUMINANCE_ALPHA16F_ARB;
77 if (imageColorDepth == VuoImageColorDepth_32)
78 return GL_LUMINANCE_ALPHA32F_ARB;
79 return GL_LUMINANCE8_ALPHA8;
83 VUserLog(
"Error: Unknown baseFormat %x (%s)", baseFormat, formatString);
95 const char *valueAsString =
"";
96 if (json_object_get_type(js) == json_type_string)
97 valueAsString = json_object_get_string(js);
101 if (! strcmp(valueAsString,
"16bpc"))
102 value = VuoImageColorDepth_16;
103 else if (! strcmp(valueAsString,
"32bpc"))
104 value = VuoImageColorDepth_32;
114 char *valueAsString =
"";
118 case VuoImageColorDepth_8:
119 valueAsString =
"8bpc";
121 case VuoImageColorDepth_16:
122 valueAsString =
"16bpc";
124 case VuoImageColorDepth_32:
125 valueAsString =
"32bpc";
129 return json_object_new_string(valueAsString);
150 if (value == VuoImageColorDepth_8)
152 else if (value == VuoImageColorDepth_16)
154 else if (value == VuoImageColorDepth_32)