CameraFactory Class Reference
Camera factory. More...
#include <cams/factory.h>
Static Public Member Functions | |
| static Camera * | instance (const char *as) |
| Get camera instance. | |
| static Camera * | instance (const CameraArgumentParser *cap) |
| Get camera instance with parameters from given camera argument parser. | |
| template<class C > | |
| static C * | instance (const char *as) |
| Get typed instance of camera. | |
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.
Definition at line 37 of file factory.h.
Member Function Documentation
| static C* CameraFactory::instance | ( | const char * | as | ) | [inline, 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:
-
as camera argument string
- Returns:
- typed camera instance
- Exceptions:
-
TypeMismatchException thrown, if requested camera does not match requested type.
| Camera * 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:
-
cap camera argument parser
- Returns:
- camera instance
- Exceptions:
-
UnknownCameraTypeException thrown if camera type is not known or was not available at build time.
Definition at line 78 of file factory.cpp.
References CameraArgumentParser::cam_type().
| C * CameraFactory::instance | ( | const char * | as | ) | [inline, 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:
-
as camera argument string
- Returns:
- camera instance of requested type
- Exceptions:
-
UnknownCameraTypeException thrown, 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 198 of file factory.cpp.
Referenced by FvBaseThread::register_for_camera().
The documentation for this class was generated from the following files:
- src/firevision/cams/factory.h
- src/firevision/cams/factory.cpp

