00001 #ifndef FCAM_F2_SENSOR_H 00002 #define FCAM_F2_SENSOR_H 00003 00011 00012 #include "../Sensor.h" 00013 #include "Daemon.h" 00014 #include "Frame.h" 00015 #include "Shot.h" 00016 #include <vector> 00017 #include <pthread.h> 00018 00019 namespace FCam { 00020 namespace F2 { 00021 00028 class Sensor : public FCam::Sensor, public Daemon::RequestGenerator { 00029 public: 00030 00031 Sensor(); 00032 ~Sensor(); 00033 00034 void capture(const FCam::Shot &); 00036 void capture(const Shot &); 00037 00038 void capture(const std::vector<FCam::Shot> &); 00040 void capture(const std::vector<Shot> &); 00041 00042 void stream(const FCam::Shot &); 00044 void stream(const Shot &); 00045 00046 void stream(const std::vector<FCam::Shot> &); 00048 void stream(const std::vector<Shot> &); 00049 00050 bool streaming(); 00051 void stopStreaming(); 00052 00054 Size minImageSize() const; 00056 Size maxImageSize() const; 00058 static Size pixelArraySize(); 00061 static Rect activeArrayRect(); 00065 static Rect pixelArrayRect(); 00066 00068 int getRollingShutterTime(const Shot&) const; 00069 00070 int getRollingShutterTime(const FCam::Shot&) const; 00071 00072 int framesPending() const; 00073 int shotsPending() const; 00074 00075 BayerPattern getBayerPattern() const {return GRBG;} 00076 00077 const float *getXYZToRawColorMatrixTungsten() const { 00078 return XYZToRawColorMatrixTungsten; 00079 } 00080 const float *getXYZToRawColorMatrixDaylight() const { 00081 return XYZToRawColorMatrixDaylight; 00082 } 00083 00084 const std::string &getManufacturer() {return manufacturer;} 00085 const std::string &getModel() {return model;} 00086 00087 FCam::Frame::Ptr getFrame(); 00093 Frame::Ptr getF2Frame(); 00094 00095 void debugTiming(bool); 00096 00097 private: 00098 // The currently streaming shot 00099 std::vector<Shot> streamingShot; 00100 00101 // The daemon that manages the F2's sensor 00102 friend class Daemon; 00103 Daemon daemon; 00104 00105 // the Daemon calls this when it's time for new frames to be queued up 00106 void generateRequest(); 00107 00108 pthread_mutex_t requestMutex; 00109 00110 // enforce the specified drop policy 00111 void enforceDropPolicy(); 00112 00113 // the color matrices for this sensor 00114 static float XYZToRawColorMatrixDaylight[]; 00115 static float XYZToRawColorMatrixTungsten[]; 00116 00117 static std::string manufacturer; 00118 static std::string model; 00119 00120 // the number of outstanding shots 00121 int shotsPending_; 00122 }; 00123 00124 } 00125 } 00126 00127 00128 #endif
1.5.6