24 #include <fvutils/net/fuse_lut_content.h> 25 #include <fvutils/ipc/shm_lut.h> 27 #include <core/exceptions/system.h> 28 #include <core/exceptions/software.h> 31 #include <netinet/in.h> 53 void *payload,
size_t payload_size)
55 if ( (type != FUSE_MT_LUT) && (type != FUSE_MT_SET_LUT) ) {
57 type, FUSE_MT_LUT, FUSE_MT_SET_LUT);
67 __lut_id = (
char *)malloc(LUT_ID_MAX_LENGTH + 1);
68 __lut_id[LUT_ID_MAX_LENGTH] = 0;
69 strncpy(__lut_id, __header->
lut_id, LUT_ID_MAX_LENGTH);
71 __buffer_size = ntohl(__header->
width) * ntohl(__header->
height) *
85 if ( _payload == NULL ) {
92 strncpy(__header->
lut_id, b->
lut_id(), LUT_ID_MAX_LENGTH);
97 __lut_id = strdup(b->
lut_id());
100 memcpy(__buffer, b->
buffer(), __buffer_size);
116 unsigned int depth,
unsigned int bpc)
118 __buffer_size = width * height * depth * bpc;
122 if ( _payload == NULL ) {
129 strncpy(__header->
lut_id, lut_id, LUT_ID_MAX_LENGTH);
130 __header->
width = htonl(width);
131 __header->
height = htonl(height);
132 __header->
depth = htonl(depth);
134 __lut_id = strdup(lut_id);
136 memcpy(__buffer, buffer, __buffer_size);
140 FuseLutContent::~FuseLutContent()
171 return __buffer_size;
181 return ntohl(__header->
width);
191 return ntohl(__header->
height);
200 return ntohl(__header->
depth);
unsigned int depth() const
Depth of LUT.
const char * lut_id() const
Get LUT ID.
unsigned int width() const
Width of LUT.
size_t buffer_size() const
Get buffer size.
unsigned char * buffer() const
Get buffer.
FuseLutContent(const char *lut_id, void *buffer, unsigned int width, unsigned int height, unsigned int depth, unsigned int bpc)
Constructor.
virtual void * payload() const
Return pointer to payload.
unsigned int width() const
Get LUT width.
unsigned int bytes_per_cell() const
Get bytes per cell.
const char * lut_id() const
Get LUT ID.
unsigned int height() const
Height of LUT.
void * _payload
Pointer to payload.
unsigned int height() const
Get LUT height.
unsigned int bytes_per_cell() const
Bytes per cell in LUT.
virtual size_t payload_size() const
Return payload size.
unsigned int depth() const
Get LUT depth.
unsigned char * buffer() const
Get LUT buffer.
virtual void serialize()
Serialize message content.
Shared memory lookup table.
System ran out of memory and desired operation could not be fulfilled.
size_t _payload_size
Payloda size.