55 #ifndef vp1394TwoGrabber_h 56 #define vp1394TwoGrabber_h 58 #include <visp3/core/vpConfig.h> 62 #if defined(VISP_HAVE_DC1394) 178 #include <dc1394/control.h> 179 #include <dc1394/utils.h> 180 #include <dc1394/vendor/avt.h> 182 #include <visp3/core/vpFrameGrabber.h> 183 #include <visp3/core/vpImage.h> 184 #include <visp3/core/vpRGBa.h> 190 static const char *strVideoMode[DC1394_VIDEO_MODE_NUM];
191 static const char *strFramerate[DC1394_FRAMERATE_NUM];
192 static const char *strColorCoding[DC1394_COLOR_CODING_NUM];
199 vpISO_SPEED_100 = DC1394_ISO_SPEED_100,
200 vpISO_SPEED_200 = DC1394_ISO_SPEED_200,
201 vpISO_SPEED_400 = DC1394_ISO_SPEED_400,
202 vpISO_SPEED_800 = DC1394_ISO_SPEED_800,
203 vpISO_SPEED_1600 = DC1394_ISO_SPEED_1600,
204 vpISO_SPEED_3200 = DC1394_ISO_SPEED_3200
212 vpVIDEO_MODE_160x120_YUV444 = DC1394_VIDEO_MODE_160x120_YUV444,
213 vpVIDEO_MODE_320x240_YUV422 = DC1394_VIDEO_MODE_320x240_YUV422,
214 vpVIDEO_MODE_640x480_YUV411 = DC1394_VIDEO_MODE_640x480_YUV411,
215 vpVIDEO_MODE_640x480_YUV422 = DC1394_VIDEO_MODE_640x480_YUV422,
216 vpVIDEO_MODE_640x480_RGB8 = DC1394_VIDEO_MODE_640x480_RGB8,
217 vpVIDEO_MODE_640x480_MONO8 = DC1394_VIDEO_MODE_640x480_MONO8,
218 vpVIDEO_MODE_640x480_MONO16 = DC1394_VIDEO_MODE_640x480_MONO16,
219 vpVIDEO_MODE_800x600_YUV422 = DC1394_VIDEO_MODE_800x600_YUV422,
220 vpVIDEO_MODE_800x600_RGB8 = DC1394_VIDEO_MODE_800x600_RGB8,
221 vpVIDEO_MODE_800x600_MONO8 = DC1394_VIDEO_MODE_800x600_MONO8,
222 vpVIDEO_MODE_1024x768_YUV422 = DC1394_VIDEO_MODE_1024x768_YUV422,
223 vpVIDEO_MODE_1024x768_RGB8 = DC1394_VIDEO_MODE_1024x768_RGB8,
224 vpVIDEO_MODE_1024x768_MONO8 = DC1394_VIDEO_MODE_1024x768_MONO8,
225 vpVIDEO_MODE_800x600_MONO16 = DC1394_VIDEO_MODE_800x600_MONO16,
226 vpVIDEO_MODE_1024x768_MONO16 = DC1394_VIDEO_MODE_1024x768_MONO16,
227 vpVIDEO_MODE_1280x960_YUV422 = DC1394_VIDEO_MODE_1280x960_YUV422,
228 vpVIDEO_MODE_1280x960_RGB8 = DC1394_VIDEO_MODE_1280x960_RGB8,
229 vpVIDEO_MODE_1280x960_MONO8 = DC1394_VIDEO_MODE_1280x960_MONO8,
230 vpVIDEO_MODE_1600x1200_YUV422 = DC1394_VIDEO_MODE_1600x1200_YUV422,
231 vpVIDEO_MODE_1600x1200_RGB8 = DC1394_VIDEO_MODE_1600x1200_RGB8,
232 vpVIDEO_MODE_1600x1200_MONO8 = DC1394_VIDEO_MODE_1600x1200_MONO8,
233 vpVIDEO_MODE_1280x960_MONO16 = DC1394_VIDEO_MODE_1280x960_MONO16,
234 vpVIDEO_MODE_1600x1200_MONO16 = DC1394_VIDEO_MODE_1600x1200_MONO16,
235 vpVIDEO_MODE_EXIF = DC1394_VIDEO_MODE_EXIF,
236 vpVIDEO_MODE_FORMAT7_0 = DC1394_VIDEO_MODE_FORMAT7_0,
237 vpVIDEO_MODE_FORMAT7_1 = DC1394_VIDEO_MODE_FORMAT7_1,
238 vpVIDEO_MODE_FORMAT7_2 = DC1394_VIDEO_MODE_FORMAT7_2,
239 vpVIDEO_MODE_FORMAT7_3 = DC1394_VIDEO_MODE_FORMAT7_3,
240 vpVIDEO_MODE_FORMAT7_4 = DC1394_VIDEO_MODE_FORMAT7_4,
241 vpVIDEO_MODE_FORMAT7_5 = DC1394_VIDEO_MODE_FORMAT7_5,
242 vpVIDEO_MODE_FORMAT7_6 = DC1394_VIDEO_MODE_FORMAT7_6,
243 vpVIDEO_MODE_FORMAT7_7 = DC1394_VIDEO_MODE_FORMAT7_7
251 vpFRAMERATE_1_875 = DC1394_FRAMERATE_1_875,
252 vpFRAMERATE_3_75 = DC1394_FRAMERATE_3_75,
253 vpFRAMERATE_7_5 = DC1394_FRAMERATE_7_5,
254 vpFRAMERATE_15 = DC1394_FRAMERATE_15,
255 vpFRAMERATE_30 = DC1394_FRAMERATE_30,
256 vpFRAMERATE_60 = DC1394_FRAMERATE_60,
257 vpFRAMERATE_120 = DC1394_FRAMERATE_120,
258 vpFRAMERATE_240 = DC1394_FRAMERATE_240
266 vpCOLOR_CODING_MONO8 = DC1394_COLOR_CODING_MONO8,
267 vpCOLOR_CODING_YUV411 = DC1394_COLOR_CODING_YUV411,
268 vpCOLOR_CODING_YUV422 = DC1394_COLOR_CODING_YUV422,
269 vpCOLOR_CODING_YUV444 = DC1394_COLOR_CODING_YUV444,
270 vpCOLOR_CODING_RGB8 = DC1394_COLOR_CODING_RGB8,
271 vpCOLOR_CODING_MONO16 = DC1394_COLOR_CODING_MONO16,
272 vpCOLOR_CODING_RGB16 = DC1394_COLOR_CODING_RGB16,
273 vpCOLOR_CODING_MONO16S = DC1394_COLOR_CODING_MONO16S,
274 vpCOLOR_CODING_RGB16S = DC1394_COLOR_CODING_RGB16S,
275 vpCOLOR_CODING_RAW8 = DC1394_COLOR_CODING_RAW8,
276 vpCOLOR_CODING_RAW16 = DC1394_COLOR_CODING_RAW16
284 vpFEATURE_BRIGHTNESS = DC1394_FEATURE_BRIGHTNESS,
285 vpFEATURE_EXPOSURE = DC1394_FEATURE_EXPOSURE,
286 vpFEATURE_SHARPNESS = DC1394_FEATURE_SHARPNESS,
288 vpFEATURE_HUE = DC1394_FEATURE_HUE,
289 vpFEATURE_SATURATION = DC1394_FEATURE_SATURATION,
290 vpFEATURE_GAMMA = DC1394_FEATURE_GAMMA,
291 vpFEATURE_SHUTTER = DC1394_FEATURE_SHUTTER,
292 vpFEATURE_GAIN = DC1394_FEATURE_GAIN,
293 vpFEATURE_IRIS = DC1394_FEATURE_IRIS,
335 } vpDc1394TwoCameraParametersData;
369 static std::string colorCoding2string(vp1394TwoColorCodingType colorcoding);
371 dc1394video_frame_t *dequeue();
375 dc1394video_frame_t *dequeue(
vpImage<vpRGBa> &I, uint64_t ×tamp, uint32_t &
id);
376 void enqueue(dc1394video_frame_t *frame);
378 static std::string framerate2string(vp1394TwoFramerateType fps);
380 void getAutoGain(
unsigned int &minvalue,
unsigned int &maxvalue);
381 void getAutoShutter(
unsigned int &minvalue,
unsigned int &maxvalue);
383 uint64_t getCamera();
384 void getCamera(uint64_t &camera);
385 void getColorCoding(vp1394TwoColorCodingType &coding);
386 uint32_t getColorCodingSupported(vp1394TwoVideoModeType videomode, std::list<vp1394TwoColorCodingType> &codings);
387 void getFramerate(vp1394TwoFramerateType &fps);
388 uint32_t getFramerateSupported(vp1394TwoVideoModeType videomode, std::list<vp1394TwoFramerateType> &fps);
390 void getGuid(uint64_t &guid);
393 void getNumCameras(
unsigned int &ncameras)
const;
394 unsigned int getNumCameras()
const;
395 unsigned int getParameterValue(vp1394TwoParametersType param);
396 unsigned int getRingBufferSize()
const;
397 void getVideoMode(vp1394TwoVideoModeType &videomode);
398 uint32_t getVideoModeSupported(std::list<vp1394TwoVideoModeType> &videomodes);
403 bool isColorCodingSupported(vp1394TwoVideoModeType videomode, vp1394TwoColorCodingType coding);
404 bool isFramerateSupported(vp1394TwoVideoModeType videomode, vp1394TwoFramerateType fps);
405 bool isVideoModeSupported(vp1394TwoVideoModeType videomode);
406 bool isVideoModeFormat7(vp1394TwoVideoModeType videomode);
414 void printCameraInfo();
418 void setAutoGain(
bool enable =
true);
419 void setAutoGain(
unsigned int minvalue,
unsigned int maxvalue);
420 void setAutoShutter(
bool enable =
true);
421 void setAutoShutter(
unsigned int minvalue,
unsigned int maxvalue);
422 void setCamera(uint64_t camera);
423 void setColorCoding(vp1394TwoColorCodingType coding);
424 void setFormat7ROI(
unsigned int left = 0,
unsigned int top = 0,
unsigned int width = 0,
unsigned int height = 0);
425 void setFramerate(vp1394TwoFramerateType fps);
426 void setIsoTransmissionSpeed(vp1394TwoIsoSpeedType isospeed);
427 void setPanControl(
unsigned int panControlValue);
428 void setParameterValue(vp1394TwoParametersType param,
unsigned int val);
429 void setRingBufferSize(
unsigned int size);
430 void setVideoMode(vp1394TwoVideoModeType videomode);
432 static vp1394TwoVideoModeType string2videoMode(std::string videomode);
433 static vp1394TwoFramerateType string2framerate(std::string fps);
434 static vp1394TwoColorCodingType string2colorCoding(std::string colorcoding);
436 static std::string videoMode2string(vp1394TwoVideoModeType videomode);
440 void initialize(
bool reset);
441 void setCapture(dc1394switch_t _switch);
442 void setTransmission(dc1394switch_t _switch);
443 inline void updateDataCamToStruct();
444 inline void updateDataStructToCam();
447 dc1394camera_t *camera, **cameras;
448 unsigned int num_cameras;
449 unsigned int camera_id;
453 unsigned int num_buffers;
456 bool *isDataModified;
457 dc1394feature_mode_t *initialShutterMode;
458 vpDc1394TwoCameraParametersData *dataCam;
460 #ifdef VISP_HAVE_DC1394_CAMERA_ENUMERATE 462 dc1394camera_list_t *list;
virtual void open(vpImage< unsigned char > &I)=0
unsigned int getWidth() const
Return the number of columns in the image.
Base class for all video devices. It is designed to provide a front end to video sources.
Class for firewire ieee1394 video devices using libdc1394-2.x api.
virtual void acquire(vpImage< unsigned char > &I)=0
unsigned int getHeight() const
Return the number of rows in the image.