60#ifndef guWhiteboard_VisionDetectionFeatures_h
61#define guWhiteboard_VisionDetectionFeatures_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_VisionDetectionFeatures_DEFINED
73#define guWhiteboard_VisionDetectionFeatures_DEFINED
75#undef VisionDetectionFeatures_DEFINED
76#define VisionDetectionFeatures_DEFINED
94 if (t_features != NULLPTR) {
108 this->init(t_frameNumber, t_features);
147 for (
int features_0_index = 0; features_0_index < 2; features_0_index++)
156 return !(*
this == t_other);
166 return !(*
this == t_other);
214#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
224#ifdef USE_WB_VISION_DETECTION_FEATURES_C_CONVERSION
227 std::string descr = buffer;
230 std::ostringstream ss;
233 bool features_first =
true;
237 features_first =
false;
245#ifdef USE_WB_VISION_DETECTION_FEATURES_C_CONVERSION
248 std::string toString = buffer;
251 std::ostringstream ss;
254 bool features_first =
true;
258 features_first =
false;
265#ifdef USE_WB_VISION_DETECTION_FEATURES_C_CONVERSION
270 char * str_cstr =
const_cast<char *
>(t_str.c_str());
271 size_t temp_length = strlen(str_cstr);
272 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
277 char* var_str = &var_str_buffer[0];
279 char* key = &key_buffer[0];
287 if (index == 0 && str_cstr[0] ==
'{') {
293 for (
int i = index; i < length; i++) {
295 if (bracecount == 0 && str_cstr[i] ==
'=') {
300 if (bracecount == 0 && isspace(str_cstr[i])) {
307 if (bracecount == 0 && str_cstr[i] ==
',') {
311 if (str_cstr[i] ==
'{') {
313 if (bracecount == 1) {
318 if (str_cstr[i] ==
'}') {
320 if (bracecount < 0) {
325 if (i == length - 1) {
329 if (endKey >= startKey && endKey - startKey < length) {
330 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
331 key[(endKey - startKey) + 1] = 0;
335 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
336 var_str[(index - startVar) + 1] = 0;
342 if (strlen(key) > 0) {
343 if (0 == strcmp(
"frameNumber", key)) {
345 }
else if (0 == strcmp(
"features", key)) {
364 int restartIndex = index;
365 index = lastBrace + 1;
371 for (
int i = index; i < length; i++) {
373 if (bracecount == 0 && str_cstr[i] ==
'=') {
378 if (bracecount == 0 && isspace(str_cstr[i])) {
385 if (bracecount == 0 && str_cstr[i] ==
',') {
389 if (str_cstr[i] ==
'{') {
393 if (str_cstr[i] ==
'}') {
395 if (bracecount < 0) {
400 if (i == length - 1) {
404 if (endKey >= startKey && endKey - startKey < length) {
405 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
406 key[(endKey - startKey) + 1] = 0;
410 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
411 var_str[(index - startVar) + 1] = 0;
422 index = restartIndex;
429 }
while(index < length);
Provides a C++ wrapper around wb_vision_detection_feature_array.
void from_string(const std::string &t_str)
Provides a C++ wrapper around wb_vision_detection_features.
void from_string(const std::string &t_str)
void set_features(const VisionDetectionFeatureArray &t_newValue, int t_i)
std::string description()
const VisionDetectionFeatureArray * features() const
bool operator!=(const VisionDetectionFeatures &t_other) const
bool operator==(const VisionDetectionFeatures &t_other) const
VisionDetectionFeatures(const VisionDetectionFeatures &t_other)
Copy Constructor.
void set_frameNumber(const uint64_t &t_newValue)
size_t features_size() const
void set_features(const VisionDetectionFeatureArray *t_newValue)
VisionDetectionFeatureArray & features(int t_i)
VisionDetectionFeatures(const std::string &t_str)
String Constructor.
const uint64_t & frameNumber() const
VisionDetectionFeatures(const struct wb_vision_detection_features &t_other)
Copy Constructor.
VisionDetectionFeatures(uint64_t t_frameNumber=0, const struct wb_vision_detection_feature_array t_features[2]=NULLPTR)
Create a new VisionDetectionFeatures.
const VisionDetectionFeatureArray & features(int t_i) const
VisionDetectionFeatures & operator=(const VisionDetectionFeatures &t_other)
Copy Assignment Operator.
Results for the Feature Detector (guvision).
Results for the Feature Detector (guvision).
struct wb_vision_detection_feature_array features[2]
Features reported for each camera.
uint64_t frameNumber
The frame number that these lines were seen in.
struct wb_vision_detection_features * wb_vision_detection_features_from_string(struct wb_vision_detection_features *self, const char *str)
Convert from a string.
const char * wb_vision_detection_features_description(const struct wb_vision_detection_features *self, char *descString, size_t bufferSize)
Convert to a description string.
const char * wb_vision_detection_features_to_string(const struct wb_vision_detection_features *self, char *toString, size_t bufferSize)
Convert to a string.
#define VISION_DETECTION_FEATURES_DESC_BUFFER_SIZE
#define VISION_DETECTION_FEATURES_TO_STRING_BUFFER_SIZE
#define VISION_DETECTION_FEATURES_FEATURES_ARRAY_SIZE
WHITEBOARD_POSTER_STRING_CONVERSION.