Fawkes API Fawkes Development Version
buffer.h
1
2/***************************************************************************
3 * buffer.h - Camera model for a simple buffer
4 *
5 * Created: Tue Mar 08 22:42:12 2016
6 * Copyright 2005-2016 Tim Niemueller [www.niemueller.de]
7 ****************************************************************************/
8
9/* This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version. A runtime exception applies to
13 * this software (see LICENSE.GPL_WRE file mentioned below for details).
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Library General Public License for more details.
19 *
20 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
21 */
22
23#ifndef _FIREVISION_CAMS_BUFFER_H_
24#define _FIREVISION_CAMS_BUFFER_H_
25
26#include <fvcams/camera.h>
27
28namespace firevision {
29
30class CameraArgumentParser;
31
32class BufferCamera : public Camera
33{
34public:
35 BufferCamera(colorspace_t cspace, unsigned int width, unsigned int height);
37
38 virtual void open();
39 virtual void start();
40 virtual void stop();
41 virtual void close();
42 virtual void capture();
43 virtual void flush();
44
45 virtual bool ready();
46
47 virtual void print_info();
48
49 virtual unsigned char *buffer();
50 virtual unsigned int buffer_size();
51 virtual void dispose_buffer();
52
53 virtual unsigned int pixel_width();
54 virtual unsigned int pixel_height();
55 virtual colorspace_t colorspace();
56
57 virtual void set_image_number(unsigned int n);
58
59private:
60 unsigned char *buffer_;
61 unsigned int buffer_size_;
62 unsigned int width_;
63 unsigned int height_;
64 colorspace_t cspace_;
65};
66
67} // end namespace firevision
68
69#endif
Simple buffer with a Camera interface.
Definition: buffer.h:33
BufferCamera(colorspace_t cspace, unsigned int width, unsigned int height)
Constructor.
Definition: buffer.cpp:44
virtual void set_image_number(unsigned int n)
Set image number to retrieve.
Definition: buffer.cpp:118
virtual void open()
Open the camera.
Definition: buffer.cpp:60
virtual void flush()
Flush image queue.
Definition: buffer.cpp:107
virtual unsigned int pixel_width()
Width of image in pixels.
Definition: buffer.cpp:123
virtual void dispose_buffer()
Dispose current buffer.
Definition: buffer.cpp:102
virtual void print_info()
Print out camera information.
Definition: buffer.cpp:75
virtual void stop()
Stop image transfer from the camera.
Definition: buffer.cpp:70
virtual void start()
Start image transfer from the camera.
Definition: buffer.cpp:65
virtual colorspace_t colorspace()
Colorspace of returned image.
Definition: buffer.cpp:135
virtual unsigned int buffer_size()
Size of buffer.
Definition: buffer.cpp:91
virtual unsigned int pixel_height()
Height of image in pixels.
Definition: buffer.cpp:129
virtual bool ready()
Camera is ready for taking pictures.
Definition: buffer.cpp:112
virtual void capture()
Capture an image.
Definition: buffer.cpp:80
~BufferCamera()
Destructor.
Definition: buffer.cpp:54
virtual void close()
Close camera.
Definition: buffer.cpp:97
virtual unsigned char * buffer()
Get access to current image buffer.
Definition: buffer.cpp:85
Camera interface for image aquiring devices in FireVision.
Definition: camera.h:33