![]() |
appkit
1.5.1
RoadNarrows Robotics Application Kit
|
#include <Camera.h>
Public Member Functions | |
| Camera (const std::string &strVideoDevName=VideoDevDft, const CamRes &resVideo=CamResQVGA, const CamRes &resImage=CamResVGA) | |
| virtual | ~Camera () |
| Destructor. More... | |
| virtual int | startVideo (const CamRes &resVideo=CamResDft) |
| Start the camera streaming video. More... | |
| virtual int | stopVideo () |
| Stop the camera from streaming video. More... | |
| virtual int | grabFrame (cv::Mat &frame) |
| Grab a image frame from the video stream. More... | |
| virtual int | clickImage (cv::Mat &img, const CamRes &resImage=CamResDft) |
| Take a still image. More... | |
| virtual void | autoFocus () |
| Auto-focus camera. | |
| bool | isCameraRunning () const |
| Test if the camera is on and running. More... | |
| bool | isTakingAnImage () const |
| Test if a still image is currently being taken. More... | |
| bool | isFatal () const |
| Test if camera object is in a fatal condition. More... | |
| CamRes | getVideoResolution () const |
| Get the current video resolution. More... | |
| CamRes | getImageResolution () const |
| Get the current still image resolution. More... | |
Static Public Member Functions | |
| static bool | isEqResolution (const CamRes &res1, const CamRes &res2) |
| Check is two camera resolutions are equal. More... | |
| static int | getVideoIndex (const std::string &strVideoDevName) |
| Get the video index associated with the device. More... | |
Protected Member Functions | |
| virtual CamRes | setCameraResolution (const CamRes &res) |
| Set the camera resolution in either video or still image mode. More... | |
Protected Attributes | |
| std::string | m_strVideoDevName |
| video device name | |
| int | m_nVideoIndex |
| video index | |
| CamRes | m_resCurrent |
| current camera resolution | |
| CamRes | m_resVideo |
| current video resolution | |
| CamRes | m_resImage |
| current still image resolution | |
| bool | m_bCameraRunning |
| camera is [not] on and running video | |
| bool | m_bTakingImage |
| taking an image is [not] finished | |
| bool | m_bFatal |
| camera instance is in a fatal state | |
|
virtual |
Destructor.
Default destructor.
Definition at line 108 of file Camera.cxx.
|
inlinevirtual |
Take a still image.
| [in,out] | img | Snap shot image taken. |
| resImage | Still image resolution. If equal to CamResDft, then the initial/last image resolution setting is used. |
Reimplemented in rnr::CameraGst, and rnr::CameraCv.
|
inline |
|
static |
Get the video index associated with the device.
| strVideoDevName | Video camera device name. |
Definition at line 117 of file Camera.cxx.
References rnr::VideoDevMajor.
|
inline |
|
inlinevirtual |
Grab a image frame from the video stream.
| [in,out] | The | image frame matrix. May be resized. |
Reimplemented in rnr::CameraGst, and rnr::CameraCv.
Definition at line 193 of file Camera.h.
Referenced by rnr::CameraCv::clickImage(), and rnr::CameraCv::startVideo().
|
inline |
Test if the camera is on and running.
Definition at line 224 of file Camera.h.
Referenced by rnr::CameraCv::clickImage(), rnr::CameraGst::clickImage(), rnr::CameraCv::grabFrame(), rnr::CameraGst::grabFrame(), rnr::CameraGst::setCameraResolution(), rnr::CameraCv::startVideo(), rnr::CameraGst::startVideo(), rnr::CameraCv::stopVideo(), and rnr::CameraGst::stopVideo().
Check is two camera resolutions are equal.
| res1 | Resolution 1. |
| res2 | Resolution 2. |
Definition at line 257 of file Camera.h.
References rnr::CamRes::height, and rnr::CamRes::width.
Referenced by rnr::CameraCv::clickImage(), rnr::CameraGst::clickImage(), rnr::CameraCv::startVideo(), and rnr::CameraGst::startVideo().
|
inline |
|
inline |
Test if a still image is currently being taken.
Definition at line 234 of file Camera.h.
Set the camera resolution in either video or still image mode.
| res | Target camera resolution. |
Reimplemented in rnr::CameraGst, and rnr::CameraCv.
Definition at line 309 of file Camera.h.
Referenced by rnr::CameraCv::clickImage(), and rnr::CameraCv::startVideo().
Start the camera streaming video.
| resVideo | Video resolution. If equal to CamResDft, then the initial/last video resolution setting is used. |
Reimplemented in rnr::CameraGst, and rnr::CameraCv.
Definition at line 152 of file Camera.h.
Referenced by rnr::CameraCv::clickImage().
|
inlinevirtual |
Stop the camera from streaming video.
Reimplemented in rnr::CameraGst, and rnr::CameraCv.
Definition at line 179 of file Camera.h.
Referenced by rnr::CameraCv::clickImage(), and rnr::CameraCv::~CameraCv().