Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef PIIMAGER_H
00016 #define PIIMAGER_H
00017
00018 enum EnumControlInterface {HIDController=1, UVCController=2};
00019 enum EnumOutputMode {Energy=1, Temperature=2};
00020
00021 namespace optris
00022 {
00023
00024 typedef void (*fptrOptrisFrame)(unsigned short* data, unsigned int w, unsigned int h);
00025 typedef void (*fptrOptrisVisibleFrame)(unsigned char* data, unsigned int w, unsigned int h);
00026
00032 class PIImager
00033 {
00034 public:
00035
00040 PIImager(const char* xmlConfig);
00041
00045 PIImager();
00046
00050 ~PIImager();
00051
00064 void init(const char* v4lPath, unsigned long serial, EnumControlInterface controller, int fov, int tMin, int tMax, float framerate, EnumOutputMode mode, int bispectral);
00065
00070 bool isOpen();
00071
00077 char* checkCalibration(unsigned long serial);
00078
00083 unsigned long getSerial();
00084
00088 bool startStreaming();
00089
00094 unsigned int getWidth();
00095
00100 unsigned int getHeight();
00101
00106 unsigned int getVisibleWidth();
00107
00112 unsigned int getVisibleHeight();
00113
00118 float getFramerate();
00119
00124 float getMaxFramerate();
00129 unsigned int getRawBufferSize();
00130
00135 int getTemperatureRangeMin();
00136
00141 int getTemperatureRangeMax();
00142
00147 bool hasBispectralTechnology();
00148
00154 int getFrame(unsigned char *buffer);
00155
00161 int acquire(unsigned short* buffer);
00162
00163
00164
00170 int getEnergyBuffer(unsigned short* buffer);
00171
00178 int getMetaData(unsigned char* buffer, int size);
00179
00184 void setFrameCallback(fptrOptrisFrame callback);
00185
00190 void setVisibleFrameCallback(fptrOptrisVisibleFrame callback);
00191
00195 void releaseFrame();
00196
00201 void process(unsigned char* buffer);
00202
00208 void setAutoFlag(bool flag);
00209
00214 bool getAutoFlag();
00215
00219 void forceFlagEvent();
00220
00225 bool isFlagOpen();
00226
00231 float getTempFlag();
00232
00237 float getTempBox();
00238
00243 float getTempChip();
00244
00248 void onThermalFrameInit(unsigned int width, unsigned int height);
00249
00253 void onThermalFrame(unsigned short* buffer);
00254
00258 void onVisibleFrameInit(unsigned int width, unsigned int height);
00259
00263 void onVisibleFrame(unsigned char* buffer);
00264
00268 int readControl(unsigned int id, int* value);
00269
00273 int writeControl(unsigned int id, int value);
00274
00275 private:
00276
00277 bool _init;
00278
00279 unsigned int _widthIn;
00280
00281 unsigned int _heightIn;
00282
00283 unsigned int _widthOut;
00284
00285 unsigned int _heightOut;
00286
00287 unsigned short* _buffer;
00288
00289 unsigned int _widthOutVisible;
00290
00291 unsigned int _heightOutVisible;
00292
00293 unsigned char* _bufferVisible;
00294
00295 fptrOptrisFrame _cbFrame;
00296
00297 fptrOptrisVisibleFrame _cbVisibleFrame;
00298
00299 int _fov;
00300
00301 int _tMin;
00302
00303 int _tMax;
00304
00305 float _framerate;
00306
00307 float _maxFramerate;
00308
00309 int _outputmode;
00310
00311 unsigned long _serial;
00312
00313 const char* _v4lPath;
00314
00315 EnumControlInterface _controller;
00316
00317 bool _autoFlag;
00318
00319 bool _manualFlag;
00320
00321 float _tBox;
00322
00323 float _tChip;
00324
00325 float _tFlag;
00326
00327 int _bispectral;
00328 };
00329
00330 }
00331
00332 #endif