Fawkes API  Fawkes Development Version
FacerInterface.cpp
1 
2 /***************************************************************************
3  * FacerInterface.cpp - Fawkes BlackBoard Interface - FacerInterface
4  *
5  * Templated created: Thu Oct 12 10:49:19 2006
6  * Copyright 2008 Tim Niemueller
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #include <interfaces/FacerInterface.h>
25 
26 #include <core/exceptions/software.h>
27 
28 #include <map>
29 #include <string>
30 #include <cstring>
31 #include <cstdlib>
32 
33 namespace fawkes {
34 
35 /** @class FacerInterface <interfaces/FacerInterface.h>
36  * FacerInterface Fawkes BlackBoard Interface.
37  *
38  The interface provides access to the face recognition plugin
39  (facer). It provides basic status information about facer and
40  allows for setting a specific mode and access the resolut.
41  calling skills via messages. It can also be used to manually
42  restart the Lua interpreter if something is wedged.
43 
44  * @ingroup FawkesInterfaces
45  */
46 
47 
48 
49 /** Constructor */
50 FacerInterface::FacerInterface() : Interface()
51 {
52  data_size = sizeof(FacerInterface_data_t);
53  data_ptr = malloc(data_size);
54  data = (FacerInterface_data_t *)data_ptr;
55  data_ts = (interface_data_ts_t *)data_ptr;
56  memset(data_ptr, 0, data_size);
57  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
58  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
59  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
60  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
61  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
62  add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
63  add_fieldinfo(IFT_UINT32, "num_identities", 1, &data->num_identities);
64  add_fieldinfo(IFT_UINT32, "recognized_identity", 1, &data->recognized_identity);
65  add_fieldinfo(IFT_STRING, "recognized_name", 64, data->recognized_name);
66  add_fieldinfo(IFT_UINT32, "num_detections", 1, &data->num_detections);
67  add_fieldinfo(IFT_UINT32, "num_recognitions", 1, &data->num_recognitions);
68  add_fieldinfo(IFT_UINT32, "most_likely_identity", 1, &data->most_likely_identity);
69  add_fieldinfo(IFT_STRING, "most_likely_gender", 64, data->most_likely_gender);
70  add_fieldinfo(IFT_FLOAT, "history_ratio", 1, &data->history_ratio);
71  add_fieldinfo(IFT_FLOAT, "sec_since_detection", 1, &data->sec_since_detection);
72  add_fieldinfo(IFT_INT32, "visibility_history", 1, &data->visibility_history);
73  add_fieldinfo(IFT_BOOL, "learning_in_progress", 1, &data->learning_in_progress);
74  add_fieldinfo(IFT_BOOL, "searching_person", 1, &data->searching_person);
75  add_fieldinfo(IFT_FLOAT, "recording_progress", 1, &data->recording_progress);
76  add_fieldinfo(IFT_FLOAT, "bearing", 1, &data->bearing);
77  add_fieldinfo(IFT_FLOAT, "slope", 1, &data->slope);
78  add_fieldinfo(IFT_UINT32, "requested_index", 1, &data->requested_index);
79  add_fieldinfo(IFT_STRING, "requested_name", 64, data->requested_name);
80  add_fieldinfo(IFT_UINT32, "index_last_learned", 1, &data->index_last_learned);
81  add_messageinfo("LearnFaceMessage");
82  add_messageinfo("SetOpmodeMessage");
83  add_messageinfo("EnableIdentityMessage");
84  add_messageinfo("SetNameMessage");
85  add_messageinfo("GetNameMessage");
86  add_messageinfo("StartSearchPersonMessage");
87  add_messageinfo("StopSearchPersonMessage");
88  unsigned char tmp_hash[] = {0x5d, 0xd, 0xac, 0xa1, 0xe1, 0x23, 0x82, 0xc4, 0x22, 0xed, 0x8b, 0xa7, 0x3e, 0x1f, 0x2d, 0x7c};
89  set_hash(tmp_hash);
90 }
91 
92 /** Destructor */
93 FacerInterface::~FacerInterface()
94 {
95  free(data_ptr);
96 }
97 /** Convert if_facer_opmode_t constant to string.
98  * @param value value to convert to string
99  * @return constant value as string.
100  */
101 const char *
103 {
104  switch (value) {
105  case OPMODE_DISABLED: return "OPMODE_DISABLED";
106  case OPMODE_DETECTION: return "OPMODE_DETECTION";
107  case OPMODE_RECOGNITION: return "OPMODE_RECOGNITION";
108  case OPMODE_LEARNING: return "OPMODE_LEARNING";
109  case OPMODE_GENDER: return "OPMODE_GENDER";
110  default: return "UNKNOWN";
111  }
112 }
113 /* Methods */
114 /** Get opmode value.
115  *
116  Current opmode.
117 
118  * @return opmode value
119  */
122 {
123  return (FacerInterface::if_facer_opmode_t)data->opmode;
124 }
125 
126 /** Get maximum length of opmode value.
127  * @return length of opmode value, can be length of the array or number of
128  * maximum number of characters for a string
129  */
130 size_t
132 {
133  return 1;
134 }
135 
136 /** Set opmode value.
137  *
138  Current opmode.
139 
140  * @param new_opmode new opmode value
141  */
142 void
144 {
145  data->opmode = new_opmode;
146  data_changed = true;
147 }
148 
149 /** Get num_identities value.
150  *
151  The number of identities in the database.
152 
153  * @return num_identities value
154  */
155 uint32_t
157 {
158  return data->num_identities;
159 }
160 
161 /** Get maximum length of num_identities value.
162  * @return length of num_identities value, can be length of the array or number of
163  * maximum number of characters for a string
164  */
165 size_t
167 {
168  return 1;
169 }
170 
171 /** Set num_identities value.
172  *
173  The number of identities in the database.
174 
175  * @param new_num_identities new num_identities value
176  */
177 void
178 FacerInterface::set_num_identities(const uint32_t new_num_identities)
179 {
180  data->num_identities = new_num_identities;
181  data_changed = true;
182 }
183 
184 /** Get recognized_identity value.
185  *
186  The index of the recognized identity.
187 
188  * @return recognized_identity value
189  */
190 uint32_t
192 {
193  return data->recognized_identity;
194 }
195 
196 /** Get maximum length of recognized_identity value.
197  * @return length of recognized_identity value, can be length of the array or number of
198  * maximum number of characters for a string
199  */
200 size_t
202 {
203  return 1;
204 }
205 
206 /** Set recognized_identity value.
207  *
208  The index of the recognized identity.
209 
210  * @param new_recognized_identity new recognized_identity value
211  */
212 void
213 FacerInterface::set_recognized_identity(const uint32_t new_recognized_identity)
214 {
215  data->recognized_identity = new_recognized_identity;
216  data_changed = true;
217 }
218 
219 /** Get recognized_name value.
220  *
221  The name of the recognized identity.
222 
223  * @return recognized_name value
224  */
225 char *
227 {
228  return data->recognized_name;
229 }
230 
231 /** Get maximum length of recognized_name value.
232  * @return length of recognized_name value, can be length of the array or number of
233  * maximum number of characters for a string
234  */
235 size_t
237 {
238  return 64;
239 }
240 
241 /** Set recognized_name value.
242  *
243  The name of the recognized identity.
244 
245  * @param new_recognized_name new recognized_name value
246  */
247 void
248 FacerInterface::set_recognized_name(const char * new_recognized_name)
249 {
250  strncpy(data->recognized_name, new_recognized_name, sizeof(data->recognized_name));
251  data_changed = true;
252 }
253 
254 /** Get num_detections value.
255  *
256  Number of currently detected faces.
257 
258  * @return num_detections value
259  */
260 uint32_t
262 {
263  return data->num_detections;
264 }
265 
266 /** Get maximum length of num_detections value.
267  * @return length of num_detections value, can be length of the array or number of
268  * maximum number of characters for a string
269  */
270 size_t
272 {
273  return 1;
274 }
275 
276 /** Set num_detections value.
277  *
278  Number of currently detected faces.
279 
280  * @param new_num_detections new num_detections value
281  */
282 void
283 FacerInterface::set_num_detections(const uint32_t new_num_detections)
284 {
285  data->num_detections = new_num_detections;
286  data_changed = true;
287 }
288 
289 /** Get num_recognitions value.
290  *
291  Number of recognized faces.
292 
293  * @return num_recognitions value
294  */
295 uint32_t
297 {
298  return data->num_recognitions;
299 }
300 
301 /** Get maximum length of num_recognitions value.
302  * @return length of num_recognitions value, can be length of the array or number of
303  * maximum number of characters for a string
304  */
305 size_t
307 {
308  return 1;
309 }
310 
311 /** Set num_recognitions value.
312  *
313  Number of recognized faces.
314 
315  * @param new_num_recognitions new num_recognitions value
316  */
317 void
318 FacerInterface::set_num_recognitions(const uint32_t new_num_recognitions)
319 {
320  data->num_recognitions = new_num_recognitions;
321  data_changed = true;
322 }
323 
324 /** Get most_likely_identity value.
325  *
326  The identity that was recognized most prevalently.
327 
328  * @return most_likely_identity value
329  */
330 uint32_t
332 {
333  return data->most_likely_identity;
334 }
335 
336 /** Get maximum length of most_likely_identity value.
337  * @return length of most_likely_identity value, can be length of the array or number of
338  * maximum number of characters for a string
339  */
340 size_t
342 {
343  return 1;
344 }
345 
346 /** Set most_likely_identity value.
347  *
348  The identity that was recognized most prevalently.
349 
350  * @param new_most_likely_identity new most_likely_identity value
351  */
352 void
353 FacerInterface::set_most_likely_identity(const uint32_t new_most_likely_identity)
354 {
355  data->most_likely_identity = new_most_likely_identity;
356  data_changed = true;
357 }
358 
359 /** Get most_likely_gender value.
360  *
361  The gender that was recogniced.
362 
363  * @return most_likely_gender value
364  */
365 char *
367 {
368  return data->most_likely_gender;
369 }
370 
371 /** Get maximum length of most_likely_gender value.
372  * @return length of most_likely_gender value, can be length of the array or number of
373  * maximum number of characters for a string
374  */
375 size_t
377 {
378  return 64;
379 }
380 
381 /** Set most_likely_gender value.
382  *
383  The gender that was recogniced.
384 
385  * @param new_most_likely_gender new most_likely_gender value
386  */
387 void
388 FacerInterface::set_most_likely_gender(const char * new_most_likely_gender)
389 {
390  strncpy(data->most_likely_gender, new_most_likely_gender, sizeof(data->most_likely_gender));
391  data_changed = true;
392 }
393 
394 /** Get history_ratio value.
395  *
396  The ratio of the most likely identity showing up in the history
397  and the length of the history.
398 
399  * @return history_ratio value
400  */
401 float
403 {
404  return data->history_ratio;
405 }
406 
407 /** Get maximum length of history_ratio value.
408  * @return length of history_ratio value, can be length of the array or number of
409  * maximum number of characters for a string
410  */
411 size_t
413 {
414  return 1;
415 }
416 
417 /** Set history_ratio value.
418  *
419  The ratio of the most likely identity showing up in the history
420  and the length of the history.
421 
422  * @param new_history_ratio new history_ratio value
423  */
424 void
425 FacerInterface::set_history_ratio(const float new_history_ratio)
426 {
427  data->history_ratio = new_history_ratio;
428  data_changed = true;
429 }
430 
431 /** Get sec_since_detection value.
432  *
433  Time in seconds since the last successful detection.
434 
435  * @return sec_since_detection value
436  */
437 float
439 {
440  return data->sec_since_detection;
441 }
442 
443 /** Get maximum length of sec_since_detection value.
444  * @return length of sec_since_detection value, can be length of the array or number of
445  * maximum number of characters for a string
446  */
447 size_t
449 {
450  return 1;
451 }
452 
453 /** Set sec_since_detection value.
454  *
455  Time in seconds since the last successful detection.
456 
457  * @param new_sec_since_detection new sec_since_detection value
458  */
459 void
460 FacerInterface::set_sec_since_detection(const float new_sec_since_detection)
461 {
462  data->sec_since_detection = new_sec_since_detection;
463  data_changed = true;
464 }
465 
466 /** Get visibility_history value.
467  *
468  The number of consecutive sighting ( <= 1 ) and non-sightings
469  ( >= -1 ), respectively.
470 
471  * @return visibility_history value
472  */
473 int32_t
475 {
476  return data->visibility_history;
477 }
478 
479 /** Get maximum length of visibility_history value.
480  * @return length of visibility_history value, can be length of the array or number of
481  * maximum number of characters for a string
482  */
483 size_t
485 {
486  return 1;
487 }
488 
489 /** Set visibility_history value.
490  *
491  The number of consecutive sighting ( <= 1 ) and non-sightings
492  ( >= -1 ), respectively.
493 
494  * @param new_visibility_history new visibility_history value
495  */
496 void
497 FacerInterface::set_visibility_history(const int32_t new_visibility_history)
498 {
499  data->visibility_history = new_visibility_history;
500  data_changed = true;
501 }
502 
503 /** Get learning_in_progress value.
504  *
505  Indicates whether a new identity is currently learnt. If
506  learning is in progress only "old" faces can be recognized.
507 
508  * @return learning_in_progress value
509  */
510 bool
512 {
513  return data->learning_in_progress;
514 }
515 
516 /** Get maximum length of learning_in_progress value.
517  * @return length of learning_in_progress value, can be length of the array or number of
518  * maximum number of characters for a string
519  */
520 size_t
522 {
523  return 1;
524 }
525 
526 /** Set learning_in_progress value.
527  *
528  Indicates whether a new identity is currently learnt. If
529  learning is in progress only "old" faces can be recognized.
530 
531  * @param new_learning_in_progress new learning_in_progress value
532  */
533 void
534 FacerInterface::set_learning_in_progress(const bool new_learning_in_progress)
535 {
536  data->learning_in_progress = new_learning_in_progress;
537  data_changed = true;
538 }
539 
540 /** Get searching_person value.
541  *
542  Indicates whether the plugin is searching for a specified person.
543  If set to true, the index and name will be listed in the fields
544  "requested_index" and "requested_name".
545 
546  * @return searching_person value
547  */
548 bool
550 {
551  return data->searching_person;
552 }
553 
554 /** Get maximum length of searching_person value.
555  * @return length of searching_person value, can be length of the array or number of
556  * maximum number of characters for a string
557  */
558 size_t
560 {
561  return 1;
562 }
563 
564 /** Set searching_person value.
565  *
566  Indicates whether the plugin is searching for a specified person.
567  If set to true, the index and name will be listed in the fields
568  "requested_index" and "requested_name".
569 
570  * @param new_searching_person new searching_person value
571  */
572 void
573 FacerInterface::set_searching_person(const bool new_searching_person)
574 {
575  data->searching_person = new_searching_person;
576  data_changed = true;
577 }
578 
579 /** Get recording_progress value.
580  *
581  Indicates the progress of recording images of a new face.
582 
583  * @return recording_progress value
584  */
585 float
587 {
588  return data->recording_progress;
589 }
590 
591 /** Get maximum length of recording_progress value.
592  * @return length of recording_progress value, can be length of the array or number of
593  * maximum number of characters for a string
594  */
595 size_t
597 {
598  return 1;
599 }
600 
601 /** Set recording_progress value.
602  *
603  Indicates the progress of recording images of a new face.
604 
605  * @param new_recording_progress new recording_progress value
606  */
607 void
608 FacerInterface::set_recording_progress(const float new_recording_progress)
609 {
610  data->recording_progress = new_recording_progress;
611  data_changed = true;
612 }
613 
614 /** Get bearing value.
615  *
616  The relative bearing to the recognized face in radians.
617 
618  * @return bearing value
619  */
620 float
622 {
623  return data->bearing;
624 }
625 
626 /** Get maximum length of bearing value.
627  * @return length of bearing value, can be length of the array or number of
628  * maximum number of characters for a string
629  */
630 size_t
632 {
633  return 1;
634 }
635 
636 /** Set bearing value.
637  *
638  The relative bearing to the recognized face in radians.
639 
640  * @param new_bearing new bearing value
641  */
642 void
643 FacerInterface::set_bearing(const float new_bearing)
644 {
645  data->bearing = new_bearing;
646  data_changed = true;
647 }
648 
649 /** Get slope value.
650  *
651  The relative slope to the recognized face in radians.
652 
653  * @return slope value
654  */
655 float
657 {
658  return data->slope;
659 }
660 
661 /** Get maximum length of slope value.
662  * @return length of slope value, can be length of the array or number of
663  * maximum number of characters for a string
664  */
665 size_t
667 {
668  return 1;
669 }
670 
671 /** Set slope value.
672  *
673  The relative slope to the recognized face in radians.
674 
675  * @param new_slope new slope value
676  */
677 void
678 FacerInterface::set_slope(const float new_slope)
679 {
680  data->slope = new_slope;
681  data_changed = true;
682 }
683 
684 /** Get requested_index value.
685  *
686  Index of the identity for which the name was requested.
687 
688  * @return requested_index value
689  */
690 uint32_t
692 {
693  return data->requested_index;
694 }
695 
696 /** Get maximum length of requested_index value.
697  * @return length of requested_index value, can be length of the array or number of
698  * maximum number of characters for a string
699  */
700 size_t
702 {
703  return 1;
704 }
705 
706 /** Set requested_index value.
707  *
708  Index of the identity for which the name was requested.
709 
710  * @param new_requested_index new requested_index value
711  */
712 void
713 FacerInterface::set_requested_index(const uint32_t new_requested_index)
714 {
715  data->requested_index = new_requested_index;
716  data_changed = true;
717 }
718 
719 /** Get requested_name value.
720  *
721  Requested name.
722 
723  * @return requested_name value
724  */
725 char *
727 {
728  return data->requested_name;
729 }
730 
731 /** Get maximum length of requested_name value.
732  * @return length of requested_name value, can be length of the array or number of
733  * maximum number of characters for a string
734  */
735 size_t
737 {
738  return 64;
739 }
740 
741 /** Set requested_name value.
742  *
743  Requested name.
744 
745  * @param new_requested_name new requested_name value
746  */
747 void
748 FacerInterface::set_requested_name(const char * new_requested_name)
749 {
750  strncpy(data->requested_name, new_requested_name, sizeof(data->requested_name));
751  data_changed = true;
752 }
753 
754 /** Get index_last_learned value.
755  *
756  Index of the identity which was learned last.
757 
758  * @return index_last_learned value
759  */
760 uint32_t
762 {
763  return data->index_last_learned;
764 }
765 
766 /** Get maximum length of index_last_learned value.
767  * @return length of index_last_learned value, can be length of the array or number of
768  * maximum number of characters for a string
769  */
770 size_t
772 {
773  return 1;
774 }
775 
776 /** Set index_last_learned value.
777  *
778  Index of the identity which was learned last.
779 
780  * @param new_index_last_learned new index_last_learned value
781  */
782 void
783 FacerInterface::set_index_last_learned(const uint32_t new_index_last_learned)
784 {
785  data->index_last_learned = new_index_last_learned;
786  data_changed = true;
787 }
788 
789 /* =========== message create =========== */
790 Message *
792 {
793  if ( strncmp("LearnFaceMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
794  return new LearnFaceMessage();
795  } else if ( strncmp("SetOpmodeMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
796  return new SetOpmodeMessage();
797  } else if ( strncmp("EnableIdentityMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
798  return new EnableIdentityMessage();
799  } else if ( strncmp("SetNameMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
800  return new SetNameMessage();
801  } else if ( strncmp("GetNameMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
802  return new GetNameMessage();
803  } else if ( strncmp("StartSearchPersonMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
804  return new StartSearchPersonMessage();
805  } else if ( strncmp("StopSearchPersonMessage", type, __INTERFACE_MESSAGE_TYPE_SIZE) == 0 ) {
806  return new StopSearchPersonMessage();
807  } else {
808  throw UnknownTypeException("The given type '%s' does not match any known "
809  "message type for this interface type.", type);
810  }
811 }
812 
813 
814 /** Copy values from other interface.
815  * @param other other interface to copy values from
816  */
817 void
819 {
820  const FacerInterface *oi = dynamic_cast<const FacerInterface *>(other);
821  if (oi == NULL) {
822  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
823  type(), other->type());
824  }
825  memcpy(data, oi->data, sizeof(FacerInterface_data_t));
826 }
827 
828 const char *
829 FacerInterface::enum_tostring(const char *enumtype, int val) const
830 {
831  if (strcmp(enumtype, "if_facer_opmode_t") == 0) {
832  return tostring_if_facer_opmode_t((if_facer_opmode_t)val);
833  }
834  throw UnknownTypeException("Unknown enum type %s", enumtype);
835 }
836 
837 /* =========== messages =========== */
838 /** @class FacerInterface::LearnFaceMessage <interfaces/FacerInterface.h>
839  * LearnFaceMessage Fawkes BlackBoard Interface Message.
840  *
841 
842  */
843 
844 
845 /** Constructor with initial values.
846  * @param ini_name initial value for name
847  */
848 FacerInterface::LearnFaceMessage::LearnFaceMessage(const char * ini_name) : Message("LearnFaceMessage")
849 {
850  data_size = sizeof(LearnFaceMessage_data_t);
851  data_ptr = malloc(data_size);
852  memset(data_ptr, 0, data_size);
853  data = (LearnFaceMessage_data_t *)data_ptr;
855  strncpy(data->name, ini_name, 64);
856  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
857  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
858  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
859  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
860  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
861  add_fieldinfo(IFT_STRING, "name", 64, data->name);
862 }
863 /** Constructor */
865 {
866  data_size = sizeof(LearnFaceMessage_data_t);
867  data_ptr = malloc(data_size);
868  memset(data_ptr, 0, data_size);
869  data = (LearnFaceMessage_data_t *)data_ptr;
871  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
872  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
873  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
874  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
875  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
876  add_fieldinfo(IFT_STRING, "name", 64, data->name);
877 }
878 
879 /** Destructor */
881 {
882  free(data_ptr);
883 }
884 
885 /** Copy constructor.
886  * @param m message to copy from
887  */
889 {
890  data_size = m->data_size;
891  data_ptr = malloc(data_size);
892  memcpy(data_ptr, m->data_ptr, data_size);
893  data = (LearnFaceMessage_data_t *)data_ptr;
895 }
896 
897 /* Methods */
898 /** Get name value.
899  * The name assigned to the new identity.
900  * @return name value
901  */
902 char *
904 {
905  return data->name;
906 }
907 
908 /** Get maximum length of name value.
909  * @return length of name value, can be length of the array or number of
910  * maximum number of characters for a string
911  */
912 size_t
914 {
915  return 64;
916 }
917 
918 /** Set name value.
919  * The name assigned to the new identity.
920  * @param new_name new name value
921  */
922 void
924 {
925  strncpy(data->name, new_name, sizeof(data->name));
926 }
927 
928 /** Clone this message.
929  * Produces a message of the same type as this message and copies the
930  * data to the new message.
931  * @return clone of this message
932  */
933 Message *
935 {
936  return new FacerInterface::LearnFaceMessage(this);
937 }
938 /** @class FacerInterface::SetOpmodeMessage <interfaces/FacerInterface.h>
939  * SetOpmodeMessage Fawkes BlackBoard Interface Message.
940  *
941 
942  */
943 
944 
945 /** Constructor with initial values.
946  * @param ini_opmode initial value for opmode
947  */
949 {
950  data_size = sizeof(SetOpmodeMessage_data_t);
951  data_ptr = malloc(data_size);
952  memset(data_ptr, 0, data_size);
953  data = (SetOpmodeMessage_data_t *)data_ptr;
955  data->opmode = ini_opmode;
956  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
957  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
958  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
959  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
960  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
961  add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
962 }
963 /** Constructor */
965 {
966  data_size = sizeof(SetOpmodeMessage_data_t);
967  data_ptr = malloc(data_size);
968  memset(data_ptr, 0, data_size);
969  data = (SetOpmodeMessage_data_t *)data_ptr;
971  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
972  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
973  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
974  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
975  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
976  add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
977 }
978 
979 /** Destructor */
981 {
982  free(data_ptr);
983 }
984 
985 /** Copy constructor.
986  * @param m message to copy from
987  */
989 {
990  data_size = m->data_size;
991  data_ptr = malloc(data_size);
992  memcpy(data_ptr, m->data_ptr, data_size);
993  data = (SetOpmodeMessage_data_t *)data_ptr;
995 }
996 
997 /* Methods */
998 /** Get opmode value.
999  *
1000  Current opmode.
1001 
1002  * @return opmode value
1003  */
1006 {
1007  return (FacerInterface::if_facer_opmode_t)data->opmode;
1008 }
1009 
1010 /** Get maximum length of opmode value.
1011  * @return length of opmode value, can be length of the array or number of
1012  * maximum number of characters for a string
1013  */
1014 size_t
1016 {
1017  return 1;
1018 }
1019 
1020 /** Set opmode value.
1021  *
1022  Current opmode.
1023 
1024  * @param new_opmode new opmode value
1025  */
1026 void
1028 {
1029  data->opmode = new_opmode;
1030 }
1031 
1032 /** Clone this message.
1033  * Produces a message of the same type as this message and copies the
1034  * data to the new message.
1035  * @return clone of this message
1036  */
1037 Message *
1039 {
1040  return new FacerInterface::SetOpmodeMessage(this);
1041 }
1042 /** @class FacerInterface::EnableIdentityMessage <interfaces/FacerInterface.h>
1043  * EnableIdentityMessage Fawkes BlackBoard Interface Message.
1044  *
1045 
1046  */
1047 
1048 
1049 /** Constructor with initial values.
1050  * @param ini_index initial value for index
1051  * @param ini_enable initial value for enable
1052  */
1053 FacerInterface::EnableIdentityMessage::EnableIdentityMessage(const uint32_t ini_index, const bool ini_enable) : Message("EnableIdentityMessage")
1054 {
1055  data_size = sizeof(EnableIdentityMessage_data_t);
1056  data_ptr = malloc(data_size);
1057  memset(data_ptr, 0, data_size);
1058  data = (EnableIdentityMessage_data_t *)data_ptr;
1060  data->index = ini_index;
1061  data->enable = ini_enable;
1062  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1063  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1064  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1065  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1066  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1067  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1068  add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1069 }
1070 /** Constructor */
1072 {
1073  data_size = sizeof(EnableIdentityMessage_data_t);
1074  data_ptr = malloc(data_size);
1075  memset(data_ptr, 0, data_size);
1076  data = (EnableIdentityMessage_data_t *)data_ptr;
1078  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1079  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1080  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1081  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1082  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1083  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1084  add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1085 }
1086 
1087 /** Destructor */
1089 {
1090  free(data_ptr);
1091 }
1092 
1093 /** Copy constructor.
1094  * @param m message to copy from
1095  */
1097 {
1098  data_size = m->data_size;
1099  data_ptr = malloc(data_size);
1100  memcpy(data_ptr, m->data_ptr, data_size);
1101  data = (EnableIdentityMessage_data_t *)data_ptr;
1103 }
1104 
1105 /* Methods */
1106 /** Get index value.
1107  * Index of the identity.
1108  * @return index value
1109  */
1110 uint32_t
1112 {
1113  return data->index;
1114 }
1115 
1116 /** Get maximum length of index value.
1117  * @return length of index value, can be length of the array or number of
1118  * maximum number of characters for a string
1119  */
1120 size_t
1122 {
1123  return 1;
1124 }
1125 
1126 /** Set index value.
1127  * Index of the identity.
1128  * @param new_index new index value
1129  */
1130 void
1132 {
1133  data->index = new_index;
1134 }
1135 
1136 /** Get enable value.
1137  * En-/disable flag.
1138  * @return enable value
1139  */
1140 bool
1142 {
1143  return data->enable;
1144 }
1145 
1146 /** Get maximum length of enable value.
1147  * @return length of enable value, can be length of the array or number of
1148  * maximum number of characters for a string
1149  */
1150 size_t
1152 {
1153  return 1;
1154 }
1155 
1156 /** Set enable value.
1157  * En-/disable flag.
1158  * @param new_enable new enable value
1159  */
1160 void
1162 {
1163  data->enable = new_enable;
1164 }
1165 
1166 /** Clone this message.
1167  * Produces a message of the same type as this message and copies the
1168  * data to the new message.
1169  * @return clone of this message
1170  */
1171 Message *
1173 {
1174  return new FacerInterface::EnableIdentityMessage(this);
1175 }
1176 /** @class FacerInterface::SetNameMessage <interfaces/FacerInterface.h>
1177  * SetNameMessage Fawkes BlackBoard Interface Message.
1178  *
1179 
1180  */
1181 
1182 
1183 /** Constructor with initial values.
1184  * @param ini_index initial value for index
1185  * @param ini_name initial value for name
1186  */
1187 FacerInterface::SetNameMessage::SetNameMessage(const uint32_t ini_index, const char * ini_name) : Message("SetNameMessage")
1188 {
1189  data_size = sizeof(SetNameMessage_data_t);
1190  data_ptr = malloc(data_size);
1191  memset(data_ptr, 0, data_size);
1192  data = (SetNameMessage_data_t *)data_ptr;
1194  data->index = ini_index;
1195  strncpy(data->name, ini_name, 64);
1196  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1197  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1198  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1199  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1200  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1201  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1202  add_fieldinfo(IFT_STRING, "name", 64, data->name);
1203 }
1204 /** Constructor */
1206 {
1207  data_size = sizeof(SetNameMessage_data_t);
1208  data_ptr = malloc(data_size);
1209  memset(data_ptr, 0, data_size);
1210  data = (SetNameMessage_data_t *)data_ptr;
1212  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1213  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1214  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1215  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1216  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1217  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1218  add_fieldinfo(IFT_STRING, "name", 64, data->name);
1219 }
1220 
1221 /** Destructor */
1223 {
1224  free(data_ptr);
1225 }
1226 
1227 /** Copy constructor.
1228  * @param m message to copy from
1229  */
1231 {
1232  data_size = m->data_size;
1233  data_ptr = malloc(data_size);
1234  memcpy(data_ptr, m->data_ptr, data_size);
1235  data = (SetNameMessage_data_t *)data_ptr;
1237 }
1238 
1239 /* Methods */
1240 /** Get index value.
1241  * Index of the identity.
1242  * @return index value
1243  */
1244 uint32_t
1246 {
1247  return data->index;
1248 }
1249 
1250 /** Get maximum length of index value.
1251  * @return length of index value, can be length of the array or number of
1252  * maximum number of characters for a string
1253  */
1254 size_t
1256 {
1257  return 1;
1258 }
1259 
1260 /** Set index value.
1261  * Index of the identity.
1262  * @param new_index new index value
1263  */
1264 void
1266 {
1267  data->index = new_index;
1268 }
1269 
1270 /** Get name value.
1271  * Name of the identity.
1272  * @return name value
1273  */
1274 char *
1276 {
1277  return data->name;
1278 }
1279 
1280 /** Get maximum length of name value.
1281  * @return length of name value, can be length of the array or number of
1282  * maximum number of characters for a string
1283  */
1284 size_t
1286 {
1287  return 64;
1288 }
1289 
1290 /** Set name value.
1291  * Name of the identity.
1292  * @param new_name new name value
1293  */
1294 void
1296 {
1297  strncpy(data->name, new_name, sizeof(data->name));
1298 }
1299 
1300 /** Clone this message.
1301  * Produces a message of the same type as this message and copies the
1302  * data to the new message.
1303  * @return clone of this message
1304  */
1305 Message *
1307 {
1308  return new FacerInterface::SetNameMessage(this);
1309 }
1310 /** @class FacerInterface::GetNameMessage <interfaces/FacerInterface.h>
1311  * GetNameMessage Fawkes BlackBoard Interface Message.
1312  *
1313 
1314  */
1315 
1316 
1317 /** Constructor with initial values.
1318  * @param ini_index initial value for index
1319  */
1320 FacerInterface::GetNameMessage::GetNameMessage(const uint32_t ini_index) : Message("GetNameMessage")
1321 {
1322  data_size = sizeof(GetNameMessage_data_t);
1323  data_ptr = malloc(data_size);
1324  memset(data_ptr, 0, data_size);
1325  data = (GetNameMessage_data_t *)data_ptr;
1327  data->index = ini_index;
1328  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1329  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1330  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1331  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1332  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1333  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1334 }
1335 /** Constructor */
1337 {
1338  data_size = sizeof(GetNameMessage_data_t);
1339  data_ptr = malloc(data_size);
1340  memset(data_ptr, 0, data_size);
1341  data = (GetNameMessage_data_t *)data_ptr;
1343  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1344  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1345  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1346  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1347  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1348  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1349 }
1350 
1351 /** Destructor */
1353 {
1354  free(data_ptr);
1355 }
1356 
1357 /** Copy constructor.
1358  * @param m message to copy from
1359  */
1361 {
1362  data_size = m->data_size;
1363  data_ptr = malloc(data_size);
1364  memcpy(data_ptr, m->data_ptr, data_size);
1365  data = (GetNameMessage_data_t *)data_ptr;
1367 }
1368 
1369 /* Methods */
1370 /** Get index value.
1371  * Index of the identity.
1372  * @return index value
1373  */
1374 uint32_t
1376 {
1377  return data->index;
1378 }
1379 
1380 /** Get maximum length of index value.
1381  * @return length of index value, can be length of the array or number of
1382  * maximum number of characters for a string
1383  */
1384 size_t
1386 {
1387  return 1;
1388 }
1389 
1390 /** Set index value.
1391  * Index of the identity.
1392  * @param new_index new index value
1393  */
1394 void
1396 {
1397  data->index = new_index;
1398 }
1399 
1400 /** Clone this message.
1401  * Produces a message of the same type as this message and copies the
1402  * data to the new message.
1403  * @return clone of this message
1404  */
1405 Message *
1407 {
1408  return new FacerInterface::GetNameMessage(this);
1409 }
1410 /** @class FacerInterface::StartSearchPersonMessage <interfaces/FacerInterface.h>
1411  * StartSearchPersonMessage Fawkes BlackBoard Interface Message.
1412  *
1413 
1414  */
1415 
1416 
1417 /** Constructor with initial values.
1418  * @param ini_index initial value for index
1419  */
1420 FacerInterface::StartSearchPersonMessage::StartSearchPersonMessage(const uint32_t ini_index) : Message("StartSearchPersonMessage")
1421 {
1422  data_size = sizeof(StartSearchPersonMessage_data_t);
1423  data_ptr = malloc(data_size);
1424  memset(data_ptr, 0, data_size);
1425  data = (StartSearchPersonMessage_data_t *)data_ptr;
1427  data->index = ini_index;
1428  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1429  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1430  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1431  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1432  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1433  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1434 }
1435 /** Constructor */
1437 {
1438  data_size = sizeof(StartSearchPersonMessage_data_t);
1439  data_ptr = malloc(data_size);
1440  memset(data_ptr, 0, data_size);
1441  data = (StartSearchPersonMessage_data_t *)data_ptr;
1443  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1444  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1445  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1446  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1447  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1448  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1449 }
1450 
1451 /** Destructor */
1453 {
1454  free(data_ptr);
1455 }
1456 
1457 /** Copy constructor.
1458  * @param m message to copy from
1459  */
1461 {
1462  data_size = m->data_size;
1463  data_ptr = malloc(data_size);
1464  memcpy(data_ptr, m->data_ptr, data_size);
1465  data = (StartSearchPersonMessage_data_t *)data_ptr;
1467 }
1468 
1469 /* Methods */
1470 /** Get index value.
1471  * Index of the identity.
1472  * @return index value
1473  */
1474 uint32_t
1476 {
1477  return data->index;
1478 }
1479 
1480 /** Get maximum length of index value.
1481  * @return length of index value, can be length of the array or number of
1482  * maximum number of characters for a string
1483  */
1484 size_t
1486 {
1487  return 1;
1488 }
1489 
1490 /** Set index value.
1491  * Index of the identity.
1492  * @param new_index new index value
1493  */
1494 void
1496 {
1497  data->index = new_index;
1498 }
1499 
1500 /** Clone this message.
1501  * Produces a message of the same type as this message and copies the
1502  * data to the new message.
1503  * @return clone of this message
1504  */
1505 Message *
1507 {
1509 }
1510 /** @class FacerInterface::StopSearchPersonMessage <interfaces/FacerInterface.h>
1511  * StopSearchPersonMessage Fawkes BlackBoard Interface Message.
1512  *
1513 
1514  */
1515 
1516 
1517 /** Constructor */
1519 {
1520  data_size = sizeof(StopSearchPersonMessage_data_t);
1521  data_ptr = malloc(data_size);
1522  memset(data_ptr, 0, data_size);
1523  data = (StopSearchPersonMessage_data_t *)data_ptr;
1525  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1526  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1527  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1528  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1529  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1530 }
1531 
1532 /** Destructor */
1534 {
1535  free(data_ptr);
1536 }
1537 
1538 /** Copy constructor.
1539  * @param m message to copy from
1540  */
1542 {
1543  data_size = m->data_size;
1544  data_ptr = malloc(data_size);
1545  memcpy(data_ptr, m->data_ptr, data_size);
1546  data = (StopSearchPersonMessage_data_t *)data_ptr;
1548 }
1549 
1550 /* Methods */
1551 /** Clone this message.
1552  * Produces a message of the same type as this message and copies the
1553  * data to the new message.
1554  * @return clone of this message
1555  */
1556 Message *
1558 {
1559  return new FacerInterface::StopSearchPersonMessage(this);
1560 }
1561 /** Check if message is valid and can be enqueued.
1562  * @param message Message to check
1563  * @return true if the message is valid, false otherwise.
1564  */
1565 bool
1567 {
1568  const LearnFaceMessage *m0 = dynamic_cast<const LearnFaceMessage *>(message);
1569  if ( m0 != NULL ) {
1570  return true;
1571  }
1572  const SetOpmodeMessage *m1 = dynamic_cast<const SetOpmodeMessage *>(message);
1573  if ( m1 != NULL ) {
1574  return true;
1575  }
1576  const EnableIdentityMessage *m2 = dynamic_cast<const EnableIdentityMessage *>(message);
1577  if ( m2 != NULL ) {
1578  return true;
1579  }
1580  const SetNameMessage *m3 = dynamic_cast<const SetNameMessage *>(message);
1581  if ( m3 != NULL ) {
1582  return true;
1583  }
1584  const GetNameMessage *m4 = dynamic_cast<const GetNameMessage *>(message);
1585  if ( m4 != NULL ) {
1586  return true;
1587  }
1588  const StartSearchPersonMessage *m5 = dynamic_cast<const StartSearchPersonMessage *>(message);
1589  if ( m5 != NULL ) {
1590  return true;
1591  }
1592  const StopSearchPersonMessage *m6 = dynamic_cast<const StopSearchPersonMessage *>(message);
1593  if ( m6 != NULL ) {
1594  return true;
1595  }
1596  return false;
1597 }
1598 
1599 /// @cond INTERNALS
1600 EXPORT_INTERFACE(FacerInterface)
1601 /// @endcond
1602 
1603 
1604 } // end namespace fawkes
size_t maxlenof_index_last_learned() const
Get maximum length of index_last_learned value.
StopSearchPersonMessage Fawkes BlackBoard Interface Message.
char * recognized_name() const
Get recognized_name value.
Facer will detect faces and try to identify the gender of the faces.
void * data_ptr
Pointer to memory that contains local data.
Definition: message.h:124
if_facer_opmode_t opmode() const
Get opmode value.
uint32_t num_detections() const
Get num_detections value.
void set_index_last_learned(const uint32_t new_index_last_learned)
Set index_last_learned value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
virtual Message * clone() const
Clone this message.
uint32_t index() const
Get index value.
void set_most_likely_identity(const uint32_t new_most_likely_identity)
Set most_likely_identity value.
size_t maxlenof_opmode() const
Get maximum length of opmode value.
size_t maxlenof_index() const
Get maximum length of index value.
char * name() const
Get name value.
void set_enable(const bool new_enable)
Set enable value.
SetOpmodeMessage Fawkes BlackBoard Interface Message.
uint32_t recognized_identity() const
Get recognized_identity value.
uint32_t index() const
Get index value.
void set_hash(unsigned char *ihash)
Set hash.
Definition: interface.cpp:314
SetNameMessage Fawkes BlackBoard Interface Message.
float history_ratio() const
Get history_ratio value.
size_t maxlenof_history_ratio() const
Get maximum length of history_ratio value.
size_t maxlenof_most_likely_gender() const
Get maximum length of most_likely_gender value.
Fawkes library namespace.
size_t maxlenof_num_identities() const
Get maximum length of num_identities value.
size_t maxlenof_sec_since_detection() const
Get maximum length of sec_since_detection value.
Timestamp data, must be present and first entries for each interface data structs! This leans on time...
Definition: message.h:129
size_t maxlenof_bearing() const
Get maximum length of bearing value.
uint32_t most_likely_identity() const
Get most_likely_identity value.
size_t maxlenof_learning_in_progress() const
Get maximum length of learning_in_progress value.
size_t maxlenof_most_likely_identity() const
Get maximum length of most_likely_identity value.
const char * tostring_if_facer_opmode_t(if_facer_opmode_t value) const
Convert if_facer_opmode_t constant to string.
void set_index(const uint32_t new_index)
Set index value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
Facer will detect faces, and then try to recognize the most dominant face.
size_t maxlenof_recording_progress() const
Get maximum length of recording_progress value.
string field
Definition: types.h:47
char * name() const
Get name value.
char * most_likely_gender() const
Get most_likely_gender value.
size_t maxlenof_searching_person() const
Get maximum length of searching_person value.
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:79
void set_num_identities(const uint32_t new_num_identities)
Set num_identities value.
GetNameMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_index() const
Get maximum length of index value.
size_t maxlenof_visibility_history() const
Get maximum length of visibility_history value.
void set_sec_since_detection(const float new_sec_since_detection)
Set sec_since_detection value.
virtual Message * clone() const
Clone this message.
if_facer_opmode_t opmode() const
Get opmode value.
void set_slope(const float new_slope)
Set slope value.
void set_recognized_identity(const uint32_t new_recognized_identity)
Set recognized_identity value.
size_t maxlenof_requested_index() const
Get maximum length of requested_index value.
size_t maxlenof_index() const
Get maximum length of index value.
void set_index(const uint32_t new_index)
Set index value.
message_data_ts_t * data_ts
data timestamp aliasing pointer
Definition: message.h:133
void set_visibility_history(const int32_t new_visibility_history)
Set visibility_history value.
size_t maxlenof_opmode() const
Get maximum length of opmode value.
unsigned int data_size
Size of memory needed to hold all data.
Definition: message.h:125
Facer will detect faces, but not try to recognize them.
bool is_searching_person() const
Get searching_person value.
uint32_t index_last_learned() const
Get index_last_learned value.
uint32_t num_identities() const
Get num_identities value.
uint32_t requested_index() const
Get requested_index value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
Definition: interface.cpp:373
bool data_changed
Indicator if data has changed.
Definition: interface.h:222
float sec_since_detection() const
Get sec_since_detection value.
const char * type() const
Get type of interface.
Definition: interface.cpp:651
void set_searching_person(const bool new_searching_person)
Set searching_person value.
void set_name(const char *new_name)
Set name value.
size_t maxlenof_index() const
Get maximum length of index value.
size_t maxlenof_name() const
Get maximum length of name value.
size_t maxlenof_requested_name() const
Get maximum length of requested_name value.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
virtual Message * clone() const
Clone this message.
void set_opmode(const if_facer_opmode_t new_opmode)
Set opmode value.
virtual Message * clone() const
Clone this message.
float slope() const
Get slope value.
void set_num_detections(const uint32_t new_num_detections)
Set num_detections value.
virtual Message * create_message(const char *type) const
Create message based on type name.
StartSearchPersonMessage Fawkes BlackBoard Interface Message.
Facer will not process any images.
int32_t visibility_history() const
Get visibility_history value.
float field
Definition: types.h:45
LearnFaceMessage Fawkes BlackBoard Interface Message.
virtual Message * clone() const
Clone this message.
size_t maxlenof_num_recognitions() const
Get maximum length of num_recognitions value.
void set_requested_name(const char *new_requested_name)
Set requested_name value.
size_t maxlenof_num_detections() const
Get maximum length of num_detections value.
void set_requested_index(const uint32_t new_requested_index)
Set requested_index value.
bool is_learning_in_progress() const
Get learning_in_progress value.
void set_opmode(const if_facer_opmode_t new_opmode)
Set opmode value.
32 bit integer field
Definition: types.h:41
size_t maxlenof_name() const
Get maximum length of name value.
void set_bearing(const float new_bearing)
Set bearing value.
size_t maxlenof_recognized_name() const
Get maximum length of recognized_name value.
Facer will gather images and learn an identity.
size_t maxlenof_recognized_identity() const
Get maximum length of recognized_identity value.
void set_num_recognitions(const uint32_t new_num_recognitions)
Set num_recognitions value.
FacerInterface Fawkes BlackBoard Interface.
void set_learning_in_progress(const bool new_learning_in_progress)
Set learning_in_progress value.
void set_recording_progress(const float new_recording_progress)
Set recording_progress value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
uint32_t num_recognitions() const
Get num_recognitions value.
void set_most_likely_gender(const char *new_most_likely_gender)
Set most_likely_gender value.
void set_history_ratio(const float new_history_ratio)
Set history_ratio value.
void add_fieldinfo(interface_fieldtype_t type, const char *name, size_t length, void *value, const char *enumtype=0, const interface_enum_map_t *enum_map=0)
Add an entry to the info list.
Definition: message.cpp:436
size_t maxlenof_slope() const
Get maximum length of slope value.
boolean field
Definition: types.h:36
virtual Message * clone() const
Clone this message.
virtual Message * clone() const
Clone this message.
EnableIdentityMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_enable() const
Get maximum length of enable value.
void set_index(const uint32_t new_index)
Set index value.
char * requested_name() const
Get requested_name value.
const char * type() const
Get message type.
Definition: message.cpp:378
if_facer_opmode_t
This determines the current status of skill execution.
float recording_progress() const
Get recording_progress value.
32 bit unsigned integer field
Definition: types.h:42
field with interface specific enum type
Definition: types.h:49
float bearing() const
Get bearing value.
void set_index(const uint32_t new_index)
Set index value.
uint32_t index() const
Get index value.
void set_name(const char *new_name)
Set name value.
void set_recognized_name(const char *new_recognized_name)
Set recognized_name value.