45 VuoPoint2d point = {0,0};
47 json_type t = json_object_get_type(js);
48 if (t == json_type_string)
50 const char *s = json_object_get_string(js);
52 sscanf(s,
"%20g, %20g", &x, &y);
53 return (VuoPoint2d){x, y};
55 else if (t == json_type_array)
57 int len = json_object_array_length(js);
59 point.x = json_object_get_double(json_object_array_get_idx(js, 0));
61 point.y = json_object_get_double(json_object_array_get_idx(js, 1));
65 json_object *o = NULL;
67 if (json_object_object_get_ex(js,
"x", &o))
69 else if (json_object_object_get_ex(js,
"X", &o))
72 if (json_object_object_get_ex(js,
"y", &o))
74 else if (json_object_object_get_ex(js,
"Y", &o))