Fawkes API  Fawkes Development Version
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
v4l.h
1 
2 /***************************************************************************
3  * v4l.h - General Video4Linux access
4  *
5  * Generated: Sat Jul 5 16:16:16 2008
6  * Copyright 2008 Tobias Kellner
7  *
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version. A runtime exception applies to
14  * this software (see LICENSE.GPL_WRE file mentioned below for details).
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Library General Public License for more details.
20  *
21  * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22  */
23 
24 #ifndef __FIREVISION_CAMS_V4L_H_
25 #define __FIREVISION_CAMS_V4L_H_
26 
27 #include <fvcams/camera.h>
28 //#include <sys/types.h>
29 
30 namespace firevision {
31 #if 0 /* just to make Emacs auto-indent happy */
32 }
33 #endif
34 
35 class CameraArgumentParser;
36 
37 class V4LCamera : public Camera
38 {
39  public:
40  V4LCamera(const char *device_name = "/dev/video0");
41  V4LCamera(const CameraArgumentParser *cap);
42  virtual ~V4LCamera();
43 
44  virtual void open();
45  virtual void start();
46  virtual void stop();
47  virtual void close();
48  virtual void flush();
49  virtual void capture();
50  virtual void print_info();
51  virtual bool ready();
52 
53  virtual unsigned char* buffer();
54  virtual unsigned int buffer_size();
55  virtual void dispose_buffer();
56 
57  virtual unsigned int pixel_width();
58  virtual unsigned int pixel_height();
59  virtual colorspace_t colorspace();
60 
61  virtual void set_image_number(unsigned int n);
62 
63  private:
64  Camera *_v4l_cam;
65  char *_device_name;
66 };
67 
68 } // end namespace firevision
69 
70 #endif //__FIREVISION_CAMS_V4L_H_