Fawkes API
Fawkes Development Version
|
Network camera. More...
#include <>>
Public Member Functions | |
NetworkCamera (const char *host, unsigned short port, bool jpeg=false) | |
Constructor. More... | |
NetworkCamera (const char *host, unsigned short port, const char *image_id, bool jpeg=false) | |
Constructor. More... | |
NetworkCamera (const CameraArgumentParser *cap) | |
Constructor. More... | |
virtual | ~NetworkCamera () |
Destructor. More... | |
virtual void | open () |
Open the camera. More... | |
virtual void | start () |
Start image transfer from the camera. More... | |
virtual void | stop () |
Stop image transfer from the camera. More... | |
virtual void | close () |
Close camera. More... | |
virtual void | flush () |
Flush image queue. More... | |
virtual void | capture () |
Capture an image. More... | |
virtual void | print_info () |
Print out camera information. More... | |
virtual bool | ready () |
Camera is ready for taking pictures. More... | |
virtual unsigned char * | buffer () |
Get access to current image buffer. More... | |
virtual unsigned int | buffer_size () |
Size of buffer. More... | |
virtual void | dispose_buffer () |
Dispose current buffer. More... | |
virtual unsigned int | pixel_width () |
Width of image in pixels. More... | |
virtual unsigned int | pixel_height () |
Height of image in pixels. More... | |
virtual colorspace_t | colorspace () |
Colorspace of returned image. More... | |
virtual void | set_image_id (const char *image_id) |
Select the image that is opened. More... | |
virtual void | set_image_number (unsigned int n) |
Set image number to retrieve. More... | |
virtual fawkes::Time * | capture_time () |
Get the Time of the last successfully captured image. More... | |
virtual std::vector< FUSE_imageinfo_t > & | image_list () |
List the available images. More... | |
virtual void | fuse_invalid_server_version (uint32_t local_version, uint32_t remote_version) throw () |
Invalid version string received. More... | |
virtual void | fuse_connection_established () throw () |
Connection has been established. More... | |
virtual void | fuse_connection_died () throw () |
Connection died. More... | |
virtual void | fuse_inbound_received (FuseNetworkMessage *m) throw () |
Message received. More... | |
![]() | |
virtual | ~Camera () |
Virtual empty destructor. More... | |
![]() | |
virtual | ~FuseClientHandler () |
Destructor. More... | |
firevision::NetworkCamera::NetworkCamera | ( | const char * | host, |
unsigned short | port, | ||
bool | jpeg = false |
||
) |
Constructor.
Allows to initiate a NetworkCamera w/o specifying an image id. This can be done later with the set_image_id() method.
host | host to connect to |
port | port to connect to |
jpeg | if true jpeg images will be transferred and automatically be decompressed, otherwise raw images are transferred |
firevision::NetworkCamera::NetworkCamera | ( | const char * | host, |
unsigned short | port, | ||
const char * | image_id, | ||
bool | jpeg = false |
||
) |
firevision::NetworkCamera::NetworkCamera | ( | const CameraArgumentParser * | cap | ) |
Constructor.
Initialize with parameters from camera argument parser, supported values are:
cap | camera argument parser |
Definition at line 140 of file net.cpp.
References firevision::CameraArgumentParser::get(), and firevision::CameraArgumentParser::has().
|
virtual |
|
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.
Definition at line 281 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow().
|
virtual |
Size of buffer.
Gets the size in bytes of the buffer returned by buffer().
Implements firevision::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.
Definition at line 238 of file net.cpp.
References firevision::FUSE_imagereq_message_t::format, and firevision::FUSE_imagereq_message_t::image_id.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow().
|
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.
NotImplementedException | thrown if Camera does not support time stamping |
Reimplemented from firevision::Camera.
|
virtual |
Close camera.
This closes the camera device. The camera must have been stopped before calling close().
Implements firevision::Camera.
Definition at line 311 of file net.cpp.
Referenced by Firestation::get_window(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().
|
virtual |
Colorspace of returned image.
Implements firevision::Camera.
Definition at line 411 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow().
|
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 330 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow().
|
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.
|
virtual |
|
virtual |
Connection has been established.
Implements firevision::FuseClientHandler.
|
virtual |
Message received.
An incoming message has been received and can now be processed. Note that if you want to work on the message after this method has finished you have to reference the message by calling FuseMessage::ref()!
m | message to handle |
Implements firevision::FuseClientHandler.
Definition at line 467 of file net.cpp.
References firevision::FUSE_imageinfo_t::buffer_size, firevision::FUSE_imageinfo_t::colorspace, firevision::FuseImageListContent::has_next(), firevision::FUSE_imageinfo_t::height, firevision::FUSE_imageinfo_t::image_id, firevision::FuseImageListContent::next(), and firevision::FUSE_imageinfo_t::width.
|
virtual |
Invalid version string received.
The remote end has a different incompatible FUSE version.
local_version | version that the FuseClient speaks |
remote_version | version that the remote FUSE server speaks. |
Implements firevision::FuseClientHandler.
|
virtual |
List the available images.
Definition at line 429 of file net.cpp.
Referenced by Firestation::get_window().
|
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.
Definition at line 196 of file net.cpp.
References firevision::FUSE_imagedesc_message_t::image_id.
Referenced by Firestation::get_window(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().
|
virtual |
Height of image in pixels.
Implements firevision::Camera.
Definition at line 351 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().
|
virtual |
Width of image in pixels.
Implements firevision::Camera.
Definition at line 341 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().
|
virtual |
Print out camera information.
Shall print out camera information and current setup information on stdout.
Implements firevision::Camera.
|
virtual |
Camera is ready for taking pictures.
The camera has been opened and started correctly and may now provide images.
Implements firevision::Camera.
|
virtual |
Select the image that is opened.
image_id | the image id |
Definition at line 389 of file net.cpp.
References firevision::FUSE_imagedesc_message_t::image_id.
|
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.
|
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 219 of file net.cpp.
Referenced by Firestation::get_window(), Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().
|
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 225 of file net.cpp.
Referenced by Bumblebee2CalibGtkWindow::~Bumblebee2CalibGtkWindow(), and FuseViewerGtkWindow::~FuseViewerGtkWindow().