FilterCanvas.h

Go to the documentation of this file.
00001 #ifndef __FILTER_CANVAS_H__
00002 #define __FILTER_CANVAS_H__
00003 
00004 #include "CS123Canvas.h"
00005 
00006 class FilterApp;
00007 class Filter;
00008 
00009 enum FILTER {
00010    //! Required Filters
00011    NONE, GREYSCALE, BLUR, SCALE, EDGEDETECT, INVERT, 
00012 
00013    //! Extra Credit -- Huzzah!
00014    ROTATE, SPECIAL1, SPECIAL2, SEAMCARVING
00015 };
00016 
00017 //! Specialized canvas for filter 
00018 /* This class has some methods that will be called automatically to 
00019  * facilitate the UI interaction for required filters.  You will not
00020  * need to modify this file */
00021 class FilterCanvas : public CS123Canvas {
00022    
00023    Q_OBJECT
00024 
00025    public:
00026       FilterCanvas();
00027       virtual ~FilterCanvas();
00028 
00029    public slots:
00030       //! Should apply the current filter to this canvas
00031       virtual void applyFilter() = 0;
00032       
00033       //! Should change the current filter of this canvas
00034       virtual void setFilter(int) = 0;
00035       
00036       //! The following methods are called whenever the default controls 
00037       //! are changed for a filter in FilterApp.C
00038       //! --------------------------------------------------------------
00039       virtual void filterBlurKernelWidthChanged(int newWidth) = 0;
00040       
00041       virtual void filterScaleWidthChanged(int newWidth) = 0;
00042       virtual void filterScaleHeightChanged(int newHeight) = 0;
00043       
00044       virtual void filterEdgeDetectThresholdChanged(int threshold) = 0;
00045       
00046       //! Extra Credit notifications (default handling is to ignore the signal)
00047       //! Note:  If you want to add your own controls, create the appropriate 
00048       //! controls in FilterControls.C, and then add your SLOTS here to notify 
00049       //! your canvas when sliders/values are changed in the gui.
00050       virtual void filterRotateRotationChanged(int degrees);
00051 
00052       //! Note:  for SEAMCARVING, the same control signals are sent as the normal SCALE
00053 
00054    protected:
00055       //! Currently selected filter
00056       Filter *m_filter;
00057 };
00058 
00059 #endif
00060 

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