Fawkes API
Fawkes Development Version
|
24 #include <interfaces/CameraControlInterface.h>
26 #include <core/exceptions/software.h>
45 CameraControlInterface::CameraControlInterface() : Interface()
47 data_size =
sizeof(CameraControlInterface_data_t);
49 data = (CameraControlInterface_data_t *)
data_ptr;
52 enum_map_Effect[(int)EFF_NONE] =
"EFF_NONE";
53 enum_map_Effect[(int)EFF_PASTEL] =
"EFF_PASTEL";
54 enum_map_Effect[(int)EFF_NEGATIVE] =
"EFF_NEGATIVE";
55 enum_map_Effect[(int)EFF_BW] =
"EFF_BW";
56 enum_map_Effect[(int)EFF_SOLARIZE] =
"EFF_SOLARIZE";
68 unsigned char tmp_hash[] = {0xc, 0xc9, 0x4a, 0x24, 0x89, 0xb8, 0x9c, 0xd1, 0x7f, 0xf5, 0xc4, 0xa3, 0x41, 0xca, 0x9a, 0xc1};
73 CameraControlInterface::~CameraControlInterface()
85 case EFF_NONE:
return "EFF_NONE";
86 case EFF_PASTEL:
return "EFF_PASTEL";
87 case EFF_NEGATIVE:
return "EFF_NEGATIVE";
88 case EFF_BW:
return "EFF_BW";
89 case EFF_SOLARIZE:
return "EFF_SOLARIZE";
90 default:
return "UNKNOWN";
131 return data->effect_supported;
191 return data->zoom_supported;
221 return data->zoom_max;
251 return data->zoom_min;
311 return data->mirror_supported;
338 if ( strncmp(
"SetEffectMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
340 }
else if ( strncmp(
"SetZoomMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
342 }
else if ( strncmp(
"SetMirrorMessage",
type, INTERFACE_MESSAGE_TYPE_SIZE_ - 1) == 0 ) {
346 "message type for this interface type.",
type);
362 memcpy(data, oi->data,
sizeof(CameraControlInterface_data_t));
368 if (strcmp(enumtype,
"Effect") == 0) {
369 return tostring_Effect((
Effect)val);
387 data_size =
sizeof(SetEffectMessage_data_t);
390 data = (SetEffectMessage_data_t *)
data_ptr;
392 data->effect = ini_effect;
393 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
394 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
396 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
403 data_size =
sizeof(SetEffectMessage_data_t);
406 data = (SetEffectMessage_data_t *)
data_ptr;
408 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
409 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
411 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
430 data = (SetEffectMessage_data_t *)
data_ptr;
487 data_size =
sizeof(SetZoomMessage_data_t);
490 data = (SetZoomMessage_data_t *)
data_ptr;
492 data->zoom = ini_zoom;
493 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
494 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
496 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
503 data_size =
sizeof(SetZoomMessage_data_t);
506 data = (SetZoomMessage_data_t *)
data_ptr;
508 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
509 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
511 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
530 data = (SetZoomMessage_data_t *)
data_ptr;
587 data_size =
sizeof(SetMirrorMessage_data_t);
590 data = (SetMirrorMessage_data_t *)
data_ptr;
592 data->mirror = ini_mirror;
593 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
594 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
596 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
603 data_size =
sizeof(SetMirrorMessage_data_t);
606 data = (SetMirrorMessage_data_t *)
data_ptr;
608 enum_map_Effect[(int)
EFF_NONE] =
"EFF_NONE";
609 enum_map_Effect[(int)
EFF_PASTEL] =
"EFF_PASTEL";
611 enum_map_Effect[(int)
EFF_BW] =
"EFF_BW";
630 data = (SetMirrorMessage_data_t *)
data_ptr;
@ EFF_SOLARIZE
Enhanced Contrast.
void * data_ptr
Pointer to local memory storage.
Effect effect() const
Get effect value.
~SetZoomMessage()
Destructor.
const char * tostring_Effect(Effect value) const
Convert Effect constant to string.
@ EFF_NEGATIVE
Negative/Positive Reversal.
@ EFF_BW
Monochrome Image.
size_t maxlenof_zoom_min() const
Get maximum length of zoom_min value.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
bool is_mirror() const
Get mirror value.
void * data_ptr
Pointer to memory that contains local data.
size_t maxlenof_mirror() const
Get maximum length of mirror value.
SetEffectMessage Fawkes BlackBoard Interface Message.
void set_zoom_min(const uint32_t new_zoom_min)
Set zoom_min value.
@ IFT_ENUM
field with interface specific enum type
message_data_ts_t * data_ts
data timestamp aliasing pointer
SetZoomMessage()
Constructor.
SetMirrorMessage Fawkes BlackBoard Interface Message.
@ IFT_UINT32
32 bit unsigned integer field
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
size_t maxlenof_effect() const
Get maximum length of effect value.
const char * type() const
Get type of interface.
virtual Message * clone() const
Clone this message.
bool is_mirror() const
Get mirror value.
SetZoomMessage Fawkes BlackBoard Interface Message.
size_t maxlenof_zoom() const
Get maximum length of zoom value.
uint32_t zoom_min() const
Get zoom_min value.
Effect effect() const
Get effect value.
size_t maxlenof_mirror() const
Get maximum length of mirror value.
uint32_t zoom_max() const
Get zoom_max value.
Timestamp data, must be present and first entries for each interface data structs!...
void set_mirror(const bool new_mirror)
Set mirror value.
void set_zoom_supported(const bool new_zoom_supported)
Set zoom_supported value.
bool data_changed
Indicator if data has changed.
uint32_t zoom() const
Get zoom value.
bool is_mirror_supported() const
Get mirror_supported value.
Fawkes library namespace.
void set_effect(const Effect new_effect)
Set effect value.
void set_hash(unsigned char *ihash)
Set hash.
virtual Message * create_message(const char *type) const
Create message based on type name.
unsigned int data_size
Size of memory needed to hold all data.
void set_mirror(const bool new_mirror)
Set mirror value.
bool is_effect_supported() const
Get effect_supported value.
bool is_zoom_supported() const
Get zoom_supported value.
size_t maxlenof_zoom_supported() const
Get maximum length of zoom_supported value.
Base class for all Fawkes BlackBoard interfaces.
void set_zoom_max(const uint32_t new_zoom_max)
Set zoom_max value.
virtual void copy_values(const Interface *other)
Copy values from other interface.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
@ EFF_PASTEL
Pastel colors.
void set_effect_supported(const bool new_effect_supported)
Set effect_supported 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.
CameraControlInterface Fawkes BlackBoard Interface.
virtual Message * clone() const
Clone this message.
size_t maxlenof_zoom() const
Get maximum length of zoom value.
void set_effect(const Effect new_effect)
Set effect value.
size_t maxlenof_zoom_max() const
Get maximum length of zoom_max value.
size_t maxlenof_effect_supported() const
Get maximum length of effect_supported value.
void set_zoom(const uint32_t new_zoom)
Set zoom value.
SetMirrorMessage()
Constructor.
uint32_t zoom() const
Get zoom value.
SetEffectMessage()
Constructor.
~SetEffectMessage()
Destructor.
size_t maxlenof_effect() const
Get maximum length of effect value.
void add_messageinfo(const char *name)
Add an entry to the message info list.
size_t maxlenof_mirror_supported() const
Get maximum length of mirror_supported value.
virtual Message * clone() const
Clone this message.
Effect
Enumeration defining the possible effects.
bool change_field(FieldT &field, const DataT &value)
Set a field and return whether it changed.
void set_zoom(const uint32_t new_zoom)
Set zoom value.
~SetMirrorMessage()
Destructor.
void set_mirror_supported(const bool new_mirror_supported)
Set mirror_supported value.