00001 #ifndef TREES_CAMERADEVICE_H
00002 #define TREES_CAMERADEVICE_H 1
00003
00004 extern "C" {
00005 #include <libraw1394/raw1394.h>
00006 #include <libdc1394/dc1394_control.h>
00007 #include <sadie.h>
00008 }
00009
00010 namespace std
00011 {
00012
00013 class Cameradevice {
00014 unsigned char* viewbuf;
00015 unsigned char* fullbuf;
00016 raw1394handle_t rawhandle;
00017 dc1394_cameracapture * dc;
00018 bool multibuffer;
00019 int* incr;
00020 unsigned int skipsize;
00021 unsigned int dsize;
00022 unsigned int hoff;
00023 unsigned int voff;
00024 unsigned int nbufs;
00025 unsigned int bpp;
00026 unsigned int horiz_size;
00027 unsigned int vert_size;
00028 unsigned int camdevprogres_type;
00029 void emitline(unsigned char* startaddr, unsigned char*& dst);
00030 public:
00031 Cameradevice(int unit, int picture_timeout, int numbufs,
00032 unsigned int h, unsigned int v,
00033 unsigned int dn, unsigned int dd);
00034 ~Cameradevice();
00035 unsigned int height() const { return vert_size; }
00036 unsigned int width() const { return horiz_size; }
00037 unsigned int depth() const { return bpp; }
00038 unsigned int size();
00039 bool progrescol() const { return 0; }
00040 unsigned int snap_width() const { return dc->frame_width - hoff; }
00041 unsigned int snap_height() const { return dc->frame_height - voff; }
00042 unsigned char* acquire();
00043 unsigned char* snapshot();
00044 bool resize(unsigned int h_req, unsigned int v_req);
00045 IMAGE* acquire_sadie(int,int,int,int);
00046 int enable_live(int);
00047 int set_gain(int);
00048 };
00049
00050 }
00051
00052 #endif