24 #ifndef _FIREVISION_CAMS_FIREWIRE_H_
25 #define _FIREVISION_CAMS_FIREWIRE_H_
27 #include <dc1394/dc1394.h>
28 #include <fvcams/camera.h>
29 #include <fvcams/control/focus.h>
31 #ifndef __STDC_LIMIT_MACROS
32 # define __STDC_LIMIT_MACROS
36 namespace firevision {
38 class CameraArgumentParser;
44 dc1394video_mode_t mode = DC1394_VIDEO_MODE_640x480_YUV422,
45 dc1394speed_t speed = DC1394_ISO_SPEED_400,
62 virtual unsigned char *
buffer();
77 virtual unsigned int focus();
91 virtual void white_balance(
unsigned int *ub,
unsigned int *vr);
94 virtual void set_gain(
unsigned int gain);
100 virtual uint64_t
guid()
const;
101 virtual const char *
model()
const;
Camera focus control interface.
Camera interface for image aquiring devices in FireVision.
bool _do_set_shutter
true if the shutter should actually be set, false otherwise
int _format7_starty
Format7 ROI Start Y coordinate.
virtual void white_balance(unsigned int *ub, unsigned int *vr)
Get white balance values.
bool _device_opened
true if device has been opened, false otherwise
virtual void set_auto_focus(bool enabled)
Enable or disable auto focus.
virtual void print_info()
Print out camera information.
virtual unsigned int focus_max()
Get maximum focus value.
virtual const char * model() const
Get camera model.
virtual colorspace_t colorspace()
Colorspace of returned image.
bool _started
true if camera has been started, false otherwise
virtual unsigned int focus()
Get current focus value.
dc1394framerate_t _framerate
DC1394 framerate.
dc1394speed_t _speed
DC1394 speed.
virtual void close()
Close camera.
FirewireCamera(dc1394framerate_t framerate=DC1394_FRAMERATE_30, dc1394video_mode_t mode=DC1394_VIDEO_MODE_640x480_YUV422, dc1394speed_t speed=DC1394_ISO_SPEED_400, int num_buffers=8)
Constructor.
virtual void parse_set_white_balance(const char *white_balance)
Parse white balance and set value.
static void print_available_fwcams()
Print list of cameras.
bool _auto_focus
true if auto focus is enabled, false if disabled
unsigned int _white_balance_ub
White balance U/B value.
virtual unsigned int pixel_width()
Width of image in pixels.
virtual void set_auto_shutter(bool enabled)
Set status of auto shutter.
virtual void set_focus(unsigned int focus)
Set new focus value.
virtual void set_gain(unsigned int gain)
Set the gain.
bool _auto_gain
True, if gain is set automatically.
virtual void open_device()
Open the desired device.
int _format7_width
Format7 width.
int _format7_startx
Format7 ROI Start X coordinate.
virtual void set_image_number(unsigned int n)
Set image number to retrieve.
virtual void set_white_balance(unsigned int ub, unsigned int vr)
Set white balance values.
virtual void set_auto_white_balance(bool enabled)
Set status of auto white balance.
virtual void capture()
Capture an image.
dc1394camera_t * _camera
DC1394 camera handle.
virtual void parse_set_shutter(const char *shutter)
Parse shutter and set value.
virtual unsigned char * buffer()
Get access to current image buffer.
virtual unsigned int shutter()
Get shutter value.
virtual unsigned int pixel_height()
Height of image in pixels.
unsigned int _shutter
Shutter value.
dc1394_t * cobj() const
Get underlying libdc1394 C handle.
virtual void open()
Open the camera.
virtual unsigned int buffer_size()
Size of buffer.
char * _model
Camera model, used in open to identify the camera, if empty first found camera is used.
virtual bool auto_focus()
Check if auto focus is enabled.
dc1394_t * _dc1394
DC1394 main context.
bool _do_set_focus
true if the focus should actually be set, false otherwise
dc1394camera_t * camera_cobj() const
Get underlying libdc1394 camera C handle.
bool _valid_frame_received
true, if a valid frame has been received, false otherwise
bool _opened
true if camera has been opened, false otherwise
dc1394color_coding_t _format7_coding
Format7 color coding.
int _format7_bpp
Format7 bytes per packet.
bool _format7_mode_enabled
Indicator of Format7 status.
unsigned int _gain
Gain value.
bool iso_mode_enabled()
Check if ISO mode is enabled.
virtual bool ready()
Camera is ready for taking pictures.
virtual bool auto_white_balance()
Get status of auto white balance.
unsigned int _white_balance_vr
White balance V/R value.
virtual void start()
Start image transfer from the camera.
virtual ~FirewireCamera()
Empty destructor.
bool _do_set_white_balance
true if the white balance should actually be set, false otherwise
virtual uint64_t guid() const
Get Firewire GUID of camera.
int _format7_height
Format7 height.
dc1394video_mode_t _mode
DC1394 video mode.
virtual void stop()
Stop image transfer from the camera.
unsigned int _focus
Focus value.
virtual void dispose_buffer()
Dispose current buffer.
virtual void set_shutter(unsigned int shutter)
Set shutter value.
virtual unsigned int focus_min()
Get minimum focus value.
virtual bool auto_shutter()
Get status of auto shutter.
int _num_buffers
Number of DMA buffers.
virtual void parse_set_focus(const char *focus)
Parse focus and set value.
virtual void flush()
Flush image queue.
dc1394video_frame_t * _frame
Last captured DC1394 video frame.
bool _auto_white_balance
true if auto white balance is enabled, false if disabled
bool _auto_shutter
true if auto shutter is enabled, false if disabled