60#ifndef guWhiteboard_MemoryImageControlStatus_h
61#define guWhiteboard_MemoryImageControlStatus_h
63#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
72#undef guWhiteboard_MemoryImageControlStatus_DEFINED
73#define guWhiteboard_MemoryImageControlStatus_DEFINED
75#undef MemoryImageControlStatus_DEFINED
76#define MemoryImageControlStatus_DEFINED
102 this->init(t_res_width, t_res_height, t_pixelFormat);
144 return !(*
this == t_other);
154 return !(*
this == t_other);
202#ifdef WHITEBOARD_POSTER_STRING_CONVERSION
212#ifdef USE_WB_MEMORY_IMAGE_CONTROL_STATUS_C_CONVERSION
215 std::string descr = buffer;
218 std::ostringstream ss;
219 ss <<
"res_width=" <<
static_cast<unsigned>(this->
res_width());
221 ss <<
"res_height=" <<
static_cast<unsigned>(this->
res_height());
226 ss <<
"pixelFormat=" <<
"MI_BGRA";
231 ss <<
"pixelFormat=" <<
"MI_RGBA";
236 ss <<
"pixelFormat=" <<
"MI_UYV422";
245#ifdef USE_WB_MEMORY_IMAGE_CONTROL_STATUS_C_CONVERSION
248 std::string toString = buffer;
251 std::ostringstream ss;
252 ss << static_cast<unsigned>(this->
res_width());
254 ss << static_cast<unsigned>(this->
res_height());
277#ifdef USE_WB_MEMORY_IMAGE_CONTROL_STATUS_C_CONVERSION
282 char * str_cstr =
const_cast<char *
>(t_str.c_str());
283 size_t temp_length = strlen(str_cstr);
284 int length = (temp_length <= INT_MAX) ? static_cast<int>(
static_cast<ssize_t
>(temp_length)) : -1;
289 char* var_str = &var_str_buffer[0];
291 char* key = &key_buffer[0];
298 if (index == 0 && str_cstr[0] ==
'{') {
304 for (
int i = index; i < length; i++) {
306 if (bracecount == 0 && str_cstr[i] ==
'=') {
311 if (bracecount == 0 && isspace(str_cstr[i])) {
318 if (bracecount == 0 && str_cstr[i] ==
',') {
322 if (str_cstr[i] ==
'{') {
326 if (str_cstr[i] ==
'}') {
328 if (bracecount < 0) {
333 if (i == length - 1) {
337 if (endKey >= startKey && endKey - startKey < length) {
338 strncpy(key, str_cstr + startKey,
static_cast<size_t>((endKey - startKey) + 1));
339 key[(endKey - startKey) + 1] = 0;
343 strncpy(var_str, str_cstr + startVar,
static_cast<size_t>((index - startVar) + 1));
344 var_str[(index - startVar) + 1] = 0;
350 if (strlen(key) > 0) {
351 if (0 == strcmp(
"res_width", key)) {
353 }
else if (0 == strcmp(
"res_height", key)) {
355 }
else if (0 == strcmp(
"pixelFormat", key)) {
375 if (strcmp(
"MI_BGRA", var_str) == 0) {
376#pragma clang diagnostic push
377#pragma clang diagnostic ignored "-Wbad-function-cast"
379#pragma clang diagnostic pop
380 }
else if (strcmp(
"MI_RGBA", var_str) == 0) {
381#pragma clang diagnostic push
382#pragma clang diagnostic ignored "-Wbad-function-cast"
384#pragma clang diagnostic pop
385 }
else if (strcmp(
"MI_UYV422", var_str) == 0) {
386#pragma clang diagnostic push
387#pragma clang diagnostic ignored "-Wbad-function-cast"
389#pragma clang diagnostic pop
391#pragma clang diagnostic push
392#pragma clang diagnostic ignored "-Wbad-function-cast"
394#pragma clang diagnostic pop
402 }
while(index < length);
Provides a C++ wrapper around wb_memory_image_control_status.
MemoryImageControlStatus(const std::string &t_str)
String Constructor.
MemoryImageControlStatus(uint16_t t_res_width=0, uint16_t t_res_height=0, enum MemoryImagePixelFormat t_pixelFormat=MI_RGBA)
Create a new MemoryImageControlStatus.
const uint16_t & res_width() const
MemoryImageControlStatus(const MemoryImageControlStatus &t_other)
Copy Constructor.
void set_pixelFormat(const enum MemoryImagePixelFormat &t_newValue)
MemoryImageControlStatus & operator=(const MemoryImageControlStatus &t_other)
Copy Assignment Operator.
void set_res_height(const uint16_t &t_newValue)
MemoryImageControlStatus(const struct wb_memory_image_control_status &t_other)
Copy Constructor.
const uint16_t & res_height() const
enum MemoryImagePixelFormat & pixelFormat() const
void set_res_width(const uint16_t &t_newValue)
bool operator!=(const MemoryImageControlStatus &t_other) const
enum MemoryImagePixelFormat & pixelFormat()
std::string description()
bool operator==(const MemoryImageControlStatus &t_other) const
void from_string(const std::string &t_str)
WHITEBOARD_POSTER_STRING_CONVERSION.
uint16_t res_height
The resolution height.
enum MemoryImagePixelFormat pixelFormat
The pixel format of the images.
uint16_t res_width
The resolution width.
const char * wb_memory_image_control_status_to_string(const struct wb_memory_image_control_status *self, char *toString, size_t bufferSize)
Convert to a string.
const char * wb_memory_image_control_status_description(const struct wb_memory_image_control_status *self, char *descString, size_t bufferSize)
Convert to a description string.
struct wb_memory_image_control_status * wb_memory_image_control_status_from_string(struct wb_memory_image_control_status *self, const char *str)
Convert from a string.
#define MEMORY_IMAGE_CONTROL_STATUS_TO_STRING_BUFFER_SIZE
#define MEMORY_IMAGE_CONTROL_STATUS_DESC_BUFFER_SIZE