FilterApp.h

Go to the documentation of this file.
00001 #ifndef __FILTERAPP_H__
00002 #define __FILTERAPP_H__
00003 
00004 #include <QMainWindow>
00005 #include <QVector>
00006 #include <QStack>
00007 
00008 class CS123Canvas;
00009 class CS123CanvasContainer;
00010 class QImage;
00011 class QDockWidget;
00012 class FilterControl;
00013 class FilterCanvas;
00014 class QPushButton;
00015 
00016 //! Top level UI for Filter
00017 class FilterApp : public QMainWindow {
00018     Q_OBJECT
00019 
00020     public:
00021    FilterApp(int argc, char **argv);
00022    ~FilterApp();
00023 
00024    void addCanvas(FilterCanvas* canvas);
00025    void addCanvas(FilterCanvas* canvas, const char* title);
00026 
00027     signals:
00028    void applyFilter();
00029    void filterChanged(int type);
00030 
00031    private slots:
00032        void nonePressed();
00033    void greyscalePressed();
00034    void blurPressed();
00035    void scalePressed();
00036    void edgeDetectPressed();
00037    void invertPressed();
00038    void rotatePressed();
00039    void special1Pressed();
00040    void special2Pressed();
00041    void seamCarvingPressed();
00042 
00043    void loadPressed();
00044    void savePressed();
00045 
00046    void selectComboBox(int);
00047 
00048    void applyPressed(bool);
00049 
00050    void unsynchronizeMarquee();
00051    void synchronizeMarquee();
00052 
00053    void selectionChanged(int x1, int y1, int x2, int y2);
00054 
00055     private:
00056    void initFilterTypes(QMenu* filterMenu);
00057    void setCurrentFilter(int type);
00058    CS123Canvas *getActiveCanvas(const char *text);
00059 
00060    //! NOTE:  If you would like to change/add controls for your filters, 
00061    //! this is the method you should look at as an example.
00062    void setupFilterControls();
00063 
00064    QStack<CS123CanvasContainer *> m_canvases;
00065    int m_noCanvas, m_selectedCombo;
00066 
00067    //! filename for default image passed via command-line
00068    QImage *m_defaultImage;
00069 
00070    //! synchronize marquee between all CS123Canvas' in the app
00071    bool m_syncMarquee;
00072 
00073    int m_currentFilter;
00074    QDockWidget *m_controlContainer;
00075 
00076    QVector<FilterControl*> m_filterControls;
00077 
00078    QPushButton *m_applyButton;
00079 };
00080 
00081 #endif
00082 

Generated on Sat Sep 20 04:06:12 2008 for CS123Support by  doxygen 1.5.6