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 "Platform.h"
00016 #include <vector>
00017 #include <pthread.h>
00018
00019 namespace FCam {
00020 namespace F2 {
00021
00022 class Daemon;
00023
00030 class Sensor : public FCam::Sensor {
00031 public:
00032
00033 Sensor();
00034 ~Sensor();
00035
00036 void capture(const FCam::Shot &);
00038 void capture(const Shot &);
00039
00040 void capture(const std::vector<FCam::Shot> &);
00042 void capture(const std::vector<Shot> &);
00043
00044 void stream(const FCam::Shot &);
00046 void stream(const Shot &);
00047
00048 void stream(const std::vector<FCam::Shot> &);
00050 void stream(const std::vector<Shot> &);
00051
00052 bool streaming();
00053 void stopStreaming();
00054 void start();
00055 void stop();
00056
00061 virtual int maxExposure() const {return 2489140;}
00062
00066 virtual int minExposure() const {return 38;}
00067
00071 virtual int maxFrameTime() const {return 2490072;}
00072
00076 virtual int minFrameTime() const {return 33414;}
00077
00079 virtual float maxGain() const {return 32.0f;}
00080
00082 virtual float minGain() const {return 1.0f;}
00083
00084
00086 Size minImageSize() const;
00088 Size maxImageSize() const;
00090 static Size pixelArraySize();
00093 static Rect activeArrayRect();
00097 static Rect pixelArrayRect();
00098
00100 int rollingShutterTime(const Shot &) const;
00101
00102 int rollingShutterTime(const FCam::Shot &) const;
00103
00104 int framesPending() const;
00105 int shotsPending() const;
00106
00107 virtual const Platform &platform() { return F2::Platform::instance(); }
00108
00109 FCam::F2::Frame getFrame();
00110
00111
00112 void debugTiming(bool);
00113
00114 protected:
00115
00116 FCam::Frame getBaseFrame() {return getFrame();}
00117
00118 private:
00119
00120 std::vector<Shot> streamingShot;
00121
00122
00123 friend class Daemon;
00124 Daemon *daemon;
00125
00126
00127 void generateRequest();
00128
00129 pthread_mutex_t requestMutex;
00130
00131
00132 void enforceDropPolicy();
00133
00134
00135 const std::vector<int> &getColorTemps() const;
00136 const float *getColorMatrix(int i) const;
00137
00138
00139 int shotsPending_;
00140 };
00141
00142 }
00143 }
00144
00145
00146 #endif