62 #include "rnr/rnrconfig.h" 65 #include "opencv/cv.h" 67 #ifdef CAM_USE_ECAM_IMPL 68 #include "econ/econ32.h" 69 #endif // CAM_USE_ECAM_IMPL 135 Camera(
const std::string &strVideoDevName=VideoDevDft,
136 const CamRes &resVideo=CamResQVGA,
137 const CamRes &resImage=CamResVGA);
157 if( isEqResolution(res, CamResDft) )
163 if( !isEqResolution(res, m_resCurrent) )
165 setCameraResolution(res);
168 m_resVideo = m_resCurrent;
169 m_bCameraRunning =
true;
181 m_bCameraRunning =
false;
226 return m_bCameraRunning;
236 return m_bTakingImage;
270 static int getVideoIndex(
const std::string &strVideoDevName);
320 #endif // _RNR_CAMERA_H const CamRes CamRes1440x1080
1440 x 1080 resolution
const CamRes CamRes2592x1944
2592 x 1944 resolution
const CamRes CamRes1600x1200
1600 x 1200 resolution
static bool isEqResolution(const CamRes &res1, const CamRes &res2)
Check is two camera resolutions are equal.
bool isFatal() const
Test if camera object is in a fatal condition.
const char *const VideoDevDft
Default video device.
const CamRes CamResUndef
Common 4:3 aspect ratio camera resolutions.
CamRes m_resCurrent
current camera resolution
const CamRes CamResDft
default resolution
virtual void autoFocus()
Auto-focus camera.
const CamRes CamRes1280x720
Common ~16:9 aspect ratio camera resolutions.
const CamRes CamRes1024x768
1024 x 768 resolution
virtual CamRes setCameraResolution(const CamRes &res)
Set the camera resolution in either video or still image mode.
bool m_bTakingImage
taking an image is [not] finished
CamRes m_resVideo
current video resolution
bool m_bCameraRunning
camera is [not] on and running video
const CamRes CamRes1280x800
Common 16:10 aspect ratio camera resolutions.
bool isTakingAnImage() const
Test if a still image is currently being taken.
const CamRes CamRes1440x900
1440 x 900 resolution
const CamRes CamResQVGA
Quarter VGA 320 x 240 res.
Camera resolution structure.
virtual int stopVideo()
Stop the camera from streaming video.
virtual int clickImage(cv::Mat &img, const CamRes &resImage=CamResDft)
Take a still image.
const int VideoDevMajor
major device number
virtual int grabFrame(cv::Mat &frame)
Grab a image frame from the video stream.
int height
height in pixels
int m_nVideoIndex
video index
CamRes m_resImage
current still image resolution
std::string m_strVideoDevName
video device name
virtual int startVideo(const CamRes &resVideo=CamResDft)
Start the camera streaming video.
CamRes getImageResolution() const
Get the current still image resolution.
const CamRes CamRes2048x1536
2048 x 1536 resolution
const int VideoIndexDft
default video index
bool isCameraRunning() const
Test if the camera is on and running.
CamRes getVideoResolution() const
Get the current video resolution.
const CamRes CamRes1920x1080
1920 x 1080 resolution
const CamRes CamResVGA
VGA 640 x 480 resolution.
bool m_bFatal
camera instance is in a fatal state