00001 // Copyright (C) 2008 University of Louisiana at Lafayette 00002 // Authors: Christopher Mire 00003 00004 #ifndef CAJUN_FW_CAMERA_INTERFACE_H 00005 #define CAJUN_FW_CAMERA_INTERFACE_H 00006 #include <dc1394/dc1394.h> 00007 #include <dc1394/control.h> 00008 #include <dc1394/camera.h> 00009 #include <dc1394/conversions.h> 00010 namespace cajun 00011 { 00012 struct camera_opts_t 00013 { 00014 unsigned num_dma_buffers; 00015 unsigned num_drop_frames; 00016 unsigned format; 00017 bool color; 00018 dc1394video_mode_t mode; 00019 int mode_choice; 00020 unsigned fps; 00021 unsigned bpp; 00022 unsigned width; 00023 unsigned height; 00024 unsigned roi_width; 00025 unsigned roi_height; 00026 }; 00027 00028 struct frame_info_t 00029 { 00030 frame_info_t () : rgb_buf (NULL), height (0), width (0), color (false), 00031 tstamp (0.0) {} 00032 unsigned char* rgb_buf; 00033 unsigned height; 00034 unsigned width; 00035 bool color; 00036 double tstamp; 00037 }; 00038 00039 class fw_camera_interface_t 00040 { 00041 public: 00042 fw_camera_interface_t () : m_buffer_size (0) {}; 00043 virtual ~fw_camera_interface_t () {}; 00044 00045 virtual void setup (dc1394_t*) = 0; 00046 virtual void cleanup () = 0; 00047 virtual void handle_input () = 0; 00048 virtual void setFormat (camera_opts_t,int)=0; 00049 00050 protected: 00051 camera_opts_t m_camera_opts; 00052 frame_info_t m_frame; 00053 unsigned m_buffer_size; 00054 00055 private: 00056 }; 00057 }; 00058 00059 #endif