00001
00002
00003
00004
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
00022
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
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089