FacerInterface.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __INTERFACES_FACERINTERFACE_H_
00025 #define __INTERFACES_FACERINTERFACE_H_
00026
00027 #include <interface/interface.h>
00028 #include <interface/message.h>
00029 #include <interface/field_iterator.h>
00030
00031 namespace fawkes {
00032
00033 class FacerInterface : public Interface
00034 {
00035
00036 INTERFACE_MGMT_FRIENDS(FacerInterface)
00037
00038 public:
00039
00040
00041
00042
00043
00044 typedef enum {
00045 OPMODE_DISABLED ,
00046 OPMODE_DETECTION ,
00047 OPMODE_RECOGNITION ,
00048 OPMODE_LEARNING
00049 } if_facer_opmode_t;
00050 const char * tostring_if_facer_opmode_t(if_facer_opmode_t value) const;
00051
00052 private:
00053 #pragma pack(push,4)
00054
00055 typedef struct {
00056 int64_t timestamp_sec;
00057 int64_t timestamp_usec;
00058 if_facer_opmode_t opmode;
00059
00060
00061 uint32_t num_identities;
00062
00063
00064 uint32_t recognized_identity;
00065
00066
00067 char recognized_name[64];
00068
00069
00070 uint32_t num_detections;
00071
00072
00073 uint32_t num_recognitions;
00074
00075
00076 uint32_t most_likely_identity;
00077
00078
00079 float history_ratio;
00080
00081
00082
00083 float sec_since_detection;
00084
00085
00086 int32_t visibility_history;
00087
00088
00089
00090 bool learning_in_progress;
00091
00092
00093
00094 float recording_progress;
00095
00096
00097 float bearing;
00098
00099
00100 float slope;
00101
00102
00103 uint32_t requested_index;
00104
00105
00106 char requested_name[64];
00107
00108
00109 } FacerInterface_data_t;
00110 #pragma pack(pop)
00111
00112 FacerInterface_data_t *data;
00113
00114 public:
00115
00116 class LearnFaceMessage : public Message
00117 {
00118 private:
00119 #pragma pack(push,4)
00120
00121 typedef struct {
00122 int64_t timestamp_sec;
00123 int64_t timestamp_usec;
00124 char name[64];
00125 } LearnFaceMessage_data_t;
00126 #pragma pack(pop)
00127
00128 LearnFaceMessage_data_t *data;
00129
00130 public:
00131 LearnFaceMessage(const char * ini_name);
00132 LearnFaceMessage();
00133 ~LearnFaceMessage();
00134
00135 LearnFaceMessage(const LearnFaceMessage *m);
00136
00137 char * name() const;
00138 void set_name(const char * new_name);
00139 size_t maxlenof_name() const;
00140 virtual Message * clone() const;
00141 };
00142
00143 class SetOpmodeMessage : public Message
00144 {
00145 private:
00146 #pragma pack(push,4)
00147
00148 typedef struct {
00149 int64_t timestamp_sec;
00150 int64_t timestamp_usec;
00151 if_facer_opmode_t opmode;
00152
00153
00154 } SetOpmodeMessage_data_t;
00155 #pragma pack(pop)
00156
00157 SetOpmodeMessage_data_t *data;
00158
00159 public:
00160 SetOpmodeMessage(const if_facer_opmode_t ini_opmode);
00161 SetOpmodeMessage();
00162 ~SetOpmodeMessage();
00163
00164 SetOpmodeMessage(const SetOpmodeMessage *m);
00165
00166 if_facer_opmode_t opmode() const;
00167 void set_opmode(const if_facer_opmode_t new_opmode);
00168 size_t maxlenof_opmode() const;
00169 virtual Message * clone() const;
00170 };
00171
00172 class EnableIdentityMessage : public Message
00173 {
00174 private:
00175 #pragma pack(push,4)
00176
00177 typedef struct {
00178 int64_t timestamp_sec;
00179 int64_t timestamp_usec;
00180 uint32_t index;
00181 bool enable;
00182 } EnableIdentityMessage_data_t;
00183 #pragma pack(pop)
00184
00185 EnableIdentityMessage_data_t *data;
00186
00187 public:
00188 EnableIdentityMessage(const uint32_t ini_index, const bool ini_enable);
00189 EnableIdentityMessage();
00190 ~EnableIdentityMessage();
00191
00192 EnableIdentityMessage(const EnableIdentityMessage *m);
00193
00194 uint32_t index() const;
00195 void set_index(const uint32_t new_index);
00196 size_t maxlenof_index() const;
00197 bool is_enable() const;
00198 void set_enable(const bool new_enable);
00199 size_t maxlenof_enable() const;
00200 virtual Message * clone() const;
00201 };
00202
00203 class SetNameMessage : public Message
00204 {
00205 private:
00206 #pragma pack(push,4)
00207
00208 typedef struct {
00209 int64_t timestamp_sec;
00210 int64_t timestamp_usec;
00211 uint32_t index;
00212 char name[64];
00213 } SetNameMessage_data_t;
00214 #pragma pack(pop)
00215
00216 SetNameMessage_data_t *data;
00217
00218 public:
00219 SetNameMessage(const uint32_t ini_index, const char * ini_name);
00220 SetNameMessage();
00221 ~SetNameMessage();
00222
00223 SetNameMessage(const SetNameMessage *m);
00224
00225 uint32_t index() const;
00226 void set_index(const uint32_t new_index);
00227 size_t maxlenof_index() const;
00228 char * name() const;
00229 void set_name(const char * new_name);
00230 size_t maxlenof_name() const;
00231 virtual Message * clone() const;
00232 };
00233
00234 class GetNameMessage : public Message
00235 {
00236 private:
00237 #pragma pack(push,4)
00238
00239 typedef struct {
00240 int64_t timestamp_sec;
00241 int64_t timestamp_usec;
00242 uint32_t index;
00243 } GetNameMessage_data_t;
00244 #pragma pack(pop)
00245
00246 GetNameMessage_data_t *data;
00247
00248 public:
00249 GetNameMessage(const uint32_t ini_index);
00250 GetNameMessage();
00251 ~GetNameMessage();
00252
00253 GetNameMessage(const GetNameMessage *m);
00254
00255 uint32_t index() const;
00256 void set_index(const uint32_t new_index);
00257 size_t maxlenof_index() const;
00258 virtual Message * clone() const;
00259 };
00260
00261 virtual bool message_valid(const Message *message) const;
00262 private:
00263 FacerInterface();
00264 ~FacerInterface();
00265
00266 public:
00267
00268 if_facer_opmode_t opmode() const;
00269 void set_opmode(const if_facer_opmode_t new_opmode);
00270 size_t maxlenof_opmode() const;
00271 uint32_t num_identities() const;
00272 void set_num_identities(const uint32_t new_num_identities);
00273 size_t maxlenof_num_identities() const;
00274 uint32_t recognized_identity() const;
00275 void set_recognized_identity(const uint32_t new_recognized_identity);
00276 size_t maxlenof_recognized_identity() const;
00277 char * recognized_name() const;
00278 void set_recognized_name(const char * new_recognized_name);
00279 size_t maxlenof_recognized_name() const;
00280 uint32_t num_detections() const;
00281 void set_num_detections(const uint32_t new_num_detections);
00282 size_t maxlenof_num_detections() const;
00283 uint32_t num_recognitions() const;
00284 void set_num_recognitions(const uint32_t new_num_recognitions);
00285 size_t maxlenof_num_recognitions() const;
00286 uint32_t most_likely_identity() const;
00287 void set_most_likely_identity(const uint32_t new_most_likely_identity);
00288 size_t maxlenof_most_likely_identity() const;
00289 float history_ratio() const;
00290 void set_history_ratio(const float new_history_ratio);
00291 size_t maxlenof_history_ratio() const;
00292 float sec_since_detection() const;
00293 void set_sec_since_detection(const float new_sec_since_detection);
00294 size_t maxlenof_sec_since_detection() const;
00295 int32_t visibility_history() const;
00296 void set_visibility_history(const int32_t new_visibility_history);
00297 size_t maxlenof_visibility_history() const;
00298 bool is_learning_in_progress() const;
00299 void set_learning_in_progress(const bool new_learning_in_progress);
00300 size_t maxlenof_learning_in_progress() const;
00301 float recording_progress() const;
00302 void set_recording_progress(const float new_recording_progress);
00303 size_t maxlenof_recording_progress() const;
00304 float bearing() const;
00305 void set_bearing(const float new_bearing);
00306 size_t maxlenof_bearing() const;
00307 float slope() const;
00308 void set_slope(const float new_slope);
00309 size_t maxlenof_slope() const;
00310 uint32_t requested_index() const;
00311 void set_requested_index(const uint32_t new_requested_index);
00312 size_t maxlenof_requested_index() const;
00313 char * requested_name() const;
00314 void set_requested_name(const char * new_requested_name);
00315 size_t maxlenof_requested_name() const;
00316 virtual Message * create_message(const char *type) const;
00317
00318 virtual void copy_values(const Interface *other);
00319 virtual const char * enum_tostring(const char *enumtype, int val) const;
00320
00321 };
00322
00323 }
00324
00325 #endif