PIImager.h
Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 2012, 2013 All Rights Reserved, http://www.optris.de         *                                                                          *
00003  *  Optris GmbH                                                               *
00004  *  Ferdinand-Buisson-Str. 14                                                 *
00005  *  13127 Berlin                                                              *
00006  *  Germany                                                                   *
00007  *                                                                            *
00008  * Contributors:                                                              *
00009  * - Linux platform development in cooperation with Nuremberg Institute of    *
00010  *   Technology Georg Simon Ohm, http//www.th-nuernberg.de                    *
00011  * - Linux 64-Bit platform supported by Fraunhofer IPA,                       *
00012  *   http://www.ipa.fraunhofer.de                                             *
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 class ImagerUVC;
00022 class BaseControlDevice;
00023 class NewFrameBuffer;
00024 class ImageProcessing;
00025 
00026 namespace optris
00027 {
00028 
00029 typedef void (*fptrOptrisFrame)(unsigned short* data, unsigned int w, unsigned int h);
00030 typedef void (*fptrOptrisVisibleFrame)(unsigned char* data, unsigned int w, unsigned int h);
00031 
00032 class Timer;
00033 
00039 class PIImager
00040 {
00041 public:
00042 
00047   PIImager(const char* xmlConfig);
00048 
00052   PIImager();
00053 
00057   ~PIImager();
00058 
00071   void init(const char* v4lPath, unsigned long serial, EnumControlInterface controller, int fov, int tMin, int tMax, float framerate, EnumOutputMode mode, int bispectral);
00072 
00077   bool isOpen();
00078 
00084   char* checkCalibration(unsigned long serial);
00085 
00090   unsigned long getSerial();
00091 
00095   bool startStreaming();
00096 
00101   unsigned int getWidth();
00102 
00107   unsigned int getHeight();
00108 
00113   unsigned int getVisibleWidth();
00114 
00119   unsigned int getVisibleHeight();
00120 
00125   float getFramerate();
00126 
00131   float getMaxFramerate();
00136   unsigned int getRawBufferSize();
00137 
00142   int getTemperatureRangeMin();
00143 
00148   int getTemperatureRangeMax();
00149 
00154   bool hasBispectralTechnology();
00155 
00161   int getFrame(unsigned char *buffer);
00162 
00168   int acquire(unsigned short* buffer);
00169 
00170   //void yield();
00171 
00177   int getEnergyBuffer(unsigned short* buffer);
00178 
00185   int getMetaData(unsigned char* buffer, int size);
00186 
00191   void setFrameCallback(fptrOptrisFrame callback);
00192 
00197   void setVisibleFrameCallback(fptrOptrisVisibleFrame callback);
00198 
00202   void releaseFrame();
00203 
00208   void process(unsigned char* buffer);
00209 
00215   void setAutoFlag(bool flag);
00216 
00221   bool getAutoFlag();
00222 
00226   void forceFlagEvent();
00227 
00232   bool isFlagOpen();
00233 
00238   float getTempFlag();
00239 
00244   float getTempBox();
00245 
00250   float getTempChip();
00251 
00255   void onFlagState(unsigned int flagstate);
00256 
00260   void onThermalFrameInit(unsigned int width, unsigned int height);
00261 
00265   void onThermalFrame(unsigned short* buffer);
00266 
00270   void onVisibleFrameInit(unsigned int width, unsigned int height);
00271 
00275   void onVisibleFrame(unsigned char* buffer);
00276 
00280   int readControl(unsigned int id, int* value);
00281 
00285   int writeControl(unsigned int id, int value);
00286 
00287 private:
00288 
00289   bool _init;
00290 
00291   unsigned int _widthIn;
00292 
00293   unsigned int _heightIn;
00294 
00295   unsigned int _widthOut;
00296 
00297   unsigned int _heightOut;
00298 
00299   unsigned short* _buffer;
00300 
00301   unsigned int _widthOutVisible;
00302 
00303   unsigned int _heightOutVisible;
00304 
00305   unsigned char* _bufferVisible;
00306 
00307   fptrOptrisFrame _cbFrame;
00308 
00309   fptrOptrisVisibleFrame _cbVisibleFrame;
00310 
00311   int _fov;
00312 
00313   int _tMin;
00314 
00315   int _tMax;
00316 
00317   float _framerate;
00318 
00319   float _maxFramerate;
00320 
00321   int _outputmode;
00322 
00323   unsigned long _serial;
00324 
00325   const char* _v4lPath;
00326 
00327   EnumControlInterface _controller;
00328 
00329   bool _autoFlag;
00330 
00331   bool _manualFlag;
00332 
00333   float _tBox;
00334 
00335   float _tChip;
00336 
00337   float _tFlag;
00338 
00339   int _bispectral;
00340 
00341   Timer* _t;
00342 
00343   ImagerUVC* _uvc;
00344 
00345   BaseControlDevice* _udev;
00346 
00347   unsigned int _flagstate;
00348 
00349   NewFrameBuffer* _SGBuffer;
00350 
00351   ImageProcessing* _ip;
00352 };
00353 
00354 }
00355 
00356 #endif


optris_drivers
Author(s): Stefan May (Nuremberg Institute of Technology Georg Simon Ohm - www.th-nuernberg.de), 64-Bit platform supported by Fraunhofer IPA (www.ipa.fraunhofer.de), Support for ROS hydro migration by Christopher-Eyk Hrabia (DAI-Labor, Technische Universität Berlin)
autogenerated on Mon Oct 6 2014 03:09:39