00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: plfilterfillrect.h,v 1.1 2004/05/21 21:02:53 maxx 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 // Fills a rectangle in a Bitmap with a color 00022 template<class PixelC> class PLFilterFillRect: public PLFilter 00023 { 00024 public: 00025 PLFilterFillRect (PLPoint min, PLPoint max, const PixelC& Color); 00026 virtual ~PLFilterFillRect(); 00027 virtual void ApplyInPlace(PLBmp *pBmp) const; 00028 00029 private: 00030 PixelC m_Color; 00031 PLPoint m_min; 00032 PLPoint m_max; 00033 }; 00034 00035 template<class PixelC> 00036 PLFilterFillRect<PixelC>::PLFilterFillRect 00037 (PLPoint min, PLPoint max, const PixelC& Color) 00038 { 00039 m_min = min; 00040 m_max = max; 00041 m_Color = Color; 00042 } 00043 00044 template<class PixelC> 00045 PLFilterFillRect<PixelC>::~PLFilterFillRect () 00046 { 00047 00048 } 00049 00050 template<class PixelC> 00051 void PLFilterFillRect<PixelC>::ApplyInPlace (PLBmp *pBmp) const 00052 { 00053 PixelC** ppLines = (PixelC**)(pBmp->GetLineArray()); 00054 for (int y=m_min.y; y<m_max.y; ++y) 00055 { 00056 PixelC* pLine = ppLines[y]; 00057 for (int x=m_min.x; x<m_max.x; ++x) 00058 pLine[x] = m_Color; 00059 } 00060 } 00061 00062 #endif 00063 00064 /* 00065 /-------------------------------------------------------------------- 00066 | 00067 | $Log: plfilterfillrect.h,v $ 00068 | Revision 1.1 2004/05/21 21:02:53 maxx 00069 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00070 | 00071 | Revision 1.1 2002/11/13 01:59:47 mspindle 00072 | *** empty log message *** 00073 | 00074 | Revision 1.4 2002/02/10 22:53:26 uzadow 00075 | Fixed cdoc problems. 00076 | 00077 | Revision 1.3 2001/10/21 17:12:40 uzadow 00078 | Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel. 00079 | 00080 | Revision 1.2 2001/09/28 19:50:56 uzadow 00081 | Added some 24 bpp stuff & other minor features. 00082 | 00083 | Revision 1.1 2001/09/16 19:03:23 uzadow 00084 | Added global name prefix PL, changed most filenames. 00085 | 00086 | Revision 1.1 2001/09/13 20:48:42 uzadow 00087 | Added fill filters. 00088 | 00089 | Revision 1.1 2001/09/13 10:39:31 uzadow 00090 | Added FilterFillRect 00091 | 00092 | 00093 \-------------------------------------------------------------------- 00094 */