Vuo  2.4.0
VuoBlurShape.c
Go to the documentation of this file.
1
10#include "type.h"
11#include "VuoBlurShape.h"
13
15#ifdef VUO_COMPILER
17 "title" : "Blur Shape",
18 "description" : "Weights for pixels in a blur",
19 "keywords" : [ ],
20 "version" : "1.0.0",
21 "dependencies" : [
22 "VuoList_VuoBlurShape"
23 ]
24 });
25#endif
27
36{
37 const char *valueAsString = "";
38 if (json_object_get_type(js) == json_type_string)
39 valueAsString = json_object_get_string(js);
40
41 VuoBlurShape value = VuoBlurShape_Gaussian;
42
43 if (strcmp(valueAsString, "linear") == 0)
44 value = VuoBlurShape_Linear;
45 else if (strcmp(valueAsString, "box") == 0)
46 value = VuoBlurShape_Box;
47 else if (strcmp(valueAsString, "disc") == 0)
48 value = VuoBlurShape_Disc;
49
50 return value;
51}
52
57{
58 char *valueAsString = "gaussian";
59
60 if (value == VuoBlurShape_Linear)
61 valueAsString = "linear";
62 else if (value == VuoBlurShape_Box)
63 valueAsString = "box";
64 else if (value == VuoBlurShape_Disc)
65 valueAsString = "disc";
66
67 return json_object_new_string(valueAsString);
68}
69
74{
76 VuoListAppendValue_VuoBlurShape(l, VuoBlurShape_Gaussian);
77 VuoListAppendValue_VuoBlurShape(l, VuoBlurShape_Linear);
78 VuoListAppendValue_VuoBlurShape(l, VuoBlurShape_Box);
79 VuoListAppendValue_VuoBlurShape(l, VuoBlurShape_Disc);
80 return l;
81}
82
87{
88 char *valueAsString = "Gaussian";
89
90 if (value == VuoBlurShape_Linear)
91 valueAsString = "Linear";
92 else if (value == VuoBlurShape_Box)
93 valueAsString = "Box";
94 else if (value == VuoBlurShape_Disc)
95 valueAsString = "Disc";
96
97 return strdup(valueAsString);
98}
99
103bool VuoBlurShape_areEqual(const VuoBlurShape valueA, const VuoBlurShape valueB)
104{
105 return valueA == valueB;
106}
107
111bool VuoBlurShape_isLessThan(const VuoBlurShape valueA, const VuoBlurShape valueB)
112{
113 return valueA < valueB;
114}