Vuo 2.4.4
Loading...
Searching...
No Matches
VuoPixelShape.c
Go to the documentation of this file.
1
10#include "VuoPixelShape.h"
11
13#ifdef VUO_COMPILER
15 "title" : "Pixel Shape",
16 "description" : "The shape to use for enlarged pixels.",
17 "keywords" : [ ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoPixelShape"
21 ]
22 });
23#endif
25
34{
35 const char *valueAsString = "";
36 if (json_object_get_type(js) == json_type_string)
37 valueAsString = json_object_get_string(js);
38
39 VuoPixelShape value = VuoPixelShape_Rectangle;
40
41 if (strcmp(valueAsString, "triangle") == 0)
42 value = VuoPixelShape_Triangle;
43 else if (strcmp(valueAsString, "hexagon") == 0)
44 value = VuoPixelShape_Hexagon;
45
46 return value;
47}
48
52json_object *VuoPixelShape_getJson(const VuoPixelShape value)
53{
54 char *valueAsString = "rectangle";
55
56 if (value == VuoPixelShape_Triangle)
57 valueAsString = "triangle";
58 else if (value == VuoPixelShape_Hexagon)
59 valueAsString = "hexagon";
60
61 return json_object_new_string(valueAsString);
62}
63
68{
70 VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Rectangle);
71 VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Triangle);
72 VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Hexagon);
73 return l;
74}
75
80{
81 char *valueAsString = "Rectangle";
82
83 if (value == VuoPixelShape_Triangle)
84 valueAsString = "Triangle";
85 else if (value == VuoPixelShape_Hexagon)
86 valueAsString = "Hexagon";
87
88 return strdup(valueAsString);
89}
90
94bool VuoPixelShape_areEqual(const VuoPixelShape valueA, const VuoPixelShape valueB)
95{
96 return valueA == valueB;
97}
98
103{
104 return valueA < valueB;
105}