31 #include <sys/ioctl.h> 34 #include <linux/videodev2.h> 36 #define VCAP_DEFAULT_VIDEODEV "/dev/video0" 37 #define VCAP_DEFAULT_OUTPUTFILE "vcap.jpg" 38 #define VCAP_DEFAULT_WIDTH 640 39 #define VCAP_DEFAULT_HEIGHT 480 40 #define VCAP_DEFAULT_JPEG_QUALITY 99 80 VCAP(std::string videoDev=VCAP_DEFAULT_VIDEODEV);
115 bool saveImage(std::string filename=VCAP_DEFAULT_OUTPUTFILE);
167 m_debugging = enable;
172 bool initVideoDevice();
175 bool checkCapabilities();
178 bool YUYV2JPEG(FILE *file);
182 void releaseBuffer();
185 bool doCaptureImage();
189 int xioctl(
int fd,
int request,
void* argp);
191 std::string m_videoDevice;
197 struct v4l2_capability m_caps;
198 struct v4l2_format m_format;
201 unsigned char *m_buffer;
210 bool m_imageCaptured;
void setDebug(bool enable)
Definition: vcap.hpp:165
API for the Video Capture driver.
Definition: vcap.hpp:72
int getWidth() const
Definition: vcap.hpp:124
~VCAP()
Definition: vcap.cxx:61
void setJPGQuality(unsigned int quality)
Definition: vcap.cxx:521
C++ API wrapper for the bh1749 driver.
Definition: a110x.hpp:29
int getHeight() const
Definition: vcap.hpp:136
VCAP(std::string videoDev=VCAP_DEFAULT_VIDEODEV)
Definition: vcap.cxx:40
bool captureImage()
Definition: vcap.cxx:417
bool saveImage(std::string filename=VCAP_DEFAULT_OUTPUTFILE)
Definition: vcap.cxx:383
bool setResolution(int width, int height)
Definition: vcap.cxx:141
int getJPGQuality() const
Definition: vcap.hpp:155