00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __CAMERA_HPP__
00041 #define __CAMERA_HPP__
00042
00043 #include <nt2/nt2.hh>
00044 #include <boost/thread/thread.hpp>
00045 #include <boost/tokenizer.hpp>
00046 #include <list>
00047 #include <CImg.h>
00048 #include "tempo.hpp"
00049 #include "grabber.hpp"
00050 #include "sender.hpp"
00051 #include "param.hpp"
00052 #include "paramip.hpp"
00053 #include "paramdisk.hpp"
00054 #include "camparam.hpp"
00055
00056
00057 #include "JpegDecompressor.hpp"
00058
00060 namespace ipsi
00061 {
00062
00158 static const bool PTZ=true;
00159
00170 template<class T, size_t N>
00171 class Camera
00172 {
00173 private:
00175 dataGrabber<T,N> *d ;
00177 cmdSender *cS ;
00179 boost::thread *t ;
00181 boost::mutex mMut ;
00183 unsigned int mFreq ;
00184
00185
00186 Caminfo c;
00187
00188
00190
00191
00193 bool PTZ ;
00194
00195 JpegDecompressor* jpeg ;
00196
00197
00198 public:
00199
00201 std::string cmd;
00202
00203
00211 Camera( Param* param );
00212
00218 ~Camera();
00219
00224 buffer_t getNextFrame();
00225
00233 void affiche_PTZ();
00234
00238 void affiche_nPTZ();
00239
00244 cimg_library::CImg<unsigned char>& getNextImg(cimg_library::CImg<unsigned char>& image, buffer_t &img, const size_t width, const size_t height);
00245
00249 void affiche();
00250
00258 std::list<buffer_t> snapshot(unsigned int nb, unsigned int dt);
00259
00266 void recSnap(unsigned int nb, unsigned int dt);
00267
00275 void sendReq(const std::string & command);
00276
00283 void sendReqFormat(const std::string & command);
00284
00290 void clearLog();
00291
00292 void send_cmd(cimg_library::CImgDisplay & main_disp, const size_t x1, const size_t x2, const size_t y1);
00293
00297 void stop();
00298 };
00299
00300 #include "camera.impl.hpp"
00301
00302 }
00303
00304 #endif