• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

include/FCam/F2/Sensor.h

Go to the documentation of this file.
00001 #ifndef FCAM_F2_SENSOR_H
00002 #define FCAM_F2_SENSOR_H
00003 
00011 
00012 #include "../Sensor.h"
00013 #include "Frame.h"
00014 #include "Shot.h"
00015 #include <vector>
00016 #include <pthread.h>
00017 
00018 namespace FCam { namespace F2 {
00019 
00020     class Daemon;
00021 
00028     class Sensor : public FCam::Sensor {
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         void start();
00053         void stop();
00054 
00059         virtual int maxExposure() const {return 2489140;} 
00060 
00064         virtual int minExposure() const {return 38;}       
00065 
00069         virtual int maxFrameTime() const {return 2490072;}
00070 
00074         virtual int minFrameTime() const {return 33414;}      
00075 
00077         virtual float maxGain() const {return 32.0f;}     
00078 
00080         virtual float minGain() const {return 1.0f;}      
00081 
00082 
00084         Size minImageSize() const; 
00086         Size maxImageSize() const; 
00088         static Size pixelArraySize(); 
00091         static Rect activeArrayRect();
00095         static Rect pixelArrayRect(); 
00096 
00098         int rollingShutterTime(const Shot&) const;
00099 
00100         int rollingShutterTime(const FCam::Shot&) const;
00101 
00102         int framesPending() const;
00103         int shotsPending() const;
00104 
00105         unsigned short minRawValue() const;
00106         unsigned short maxRawValue() const;
00107     
00108         BayerPattern bayerPattern() const;
00109             
00110         const std::string &manufacturer() const;
00111         const std::string &model() const;
00112 
00113         void rawToRGBColorMatrix(int kelvin, float *matrix) const;
00114 
00115         
00116         FCam::F2::Frame getFrame();
00117         
00118 
00119         void debugTiming(bool);
00120 
00121     protected:
00122         
00123         FCam::Frame getBaseFrame() {return getFrame();}
00124 
00125     private:
00126         // The currently streaming shot         
00127         std::vector<Shot> streamingShot;        
00128 
00129         // The daemon that manages the F2's sensor
00130         friend class Daemon;
00131         Daemon *daemon;
00132             
00133         // the Daemon calls this when it's time for new frames to be queued up
00134         void generateRequest();
00135 
00136         pthread_mutex_t requestMutex;
00137           
00138         // enforce the specified drop policy
00139         void enforceDropPolicy();
00140 
00141         // allow tagFrames to get at color matrix information
00142         const std::vector<int> &getColorTemps() const;
00143         const float *getColorMatrix(int i) const;
00144 
00145         // the number of outstanding shots
00146         int shotsPending_;
00147     };
00148         
00149     }
00150 }
00151 
00152 
00153 #endif

Generated on Fri Sep 24 2010 15:52:59 for FCam by  doxygen 1.7.1