Fawkes API  Fawkes Development Version
firevision::CameraFactory Class Reference

Camera factory. More...

#include <>>

Static Public Member Functions

static Camerainstance (const char *as)
 Get camera instance. More...
 
static Camerainstance (const CameraArgumentParser *cap)
 Get camera instance with parameters from given camera argument parser. More...
 
template<class C >
static C * instance (const char *as)
 Get typed instance of camera. More...
 

Detailed Description

Camera factory.

This camera factory provides access to all cameras in a unified way. You just supply a camera argument string and depending on the camera ID and compile-time support of camera types an instance of the desired camera is returned or otherwise an exception is thrown. See instance() for a list of supported camera types.

Author
Tim Niemueller

Definition at line 42 of file factory.h.

Member Function Documentation

◆ instance() [1/3]

Camera * firevision::CameraFactory::instance ( const char *  as)
static

Get camera instance.

Get an instance of a camera of the given type. The argument string determines the type of camera to open. Supported camera types:

  • firewire, FirewireCamera, compiled if HAVE_FIREWIRE_CAM is defined in fvconf.mk
  • leutron, LeutronCamera, compiled if HAVE_LEUTRON_CAM is defined in fvconf.mk
  • file, FileLoader, compiled if HAVE_FILELOADER_CAM is defined in fvconf.mk
  • shmem, SharedMemoryCamera, compiled if HAVE_SHMEM_CAM is defined in fvconf.mk
  • net, NetworkCamera, compiled if HAVE_NETWORK_CAM is defined in fvconf.mk
  • v4l, V4LCamera, compiled if HAVE_V4L_CAM is defined in fvconf.mk
    Parameters
    ascamera argument string
    Returns
    camera instance of requested type
    Exceptions
    UnknownCameraTypeExceptionthrown, if the desired camera could not be instantiated. This could be either to a misspelled camera ID, generally missing support or unset definition due to configuration in fvconf.mk or missing libraries and camera support compile-time autodetection.

Definition at line 239 of file factory.cpp.

Referenced by instance().

◆ instance() [2/3]

Camera * firevision::CameraFactory::instance ( const CameraArgumentParser cap)
static

Get camera instance with parameters from given camera argument parser.

This is a convenience method and works like instace(const char *as).

Parameters
capcamera argument parser
Returns
camera instance
Exceptions
UnknownCameraTypeExceptionthrown if camera type is not known or was not available at build time.

Definition at line 92 of file factory.cpp.

References firevision::CameraArgumentParser::cam_type().

◆ instance() [3/3]

template<class C >
C * firevision::CameraFactory::instance ( const char *  as)
static

Get typed instance of camera.

Creates a new instance and converts it to the requested type. If the type does not match the requested camera an exception is thrown.

Parameters
ascamera argument string
Returns
typed camera instance
Exceptions
TypeMismatchExceptionthrown, if requested camera does not match requested type.

Definition at line 63 of file factory.h.

References instance().


The documentation for this class was generated from the following files: