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

Fl_Image_Filter.h

00001 /*
00002  * $Id: Fl_Image_Filter.h,v 1.5 2003/02/04 16:23:11 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_IMAGEFILTER_H_
00023 #define _FL_IMAGEFILTER_H_
00024 
00025 #include "Enumerations.h"
00026 #include "Fl_Renderer.h"
00027 #include "Fl_Util.h"
00028 
00029 class Fl_Image;
00030 
00039 // apply_to_[new|this](Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1, float val2, float val3)
00040 // image - Fl_Image where to apply modifier
00041 // rect - rectangle to apply or NULL for whole image
00042 // filter - modifier filter (see end of this file)
00043 // float val1-val3 modifier values, defined below
00044 
00048 class Fl_Image_Filter
00049 {
00050 public:
00051     static bool apply_to_this(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter);
00052     static bool apply_to_this(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1);
00053     static bool apply_to_this(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1, float val2);
00054     static bool apply_to_this(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1, float val2, float val3);
00055 
00056     static Fl_Image *apply_to_new(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter);
00057     static Fl_Image *apply_to_new(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1);
00058     static Fl_Image *apply_to_new(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1, float val2);
00059     static Fl_Image *apply_to_new(Fl_Image *image, Fl_Rect *rect, Fl_Image_Filter *filter, float val1, float val2, float val3);
00060 
00061 protected:
00062     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3) { return false; }
00063 };
00064 
00065 class FilterBrightness : public Fl_Image_Filter
00066 {
00067 public:
00068     // Takes 1 value, brightness correction
00069     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00070 };
00071 
00072 class FilterContrast : public Fl_Image_Filter
00073 {
00074 public:
00075     // Takes 1-3 values (RGB), contrast correction
00076     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00077 };
00078 
00079 class FilterGamma : public Fl_Image_Filter
00080 {
00081 public:
00082     // Takes 1-3 values (RGB), gamma correction
00083     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00084 };
00085 
00086 class FilterGrayscale : public Fl_Image_Filter
00087 {
00088 public:
00089     // Takes 1 value, grayscales image. val1 as intensity
00090     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00091 };
00092 
00093 class FilterForeBlend : public Fl_Image_Filter
00094 {
00095 public:
00096     // Takes 0 value, grayscales image
00097     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00098 };
00099 
00100 class FilterBackBlend : public Fl_Image_Filter
00101 {
00102 public:
00103     // Takes 0 value, grayscales image
00104     virtual bool execute(uint8 **data, Fl_Rect &rect, int pitch, Fl_PixelFormat *fmt, float val1, float val2, float val3);
00105 };
00106 
00107 extern FL_API FilterBrightness filter_brightness;
00108 #define FILTER_BRIGHTNESS (&filter_brightness)
00109 
00110 extern FL_API FilterContrast filter_contrast;
00111 #define FILTER_CONTRAST (&filter_contrast)
00112 
00113 extern FL_API FilterGamma filter_gamma;
00114 #define FILTER_GAMMA (&filter_gamma)
00115 
00116 extern FL_API FilterGrayscale filter_grayscale;
00117 #define FILTER_GRAYSCALE (&filter_grayscale)
00118 
00119 extern FL_API FilterForeBlend filter_foreblend;
00120 #define FILTER_FOREBLEND (&filter_foreblend)
00121 
00122 extern FL_API FilterBackBlend filter_backblend;
00123 #define FILTER_BACKBLEND (&filter_backblend)
00124 
00125 #endif

Generated on Thu Jul 31 15:33:44 2003 for eFLTK by doxygen1.2.15