17 "title" :
"Brightness Type",
18 "description" :
"How to determine the brightness of a color",
19 "keywords" : [
"mask",
"color" ],
22 "VuoList_VuoThresholdType"
34 const char *valueAsString =
"";
35 if (json_object_get_type(js) == json_type_string)
36 valueAsString = json_object_get_string(js);
40 if (!strcmp(valueAsString,
"rec709"))
41 value = VuoThresholdType_Rec709;
42 else if (!strcmp(valueAsString,
"desaturate"))
43 value = VuoThresholdType_Desaturate;
44 else if (!strcmp(valueAsString,
"rgb"))
45 value = VuoThresholdType_RGB;
46 else if (!strcmp(valueAsString,
"rgb-average"))
47 value = VuoThresholdType_RGBAverage;
48 else if (!strcmp(valueAsString,
"rgb-maximum"))
49 value = VuoThresholdType_RGBMaximum;
50 else if (!strcmp(valueAsString,
"rgb-minimum"))
51 value = VuoThresholdType_RGBMinimum;
52 else if( !strcmp(valueAsString,
"red"))
53 value = VuoThresholdType_Red;
54 else if( !strcmp(valueAsString,
"green"))
55 value = VuoThresholdType_Green;
56 else if (!strcmp(valueAsString,
"blue"))
57 value = VuoThresholdType_Blue;
58 else if(!strcmp(valueAsString,
"alpha"))
59 value = VuoThresholdType_Alpha;
74 case VuoThresholdType_Rec709:
75 valueAsString =
"rec709";
78 case VuoThresholdType_Desaturate:
79 valueAsString =
"desaturate";
82 case VuoThresholdType_RGB:
83 valueAsString =
"rgb";
86 case VuoThresholdType_RGBAverage:
87 valueAsString =
"rgb-average";
90 case VuoThresholdType_RGBMaximum:
91 valueAsString =
"rgb-maximum";
94 case VuoThresholdType_RGBMinimum:
95 valueAsString =
"rgb-minimum";
98 case VuoThresholdType_Red:
99 valueAsString =
"red";
102 case VuoThresholdType_Green:
103 valueAsString =
"green";
106 case VuoThresholdType_Blue:
107 valueAsString =
"blue";
110 case VuoThresholdType_Alpha:
111 valueAsString =
"alpha";
115 valueAsString =
"rec601";
117 return json_object_new_string(valueAsString);
145 char *valueAsString =
"";
149 case VuoThresholdType_Rec601:
150 valueAsString =
"Perceptual (ITU Rec. 601 / NTSC CRT)";
153 case VuoThresholdType_Rec709:
154 valueAsString =
"Perceptual (ITU Rec. 709 / HDTV)";
157 case VuoThresholdType_Desaturate:
158 valueAsString =
"Desaturate (HSL)";
161 case VuoThresholdType_RGB:
162 valueAsString =
"Individual Components (RGB)";
165 case VuoThresholdType_RGBAverage:
166 valueAsString =
"Average Components (RGB)";
169 case VuoThresholdType_RGBMaximum:
170 valueAsString =
"Lightest Components (RGB)";
173 case VuoThresholdType_RGBMinimum:
174 valueAsString =
"Darkest Components (RGB)";
177 case VuoThresholdType_Red:
178 valueAsString =
"Red";
181 case VuoThresholdType_Green:
182 valueAsString =
"Green";
185 case VuoThresholdType_Blue:
186 valueAsString =
"Blue";
189 case VuoThresholdType_Alpha:
190 valueAsString =
"Opacity";
194 return strdup(valueAsString);