• 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 #include "Platform.h"
00015 
00016 namespace FCam { namespace N900 {
00017 
00018     class Daemon;
00019 
00042     class Sensor : public FCam::Sensor {
00043     public:
00044             
00045         Sensor();
00046         ~Sensor();
00047         
00048         void capture(const FCam::Shot &);
00049         void capture(const std::vector<FCam::Shot> &);
00050         void stream(const FCam::Shot &s);
00051         void stream(const std::vector<FCam::Shot> &);
00052         bool streaming();
00053         void stopStreaming();
00054         void start();
00055         void stop();
00056 
00060         virtual int maxExposure() const {return 2489140;} 
00061 
00065         virtual int minExposure() const {return 38;}       
00066 
00070         virtual int maxFrameTime() const {return 2490072;}
00071 
00075         virtual int minFrameTime() const {return 33414;}      
00076 
00078         virtual float maxGain() const {return 32.0f;}     
00079 
00081         virtual float minGain() const {return 1.0f;}      
00082 
00084         virtual Size minImageSize() const {return Size(160, 120);}
00085 
00089         virtual Size maxImageSize() const {return Size(2592, 1968);}
00090 
00092         virtual int maxHistogramRegions() const {return 4;}
00093 
00094 
00098         int rollingShutterTime(const Shot &) const;
00099             
00100         int framesPending() const;
00101         int shotsPending() const;
00102 
00103         virtual const Platform &platform() {return N900::Platform::instance();}
00104 
00105         FCam::N900::Frame getFrame();
00106 
00107     protected:
00108         
00109         FCam::Frame getBaseFrame() {return getFrame();}
00110 
00111     private:
00112         // The currently streaming shot            
00113         std::vector<Shot> streamingShot;            
00114 
00115         // The daemon that manages the N900's sensor
00116         friend class Daemon;
00117         Daemon *daemon;
00118             
00119         // the Daemon calls this when it's time for new frames to be queued up
00120         void generateRequest();
00121 
00122         pthread_mutex_t requestMutex;
00123           
00124         // enforce the specified drop policy
00125         void enforceDropPolicy();
00126 
00127         // The number of outstanding shots
00128         int shotsPending_;  
00129 
00130         // This is so the daemon can inform the sensor that a frame
00131         // was dropped due to the frame limit being hit in a
00132         // thread-safe way
00133         void decShotsPending();
00134     };
00135         
00136 }
00137 }
00138 
00139 
00140 #endif

Generated on Mon Aug 16 2010 14:25:45 for FCam by  doxygen 1.7.1