55 #if defined(ARCH_overo) 60 #include "rnr/rnrconfig.h" 67 #include "opencv/cv.h" 69 #include "econ/econ50.h" 81 CameraEcon50::CameraEcon50(
const std::string &strVideoDevName,
84 CameraCv(strVideoDevName, resVideo, resImage)
89 CameraEcon50::~CameraEcon50()
93 if( m_bufTmpName[0] != 0 )
99 int CameraEcon50::clickImage(Mat &img,
const CamRes &resImage)
107 LOGERROR(
"No ecam object.");
121 LOGERROR(
"Still image capture not supported yet.");
126 void CameraEcon50::autoFocus()
130 CamRes CameraEcon50::setCameraResolution(
const CamRes &res)
137 void CameraEcon50::makeTmpFile()
139 string strX(
"XXXXXX");
140 string strSuffix(
".bmp");
143 sprintf(m_bufTmpName,
"/tmp/camecon50-%s%s", strX.c_str(), strSuffix.c_str());
146 if( (fd = mkstemps(m_bufTmpName, strSuffix.length())) < 0 )
148 LOGERROR(
"mkstemps(%s, %zu) failed.\n", m_bufTmpName, strSuffix.length());
156 sprintf(tmp,
"/tmp/camecon50-%s", strX.c_str());
158 if( (fd = mkstemp(tmp)) < 0 )
160 LOGERROR(
"mkstemp(%s) failed.\n", tmp);
167 rename(tmp, m_bufTmpName);
177 #endif // defined(ARCH_overo) OpenCv implementation of the camera class. The video is streamed via OpenCv calls.
static bool isEqResolution(const CamRes &res1, const CamRes &res2)
Check is two camera resolutions are equal.
CamRes m_resCurrent
current camera resolution
Video and still image camera base class.
Econ 5.0 megapixel video and still image camera class.
const CamRes CamResDft
default resolution
bool m_bTakingImage
taking an image is [not] finished
CamRes m_resVideo
current video resolution
OpenCv video and still image camera class.
virtual int stopVideo()
Stop the camera from streaming video.
Camera resolution structure.
CamRes m_resImage
current still image resolution
bool isCameraRunning() const
Test if the camera is on and running.
bool m_bFatal
camera instance is in a fatal state