Virtual class which declares an general interface for imaging sensors. More...
#include <CamInterface.h>
Public Member Functions | |
| CamInterface () | |
| virtual | ~CamInterface () |
| virtual int | listCameras (std::vector< CamInfo > &cam_infos) const |
| Lists all available cameras. | |
| virtual bool | findCamera (const CamInfo &pattern, CamInfo &cam) const |
| Returns information about the first camera that matches the pattern. | |
| virtual int | countCameras () const |
| Counts the number of available cameras. | |
| virtual bool | open (const CamInfo &cam, const AccessMode mode=Master) |
| Opens a specific camera. | |
| virtual bool | open2 (const std::string &display_name, const AccessMode mode=Master) |
| Opens the first camera that matches the pattern. | |
| virtual bool | open2 (unsigned long &unique_camera_id, const AccessMode mode=Master) |
| Opens the first camera that matches the pattern. | |
| virtual bool | open2 (const CamInfo &pattern, const AccessMode mode=Master) |
| Opens the first camera that matches the pattern. | |
| virtual bool | isOpen () const |
| Checks if the camera is open. | |
| virtual const CamInfo * | getCameraInfo () const |
| Returns a pointer to CamInfo of the opened camera. | |
| virtual bool | close () |
| Closes the camera. | |
| virtual bool | grab (const GrabMode mode=SingleFrame, const int buffer_len=1) |
| Starts capturing into a buffer. | |
| virtual bool | retrieveFrame (base::samples::frame::Frame &frame, const int timeout=1000) |
| Retrieves the next frame from the buffer (no data are copied). | |
| virtual bool | isFrameAvailable () |
| Checks if a frame can be retrieved from the buffer. | |
| virtual int | skipFrames () |
| Skips all buffered frame beside the last one. | |
| virtual bool | setIpSettings (const CamInfo &cam, const IPSettings &ip_settings) const |
| Sets the IP adress and subnetmask of a ethernet camera. | |
| virtual bool | setAttrib (const int_attrib::CamAttrib attrib, const int value) |
| Sets the value of an integer attribute. | |
| virtual bool | setAttrib (const double_attrib::CamAttrib attrib, const double value) |
| Sets the value of a double attribute. | |
| virtual bool | setAttrib (const str_attrib::CamAttrib attrib, const std::string value) |
| Sets the value of a string attribute. | |
| virtual bool | setAttrib (const enum_attrib::CamAttrib attrib) |
| Sets the value of an enum attribute. | |
| virtual bool | isAttribAvail (const int_attrib::CamAttrib attrib) |
| Checks if an integer attribute is available. | |
| virtual bool | isAttribAvail (const double_attrib::CamAttrib attrib) |
| Checks if a double attribute is available. | |
| virtual bool | isAttribAvail (const str_attrib::CamAttrib attrib) |
| Checks if a string attribute is available. | |
| virtual bool | isAttribAvail (const enum_attrib::CamAttrib attrib) |
| Checks if a enum attribute is available. | |
| virtual int | getAttrib (const int_attrib::CamAttrib attrib) |
| Returns the value of an integer attribute. | |
| virtual double | getAttrib (const double_attrib::CamAttrib attrib) |
| Returns the value of a double attribute. | |
| virtual std::string | getAttrib (const str_attrib::CamAttrib attrib) |
| Returns the value of a string attribute. | |
| virtual bool | isAttribSet (const enum_attrib::CamAttrib attrib) |
| Checks if the enum attribute is set. | |
| virtual CamInterface & | operator>> (base::samples::frame::Frame &frame) |
| Retrieves a camera frame (no data are copied) | |
| virtual bool | setFrameSettings (const base::samples::frame::frame_size_t size, const base::samples::frame::frame_mode_t mode, const uint8_t color_depth, const bool resize_frames=true) |
| Sets the frame settings size, mode and color depth. | |
| virtual bool | setFrameSettings (const base::samples::frame::Frame &frame, const bool resize_frames=true) |
| Sets the camera frame settings to the values of the frame. | |
| virtual bool | getFrameSettings (base::samples::frame::frame_size_t &size, base::samples::frame::frame_mode_t &mode, uint8_t &color_depth) |
| Gets the actual frame settings size, mode and color depth. | |
| virtual bool | triggerFrame () |
| Triggers a new frame if FrameStartTriggerMode is set to Software. | |
| virtual bool | setToDefault () |
| Sets the camera to default settings. | |
| virtual bool | setFrameToCameraFrameSettings (base::samples::frame::Frame &frame) |
| Configures the frame that it matches the camera frame settings. | |
| virtual bool | setCallbackFcn (void(*pcallback_function)(const void *p), void *p) |
| Sets a callback function which is called when a new frame can be retrieved. | |
| virtual void | synchronizeWithSystemTime (uint32_t time_interval) |
| synchronizes the camera time with the system time. Should be called only once | |
| virtual void | saveConfiguration (uint8_t index) |
| saves the current camera configuration to the non-volatile memory inside the camera | |
| virtual void | loadConfiguration (uint8_t index) |
| loads the camera configuration from the non-volatile memory | |
| virtual void | getRange (const double_attrib::CamAttrib attrib, double &dmin, double &dmax) |
| returns the range of an double_attrib | |
| virtual void | getRange (const int_attrib::CamAttrib attrib, int &imin, int &imax) |
| returns the range of an int_attrib | |
| virtual int | getFileDescriptor () const |
| returns the file descriptor of the camera | |
| virtual std::string | doDiagnose () |
| does a camera diagnose | |
Protected Attributes | |
| base::samples::frame::frame_size_t | image_size_ |
| base::samples::frame::frame_mode_t | image_mode_ |
| uint8_t | image_color_depth_ |
| GrabMode | act_grab_mode_ |
Virtual class which declares an general interface for imaging sensors.
Use this class as base class if you want to add your own sensor.
| camera::CamInterface::CamInterface | ( | ) |
|
virtual |
|
inlinevirtual |
Closes the camera.
|
virtual |
Counts the number of available cameras.
|
virtual |
does a camera diagnose
Returns information about the first camera that matches the pattern.
| pattern | camera pattern |
| cam | structure where the camera information is stored |
|
inlinevirtual |
Returns the value of an integer attribute.
| attrib | identifier of the attribute |
|
inlinevirtual |
Returns the value of a double attribute.
| attrib | identifier of the attribute |
|
inlinevirtual |
Returns the value of a string attribute.
| attrib | identifier of the attribute |
|
inlinevirtual |
|
inlinevirtual |
returns the file descriptor of the camera
|
inlinevirtual |
Gets the actual frame settings size, mode and color depth.
| size | size of the frame in pixel |
| mode | color mode of the frame (MODE_GRAYSCALE,MODE_RGB,...) |
| color_depth | number of bytes per pixel |
|
inlinevirtual |
returns the range of an double_attrib
| attrib | identifier of the attribute |
| dmin | Minimum value returned here |
| dmax | Maximum value returned here |
|
inlinevirtual |
returns the range of an int_attrib
| attrib | identifier of the attribute |
| dmin | Minimum value returned here |
| dmax | Maximum value returned here |
|
inlinevirtual |
Starts capturing into a buffer.
| mode | capturing mode (SingleFrame, MultiFrame, Continuously) |
| buffer_len | length of the buffer in frames. |
|
inlinevirtual |
Checks if an integer attribute is available.
| attrib | identifier of the attribute to be checked |
|
inlinevirtual |
Checks if a double attribute is available.
| attrib | identifier of the attribute to be checked |
|
inlinevirtual |
Checks if a string attribute is available.
| attrib | identifier of the attribute to be checked |
|
inlinevirtual |
Checks if a enum attribute is available.
| attrib | identifier of the attribute to be checked |
|
inlinevirtual |
Checks if the enum attribute is set.
| attrib | identifier of the attribute |
|
inlinevirtual |
Checks if a frame can be retrieved from the buffer.
|
inlinevirtual |
Checks if the camera is open.
|
inlinevirtual |
Lists all available cameras.
| cam_infos | vector of all available cameras |
|
inlinevirtual |
loads the camera configuration from the non-volatile memory
| index | index of the file (allowed values 0-3; 0 = factory defaults) |
|
inlinevirtual |
Opens a specific camera.
| cam | camera which shall be opened |
| mode | connection mode (eMaster, eMonitor) |
|
virtual |
Opens the first camera that matches the pattern.
This functions uses findCamera() and open() to open the camera.
| display_name | display name of the camera |
| mode | connection mode (eMaster, eMonitor) |
|
virtual |
Opens the first camera that matches the pattern.
This functions uses findCamera() and open() to open the camera.
| unique_camera_id | unique camera id |
| mode | connection mode (eMaster, eMonitor) |
|
virtual |
Opens the first camera that matches the pattern.
This functions uses findCamera() and open() to open the camera.
| pattern | camera pattern |
| mode | connection mode (eMaster, eMonitor) |
|
virtual |
Retrieves a camera frame (no data are copied)
If grab is called in advance the operator is equal to the function retrieveFrame(). Otherwise the function calls grab(eSingleFrame,1) and retrieveFrame().
| frame | structure where the frame is stored. |
|
inlinevirtual |
Retrieves the next frame from the buffer (no data are copied).
This function is synchron and blocks until a frame can be retrieved from the buffer or a timeout occurs. To check if a frame can be retrievt call isFrameAvailable().
| frame | structure where the frame is stored. |
| timeout | timeout waiting for a frame, in milliseconds |
|
inlinevirtual |
saves the current camera configuration to the non-volatile memory inside the camera
| index | index of the file (allowed values 1-3) |
|
inlinevirtual |
Sets the value of an integer attribute.
| attrib | identifier of the attribute to be changed |
| value | new integer value. |
|
inlinevirtual |
Sets the value of a double attribute.
| attrib | identifier of the attribute to be changed |
| value | new double value. |
|
inlinevirtual |
Sets the value of a string attribute.
| attrib | identifier of the attribute to be changed |
| value | new string value. |
|
inlinevirtual |
Sets the value of an enum attribute.
| attrib | identifier of the attribute to be changed |
| value | new enum value. |
|
inlinevirtual |
Sets a callback function which is called when a new frame can be retrieved.
| pfunction | function pointer to a function which is called when a new frame can be retrieved by the function retrieveFrame(). The callback function must follow the syntax 'static void fcn(const void* p)' |
|
virtual |
Sets the frame settings size, mode and color depth.
| size | size of the frame in pixel |
| mode | color mode of the frame (MODE_GRAYSCALE,MODE_RGB,...) |
| color_depth | number of bytes per pixel |
| resize_frames | resizes all buffered frame to the right size |
|
virtual |
Sets the camera frame settings to the values of the frame.
| frame | frame which descripes the settings to be set |
| resize_frames | resizes all buffered frame to the right size |
|
virtual |
Configures the frame that it matches the camera frame settings.
| frame | frame to be configured |
|
inlinevirtual |
Sets the IP adress and subnetmask of a ethernet camera.
| cam | camera whose ip settings shall be changed |
| ip_settings | ip settings to be set. |
|
inlinevirtual |
Sets the camera to default settings.
|
inlinevirtual |
Skips all buffered frame beside the last one.
|
inlinevirtual |
synchronizes the camera time with the system time. Should be called only once
| time_intervall | Time interval in ms for statistical calculations. The functions blocks in the meantime |
|
inlinevirtual |
Triggers a new frame if FrameStartTriggerMode is set to Software.
|
protected |
|
protected |
|
protected |
|
protected |
1.8.1.2