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

plfiltercontrast.h

00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plfiltercontrast.h,v 1.3 2002/02/24 13:00:46 uzadow Exp $
00005 |
00006 |      Copyright (c) 1996-2002 Ulrich von Zadow
00007 |
00008 \--------------------------------------------------------------------
00009 */
00010 
00011 #if !defined(INCL_PLFILTERCONTRAST)
00012 #define INCL_PLFILTERCONTRAST
00013 
00014 #if _MSC_VER > 1000
00015 #pragma once
00016 #endif // _MSC_VER > 1000
00017 
00018 #include "plfilter.h"
00019 #include "plpaintlibdefs.h"
00020 
00021 class PLBmp;
00022 
00023 //! Enhances or reduces the image contrast using a linear mapping
00024 //! between input and output. The zero point (i. e., the intensity
00025 //! that is neither enhanced nor reduced) has to be provided.
00026 //! (A Contrast filter is defined in the following way: It lowers all
00027 //! intensity values below a given threshold, and it raises them
00028 //! beyond. Most applications position the threshold at 50 %. This
00029 //! does not always yield the best results, especially if you have an
00030 //! unbalanced dark/light ratio of pixels. The best you can do here
00031 //! is play around with the threshold.)
00032 //! Works for 24 and 32 bpp bitmaps.
00033 class PLFilterContrast : public PLFilter
00034 {
00035 public:
00036   //! contrast is the slope of the function. offset is the intensity
00037   //! at which the color stays the same. Above this value, intensities
00038   //! are increased. Below it, they are reduced. With offset 128 and
00039   //! contrast 1, the image stays unchanged.
00040   PLFilterContrast(double contrast,
00041                    PLBYTE offset);
00042   virtual ~PLFilterContrast();
00043   virtual void Apply(PLBmp *pBmpSource, PLBmp* pBmpDest) const;
00044 
00045 protected:
00046   double m_contrast;
00047   double m_offset;
00048 };
00049 #endif
00050 
00051 /*
00052 /--------------------------------------------------------------------
00053 |
00054 |      $Log: plfiltercontrast.h,v $
00055 |      Revision 1.3  2002/02/24 13:00:46  uzadow
00056 |      Documentation update; removed buggy PLFilterRotate.
00057 |
00058 |      Revision 1.2  2001/10/06 22:03:26  uzadow
00059 |      Added PL prefix to basic data types.
00060 |
00061 |      Revision 1.1  2001/09/16 19:03:23  uzadow
00062 |      Added global name prefix PL, changed most filenames.
00063 |
00064 |      Revision 1.5  2001/01/15 15:05:31  uzadow
00065 |      Added PLBmp::ApplyFilter() and PLBmp::CreateFilteredCopy()
00066 |
00067 |      Revision 1.4  2001/01/13 14:44:52  uzadow
00068 |      Doc update.
00069 |
00070 |      Revision 1.3  2001/01/12 23:30:01  uzadow
00071 |      Doc update.
00072 |
00073 |      Revision 1.2  2001/01/12 23:04:37  uzadow
00074 |      Comments.
00075 |
00076 |      Revision 1.1  2000/11/06 23:20:22  uzadow
00077 |      Added Contrast, Intensity and Lightness filters by
00078 |      Thomas Hirschmann
00079 |
00080 |
00081 \--------------------------------------------------------------------
00082 */

Generated on Sun Jun 6 13:42:22 2004 for paintlib by doxygen 1.3.2