Vuo  2.3.2
VuoPixelShape.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 #include "VuoPixelShape.h"
12 #include "VuoList_VuoPixelShape.h"
13 
15 #ifdef VUO_COMPILER
17  "title" : "Pixel Shape",
18  "description" : "The shape to use for enlarged pixels.",
19  "keywords" : [ ],
20  "version" : "1.0.0",
21  "dependencies" : [
22  "VuoList_VuoPixelShape"
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  VuoPixelShape value = VuoPixelShape_Rectangle;
42 
43  if (strcmp(valueAsString, "triangle") == 0)
44  value = VuoPixelShape_Triangle;
45  else if (strcmp(valueAsString, "hexagon") == 0)
46  value = VuoPixelShape_Hexagon;
47 
48  return value;
49 }
50 
55 {
56  char *valueAsString = "rectangle";
57 
58  if (value == VuoPixelShape_Triangle)
59  valueAsString = "triangle";
60  else if (value == VuoPixelShape_Hexagon)
61  valueAsString = "hexagon";
62 
63  return json_object_new_string(valueAsString);
64 }
65 
70 {
72  VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Rectangle);
73  VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Triangle);
74  VuoListAppendValue_VuoPixelShape(l, VuoPixelShape_Hexagon);
75  return l;
76 }
77 
82 {
83  char *valueAsString = "Rectangle";
84 
85  if (value == VuoPixelShape_Triangle)
86  valueAsString = "Triangle";
87  else if (value == VuoPixelShape_Hexagon)
88  valueAsString = "Hexagon";
89 
90  return strdup(valueAsString);
91 }
92 
96 bool VuoPixelShape_areEqual(const VuoPixelShape valueA, const VuoPixelShape valueB)
97 {
98  return valueA == valueB;
99 }
100 
104 bool VuoPixelShape_isLessThan(const VuoPixelShape valueA, const VuoPixelShape valueB)
105 {
106  return valueA < valueB;
107 }