24 #ifndef __FIREVISION_FVUTILS_IPC_SHM_IMAGE_H_
25 #define __FIREVISION_FVUTILS_IPC_SHM_IMAGE_H_
27 #include <utils/ipc/shm.h>
28 #include <utils/ipc/shm_lister.h>
29 #include <utils/time/time.h>
31 #include <fvutils/ipc/defs.h>
32 #include <fvutils/color/colorspaces.h>
36 #define FIREVISION_SHM_IMAGE_MAGIC_TOKEN "FireVision Image"
46 char image_id[IMAGE_ID_MAX_LENGTH];
47 char frame_id[FRAME_ID_MAX_LENGTH];
63 unsigned int flag_circle_found : 1;
64 unsigned int flag_image_ready : 1;
65 unsigned int flag_reserved : 30;
74 colorspace_t colorspace,
81 virtual bool matches(
void *memptr);
82 virtual size_t size();
83 virtual void print_info();
84 virtual bool create();
85 virtual void initialize(
void *memptr);
86 virtual void set(
void *memptr);
88 virtual size_t data_size();
91 void set_image_id(
const char *image_id);
92 void set_frame_id(
const char *frame_id);
93 colorspace_t colorspace()
const;
94 unsigned int width()
const;
95 unsigned int height()
const;
96 const char * image_id()
const;
97 const char * frame_id()
const;
104 colorspace_t _colorspace;
106 unsigned int _height;
108 char *_orig_image_id;
109 char *_orig_frame_id;
110 colorspace_t _orig_colorspace;
111 unsigned int _orig_width;
112 unsigned int _orig_height;
124 virtual void print_header();
125 virtual void print_footer();
126 virtual void print_no_segments();
127 virtual void print_no_orphaned_segments();
129 int shm_id,
int semaphore,
130 unsigned int mem_size,
141 unsigned int width,
unsigned int height);
145 const char * image_id()
const;
146 const char * frame_id()
const;
147 unsigned char * buffer()
const;
148 colorspace_t colorspace()
const;
149 unsigned int width()
const;
150 unsigned int height()
const;
151 unsigned int roi_x()
const;
152 unsigned int roi_y()
const;
153 unsigned int roi_width()
const;
154 unsigned int roi_height()
const;
155 int circle_x()
const;
156 int circle_y()
const;
157 unsigned int circle_radius()
const;
158 bool circle_found()
const;
159 void set_roi_x(
unsigned int roi_x);
160 void set_roi_y(
unsigned int roi_y);
161 void set_roi_width(
unsigned int roi_w);
162 void set_roi_height(
unsigned int roi_h);
163 void set_roi(
unsigned int roi_x,
unsigned int roi_y,
164 unsigned int roi_w,
unsigned int roi_h);
165 void set_circle_x(
int circle_x);
166 void set_circle_y(
int circle_y);
167 void set_circle_radius(
unsigned int circle_radius);
168 void set_circle(
int x,
int y,
unsigned int r);
169 void set_circle_found(
bool found);
170 bool set_image_id(
const char *image_id);
171 void set_frame_id(
const char *frame_id);
174 void capture_time(
long int *sec,
long int *usec)
const;
176 void set_capture_time(
long int sec,
long int usec);
179 static void cleanup(
bool use_lister =
true);
180 static bool exists(
const char *image_id);
181 static void wipe(
const char *image_id);
184 void constructor(
const char *image_id, colorspace_t cspace,
185 unsigned int width,
unsigned int height,
192 colorspace_t _colorspace;
194 unsigned int _height;
A class for handling time.
Shared memory image buffer.
Format list output for shared memory segments.
Shared memory image buffer lister.