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

plfilterfillrect.h

00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plfilterfillrect.h,v 1.4 2002/02/10 22:53:26 uzadow Exp $
00005 |
00006 \--------------------------------------------------------------------
00007 */
00008 
00009 #if !defined(INCL_PLFILTERFILLRECT)
00010 #define INCL_PLFILTERFILLRECT
00011 
00012 #if _MSC_VER > 1000
00013 #pragma once
00014 #endif // _MSC_VER > 1000
00015 
00016 #include "plfilter.h"
00017 #include "../plpoint.h"
00018 
00019 class PLBmp;
00020 
00021 //! Filter that fills a rectangle in a Bitmap with a color. Works
00022 //! for 8, 24 and 32 bpp.
00023 template<class PixelC> class PLFilterFillRect: public PLFilter
00024 {
00025 public:
00026     PLFilterFillRect (PLPoint min, PLPoint max, const PixelC& Color);
00027     virtual ~PLFilterFillRect();
00028     virtual void ApplyInPlace(PLBmp *pBmp) const;
00029 
00030 private:
00031     PixelC m_Color;
00032     PLPoint m_min;
00033     PLPoint m_max;
00034 };
00035 
00036 template<class PixelC>
00037 PLFilterFillRect<PixelC>::PLFilterFillRect
00038     (PLPoint min, PLPoint max, const PixelC& Color)
00039 {
00040   m_min = min;
00041   m_max = max;
00042   m_Color = Color;
00043 }
00044 
00045 template<class PixelC>
00046 PLFilterFillRect<PixelC>::~PLFilterFillRect ()
00047 {
00048 
00049 }
00050 
00051 template<class PixelC>
00052 void PLFilterFillRect<PixelC>::ApplyInPlace (PLBmp *pBmp) const
00053 {
00054   PixelC** ppLines = (PixelC**)(pBmp->GetLineArray());
00055   for (int y=m_min.y; y<m_max.y; ++y)
00056   {
00057     PixelC* pLine = ppLines[y];
00058     for (int x=m_min.x; x<m_max.x; ++x)
00059       pLine[x] = m_Color;
00060   }
00061 }
00062 
00063 #endif
00064 
00065 /*
00066 /--------------------------------------------------------------------
00067 |
00068 |      $Log: plfilterfillrect.h,v $
00069 |      Revision 1.4  2002/02/10 22:53:26  uzadow
00070 |      Fixed cdoc problems.
00071 |
00072 |      Revision 1.3  2001/10/21 17:12:40  uzadow
00073 |      Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel.
00074 |
00075 |      Revision 1.2  2001/09/28 19:50:56  uzadow
00076 |      Added some 24 bpp stuff & other minor features.
00077 |
00078 |      Revision 1.1  2001/09/16 19:03:23  uzadow
00079 |      Added global name prefix PL, changed most filenames.
00080 |
00081 |      Revision 1.1  2001/09/13 20:48:42  uzadow
00082 |      Added fill filters.
00083 |
00084 |      Revision 1.1  2001/09/13 10:39:31  uzadow
00085 |      Added FilterFillRect
00086 |
00087 |
00088 \--------------------------------------------------------------------
00089 */

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