Fawkes API
Fawkes Development Version
|
#include <>>
Public Member Functions | |
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. More... | |
FirewireCamera (const CameraArgumentParser *cap) | |
Constructor. More... | |
virtual | ~FirewireCamera () |
Empty destructor. More... | |
virtual void | open_device () |
Open the desired device. More... | |
virtual void | open () |
virtual void | start () |
virtual void | stop () |
virtual void | close () |
virtual void | flush () |
virtual void | capture () |
virtual void | print_info () |
virtual bool | ready () |
virtual unsigned char * | buffer () |
virtual unsigned int | buffer_size () |
virtual void | dispose_buffer () |
virtual unsigned int | pixel_width () |
virtual unsigned int | pixel_height () |
virtual colorspace_t | colorspace () |
virtual void | set_image_number (unsigned int n) |
bool | iso_mode_enabled () |
Check if ISO mode is enabled. More... | |
virtual bool | auto_focus () |
virtual void | set_auto_focus (bool enabled) |
virtual unsigned int | focus () |
virtual void | set_focus (unsigned int focus) |
virtual unsigned int | focus_min () |
virtual unsigned int | focus_max () |
virtual bool | auto_shutter () |
Get status of auto shutter. More... | |
virtual void | set_auto_shutter (bool enabled) |
Set status of auto shutter. More... | |
virtual unsigned int | shutter () |
Get shutter value. More... | |
virtual void | set_shutter (unsigned int shutter) |
Set shutter value. More... | |
virtual bool | auto_white_balance () |
Get status of auto white balance. More... | |
virtual void | set_auto_white_balance (bool enabled) |
Set status of auto white balance. More... | |
virtual void | white_balance (unsigned int *ub, unsigned int *vr) |
Get white balance values. More... | |
virtual void | set_white_balance (unsigned int ub, unsigned int vr) |
Set white balance values. More... | |
virtual void | set_gain (unsigned int gain) |
Set the gain. More... | |
virtual void | parse_set_focus (const char *focus) |
Parse focus and set value. More... | |
virtual void | parse_set_white_balance (const char *white_balance) |
Parse white balance and set value. More... | |
virtual void | parse_set_shutter (const char *shutter) |
Parse shutter and set value. More... | |
virtual uint64_t | guid () const |
Get Firewire GUID of camera. More... | |
virtual const char * | model () const |
Get camera model. More... | |
dc1394_t * | cobj () const |
Get underlying libdc1394 C handle. More... | |
dc1394camera_t * | camera_cobj () const |
Get underlying libdc1394 camera C handle. More... | |
![]() | |
virtual | ~Camera () |
Virtual empty destructor. More... | |
virtual fawkes::Time * | capture_time () |
Get the Time of the last successfully captured image. More... | |
![]() | |
virtual | ~CameraControlFocus () |
Empty virtual destructor. More... | |
![]() | |
virtual | ~CameraControl () |
Virtual empty destructor. More... | |
Static Public Member Functions | |
static void | print_available_fwcams () |
Print list of cameras. More... | |
Protected Attributes | |
int | _num_buffers |
Number of DMA buffers. More... | |
bool | _device_opened |
true if device has been opened, false otherwise More... | |
bool | _opened |
true if camera has been opened, false otherwise More... | |
bool | _started |
true if camera has been started, false otherwise More... | |
bool | _auto_focus |
true if auto focus is enabled, false if disabled More... | |
bool | _auto_shutter |
true if auto shutter is enabled, false if disabled More... | |
bool | _auto_white_balance |
true if auto white balance is enabled, false if disabled More... | |
bool | _valid_frame_received |
true, if a valid frame has been received, false otherwise More... | |
bool | _do_set_shutter |
true if the shutter should actually be set, false otherwise More... | |
bool | _do_set_white_balance |
true if the white balance should actually be set, false otherwise More... | |
bool | _do_set_focus |
true if the focus should actually be set, false otherwise More... | |
dc1394_t * | _dc1394 |
DC1394 main context. More... | |
dc1394video_mode_t | _mode |
DC1394 video mode. More... | |
bool | _format7_mode_enabled |
Indicator of Format7 status. More... | |
dc1394speed_t | _speed |
DC1394 speed. More... | |
dc1394framerate_t | _framerate |
DC1394 framerate. More... | |
dc1394camera_t * | _camera |
DC1394 camera handle. More... | |
dc1394video_frame_t * | _frame |
Last captured DC1394 video frame. More... | |
dc1394color_coding_t | _format7_coding |
Format7 color coding. More... | |
int | _format7_bpp |
Format7 bytes per packet. More... | |
int | _format7_width |
Format7 width. More... | |
int | _format7_height |
Format7 height. More... | |
int | _format7_startx |
Format7 ROI Start X coordinate. More... | |
int | _format7_starty |
Format7 ROI Start Y coordinate. More... | |
unsigned int | _white_balance_ub |
White balance U/B value. More... | |
unsigned int | _white_balance_vr |
White balance V/R value. More... | |
unsigned int | _shutter |
Shutter value. More... | |
unsigned int | _focus |
Focus value. More... | |
unsigned int | _gain |
Gain value. More... | |
bool | _auto_gain |
True, if gain is set automatically. More... | |
char * | _model |
Camera model, used in open to identify the camera, if empty first found camera is used. More... | |
Firewire camera. This camera implementation allows for access to IEEE1394 cameras via libdc1394.
Definition at line 39 of file firewire.h.
firevision::FirewireCamera::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.
framerate | desired framerate |
mode | desired mode |
speed | IEEE 1394 speed |
num_buffers | number of DMA buffers |
Definition at line 56 of file firewire.cpp.
firevision::FirewireCamera::FirewireCamera | ( | const CameraArgumentParser * | cap | ) |
Constructor.
Initialize and take parameters from camera argument parser. The following arguments are supported:
cap | camera argument parser |
Definition at line 841 of file firewire.cpp.
References firevision::CameraArgumentParser::cam_id(), firevision::CameraArgumentParser::get(), and firevision::CameraArgumentParser::has().
|
virtual |
Empty destructor.
Definition at line 92 of file firewire.cpp.
|
virtual |
Check if auto focus is enabled.
NotImplementedException | Not implemented by this control |
Implements firevision::CameraControlFocus.
Definition at line 538 of file firewire.cpp.
|
virtual |
Get status of auto shutter.
Definition at line 602 of file firewire.cpp.
|
virtual |
Get status of auto white balance.
Definition at line 649 of file firewire.cpp.
|
virtual |
Get access to current image buffer. This will return a pointer to the current buffer. The buffer contains an image of the given colorspace, width and height.
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera.
Definition at line 364 of file firewire.cpp.
|
virtual |
Size of buffer. Gets the size in bytes of the buffer returned by buffer().
Implements firevision::Camera.
Definition at line 374 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::open().
|
inline |
Get underlying libdc1394 camera C handle.
Definition at line 115 of file firewire.h.
References _camera.
|
virtual |
Capture an image. Although cameras shall operate with a continuous image flow where possible sometimes capturing an image means copying a buffer or advancing a buffer list pointer. This shall be done in this method. For a camera-using application it is mandatory to call capture() just before accessing the image buffer.
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera.
Definition at line 329 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::capture().
|
virtual |
Close camera. This closes the camera device. The camera must have been stopped before calling close().
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera.
Definition at line 384 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::close().
|
inline |
Get underlying libdc1394 C handle.
Definition at line 107 of file firewire.h.
References _dc1394.
|
virtual |
Colorspace of returned image.
Implements firevision::Camera.
Definition at line 452 of file firewire.cpp.
|
virtual |
Dispose current buffer. Some cameras need disposal of the current buffer (for example to free space in a queue to retrieve the next image). This is done with this method. It has to be called after all work has been done on the image as desired. After dispose_buffer() has been called no further access may happen to the image buffer or undesired behavior may happen.
Implements firevision::Camera.
Definition at line 400 of file firewire.cpp.
Referenced by Bumblebee2Thread::loop().
|
virtual |
Flush image queue. Some cameras may have an image buffer queue. With this it can happen that if the processing of an image took longer than desired it is needed to flush this buffer queue.
Implements firevision::Camera.
Definition at line 355 of file firewire.cpp.
|
virtual |
Get current focus value.
Implements firevision::CameraControlFocus.
Definition at line 544 of file firewire.cpp.
|
virtual |
Get maximum focus value.
Implements firevision::CameraControlFocus.
Definition at line 573 of file firewire.cpp.
|
virtual |
Get minimum focus value.
Implements firevision::CameraControlFocus.
Definition at line 561 of file firewire.cpp.
|
virtual |
Get Firewire GUID of camera.
Definition at line 306 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::print_info(), and firevision::Bumblebee2Camera::verify_guid().
bool firevision::FirewireCamera::iso_mode_enabled | ( | ) |
Check if ISO mode is enabled.
Exception | thrown if the transmission status could not be determined |
Definition at line 268 of file firewire.cpp.
|
virtual |
Get camera model.
Definition at line 319 of file firewire.cpp.
|
virtual |
Open the camera. The camera is opened, but image transfer not yet started. This can be used to detect general problems with the camera while delaying the real transfer startup until it is needed.
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera, and firevision::PikeCamera.
Definition at line 147 of file firewire.cpp.
Referenced by firevision::PikeCamera::open(), and firevision::Bumblebee2Camera::open().
|
virtual |
Open the desired device.
This only opens the device but does not do any initialization.
Reimplemented in firevision::Bumblebee2Camera.
Definition at line 105 of file firewire.cpp.
|
virtual |
Parse focus and set value.
Parses the given string for a valid focus value and sets it.
focus | string representation of value |
Definition at line 713 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
virtual |
Parse shutter and set value.
Parses the given string for a valid shutter value and sets it.
shutter | string representation of value |
Definition at line 780 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
virtual |
Parse white balance and set value.
Parses the given string for a valid white balance value and sets it.
white_balance | string representation of value |
Definition at line 739 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
virtual |
Height of image in pixels.
Implements firevision::Camera.
Definition at line 430 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::decode_bayer(), firevision::Bumblebee2Camera::deinterlace_stereo(), Bumblebee2Thread::init(), and firevision::Bumblebee2Camera::open().
|
virtual |
Width of image in pixels.
Implements firevision::Camera.
Definition at line 408 of file firewire.cpp.
Referenced by firevision::Bumblebee2Camera::decode_bayer(), firevision::Bumblebee2Camera::deinterlace_stereo(), Bumblebee2Thread::init(), and firevision::Bumblebee2Camera::open().
|
static |
Print list of cameras.
Prints a list of available cameras to stdout.
Definition at line 984 of file firewire.cpp.
|
virtual |
Print out camera information. Shall print out camera information and current setup information on stdout.
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera, and firevision::PikeCamera.
Definition at line 279 of file firewire.cpp.
Referenced by firevision::PikeCamera::print_info(), and firevision::Bumblebee2Camera::print_info().
|
virtual |
Camera is ready for taking pictures. The camera has been opened and started correctly and may now provide images.
Implements firevision::Camera.
Definition at line 508 of file firewire.cpp.
|
virtual |
Enable or disable auto focus.
enabled | if true, enable auto focus, otherwise disable |
NotImplementedException | Not implemented by this control |
Implements firevision::CameraControlFocus.
Definition at line 521 of file firewire.cpp.
|
virtual |
Set status of auto shutter.
enabled | true to enable auto shutter, false to disable. |
Definition at line 588 of file firewire.cpp.
|
virtual |
Set status of auto white balance.
enabled | true to enable auto white balance, false to disable. |
Definition at line 635 of file firewire.cpp.
|
virtual |
Set new focus value.
focus | new focus value |
Implements firevision::CameraControlFocus.
Definition at line 555 of file firewire.cpp.
|
virtual |
|
virtual |
Set image number to retrieve. If a camera is able to retrieve several images this method can be used to select the image to be retrieved with the next call to capture().
n | image number to set |
Implements firevision::Camera.
Reimplemented in firevision::Bumblebee2Camera.
Definition at line 514 of file firewire.cpp.
|
virtual |
|
virtual |
Set white balance values.
ub | U/B value |
vr | V/R value |
Definition at line 675 of file firewire.cpp.
|
virtual |
|
virtual |
Start image transfer from the camera. For many cameras opening the camera and starting transmission of images are two tasks. This method will simply initiate the transfer after the camera as been opened. And exception shall be thrown if the camera has not been opened.
Implements firevision::Camera.
Definition at line 224 of file firewire.cpp.
Referenced by Bumblebee2Thread::init().
|
virtual |
Stop image transfer from the camera. This will stop the image transfer initiated with start(). This can be used to start and stop the image transfer at will without opening and closing operations inbetween.
Implements firevision::Camera.
Definition at line 254 of file firewire.cpp.
Referenced by Bumblebee2Thread::finalize().
|
virtual |
Get white balance values.
ub | contains U/B value upon return |
vr | contains V/R value upon return |
Definition at line 659 of file firewire.cpp.
|
protected |
true if auto focus is enabled, false if disabled
Definition at line 130 of file firewire.h.
|
protected |
True, if gain is set automatically.
Definition at line 185 of file firewire.h.
|
protected |
true if auto shutter is enabled, false if disabled
Definition at line 132 of file firewire.h.
|
protected |
true if auto white balance is enabled, false if disabled
Definition at line 134 of file firewire.h.
|
protected |
DC1394 camera handle.
Definition at line 155 of file firewire.h.
Referenced by camera_cobj(), firevision::Bumblebee2Camera::is_bumblebee2(), firevision::Bumblebee2Camera::open(), firevision::Bumblebee2Camera::open_device(), firevision::PikeCamera::print_info(), firevision::Bumblebee2Camera::serial_no(), firevision::PikeCamera::set_autofunction_aoi(), and firevision::Bumblebee2Camera::write_triclops_config_from_camera_to_file().
|
protected |
DC1394 main context.
Definition at line 145 of file firewire.h.
Referenced by cobj(), and firevision::Bumblebee2Camera::open_device().
|
protected |
true if device has been opened, false otherwise
Definition at line 124 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::open_device().
|
protected |
true if the focus should actually be set, false otherwise
Definition at line 142 of file firewire.h.
|
protected |
true if the shutter should actually be set, false otherwise
Definition at line 138 of file firewire.h.
|
protected |
true if the white balance should actually be set, false otherwise
Definition at line 140 of file firewire.h.
|
protected |
Focus value.
Definition at line 180 of file firewire.h.
|
protected |
Format7 bytes per packet.
Definition at line 161 of file firewire.h.
|
protected |
Format7 color coding.
Definition at line 159 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
Format7 height.
Definition at line 165 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
Indicator of Format7 status.
Definition at line 149 of file firewire.h.
|
protected |
Format7 ROI Start X coordinate.
Definition at line 167 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
Format7 ROI Start Y coordinate.
Definition at line 169 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
Format7 width.
Definition at line 163 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
Last captured DC1394 video frame.
Definition at line 157 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::capture(), and firevision::Bumblebee2Camera::deinterlace_stereo().
|
protected |
DC1394 framerate.
Definition at line 153 of file firewire.h.
|
protected |
Gain value.
Definition at line 183 of file firewire.h.
|
protected |
DC1394 video mode.
Definition at line 147 of file firewire.h.
|
protected |
Camera model, used in open to identify the camera, if empty first found camera is used.
Definition at line 188 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera(), and firevision::Bumblebee2Camera::open_device().
|
protected |
Number of DMA buffers.
Definition at line 122 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::Bumblebee2Camera().
|
protected |
true if camera has been opened, false otherwise
Definition at line 126 of file firewire.h.
Referenced by firevision::Bumblebee2Camera::close(), firevision::Bumblebee2Camera::is_bumblebee2(), firevision::PikeCamera::open(), firevision::Bumblebee2Camera::open(), firevision::Bumblebee2Camera::serial_no(), firevision::PikeCamera::set_autofunction_aoi(), and firevision::Bumblebee2Camera::verify_guid().
|
protected |
Shutter value.
Definition at line 177 of file firewire.h.
|
protected |
DC1394 speed.
Definition at line 151 of file firewire.h.
|
protected |
true if camera has been started, false otherwise
Definition at line 128 of file firewire.h.
|
protected |
true, if a valid frame has been received, false otherwise
Definition at line 136 of file firewire.h.
|
protected |
White balance U/B value.
Definition at line 172 of file firewire.h.
|
protected |
White balance V/R value.
Definition at line 174 of file firewire.h.