Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

image_filters.h

Go to the documentation of this file.
00001 /*
00002  * image_filters.h -- RGB24 image filters
00003  * Copyright (C) 2002 Charles Yates <charles.yates@pandora.be>
00004  * Copyright (C) 2002-2007 Dan Dennedy <dan@dennedy.org>
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software Foundation,
00018  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 #ifndef _IMAGE_FILTERS_H_
00022 #define _IMAGE_FILTERS_H_
00023 
00024 // C++ Includes
00025 
00026 #include <vector>
00027 using std::vector;
00028 
00029 // C Includes
00030 
00031 #include <stdint.h>
00032 #include <gtk/gtk.h>
00033 
00038 class NullImageFilter
00039 {
00040 };
00041 
00051 class ImageFilter 
00052 {
00053     public:
00054         virtual ~ImageFilter() {}
00055         virtual char *GetDescription( ) const = 0;
00056         virtual void FilterFrame( uint8_t *pixels, int width, int height, double position, double frame_delta ) = 0;
00057         virtual bool IsUsable( ) { return true; }
00058 };
00059 
00080 class GDKImageFilter : public ImageFilter
00081 {
00082     public:
00083         virtual ~GDKImageFilter() {}
00084         virtual void AttachWidgets( GtkBin *bin ) { }
00085         virtual void DetachWidgets( GtkBin *bin ) { }
00086         virtual void InterpretWidgets( GtkBin *bin ) { }
00087 };
00088 
00095 class GDKImageFilterAdapter : public GDKImageFilter
00096 {
00097     private:
00098         ImageFilter *filter;
00099 
00100     public:
00101         GDKImageFilterAdapter( ImageFilter *filter ) { this->filter = filter; }
00102         virtual ~GDKImageFilterAdapter( ) { delete filter; }
00103         char *GetDescription( ) const { return this->filter->GetDescription( ); }
00104         void FilterFrame( uint8_t *pixels, int width, int height, double position, double frame_delta ) 
00105         { 
00106             return this->filter->FilterFrame( pixels, width, height, position, frame_delta ); 
00107         }
00108 };
00109 
00120 class GDKImageFilterRepository
00121 {
00122     private:
00123         vector <GDKImageFilter *> filters;
00124         GDKImageFilter *selected_filter;
00125         GtkOptionMenu *menu;
00126         GtkBin *container;
00127     public:
00128         GDKImageFilterRepository();
00129         ~GDKImageFilterRepository();
00130         void Register( GDKImageFilter *filter );
00131         void Initialise( GtkOptionMenu *menu, GtkBin *container );
00132         GDKImageFilter *Get( ) const;
00133         void SelectionChange( );
00134 };
00135 
00136 #endif

Generated on Sun Mar 11 22:11:45 2007 for Kino by  doxygen 1.4.2