Go to the documentation of this file.00001 #ifndef FCAM_DUMMY_SENSOR_H
00002 #define FCAM_DUMMY_SENSOR_H
00003
00008 #include <pthread.h>
00009
00010 #include "../Sensor.h"
00011 #include "Frame.h"
00012
00013 namespace FCam { namespace Dummy {
00014
00015 class Daemon;
00016
00025 class Sensor : public FCam::Sensor {
00026 public:
00027 Sensor(); ~Sensor();
00028
00029 void capture(const FCam::Shot &);
00030 void capture(const Shot &);
00031
00032 void capture(const std::vector<FCam::Shot> &);
00033 void capture(const std::vector<Shot> &);
00034
00035 void stream(const FCam::Shot &);
00036 void stream(const Shot &);
00037
00038 void stream(const std::vector<FCam::Shot> &);
00039 void stream(const std::vector<Shot> &);
00040
00041 bool streaming();
00042 void stopStreaming();
00043 void start();
00044 void stop();
00045
00046 virtual int maxExposure() const {return 10000000;}
00047
00048 virtual int minExposure() const {return 1;}
00049
00050 virtual int maxFrameTime() const {return 10000000;}
00051
00052 virtual int minFrameTime() const {return 1;}
00053
00054 virtual float maxGain() const {return 1000.0f;}
00055
00056 virtual float minGain() const {return 1.0f;}
00057
00058 virtual Size minImageSize() const {return Size(1, 1);}
00059
00060 virtual Size maxImageSize() const {return Size(3000, 2000);}
00061
00062 virtual int maxHistogramRegions() const {return 4;}
00063
00064 int rollingShutterTime(const FCam::Shot &) const;
00065
00066 int framesPending() const;
00067 int shotsPending() const;
00068
00069 unsigned short minRawValue() const;
00070 unsigned short maxRawValue() const;
00071
00072 BayerPattern bayerPattern() const;
00073
00074 const std::string &manufacturer() const;
00075 const std::string &model() const;
00076
00077 virtual void rawToRGBColorMatrix(int kelvin, float *matrix) const;
00078
00079 FCam::Dummy::Frame getFrame();
00080
00081 protected:
00082
00083 FCam::Frame getBaseFrame() {return getFrame();}
00084
00085 private:
00086 friend class Daemon;
00087 Daemon *daemon;
00088
00089 void generateRequest();
00090
00091 pthread_mutex_t requestMutex;
00092
00093
00094 std::vector<Shot> streamingShot;
00095
00096 void enforceDropPolicy();
00097
00098 int shotsPending_;
00099 };
00100 }}
00101
00102 #endif