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

include/FCam/N900/Sensor.h

Go to the documentation of this file.
00001 #ifndef FCAM_N900_SENSOR_H
00002 #define FCAM_N900_SENSOR_H
00003 
00010 #include "../Sensor.h"
00011 #include <vector>
00012 #include <pthread.h>
00013 #include "Frame.h"
00014 
00015 namespace FCam { namespace N900 {
00016 
00017     class Daemon;
00018 
00041     class Sensor : public FCam::Sensor {
00042     public:
00043             
00044         Sensor();
00045         ~Sensor();
00046         
00047         void capture(const FCam::Shot &);
00048         void capture(const std::vector<FCam::Shot> &);
00049         void stream(const FCam::Shot &s);
00050         void stream(const std::vector<FCam::Shot> &);
00051         bool streaming();
00052         void stopStreaming();
00053         void start();
00054         void stop();
00055 
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 
00083         virtual Size minImageSize() const {return Size(160, 120);}
00084 
00088         virtual Size maxImageSize() const {return Size(2592, 1968);}
00089 
00091         virtual int maxHistogramRegions() const {return 4;}
00092 
00093 
00097         int rollingShutterTime(const Shot &) const;
00098             
00099         int framesPending() const;
00100         int shotsPending() const;
00101 
00103         unsigned short minRawValue() const;
00104         unsigned short maxRawValue() const;
00105 
00107         BayerPattern bayerPattern() const;
00108 
00109         const std::string &manufacturer() const;
00110         const std::string &model() const;
00111 
00112         virtual void rawToRGBColorMatrix(int kelvin, float *matrix) const;
00113 
00114         FCam::N900::Frame getFrame();
00115 
00116     protected:
00117         
00118         FCam::Frame getBaseFrame() {return getFrame();}
00119 
00120     private:
00121         // The currently streaming shot            
00122         std::vector<Shot> streamingShot;            
00123 
00124         // The daemon that manages the N900's sensor
00125         friend class Daemon;
00126         Daemon *daemon;
00127             
00128         // the Daemon calls this when it's time for new frames to be queued up
00129         void generateRequest();
00130 
00131         pthread_mutex_t requestMutex;
00132           
00133         // enforce the specified drop policy
00134         void enforceDropPolicy();
00135 
00136         // The number of outstanding shots
00137         int shotsPending_;           
00138     };
00139         
00140 }
00141 }
00142 
00143 
00144 #endif

Generated on Thu Jul 15 2010 17:51:28 for FCam by  doxygen 1.7.1