Vuo  2.3.2
VuoFace.c
Go to the documentation of this file.
1 
10 #include "type.h"
11 #include "VuoFace.h"
12 
14 #ifdef VUO_COMPILER
16  "title": "Face",
17  "description": "Coordinates of a face and its landmarks.",
18  "keywords": [],
19  "version": "1.0.0",
20  "dependencies" : [
21  "VuoRectangle",
22  "VuoPoint2d",
23  ]
24 });
25 #endif
27 
44 {
45  return (VuoFace){
46  VuoJson_getObjectValue(VuoRectangle, js, "face", (VuoRectangle){{0,0},{0,0}}),
47  VuoJson_getObjectValue(VuoPoint2d, js, "leftEye", (VuoPoint2d){0,0}),
48  VuoJson_getObjectValue(VuoPoint2d, js, "rightEye", (VuoPoint2d){0,0}),
49  VuoJson_getObjectValue(VuoPoint2d, js, "nose", (VuoPoint2d){0,0}),
50  VuoJson_getObjectValue(VuoPoint2d, js, "mouthLeftEdge", (VuoPoint2d){0,0}),
51  VuoJson_getObjectValue(VuoPoint2d, js, "mouthRightEdge", (VuoPoint2d){0,0}),
52  };
53 }
54 
60 {
61  json_object *js = json_object_new_object();
62  json_object_object_add(js, "face", VuoRectangle_getJson(f.face));
63  json_object_object_add(js, "leftEye", VuoPoint2d_getJson(f.leftEye));
64  json_object_object_add(js, "rightEye", VuoPoint2d_getJson(f.rightEye));
65  json_object_object_add(js, "nose", VuoPoint2d_getJson(f.nose));
66  json_object_object_add(js, "mouthLeftEdge", VuoPoint2d_getJson(f.mouthLeftEdge));
67  json_object_object_add(js, "mouthRightEdge", VuoPoint2d_getJson(f.mouthRightEdge));
68  return js;
69 }
70 
76 {
77  return VuoRectangle_getSummary(f.face);
78 }
79 
85  VuoPoint2d leftEye,
86  VuoPoint2d rightEye,
87  VuoPoint2d nose,
88  VuoPoint2d mouthLeftEdge,
89  VuoPoint2d mouthRightEdge)
90 {
91  return (VuoFace){
92  face,
93  leftEye,
94  rightEye,
95  nose,
96  mouthLeftEdge,
97  mouthRightEdge,
98  };
99 }