Camera Class Reference
Camera interface for image aquiring devices in FireVision. More...
#include <cams/camera.h>

Public Member Functions | |
| virtual | ~Camera () |
| Virtual empty destructor. | |
| virtual void | open ()=0 |
| Open the camera. | |
| virtual void | start ()=0 |
| Start image transfer from the camera. | |
| virtual void | stop ()=0 |
| Stop image transfer from the camera. | |
| virtual void | close ()=0 |
| Close camera. | |
| virtual void | capture ()=0 |
| Capture an image. | |
| virtual void | flush ()=0 |
| Flush image queue. | |
| virtual bool | ready ()=0 |
| Camera is ready for taking pictures. | |
| virtual void | print_info ()=0 |
| Print out camera information. | |
| virtual unsigned char * | buffer ()=0 |
| Get access to current image buffer. | |
| virtual unsigned int | buffer_size ()=0 |
| Size of buffer. | |
| virtual void | dispose_buffer ()=0 |
| Dispose current buffer. | |
| virtual unsigned int | pixel_width ()=0 |
| Width of image in pixels. | |
| virtual unsigned int | pixel_height ()=0 |
| Height of image in pixels. | |
| virtual colorspace_t | colorspace ()=0 |
| Colorspace of returned image. | |
| virtual fawkes::Time * | capture_time () |
| Get the Time of the last successfully captured image. | |
| virtual void | set_image_number (unsigned int n)=0 |
| Set image number to retrieve. | |
Detailed Description
Camera interface for image aquiring devices in FireVision.In general cameras shall initiate a continuous flow of images and shall be optimized for real-time image processing (25 Hz).
Definition at line 30 of file camera.h.
Constructor & Destructor Documentation
| Camera::~Camera | ( | ) | [virtual] |
Member Function Documentation
| unsigned char * Camera::buffer | ( | ) | [pure 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.
- Returns:
- pointer to image buffer
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::buffer(), FvRetrieverThread::loop(), and FvAcquisitionThread::loop().
| unsigned int Camera::buffer_size | ( | ) | [pure virtual] |
Size of buffer.
Gets the size in bytes of the buffer returned by buffer().
- Returns:
- size of buffer in bytes
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::buffer_size(), and FvRetrieverThread::loop().
| void Camera::capture | ( | ) | [pure 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.
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::capture(), FvRetrieverThread::loop(), and FvAcquisitionThread::loop().
| fawkes::Time * Camera::capture_time | ( | ) | [virtual] |
Get the Time of the last successfully captured image.
Returns a Time representing the time when the last image was captured successfully. Note that calling this function is only valid after capture() and before dispose_buffer() has been called -- it is only valid when an image is currently available.
- Returns:
- Time of the currently processed image. The pointer shall be valid at least until the next call to dispose_buffer().
- Exceptions:
-
NotImplementedException thrown if Camera does not support time stamping
Reimplemented in NetworkCamera, SharedMemoryCamera, and V4L2Camera.
Definition at line 136 of file camera.cpp.
Referenced by ImageWidget::ImageWidget(), FvAcquisitionThread::loop(), and ImageWidget::set_camera().
| void Camera::close | ( | ) | [pure virtual] |
Close camera.
This closes the camera device. The camera must have been stopped before calling close().
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::close(), and FvAcquisitionThread::~FvAcquisitionThread().
| colorspace_t Camera::colorspace | ( | ) | [pure virtual] |
Colorspace of returned image.
- Returns:
- colorspace of image returned by buffer()
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::colorspace(), FvAcquisitionThread::FvAcquisitionThread(), and FvRetrieverThread::init().
| void Camera::dispose_buffer | ( | ) | [pure 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.
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::dispose_buffer(), FvRetrieverThread::loop(), and FvAcquisitionThread::loop().
| void Camera::flush | ( | ) | [pure 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.
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::flush().
| void Camera::open | ( | ) | [pure 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.
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by FvBaseThread::register_for_camera().
| unsigned int Camera::pixel_height | ( | ) | [pure virtual] |
Height of image in pixels.
- Returns:
- height of image in pixels
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by FvAcquisitionThread::FvAcquisitionThread(), FvRetrieverThread::init(), V4LCamera::pixel_height(), ImageWidget::set_camera(), and ImageWidget::set_size().
| unsigned int Camera::pixel_width | ( | ) | [pure virtual] |
Width of image in pixels.
- Returns:
- width of image in pixels
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by FvAcquisitionThread::FvAcquisitionThread(), FvRetrieverThread::init(), V4LCamera::pixel_width(), ImageWidget::set_camera(), and ImageWidget::set_size().
| void Camera::print_info | ( | ) | [pure virtual] |
Print out camera information.
Shall print out camera information and current setup information on stdout.
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::print_info().
| bool Camera::ready | ( | ) | [pure virtual] |
Camera is ready for taking pictures.
The camera has been opened and started correctly and may now provide images.
- Returns:
- true, if the camera is ready, false otherwise
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::ready().
| void Camera::set_image_number | ( | unsigned int | n | ) | [pure 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().
- Parameters:
-
n image number to set
Implemented in Bumblebee2Camera, FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::set_image_number().
| void Camera::start | ( | ) | [pure 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.
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by FvBaseThread::register_for_camera(), and V4LCamera::start().
| void Camera::stop | ( | ) | [pure 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.
Implemented in FileLoader, FirewireCamera, LeutronCamera, NetworkCamera, SharedMemoryCamera, V4LCamera, V4L1Camera, and V4L2Camera.
Referenced by V4LCamera::stop().
The documentation for this class was generated from the following files:
- src/firevision/cams/camera.h
- src/firevision/cams/camera.cpp

