1 #ifndef _ROS_sensor_msgs_CompressedImage_h
2 #define _ROS_sensor_msgs_CompressedImage_h
29 virtual int serialize(
unsigned char *outbuffer)
const
33 uint32_t length_format = strlen(this->
format);
34 memcpy(outbuffer + offset, &length_format,
sizeof(uint32_t));
36 memcpy(outbuffer + offset, this->
format, length_format);
37 offset += length_format;
39 *(outbuffer + offset++) = 0;
40 *(outbuffer + offset++) = 0;
41 *(outbuffer + offset++) = 0;
43 *(outbuffer + offset + 0) = (this->
data[i] >> (8 * 0)) & 0xFF;
44 offset +=
sizeof(this->
data[i]);
53 uint32_t length_format;
54 memcpy(&length_format, (inbuffer + offset),
sizeof(uint32_t));
56 for(
unsigned int k= offset; k< offset+length_format; ++k){
57 inbuffer[k-1]=inbuffer[k];
59 inbuffer[offset+length_format-1]=0;
60 this->
format = (
char *)(inbuffer + offset-1);
61 offset += length_format;
62 uint8_t data_lengthT = *(inbuffer + offset++);
64 this->
data = (uint8_t*)realloc(this->
data, data_lengthT *
sizeof(uint8_t));
68 this->
st_data = ((uint8_t) (*(inbuffer + offset)));
69 offset +=
sizeof(this->
st_data);
70 memcpy( &(this->
data[i]), &(this->
st_data),
sizeof(uint8_t));
75 const char *
getType(){
return "sensor_msgs/CompressedImage"; };
76 const char *
getMD5(){
return "8f7a12909da2c9d3332d540a0977563f"; };
const char * getType()
Definition: CompressedImage.h:75
uint8_t data_length
Definition: CompressedImage.h:18
uint8_t * data
Definition: CompressedImage.h:20
virtual int serialize(unsigned char *outbuffer) const
Definition: CompressedImage.h:29
Definition: CompressedImage.h:13
const char * format
Definition: CompressedImage.h:17
uint8_t st_data
Definition: CompressedImage.h:19
CompressedImage()
Definition: CompressedImage.h:22
virtual int deserialize(unsigned char *inbuffer)
Definition: CompressedImage.h:49
const char * getMD5()
Definition: CompressedImage.h:76
std_msgs::Header header
Definition: CompressedImage.h:16