00001 extern "C" { 00002 #include "sdvlib.h" 00003 #include "camera.h" 00004 #include "sadie.h" 00005 } 00006 00007 #ifdef __SUNPRO_CC 00008 typedef int bool; 00009 const bool false = 0; 00010 const bool true = 1; 00011 #endif 00012 00013 class Cameradevice { 00014 unsigned char* viewbuf; 00015 unsigned char* fullbuf; 00016 SdvDev* sd; 00017 bool multibuffer; 00018 int* incr; 00019 unsigned int skipsize; 00020 unsigned int dsize; 00021 unsigned int hoff; 00022 unsigned int voff; 00023 unsigned int nbufs; 00024 unsigned int horiz_size; 00025 unsigned int vert_size; 00026 void emitline(unsigned char* startaddr, unsigned char*& dst); 00027 public: 00028 Cameradevice(int unit, int picture_timeout, int numbufs, 00029 unsigned int h, unsigned int v, 00030 unsigned int dn, unsigned int dd); 00031 ~Cameradevice(); 00032 unsigned int height() const { return vert_size; } 00033 unsigned int width() const { return horiz_size; } 00034 unsigned int depth() const { return sd->depth; } 00035 unsigned int size() const { return sd->imagesize; } 00036 bool progrescol() const { return sd->progres_type == PROGRES_COL; } 00037 unsigned int snap_width() const { return sd->x_size - hoff; } 00038 unsigned int snap_height() const { return sd->y_size - voff; } 00039 unsigned char* acquire(); 00040 unsigned char* snapshot(); 00041 bool resize(unsigned int h_req, unsigned int v_req); 00042 IMAGE* acquire_sadie(int,int,int,int); 00043 int enable_live(int); 00044 int set_gain(int); 00045 }; 00046