00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: plfilterpixel.h,v 1.1 2004/05/21 21:02:53 maxx Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #ifndef INCL_FILTERPIXEL 00012 #define INCL_FILTERPIXEL 00013 00014 #if _MSC_VER > 1000 00015 #pragma once 00016 #endif 00017 00018 #include "plfilter.h" 00019 00020 #include "plpixel32.h" 00021 #include "plpixel24.h" 00022 #include "plpixel8.h" 00023 00024 #include <typeinfo.h> 00025 00026 template <class PixelC, class PixelOp> 00027 class PLFilterPixel : public PLFilter 00028 { 00029 public: 00030 PLFilterPixel(); 00031 00032 virtual ~PLFilterPixel(); 00033 00034 void ApplyInPlace(PLBmp * pBmp) const; 00035 }; 00036 00037 template <class PixelC, class PixelOp> 00038 PLFilterPixel<PixelC, PixelOp>::PLFilterPixel 00039 () 00040 { 00041 } 00042 00043 template <class PixelC, class PixelOp> 00044 PLFilterPixel<PixelC, PixelOp>::~PLFilterPixel () 00045 { 00046 } 00047 00048 template <class PixelC, class PixelOp> 00049 void PLFilterPixel<PixelC, PixelOp>::ApplyInPlace (PLBmp *pBmp) const 00050 { 00051 PixelC** ppLines = (PixelC**)(pBmp->GetLineArray()); 00052 00053 switch (pBmp->GetBitsPerPixel()) 00054 { 00055 case 32: 00056 PLASSERT (typeid(PixelC) == typeid (PLPixel32)); 00057 break; 00058 case 24: 00059 PLASSERT (typeid(PixelC) == typeid (PLPixel24)); 00060 break; 00061 case 8: 00062 PLASSERT (typeid(PixelC) == typeid (PLPixel8)); 00063 break; 00064 default: 00065 PLASSERT (false); 00066 } 00067 00068 PixelOp Op; 00069 for (int y=0; y<pBmp->GetHeight(); ++y) 00070 { 00071 PixelC* pLine = ppLines[y]; 00072 for (int x=0; x<pBmp->GetWidth(); ++x) 00073 pLine[x] = Op.Apply(pLine[x]); 00074 } 00075 } 00076 00077 #endif 00078 00079 /* 00080 /-------------------------------------------------------------------- 00081 | 00082 | $Log: plfilterpixel.h,v $ 00083 | Revision 1.1 2004/05/21 21:02:53 maxx 00084 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00085 | 00086 | Revision 1.1 2002/11/13 01:59:48 mspindle 00087 | *** empty log message *** 00088 | 00089 | Revision 1.3 2002/02/24 13:00:47 uzadow 00090 | Documentation update; removed buggy PLFilterRotate. 00091 | 00092 | Revision 1.2 2002/02/10 22:53:26 uzadow 00093 | Fixed cdoc problems. 00094 | 00095 | Revision 1.1 2001/10/21 17:12:40 uzadow 00096 | Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel. 00097 | 00098 | 00099 \-------------------------------------------------------------------- 00100 */