Camstream: CamStream API documentation

Main Page Class Hierarchy Compound List File List Compound Members File Members

# CamPanel.h

Go to the documentation of this file.

    00001 #ifndef CAMPANEL_HPP
    00002 #define CAMPANEL_HPP
    00003
    00004 #if HAVE_CONFIG_H
    00005 #include <config.h>
    00006 #endif
    00007
    00008 #include <qdialog.h>
    00009 #include <qimage.h>
    00010 #include <qobject.h>
    00011 #include <qpainter.h>
    00012 #include <qpopupmenu.h>
    00013 #include <qsize.h>
    00014 #include <qwidget.h>
    00015
    00016 class CCamPanel: public QWidget
    00017 {
    00018    Q_OBJECT
    00019 private:
    00020    // Image and visible size
    00021    QSize ImgSize, VisSize;
    00022    QString Name, Description;
    00023    QImage ImgNull; // Default empty image
    00024    bool Drawable;
    00025    int Usage;
    00026    int PanelType;
    00027
    00028    void CallIntg(int n, uchar *dst, uchar *src);
    00029
    00030 protected:
    00032    int image_w;
    00034    int image_h;
    00036    int half_w;
    00038    int half_h;
    00039
    00041    QImage ImgRGB;
    00043    QImage ImgY;
    00045    QImage ImgU;
    00047    QImage ImgV;
    00049    QPixmap PixGraph;
    00050
    00051    QPopupMenu *pMenu;
    00052    bool MenuVisible;
    00053
    00054    CCamPanel(const QString &new_name, const QString &new_description, int panel_type, bool draw = TRUE, QWidget *parent = 0, const char *name = 0);
    00055    void SetImageSize(const QSize &new_size);
    00056    void SetVisibleSize(const QSize &new_size);
    00057    void CreateImages();
    00058
    00059    void ConnectUsage(CCamPanel *parent);
    00060    void ConnectResizes(CCamPanel *parent);
    00061
    00062 public:
    00066    enum PanelTypes {
    00067      None,
    00068      RGB,
    00069      YUV420,
    00070      Graph,
    00071    };
    00072
    00073    virtual ~CCamPanel();
    00074
    00075    QString GetName() const;
    00076    QString GetDescription() const;
    00077    int GetPanelType() const;
    00078    QSize GetImageSize() const;
    00079    QSize GetVisibleSize() const;
    00080    bool IsDrawable();
    00081    int IsUsed();
    00082
    00083 //   virtual void Draw(QPainter *p);
    00084    virtual const QImage &GetImage(int n = 0);
    00085    const QPixmap &GetPixmap() const;
    00086
    00087    virtual QDialog *GetPropertiesDialog() const;
    00088
    00089    // Operators
    00090    const CCamPanel &copy(const CCamPanel &src);
    00091    const CCamPanel &operator += (const CCamPanel &add);
    00092    CCamPanel &operator -= (const CCamPanel &minus);
    00093
    00094    // overloaded from QWidget
    00095    virtual QSize sizeHint() const;
    00096    virtual QSizePolicy sizePolicy() const;
    00097    virtual void paintEvent(QPaintEvent *);
    00098
    00099 public slots:
    00100    virtual void SetSize(const QSize &new_size);
    00101
    00102    void IncrementUse();
    00103    void DecrementUse();
    00104
    00105    virtual void RightClick(const QPoint &pos);
    00106
    00107 signals:
    00109    void ChangedImageSize(const QSize &new_size);
    00111    void ChangedVisibleSize(const QSize &new_size);
    00113    void ChangedVisibility(bool new_visibility);
    00115    void ChangedToVisible();
    00117    void ChangedToHidden();
    00119    void ChangedUsage(int new_usage);
    00121    void ChangedToUsed();
    00123    void ChangedToUnused();
    00125    void Updated();
    00126 };
    00127
    00128 #endif