v4l.h

00001
00002 /***************************************************************************
00003  *  v4l.h - General Video4Linux access
00004  *
00005  *  Generated: Sat Jul  5 16:16:16 2008
00006  *  Copyright  2008 Tobias Kellner
00007  *
00008  ****************************************************************************/
00009
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version. A runtime exception applies to
00014  *  this software (see LICENSE.GPL_WRE file mentioned below for details).
00015  *
00016  *  This program is distributed in the hope that it will be useful,
00017  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  *  GNU Library General Public License for more details.
00020  *
00021  *  Read the full text in the LICENSE.GPL_WRE file in the doc directory.
00022  */
00023
00024 #ifndef __FIREVISION_CAMS_V4L_H_
00025 #define __FIREVISION_CAMS_V4L_H_
00026 
00027 #include <cams/camera.h>
00028 //#include <sys/types.h>
00029
00030 class CameraArgumentParser;
00031
00032 class V4LCamera : public Camera
00033 {
00034  public:
00035   V4LCamera(const char *device_name = "/dev/video0");
00036   V4LCamera(const CameraArgumentParser *cap);
00037   virtual ~V4LCamera();
00038
00039   virtual void open();
00040   virtual void start();
00041   virtual void stop();
00042   virtual void close();
00043   virtual void flush();
00044   virtual void capture();
00045   virtual void print_info();
00046   virtual bool ready();
00047
00048   virtual unsigned char* buffer();
00049   virtual unsigned int   buffer_size();
00050   virtual void           dispose_buffer();
00051
00052   virtual unsigned int    pixel_width();
00053   virtual unsigned int    pixel_height();
00054   virtual colorspace_t    colorspace();
00055
00056   virtual void           set_image_number(unsigned int n);
00057
00058  private:
00059   Camera *_v4l_cam;
00060   char *_device_name;
00061 };
00062
00063 #endif //__FIREVISION_CAMS_V4L_H_