35 #ifndef _CAMINTERFACE_H 36 #define _CAMINTERFACE_H 39 #include <base/samples/Frame.hpp> 76 {
throw std::runtime_error(
"listCameras is not yet implemented for the camera interface!");
return 0;};
100 {
throw std::runtime_error(
"open is not yet implemented for the camera interface!");
return 0;};
131 {
throw std::runtime_error(
"isOpen is not yet implemented for the camera interface!");
return 0;};
139 throw std::runtime_error(
"This camerea interface does not support getCameraInfo.");
148 {
throw std::runtime_error(
"close is not yet implemented for the camera interface!");
return 0;};
157 const int buffer_len=1)
158 {
throw std::runtime_error(
"grab is not yet implemented for the camera interface!");
return 0;};
172 virtual bool retrieveFrame(base::samples::frame::Frame &frame,
const int timeout=1000)
173 {
throw std::runtime_error(
"retrieveFrame is not yet implemented for the camera interface!");
return 0;};
180 {
throw std::runtime_error(
"isFrameAvailable is not yet implemented for the camera interface!");
return 0;};
187 {
throw std::runtime_error(
"skipFrames is not yet implemented for the camera interface!");
return 0;};
197 {
throw std::runtime_error(
"setIpSettings is not yet implemented for the camera interface!");
return 0;};
206 {
throw std::runtime_error(
"setAttrib int_attrib is not yet implemented for the camera interface!");
return 0;};
216 {
throw std::runtime_error(
"setAttrib double_attrib is not yet implemented for the camera interface!");
return 0;};
225 {
throw std::runtime_error(
"setAttrib str_attrib is not yet implemented for the camera interface!");
return 0;};
234 {
throw std::runtime_error(
"setAttrib enum_attrib is not yet implemented for the camera interface!");
return 0;};
242 {
throw std::runtime_error(
"isAttribAvail int_attrib is not yet implemented for the camera interface!");
return 0;};
250 {
throw std::runtime_error(
"isAttribAvail double_attrib is not yet implemented for the camera interface!");
return 0;};
258 {
throw std::runtime_error(
"isAttribAvail str_attrib is not yet implemented for the camera interface!");
return 0;};
266 {
throw std::runtime_error(
"isAttribAvail enum_attrib is not yet implemented for the camera interface!");
return 0;};
274 {
throw std::runtime_error(
"getAttrib int_attrib is not yet implemented for the camera interface!");
return 0;};
282 {
throw std::runtime_error(
"getAttrib double_attrib is not yet implemented for the camera interface!");
return 0;};
290 {
throw std::runtime_error(
"getAttrib str_attrib is not yet implemented for the camera interface!");
return 0;};
298 {
throw std::runtime_error(
"isAttribSet is not yet implemented for the camera interface!");
return 0;};
320 virtual bool setFrameSettings(
const base::samples::frame::frame_size_t size,
321 const base::samples::frame::frame_mode_t mode,
322 const uint8_t color_depth,
323 const bool resize_frames =
true);
333 const bool resize_frames =
true);
343 base::samples::frame::frame_mode_t &mode,
344 uint8_t &color_depth)
345 {
throw std::runtime_error(
"getFrameSettings is not yet implemented for the camera interface!");
return 0;};
352 {
throw std::runtime_error(
"triggerFrame is not yet implemented for the camera interface!");
return 0;};
359 {
throw std::runtime_error(
"setToDefault is not yet implemented for the camera interface!");
return 0;};
381 throw std::runtime_error(
"This camerea does not support callback functions. " 382 "Use is isFrameAvailable() instead.");
391 throw std::runtime_error(
"This camerea does not support synchronizeWithSystemTime. " 392 "The timestamp of the camera frame will be invalid.");
401 throw std::runtime_error(
"This camerea does not support saveConfiguration.");
410 throw std::runtime_error(
"This camerea does not support loadConfiguration.");
421 throw std::runtime_error(
"This camerea does not support getRange for double_attrib.");
432 throw std::runtime_error(
"This camerea does not support getRange for int_attrib.");
441 throw std::runtime_error(
"This camerea does not provide a file descriptor.");
virtual int countCameras() const
Counts the number of available cameras.
Definition: CamInterface.cpp:97
CamAttrib
Definition: CamTypes.h:119
virtual bool isAttribAvail(const double_attrib::CamAttrib attrib)
Checks if a double attribute is available.
Definition: CamInterface.h:249
virtual bool isAttribSet(const enum_attrib::CamAttrib attrib)
Checks if the enum attribute is set.
Definition: CamInterface.h:297
virtual bool setIpSettings(const CamInfo &cam, const IPSettings &ip_settings) const
Sets the IP adress and subnetmask of a ethernet camera.
Definition: CamInterface.h:195
virtual bool isAttribAvail(const enum_attrib::CamAttrib attrib)
Checks if a enum attribute is available.
Definition: CamInterface.h:265
virtual bool setAttrib(const int_attrib::CamAttrib attrib, const int value)
Sets the value of an integer attribute.
Definition: CamInterface.h:205
virtual bool setAttrib(const str_attrib::CamAttrib attrib, const std::string value)
Sets the value of a string attribute.
Definition: CamInterface.h:224
CamInterface()
Definition: CamInterface.cpp:23
AccessMode
Definition: CamTypes.h:442
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.
Definition: CamInterface.cpp:36
virtual bool isAttribAvail(const str_attrib::CamAttrib attrib)
Checks if a string attribute is available.
Definition: CamInterface.h:257
virtual bool close()
Closes the camera.
Definition: CamInterface.h:147
virtual void synchronizeWithSystemTime(uint32_t time_interval)
synchronizes the camera time with the system time. Should be called only once
Definition: CamInterface.h:389
CamAttrib
Definition: CamTypes.h:109
virtual double getAttrib(const double_attrib::CamAttrib attrib)
Returns the value of a double attribute.
Definition: CamInterface.h:281
GrabMode
Definition: CamTypes.h:431
virtual bool findCamera(const CamInfo &pattern, CamInfo &cam) const
Returns information about the first camera that matches the pattern.
Definition: CamInterface.cpp:55
virtual void getRange(const int_attrib::CamAttrib attrib, int &imin, int &imax)
returns the range of an int_attrib
Definition: CamInterface.h:430
CamAttrib
Definition: CamTypes.h:24
GrabMode act_grab_mode_
Definition: CamInterface.h:56
virtual bool open2(const std::string &display_name, const AccessMode mode=Master)
Opens the first camera that matches the pattern.
Definition: CamInterface.cpp:81
Definition: CamInfoUtils.h:17
CamAttrib
Definition: CamTypes.h:137
virtual int getFileDescriptor() const
returns the file descriptor of the camera
Definition: CamInterface.h:439
uint8_t image_color_depth_
Definition: CamInterface.h:54
virtual void saveConfiguration(uint8_t index)
saves the current camera configuration to the non-volatile memory inside the camera ...
Definition: CamInterface.h:399
virtual std::string getAttrib(const str_attrib::CamAttrib attrib)
Returns the value of a string attribute.
Definition: CamInterface.h:289
virtual bool setAttrib(const enum_attrib::CamAttrib attrib)
Sets the value of an enum attribute.
Definition: CamInterface.h:233
virtual bool retrieveFrame(base::samples::frame::Frame &frame, const int timeout=1000)
Retrieves the next frame from the buffer (no data are copied).
Definition: CamInterface.h:172
Definition: CamTypes.h:362
virtual bool open(const CamInfo &cam, const AccessMode mode=Master)
Opens a specific camera.
Definition: CamInterface.h:99
base::samples::frame::frame_size_t image_size_
Definition: CamInterface.h:51
virtual CamInterface & operator>>(base::samples::frame::Frame &frame)
Retrieves a camera frame (no data are copied)
Definition: CamInterface.cpp:103
virtual bool isOpen() const
Checks if the camera is open.
Definition: CamInterface.h:130
virtual bool isFrameAvailable()
Checks if a frame can be retrieved from the buffer.
Definition: CamInterface.h:179
Definition: CamTypes.h:445
base::samples::frame::frame_mode_t image_mode_
Definition: CamInterface.h:52
virtual bool triggerFrame()
Triggers a new frame if FrameStartTriggerMode is set to Software.
Definition: CamInterface.h:351
virtual int getAttrib(const int_attrib::CamAttrib attrib)
Returns the value of an integer attribute.
Definition: CamInterface.h:273
virtual std::string doDiagnose()
does a camera diagnose
Definition: CamInterface.cpp:123
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.
Definition: CamInterface.h:379
virtual int listCameras(std::vector< CamInfo > &cam_infos) const
Lists all available cameras.
Definition: CamInterface.h:75
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.
Definition: CamInterface.h:342
virtual bool isAttribAvail(const int_attrib::CamAttrib attrib)
Checks if an integer attribute is available.
Definition: CamInterface.h:241
virtual const CamInfo * getCameraInfo() const
Returns a pointer to CamInfo of the opened camera.
Definition: CamInterface.h:137
virtual ~CamInterface()
Definition: CamInterface.cpp:31
virtual int skipFrames()
Skips all buffered frame beside the last one.
Definition: CamInterface.h:186
virtual bool grab(const GrabMode mode=SingleFrame, const int buffer_len=1)
Starts capturing into a buffer.
Definition: CamInterface.h:156
Virtual class which declares an general interface for imaging sensors.
Definition: CamInterface.h:48
virtual bool setFrameToCameraFrameSettings(base::samples::frame::Frame &frame)
Configures the frame that it matches the camera frame settings.
Definition: CamInterface.cpp:111
virtual bool setToDefault()
Sets the camera to default settings.
Definition: CamInterface.h:358
virtual void getRange(const double_attrib::CamAttrib attrib, double &dmin, double &dmax)
returns the range of an double_attrib
Definition: CamInterface.h:419
Definition: CamTypes.h:264
Definition: CamTypes.h:434
virtual bool setAttrib(const double_attrib::CamAttrib attrib, const double value)
Sets the value of a double attribute.
Definition: CamInterface.h:214
virtual void loadConfiguration(uint8_t index)
loads the camera configuration from the non-volatile memory
Definition: CamInterface.h:408