00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: plfilterresizehamming.cpp,v 1.1 2004/05/21 21:02:53 maxx Exp $ 00005 | 00006 | Copyright (c) 1996-1998 Ulrich von Zadow 00007 | 00008 \-------------------------------------------------------------------- 00009 */ 00010 00011 #include "plstdpch.h" 00012 #include "plfilterresizehamming.h" 00013 #include "pl2passscale.h" 00014 #include "plbitmap.h" 00015 00016 00017 PLFilterResizeHamming::PLFilterResizeHamming (int NewXSize, int NewYSize, double NewRadius) 00018 : PLFilterResize (NewXSize, NewYSize), 00019 m_NewRadius(NewRadius) 00020 { 00021 } 00022 00023 void PLFilterResizeHamming::Apply(PLBmp * pBmpSource, PLBmp * pBmpDest) const 00024 { 00025 PLASSERT(pBmpSource->GetBitsPerPixel()==32); 00026 00027 // Create a new Bitmap 00028 pBmpDest->Create(m_NewXSize, 00029 m_NewYSize, 00030 pBmpSource->GetBitsPerPixel(), 00031 pBmpSource->HasAlpha(), 00032 pBmpSource->GetResolution()); 00033 00034 // Create a Filter Class from template 00035 PLHammingContribDef f(m_NewRadius); 00036 C2PassScale <CDataRGBA_UBYTE> sS(f); 00037 sS.Scale ((CDataRGBA_UBYTE::_RowType *) pBmpSource->GetLineArray(), 00038 pBmpSource->GetWidth(), 00039 pBmpSource->GetHeight(), 00040 (CDataRGBA_UBYTE::_RowType *) pBmpDest->GetLineArray(), 00041 pBmpDest->GetWidth(), 00042 pBmpDest->GetHeight()); 00043 } 00044 00045 /* 00046 /-------------------------------------------------------------------- 00047 | 00048 | $Log: plfilterresizehamming.cpp,v $ 00049 | Revision 1.1 2004/05/21 21:02:53 maxx 00050 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00051 | 00052 | Revision 1.1 2002/11/13 01:59:48 mspindle 00053 | *** empty log message *** 00054 | 00055 | Revision 1.4 2001/10/16 17:12:27 uzadow 00056 | Added support for resolution information (Luca Piergentili) 00057 | 00058 | Revision 1.3 2001/09/30 16:57:26 uzadow 00059 | Improved speed of 2passfilter.h, code readability changes. 00060 | 00061 | Revision 1.2 2001/09/16 20:57:17 uzadow 00062 | Linux version name prefix changes 00063 | 00064 | Revision 1.1 2001/09/16 19:03:23 uzadow 00065 | Added global name prefix PL, changed most filenames. 00066 | 00067 | Revision 1.4 2001/01/15 15:05:31 uzadow 00068 | Added PLBmp::ApplyFilter() and PLBmp::CreateFilteredCopy() 00069 | 00070 | Revision 1.3 2000/01/16 20:43:16 anonymous 00071 | Removed MFC dependencies 00072 | 00073 | Revision 1.2 1999/12/08 16:31:40 Ulrich von Zadow 00074 | Unix compatibility 00075 | 00076 | Revision 1.1 1999/10/21 16:05:18 Ulrich von Zadow 00077 | Moved filters to separate directory. Added Crop, Grayscale and 00078 | GetAlpha filters. 00079 | 00080 | Revision 1.1 1999/10/19 21:29:45 Ulrich von Zadow 00081 | Added filters. 00082 | 00083 | 00084 \-------------------------------------------------------------------- 00085 */