16 "title" :
"2D Transform",
17 "description" :
"A 2D transformation (scale, rotation, translation).",
46 t.translation = translation;
70 if (json_object_object_get_ex(js,
"rotation", &o))
71 t.
rotation = json_object_get_double(o);
73 if (json_object_object_get_ex(js,
"translation", &o))
75 t.translation.x = json_object_get_double(json_object_array_get_idx(o,0));
76 t.translation.y = json_object_get_double(json_object_array_get_idx(o,1));
79 if (json_object_object_get_ex(js,
"scale", &o))
81 t.scale.x = json_object_get_double(json_object_array_get_idx(o,0));
82 t.scale.y = json_object_get_double(json_object_array_get_idx(o,1));
95 return json_object_new_string(
"identity");
101 json_object_array_add(o,json_object_new_double(value.translation.x));
102 json_object_array_add(o,json_object_new_double(value.translation.y));
103 json_object_object_add(js,
"translation", o);
106 json_object_object_add(js,
"rotation", json_object_new_double(value.
rotation));
110 json_object_array_add(o,json_object_new_double(value.scale.x));
111 json_object_array_add(o,json_object_new_double(value.scale.y));
112 json_object_object_add(js,
"scale", o);
126 return strdup(
"identity transform (no change)");
129 return VuoText_format(
"<div>translation (%g, %g)</div><div>rotation %g°</div><div>scale (%g, %g)</div>",
130 value.translation.x, value.translation.y, rotationInDegrees, value.scale.x, value.scale.y);