QCamAdd.hpp

00001 #ifndef _QCamAdd_hpp_
00002 #define _QCamAdd_hpp_
00003 
00004 #include <qobject.h>
00005 
00006 
00007 #include "QCam.hpp"
00008 #include <qsize.h>
00009 #include <stdio.h>
00010 #include <stdlib.h>
00011 //#include <linux/types.h>
00012 //#include <linux/videodev.h>
00013 #include <math.h>
00014 
00015 #define QCAM_ADD_COLOR
00016 
00017 class QCamSlider;
00018 class QImage;
00019 class QHBox;
00020 class QPushButton;
00021 class elementaryFrame;
00022 class QProgressBar;
00023 class QCamRadioBox;
00024 class QCamComboBox;
00025 class QCheckBox;
00026 class QVGroupBox;
00027 class QHGroupBox;
00028 
00029 #define MultiSatMode
00030 
00032 class QCamAdd : public QCam {
00033    Q_OBJECT
00034    QCam * cam_;
00037    int numOfActivatedBuffers_;
00039    int numOfActiveBuffers_;
00040    int curBuff_;
00041    int * integrationBuff_;
00042    
00043    QCamFrame * frameHistory_;
00044    mutable QCamFrame computedFrame_;
00045    QSize curSize_;
00046    int maxYValue_;
00047    int minYValue_;
00048    int maxCrValue_;
00049 #ifdef MultiSatMode
00050    int maxCrValueAutoSaturated_;
00051 #else
00052    bool maxCrValueAutoSaturated_;
00053 #endif
00054    bool maxYValueAuto_;
00055    bool minYValueAuto_;
00056    
00057    static const int numOfBuffers_;
00058    
00059    mutable bool newIntegrationBuff_;
00060    double (*funcDisplay_)(double);
00061    bool negateDisplay_;
00062    ImageMode mode_;
00063    void allocBuff(const QSize &);
00064    void zeroBuff(const QSize & size);
00065    //void clear();
00066    void addFrame(const QCamFrame &);
00067    bool writeFit(const QString & name,int * buff) const;
00068    bool loadFit(const QString & name,int * buff) const;
00069    void integration2yuv(const int * integration,
00070                         QCamFrame & yuv ) const ;
00071    void removeFrame(const QCamFrame & frame);
00072    void addFrame(const QCamFrame & frame,
00073                  int & maxYValue,
00074                  int & minYValue,
00075                  int & maxCrValue);
00076    void moveFrame(const QCamFrame & frame,
00077                   int & maxYValue,
00078                   int & minYValue,
00079                   int & maxCrValue,
00080                   const bool adding);
00081    /* for remote control */
00082    QHGroupBox * accumulationWidget_;
00083    QCamComboBox *remoteCTRLnumOfActiveBuffer_;
00084    QProgressBar * bufferFill_;
00085    QPushButton * resetBufferFill_;
00086    QVGroupBox * displayOptions_;
00087    QCamSlider *remoteCTRLmaxYvalue_;
00088    QCamSlider *remoteCTRLminYvalue_;
00089    QCamRadioBox * modeDisplayButton_;
00090    QCheckBox * invDisplayButton_;
00091 #ifdef MultiSatMode
00092    QCamRadioBox * maxCrSaturatedButton_;
00093 #else
00094    QCheckBox * maxCrSaturatedButton_;
00095 #endif
00096 public:
00097    QCamAdd(QCam* cam);
00098    const QSize & size() const { return cam_->size();}
00099    void resize(const QSize & s) {cam_->resize(s);}
00100    virtual const QSize * getAllowedSize() const { return QCam::getAllowedSize();}
00101    ~QCamAdd();
00102    QWidget * buildGUI(QWidget * parent);
00103    QCamFrame yuvFrame() const;
00104 public slots:
00105    void setNumOfBuffer(int nbuf);
00106    void setMaxYvalue(int);
00107    void setMinYvalue(int);
00108    void resetBufferFill();
00109    void modeDisplay(int val);
00110    void negateDisplay(bool val) {negateDisplay_=val;}
00111 #ifdef  MultiSatMode
00112    void maxSaturatedColors(int val) {maxCrValueAutoSaturated_=val;}
00113 #else
00114    void maxSaturatedColors(bool val) {maxCrValueAutoSaturated_=val;}
00115 #endif
00116  signals:
00117    void numOfBufferChange(int);
00118    void maxYValueChange(int);
00119    void minYValueChange(int);
00120  private slots:
00121    void addNewFrame();
00122 };
00123 
00124 #endif
00125 
00126 
00127 
00128 
00129 
00130 

Generated on Sat Oct 27 09:21:03 2007 for QastroCam by  doxygen 1.5.1