Vuo 2.4.4
Loading...
Searching...
No Matches
VuoProjectionType.c
Go to the documentation of this file.
1
10#include "VuoProjectionType.h"
11
13#ifdef VUO_COMPILER
15 "title" : "Projection Type",
16 "description" : "Describes how an image is transformed when rendering with a perspective.",
17 "keywords" : [ "scale", "distance", "project", "map", "mapping" ],
18 "version" : "1.0.0",
19 "dependencies" : [
20 "VuoList_VuoProjectionType"
21 ]
22 });
23#endif
25
31{
32 const char *valueAsString = "";
33
34 if (json_object_get_type(js) == json_type_string)
35 valueAsString = json_object_get_string(js);
36
37 VuoProjectionType value = VuoProjectionType_Perspective;
38
39 if (! strcmp(valueAsString, "perspective"))
40 value = VuoProjectionType_Perspective;
41 else if (! strcmp(valueAsString, "affine"))
42 value = VuoProjectionType_Affine;
43
44 return value;
45}
46
52{
53 char *valueAsString = "";
54
55 switch (value)
56 {
57 case VuoProjectionType_Perspective:
58 valueAsString = "perspective";
59 break;
60 case VuoProjectionType_Affine:
61 valueAsString = "affine";
62 break;
63 }
64
65 return json_object_new_string(valueAsString);
66}
67
78
84{
85 char *valueAsString = "";
86
87 switch (value)
88 {
89 case VuoProjectionType_Perspective:
90 valueAsString = "Perspective";
91 break;
92 case VuoProjectionType_Affine:
93 valueAsString = "Affine";
94 break;
95 }
96
97 return strdup(valueAsString);
98}