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)-1);
251  data->recognized_name[sizeof(data->recognized_name)-1] = 0;
252  data_changed = true;
253 }
254 
255 /** Get num_detections value.
256  *
257  Number of currently detected faces.
258 
259  * @return num_detections value
260  */
261 uint32_t
263 {
264  return data->num_detections;
265 }
266 
267 /** Get maximum length of num_detections value.
268  * @return length of num_detections value, can be length of the array or number of
269  * maximum number of characters for a string
270  */
271 size_t
273 {
274  return 1;
275 }
276 
277 /** Set num_detections value.
278  *
279  Number of currently detected faces.
280 
281  * @param new_num_detections new num_detections value
282  */
283 void
284 FacerInterface::set_num_detections(const uint32_t new_num_detections)
285 {
286  data->num_detections = new_num_detections;
287  data_changed = true;
288 }
289 
290 /** Get num_recognitions value.
291  *
292  Number of recognized faces.
293 
294  * @return num_recognitions value
295  */
296 uint32_t
298 {
299  return data->num_recognitions;
300 }
301 
302 /** Get maximum length of num_recognitions value.
303  * @return length of num_recognitions value, can be length of the array or number of
304  * maximum number of characters for a string
305  */
306 size_t
308 {
309  return 1;
310 }
311 
312 /** Set num_recognitions value.
313  *
314  Number of recognized faces.
315 
316  * @param new_num_recognitions new num_recognitions value
317  */
318 void
319 FacerInterface::set_num_recognitions(const uint32_t new_num_recognitions)
320 {
321  data->num_recognitions = new_num_recognitions;
322  data_changed = true;
323 }
324 
325 /** Get most_likely_identity value.
326  *
327  The identity that was recognized most prevalently.
328 
329  * @return most_likely_identity value
330  */
331 uint32_t
333 {
334  return data->most_likely_identity;
335 }
336 
337 /** Get maximum length of most_likely_identity value.
338  * @return length of most_likely_identity value, can be length of the array or number of
339  * maximum number of characters for a string
340  */
341 size_t
343 {
344  return 1;
345 }
346 
347 /** Set most_likely_identity value.
348  *
349  The identity that was recognized most prevalently.
350 
351  * @param new_most_likely_identity new most_likely_identity value
352  */
353 void
354 FacerInterface::set_most_likely_identity(const uint32_t new_most_likely_identity)
355 {
356  data->most_likely_identity = new_most_likely_identity;
357  data_changed = true;
358 }
359 
360 /** Get most_likely_gender value.
361  *
362  The gender that was recogniced.
363 
364  * @return most_likely_gender value
365  */
366 char *
368 {
369  return data->most_likely_gender;
370 }
371 
372 /** Get maximum length of most_likely_gender value.
373  * @return length of most_likely_gender value, can be length of the array or number of
374  * maximum number of characters for a string
375  */
376 size_t
378 {
379  return 64;
380 }
381 
382 /** Set most_likely_gender value.
383  *
384  The gender that was recogniced.
385 
386  * @param new_most_likely_gender new most_likely_gender value
387  */
388 void
389 FacerInterface::set_most_likely_gender(const char * new_most_likely_gender)
390 {
391  strncpy(data->most_likely_gender, new_most_likely_gender, sizeof(data->most_likely_gender)-1);
392  data->most_likely_gender[sizeof(data->most_likely_gender)-1] = 0;
393  data_changed = true;
394 }
395 
396 /** Get history_ratio value.
397  *
398  The ratio of the most likely identity showing up in the history
399  and the length of the history.
400 
401  * @return history_ratio value
402  */
403 float
405 {
406  return data->history_ratio;
407 }
408 
409 /** Get maximum length of history_ratio value.
410  * @return length of history_ratio value, can be length of the array or number of
411  * maximum number of characters for a string
412  */
413 size_t
415 {
416  return 1;
417 }
418 
419 /** Set history_ratio value.
420  *
421  The ratio of the most likely identity showing up in the history
422  and the length of the history.
423 
424  * @param new_history_ratio new history_ratio value
425  */
426 void
427 FacerInterface::set_history_ratio(const float new_history_ratio)
428 {
429  data->history_ratio = new_history_ratio;
430  data_changed = true;
431 }
432 
433 /** Get sec_since_detection value.
434  *
435  Time in seconds since the last successful detection.
436 
437  * @return sec_since_detection value
438  */
439 float
441 {
442  return data->sec_since_detection;
443 }
444 
445 /** Get maximum length of sec_since_detection value.
446  * @return length of sec_since_detection value, can be length of the array or number of
447  * maximum number of characters for a string
448  */
449 size_t
451 {
452  return 1;
453 }
454 
455 /** Set sec_since_detection value.
456  *
457  Time in seconds since the last successful detection.
458 
459  * @param new_sec_since_detection new sec_since_detection value
460  */
461 void
462 FacerInterface::set_sec_since_detection(const float new_sec_since_detection)
463 {
464  data->sec_since_detection = new_sec_since_detection;
465  data_changed = true;
466 }
467 
468 /** Get visibility_history value.
469  *
470  The number of consecutive sighting ( <= 1 ) and non-sightings
471  ( >= -1 ), respectively.
472 
473  * @return visibility_history value
474  */
475 int32_t
477 {
478  return data->visibility_history;
479 }
480 
481 /** Get maximum length of visibility_history value.
482  * @return length of visibility_history value, can be length of the array or number of
483  * maximum number of characters for a string
484  */
485 size_t
487 {
488  return 1;
489 }
490 
491 /** Set visibility_history value.
492  *
493  The number of consecutive sighting ( <= 1 ) and non-sightings
494  ( >= -1 ), respectively.
495 
496  * @param new_visibility_history new visibility_history value
497  */
498 void
499 FacerInterface::set_visibility_history(const int32_t new_visibility_history)
500 {
501  data->visibility_history = new_visibility_history;
502  data_changed = true;
503 }
504 
505 /** Get learning_in_progress value.
506  *
507  Indicates whether a new identity is currently learnt. If
508  learning is in progress only "old" faces can be recognized.
509 
510  * @return learning_in_progress value
511  */
512 bool
514 {
515  return data->learning_in_progress;
516 }
517 
518 /** Get maximum length of learning_in_progress value.
519  * @return length of learning_in_progress value, can be length of the array or number of
520  * maximum number of characters for a string
521  */
522 size_t
524 {
525  return 1;
526 }
527 
528 /** Set learning_in_progress value.
529  *
530  Indicates whether a new identity is currently learnt. If
531  learning is in progress only "old" faces can be recognized.
532 
533  * @param new_learning_in_progress new learning_in_progress value
534  */
535 void
536 FacerInterface::set_learning_in_progress(const bool new_learning_in_progress)
537 {
538  data->learning_in_progress = new_learning_in_progress;
539  data_changed = true;
540 }
541 
542 /** Get searching_person value.
543  *
544  Indicates whether the plugin is searching for a specified person.
545  If set to true, the index and name will be listed in the fields
546  "requested_index" and "requested_name".
547 
548  * @return searching_person value
549  */
550 bool
552 {
553  return data->searching_person;
554 }
555 
556 /** Get maximum length of searching_person value.
557  * @return length of searching_person value, can be length of the array or number of
558  * maximum number of characters for a string
559  */
560 size_t
562 {
563  return 1;
564 }
565 
566 /** Set searching_person value.
567  *
568  Indicates whether the plugin is searching for a specified person.
569  If set to true, the index and name will be listed in the fields
570  "requested_index" and "requested_name".
571 
572  * @param new_searching_person new searching_person value
573  */
574 void
575 FacerInterface::set_searching_person(const bool new_searching_person)
576 {
577  data->searching_person = new_searching_person;
578  data_changed = true;
579 }
580 
581 /** Get recording_progress value.
582  *
583  Indicates the progress of recording images of a new face.
584 
585  * @return recording_progress value
586  */
587 float
589 {
590  return data->recording_progress;
591 }
592 
593 /** Get maximum length of recording_progress value.
594  * @return length of recording_progress value, can be length of the array or number of
595  * maximum number of characters for a string
596  */
597 size_t
599 {
600  return 1;
601 }
602 
603 /** Set recording_progress value.
604  *
605  Indicates the progress of recording images of a new face.
606 
607  * @param new_recording_progress new recording_progress value
608  */
609 void
610 FacerInterface::set_recording_progress(const float new_recording_progress)
611 {
612  data->recording_progress = new_recording_progress;
613  data_changed = true;
614 }
615 
616 /** Get bearing value.
617  *
618  The relative bearing to the recognized face in radians.
619 
620  * @return bearing value
621  */
622 float
624 {
625  return data->bearing;
626 }
627 
628 /** Get maximum length of bearing value.
629  * @return length of bearing value, can be length of the array or number of
630  * maximum number of characters for a string
631  */
632 size_t
634 {
635  return 1;
636 }
637 
638 /** Set bearing value.
639  *
640  The relative bearing to the recognized face in radians.
641 
642  * @param new_bearing new bearing value
643  */
644 void
645 FacerInterface::set_bearing(const float new_bearing)
646 {
647  data->bearing = new_bearing;
648  data_changed = true;
649 }
650 
651 /** Get slope value.
652  *
653  The relative slope to the recognized face in radians.
654 
655  * @return slope value
656  */
657 float
659 {
660  return data->slope;
661 }
662 
663 /** Get maximum length of slope value.
664  * @return length of slope value, can be length of the array or number of
665  * maximum number of characters for a string
666  */
667 size_t
669 {
670  return 1;
671 }
672 
673 /** Set slope value.
674  *
675  The relative slope to the recognized face in radians.
676 
677  * @param new_slope new slope value
678  */
679 void
680 FacerInterface::set_slope(const float new_slope)
681 {
682  data->slope = new_slope;
683  data_changed = true;
684 }
685 
686 /** Get requested_index value.
687  *
688  Index of the identity for which the name was requested.
689 
690  * @return requested_index value
691  */
692 uint32_t
694 {
695  return data->requested_index;
696 }
697 
698 /** Get maximum length of requested_index value.
699  * @return length of requested_index value, can be length of the array or number of
700  * maximum number of characters for a string
701  */
702 size_t
704 {
705  return 1;
706 }
707 
708 /** Set requested_index value.
709  *
710  Index of the identity for which the name was requested.
711 
712  * @param new_requested_index new requested_index value
713  */
714 void
715 FacerInterface::set_requested_index(const uint32_t new_requested_index)
716 {
717  data->requested_index = new_requested_index;
718  data_changed = true;
719 }
720 
721 /** Get requested_name value.
722  *
723  Requested name.
724 
725  * @return requested_name value
726  */
727 char *
729 {
730  return data->requested_name;
731 }
732 
733 /** Get maximum length of requested_name value.
734  * @return length of requested_name value, can be length of the array or number of
735  * maximum number of characters for a string
736  */
737 size_t
739 {
740  return 64;
741 }
742 
743 /** Set requested_name value.
744  *
745  Requested name.
746 
747  * @param new_requested_name new requested_name value
748  */
749 void
750 FacerInterface::set_requested_name(const char * new_requested_name)
751 {
752  strncpy(data->requested_name, new_requested_name, sizeof(data->requested_name)-1);
753  data->requested_name[sizeof(data->requested_name)-1] = 0;
754  data_changed = true;
755 }
756 
757 /** Get index_last_learned value.
758  *
759  Index of the identity which was learned last.
760 
761  * @return index_last_learned value
762  */
763 uint32_t
765 {
766  return data->index_last_learned;
767 }
768 
769 /** Get maximum length of index_last_learned value.
770  * @return length of index_last_learned value, can be length of the array or number of
771  * maximum number of characters for a string
772  */
773 size_t
775 {
776  return 1;
777 }
778 
779 /** Set index_last_learned value.
780  *
781  Index of the identity which was learned last.
782 
783  * @param new_index_last_learned new index_last_learned value
784  */
785 void
786 FacerInterface::set_index_last_learned(const uint32_t new_index_last_learned)
787 {
788  data->index_last_learned = new_index_last_learned;
789  data_changed = true;
790 }
791 
792 /* =========== message create =========== */
793 Message *
795 {
796  if ( strncmp("LearnFaceMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
797  return new LearnFaceMessage();
798  } else if ( strncmp("SetOpmodeMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
799  return new SetOpmodeMessage();
800  } else if ( strncmp("EnableIdentityMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
801  return new EnableIdentityMessage();
802  } else if ( strncmp("SetNameMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
803  return new SetNameMessage();
804  } else if ( strncmp("GetNameMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
805  return new GetNameMessage();
806  } else if ( strncmp("StartSearchPersonMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
807  return new StartSearchPersonMessage();
808  } else if ( strncmp("StopSearchPersonMessage", type, INTERFACE_MESSAGE_TYPE_SIZE_) == 0 ) {
809  return new StopSearchPersonMessage();
810  } else {
811  throw UnknownTypeException("The given type '%s' does not match any known "
812  "message type for this interface type.", type);
813  }
814 }
815 
816 
817 /** Copy values from other interface.
818  * @param other other interface to copy values from
819  */
820 void
822 {
823  const FacerInterface *oi = dynamic_cast<const FacerInterface *>(other);
824  if (oi == NULL) {
825  throw TypeMismatchException("Can only copy values from interface of same type (%s vs. %s)",
826  type(), other->type());
827  }
828  memcpy(data, oi->data, sizeof(FacerInterface_data_t));
829 }
830 
831 const char *
832 FacerInterface::enum_tostring(const char *enumtype, int val) const
833 {
834  if (strcmp(enumtype, "if_facer_opmode_t") == 0) {
835  return tostring_if_facer_opmode_t((if_facer_opmode_t)val);
836  }
837  throw UnknownTypeException("Unknown enum type %s", enumtype);
838 }
839 
840 /* =========== messages =========== */
841 /** @class FacerInterface::LearnFaceMessage <interfaces/FacerInterface.h>
842  * LearnFaceMessage Fawkes BlackBoard Interface Message.
843  *
844 
845  */
846 
847 
848 /** Constructor with initial values.
849  * @param ini_name initial value for name
850  */
851 FacerInterface::LearnFaceMessage::LearnFaceMessage(const char * ini_name) : Message("LearnFaceMessage")
852 {
853  data_size = sizeof(LearnFaceMessage_data_t);
854  data_ptr = malloc(data_size);
855  memset(data_ptr, 0, data_size);
856  data = (LearnFaceMessage_data_t *)data_ptr;
858  strncpy(data->name, ini_name, 64-1);
859  data->name[64-1] = 0;
860  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
861  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
862  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
863  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
864  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
865  add_fieldinfo(IFT_STRING, "name", 64, data->name);
866 }
867 /** Constructor */
869 {
870  data_size = sizeof(LearnFaceMessage_data_t);
871  data_ptr = malloc(data_size);
872  memset(data_ptr, 0, data_size);
873  data = (LearnFaceMessage_data_t *)data_ptr;
875  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
876  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
877  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
878  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
879  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
880  add_fieldinfo(IFT_STRING, "name", 64, data->name);
881 }
882 
883 /** Destructor */
885 {
886  free(data_ptr);
887 }
888 
889 /** Copy constructor.
890  * @param m message to copy from
891  */
893 {
894  data_size = m->data_size;
895  data_ptr = malloc(data_size);
896  memcpy(data_ptr, m->data_ptr, data_size);
897  data = (LearnFaceMessage_data_t *)data_ptr;
899 }
900 
901 /* Methods */
902 /** Get name value.
903  * The name assigned to the new identity.
904  * @return name value
905  */
906 char *
908 {
909  return data->name;
910 }
911 
912 /** Get maximum length of name value.
913  * @return length of name value, can be length of the array or number of
914  * maximum number of characters for a string
915  */
916 size_t
918 {
919  return 64;
920 }
921 
922 /** Set name value.
923  * The name assigned to the new identity.
924  * @param new_name new name value
925  */
926 void
928 {
929  strncpy(data->name, new_name, sizeof(data->name)-1);
930  data->name[sizeof(data->name)-1] = 0;
931 }
932 
933 /** Clone this message.
934  * Produces a message of the same type as this message and copies the
935  * data to the new message.
936  * @return clone of this message
937  */
938 Message *
940 {
941  return new FacerInterface::LearnFaceMessage(this);
942 }
943 /** @class FacerInterface::SetOpmodeMessage <interfaces/FacerInterface.h>
944  * SetOpmodeMessage Fawkes BlackBoard Interface Message.
945  *
946 
947  */
948 
949 
950 /** Constructor with initial values.
951  * @param ini_opmode initial value for opmode
952  */
954 {
955  data_size = sizeof(SetOpmodeMessage_data_t);
956  data_ptr = malloc(data_size);
957  memset(data_ptr, 0, data_size);
958  data = (SetOpmodeMessage_data_t *)data_ptr;
960  data->opmode = ini_opmode;
961  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
962  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
963  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
964  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
965  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
966  add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
967 }
968 /** Constructor */
970 {
971  data_size = sizeof(SetOpmodeMessage_data_t);
972  data_ptr = malloc(data_size);
973  memset(data_ptr, 0, data_size);
974  data = (SetOpmodeMessage_data_t *)data_ptr;
976  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
977  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
978  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
979  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
980  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
981  add_fieldinfo(IFT_ENUM, "opmode", 1, &data->opmode, "if_facer_opmode_t", &enum_map_if_facer_opmode_t);
982 }
983 
984 /** Destructor */
986 {
987  free(data_ptr);
988 }
989 
990 /** Copy constructor.
991  * @param m message to copy from
992  */
994 {
995  data_size = m->data_size;
996  data_ptr = malloc(data_size);
997  memcpy(data_ptr, m->data_ptr, data_size);
998  data = (SetOpmodeMessage_data_t *)data_ptr;
1000 }
1001 
1002 /* Methods */
1003 /** Get opmode value.
1004  *
1005  Current opmode.
1006 
1007  * @return opmode value
1008  */
1011 {
1012  return (FacerInterface::if_facer_opmode_t)data->opmode;
1013 }
1014 
1015 /** Get maximum length of opmode value.
1016  * @return length of opmode value, can be length of the array or number of
1017  * maximum number of characters for a string
1018  */
1019 size_t
1021 {
1022  return 1;
1023 }
1024 
1025 /** Set opmode value.
1026  *
1027  Current opmode.
1028 
1029  * @param new_opmode new opmode value
1030  */
1031 void
1033 {
1034  data->opmode = new_opmode;
1035 }
1036 
1037 /** Clone this message.
1038  * Produces a message of the same type as this message and copies the
1039  * data to the new message.
1040  * @return clone of this message
1041  */
1042 Message *
1044 {
1045  return new FacerInterface::SetOpmodeMessage(this);
1046 }
1047 /** @class FacerInterface::EnableIdentityMessage <interfaces/FacerInterface.h>
1048  * EnableIdentityMessage Fawkes BlackBoard Interface Message.
1049  *
1050 
1051  */
1052 
1053 
1054 /** Constructor with initial values.
1055  * @param ini_index initial value for index
1056  * @param ini_enable initial value for enable
1057  */
1058 FacerInterface::EnableIdentityMessage::EnableIdentityMessage(const uint32_t ini_index, const bool ini_enable) : Message("EnableIdentityMessage")
1059 {
1060  data_size = sizeof(EnableIdentityMessage_data_t);
1061  data_ptr = malloc(data_size);
1062  memset(data_ptr, 0, data_size);
1063  data = (EnableIdentityMessage_data_t *)data_ptr;
1065  data->index = ini_index;
1066  data->enable = ini_enable;
1067  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1068  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1069  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1070  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1071  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1072  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1073  add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1074 }
1075 /** Constructor */
1077 {
1078  data_size = sizeof(EnableIdentityMessage_data_t);
1079  data_ptr = malloc(data_size);
1080  memset(data_ptr, 0, data_size);
1081  data = (EnableIdentityMessage_data_t *)data_ptr;
1083  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1084  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1085  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1086  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1087  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1088  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1089  add_fieldinfo(IFT_BOOL, "enable", 1, &data->enable);
1090 }
1091 
1092 /** Destructor */
1094 {
1095  free(data_ptr);
1096 }
1097 
1098 /** Copy constructor.
1099  * @param m message to copy from
1100  */
1102 {
1103  data_size = m->data_size;
1104  data_ptr = malloc(data_size);
1105  memcpy(data_ptr, m->data_ptr, data_size);
1106  data = (EnableIdentityMessage_data_t *)data_ptr;
1108 }
1109 
1110 /* Methods */
1111 /** Get index value.
1112  * Index of the identity.
1113  * @return index value
1114  */
1115 uint32_t
1117 {
1118  return data->index;
1119 }
1120 
1121 /** Get maximum length of index value.
1122  * @return length of index value, can be length of the array or number of
1123  * maximum number of characters for a string
1124  */
1125 size_t
1127 {
1128  return 1;
1129 }
1130 
1131 /** Set index value.
1132  * Index of the identity.
1133  * @param new_index new index value
1134  */
1135 void
1137 {
1138  data->index = new_index;
1139 }
1140 
1141 /** Get enable value.
1142  * En-/disable flag.
1143  * @return enable value
1144  */
1145 bool
1147 {
1148  return data->enable;
1149 }
1150 
1151 /** Get maximum length of enable value.
1152  * @return length of enable value, can be length of the array or number of
1153  * maximum number of characters for a string
1154  */
1155 size_t
1157 {
1158  return 1;
1159 }
1160 
1161 /** Set enable value.
1162  * En-/disable flag.
1163  * @param new_enable new enable value
1164  */
1165 void
1167 {
1168  data->enable = new_enable;
1169 }
1170 
1171 /** Clone this message.
1172  * Produces a message of the same type as this message and copies the
1173  * data to the new message.
1174  * @return clone of this message
1175  */
1176 Message *
1178 {
1179  return new FacerInterface::EnableIdentityMessage(this);
1180 }
1181 /** @class FacerInterface::SetNameMessage <interfaces/FacerInterface.h>
1182  * SetNameMessage Fawkes BlackBoard Interface Message.
1183  *
1184 
1185  */
1186 
1187 
1188 /** Constructor with initial values.
1189  * @param ini_index initial value for index
1190  * @param ini_name initial value for name
1191  */
1192 FacerInterface::SetNameMessage::SetNameMessage(const uint32_t ini_index, const char * ini_name) : Message("SetNameMessage")
1193 {
1194  data_size = sizeof(SetNameMessage_data_t);
1195  data_ptr = malloc(data_size);
1196  memset(data_ptr, 0, data_size);
1197  data = (SetNameMessage_data_t *)data_ptr;
1199  data->index = ini_index;
1200  strncpy(data->name, ini_name, 64-1);
1201  data->name[64-1] = 0;
1202  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1203  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1204  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1205  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1206  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1207  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1208  add_fieldinfo(IFT_STRING, "name", 64, data->name);
1209 }
1210 /** Constructor */
1212 {
1213  data_size = sizeof(SetNameMessage_data_t);
1214  data_ptr = malloc(data_size);
1215  memset(data_ptr, 0, data_size);
1216  data = (SetNameMessage_data_t *)data_ptr;
1218  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1219  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1220  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1221  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1222  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1223  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1224  add_fieldinfo(IFT_STRING, "name", 64, data->name);
1225 }
1226 
1227 /** Destructor */
1229 {
1230  free(data_ptr);
1231 }
1232 
1233 /** Copy constructor.
1234  * @param m message to copy from
1235  */
1237 {
1238  data_size = m->data_size;
1239  data_ptr = malloc(data_size);
1240  memcpy(data_ptr, m->data_ptr, data_size);
1241  data = (SetNameMessage_data_t *)data_ptr;
1243 }
1244 
1245 /* Methods */
1246 /** Get index value.
1247  * Index of the identity.
1248  * @return index value
1249  */
1250 uint32_t
1252 {
1253  return data->index;
1254 }
1255 
1256 /** Get maximum length of index value.
1257  * @return length of index value, can be length of the array or number of
1258  * maximum number of characters for a string
1259  */
1260 size_t
1262 {
1263  return 1;
1264 }
1265 
1266 /** Set index value.
1267  * Index of the identity.
1268  * @param new_index new index value
1269  */
1270 void
1272 {
1273  data->index = new_index;
1274 }
1275 
1276 /** Get name value.
1277  * Name of the identity.
1278  * @return name value
1279  */
1280 char *
1282 {
1283  return data->name;
1284 }
1285 
1286 /** Get maximum length of name value.
1287  * @return length of name value, can be length of the array or number of
1288  * maximum number of characters for a string
1289  */
1290 size_t
1292 {
1293  return 64;
1294 }
1295 
1296 /** Set name value.
1297  * Name of the identity.
1298  * @param new_name new name value
1299  */
1300 void
1302 {
1303  strncpy(data->name, new_name, sizeof(data->name)-1);
1304  data->name[sizeof(data->name)-1] = 0;
1305 }
1306 
1307 /** Clone this message.
1308  * Produces a message of the same type as this message and copies the
1309  * data to the new message.
1310  * @return clone of this message
1311  */
1312 Message *
1314 {
1315  return new FacerInterface::SetNameMessage(this);
1316 }
1317 /** @class FacerInterface::GetNameMessage <interfaces/FacerInterface.h>
1318  * GetNameMessage Fawkes BlackBoard Interface Message.
1319  *
1320 
1321  */
1322 
1323 
1324 /** Constructor with initial values.
1325  * @param ini_index initial value for index
1326  */
1327 FacerInterface::GetNameMessage::GetNameMessage(const uint32_t ini_index) : Message("GetNameMessage")
1328 {
1329  data_size = sizeof(GetNameMessage_data_t);
1330  data_ptr = malloc(data_size);
1331  memset(data_ptr, 0, data_size);
1332  data = (GetNameMessage_data_t *)data_ptr;
1334  data->index = ini_index;
1335  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1336  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1337  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1338  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1339  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1340  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1341 }
1342 /** Constructor */
1344 {
1345  data_size = sizeof(GetNameMessage_data_t);
1346  data_ptr = malloc(data_size);
1347  memset(data_ptr, 0, data_size);
1348  data = (GetNameMessage_data_t *)data_ptr;
1350  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1351  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1352  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1353  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1354  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1355  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1356 }
1357 
1358 /** Destructor */
1360 {
1361  free(data_ptr);
1362 }
1363 
1364 /** Copy constructor.
1365  * @param m message to copy from
1366  */
1368 {
1369  data_size = m->data_size;
1370  data_ptr = malloc(data_size);
1371  memcpy(data_ptr, m->data_ptr, data_size);
1372  data = (GetNameMessage_data_t *)data_ptr;
1374 }
1375 
1376 /* Methods */
1377 /** Get index value.
1378  * Index of the identity.
1379  * @return index value
1380  */
1381 uint32_t
1383 {
1384  return data->index;
1385 }
1386 
1387 /** Get maximum length of index value.
1388  * @return length of index value, can be length of the array or number of
1389  * maximum number of characters for a string
1390  */
1391 size_t
1393 {
1394  return 1;
1395 }
1396 
1397 /** Set index value.
1398  * Index of the identity.
1399  * @param new_index new index value
1400  */
1401 void
1403 {
1404  data->index = new_index;
1405 }
1406 
1407 /** Clone this message.
1408  * Produces a message of the same type as this message and copies the
1409  * data to the new message.
1410  * @return clone of this message
1411  */
1412 Message *
1414 {
1415  return new FacerInterface::GetNameMessage(this);
1416 }
1417 /** @class FacerInterface::StartSearchPersonMessage <interfaces/FacerInterface.h>
1418  * StartSearchPersonMessage Fawkes BlackBoard Interface Message.
1419  *
1420 
1421  */
1422 
1423 
1424 /** Constructor with initial values.
1425  * @param ini_index initial value for index
1426  */
1427 FacerInterface::StartSearchPersonMessage::StartSearchPersonMessage(const uint32_t ini_index) : Message("StartSearchPersonMessage")
1428 {
1429  data_size = sizeof(StartSearchPersonMessage_data_t);
1430  data_ptr = malloc(data_size);
1431  memset(data_ptr, 0, data_size);
1432  data = (StartSearchPersonMessage_data_t *)data_ptr;
1434  data->index = ini_index;
1435  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1436  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1437  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1438  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1439  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1440  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1441 }
1442 /** Constructor */
1444 {
1445  data_size = sizeof(StartSearchPersonMessage_data_t);
1446  data_ptr = malloc(data_size);
1447  memset(data_ptr, 0, data_size);
1448  data = (StartSearchPersonMessage_data_t *)data_ptr;
1450  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1451  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1452  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1453  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1454  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1455  add_fieldinfo(IFT_UINT32, "index", 1, &data->index);
1456 }
1457 
1458 /** Destructor */
1460 {
1461  free(data_ptr);
1462 }
1463 
1464 /** Copy constructor.
1465  * @param m message to copy from
1466  */
1468 {
1469  data_size = m->data_size;
1470  data_ptr = malloc(data_size);
1471  memcpy(data_ptr, m->data_ptr, data_size);
1472  data = (StartSearchPersonMessage_data_t *)data_ptr;
1474 }
1475 
1476 /* Methods */
1477 /** Get index value.
1478  * Index of the identity.
1479  * @return index value
1480  */
1481 uint32_t
1483 {
1484  return data->index;
1485 }
1486 
1487 /** Get maximum length of index value.
1488  * @return length of index value, can be length of the array or number of
1489  * maximum number of characters for a string
1490  */
1491 size_t
1493 {
1494  return 1;
1495 }
1496 
1497 /** Set index value.
1498  * Index of the identity.
1499  * @param new_index new index value
1500  */
1501 void
1503 {
1504  data->index = new_index;
1505 }
1506 
1507 /** Clone this message.
1508  * Produces a message of the same type as this message and copies the
1509  * data to the new message.
1510  * @return clone of this message
1511  */
1512 Message *
1514 {
1516 }
1517 /** @class FacerInterface::StopSearchPersonMessage <interfaces/FacerInterface.h>
1518  * StopSearchPersonMessage Fawkes BlackBoard Interface Message.
1519  *
1520 
1521  */
1522 
1523 
1524 /** Constructor */
1526 {
1527  data_size = sizeof(StopSearchPersonMessage_data_t);
1528  data_ptr = malloc(data_size);
1529  memset(data_ptr, 0, data_size);
1530  data = (StopSearchPersonMessage_data_t *)data_ptr;
1532  enum_map_if_facer_opmode_t[(int)OPMODE_DISABLED] = "OPMODE_DISABLED";
1533  enum_map_if_facer_opmode_t[(int)OPMODE_DETECTION] = "OPMODE_DETECTION";
1534  enum_map_if_facer_opmode_t[(int)OPMODE_RECOGNITION] = "OPMODE_RECOGNITION";
1535  enum_map_if_facer_opmode_t[(int)OPMODE_LEARNING] = "OPMODE_LEARNING";
1536  enum_map_if_facer_opmode_t[(int)OPMODE_GENDER] = "OPMODE_GENDER";
1537 }
1538 
1539 /** Destructor */
1541 {
1542  free(data_ptr);
1543 }
1544 
1545 /** Copy constructor.
1546  * @param m message to copy from
1547  */
1549 {
1550  data_size = m->data_size;
1551  data_ptr = malloc(data_size);
1552  memcpy(data_ptr, m->data_ptr, data_size);
1553  data = (StopSearchPersonMessage_data_t *)data_ptr;
1555 }
1556 
1557 /* Methods */
1558 /** Clone this message.
1559  * Produces a message of the same type as this message and copies the
1560  * data to the new message.
1561  * @return clone of this message
1562  */
1563 Message *
1565 {
1566  return new FacerInterface::StopSearchPersonMessage(this);
1567 }
1568 /** Check if message is valid and can be enqueued.
1569  * @param message Message to check
1570  * @return true if the message is valid, false otherwise.
1571  */
1572 bool
1574 {
1575  const LearnFaceMessage *m0 = dynamic_cast<const LearnFaceMessage *>(message);
1576  if ( m0 != NULL ) {
1577  return true;
1578  }
1579  const SetOpmodeMessage *m1 = dynamic_cast<const SetOpmodeMessage *>(message);
1580  if ( m1 != NULL ) {
1581  return true;
1582  }
1583  const EnableIdentityMessage *m2 = dynamic_cast<const EnableIdentityMessage *>(message);
1584  if ( m2 != NULL ) {
1585  return true;
1586  }
1587  const SetNameMessage *m3 = dynamic_cast<const SetNameMessage *>(message);
1588  if ( m3 != NULL ) {
1589  return true;
1590  }
1591  const GetNameMessage *m4 = dynamic_cast<const GetNameMessage *>(message);
1592  if ( m4 != NULL ) {
1593  return true;
1594  }
1595  const StartSearchPersonMessage *m5 = dynamic_cast<const StartSearchPersonMessage *>(message);
1596  if ( m5 != NULL ) {
1597  return true;
1598  }
1599  const StopSearchPersonMessage *m6 = dynamic_cast<const StopSearchPersonMessage *>(message);
1600  if ( m6 != NULL ) {
1601  return true;
1602  }
1603  return false;
1604 }
1605 
1606 /// @cond INTERNALS
1607 EXPORT_INTERFACE(FacerInterface)
1608 /// @endcond
1609 
1610 
1611 } // 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:125
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:41
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:316
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!...
Definition: message.h:130
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:48
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:78
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:135
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:126
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:375
bool data_changed
Indicator if data has changed.
Definition: interface.h:226
float sec_since_detection() const
Get sec_since_detection value.
const char * type() const
Get type of interface.
Definition: interface.cpp:640
void * data_ptr
Pointer to local memory storage.
Definition: interface.h:224
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:46
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:42
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:410
size_t maxlenof_slope() const
Get maximum length of slope value.
boolean field
Definition: types.h:37
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.
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:43
field with interface specific enum type
Definition: types.h:50
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.