00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00084
#include <string>
00085
using namespace std;
00086
00102 class SC1ModCam {
00103
public:
00104
00105
SC1ModCam (string devname =
"/dev/video",
int parport = 0x378);
00106
~SC1ModCam ();
00107
00108
unsigned long set_exposure (
unsigned long msecs);
00109
unsigned long get_exposure (
void);
00110
00111
unsigned long set_multiplier (
unsigned int m);
00112
unsigned long get_multiplier (
void);
00113
00114
unsigned int set_fps (
unsigned int fps);
00115
unsigned int get_fps (
void);
00116
00117
bool set_resolution (
int width,
int height);
00118
void get_resolution (
int * width,
int * height);
00119
00120
void *
get_buffer (
void);
00121 size_t
get_buffer_size (
void);
00122
00123
bool take_photo ();
00124
00125
enum ERRCODE {
00126 ERR_OK = 0,
00127 ERR_ERROR,
00128 ERR_WARN,
00129 ERR_FATAL,
00130 };
00131
00132
enum ERRCODE
error (string * msg = NULL);
00133
00134
protected:
00135
00136
void _set_error(string error,
enum ERRCODE code = ERR_ERROR);
00137
void _unset_error(
void);
00138 string _error_string;
00139
enum ERRCODE _error_code;
00140
00141
void * _buffer;
00142
int _multiplier;
00143
00144
int _fps;
00145
int _image_width;
00146
int _image_height;
00147
static const float _bytes_per_pixel = 1.5;
00148
00149
bool _sync_settings (
void);
00150
bool _setup_camera (
void);
00151
00152
00153
bool _open_shutter();
00154
bool _close_shutter();
00155
00156
00157
void _usleep (
unsigned long usecs);
00158
00159
int _devfd;
00160
00161 };
00162
00163