00001 /* 00002 /-------------------------------------------------------------------- 00003 | 00004 | $Id: plfiltermirror.cpp,v 1.1 2004/05/21 21:02:53 maxx Exp $ 00005 | 00006 | Copyright (c) 1996-2002 Ulrich von Zadow 00007 | Original code by Richard Hollis 00008 | 00009 \-------------------------------------------------------------------- 00010 */ 00011 00012 #include "plstdpch.h" 00013 #include "plbitmap.h" 00014 #include "plfiltermirror.h" 00015 #include "plpoint.h" 00016 00018 // Construction/Destruction 00020 00021 PLFilterMirror::PLFilterMirror() : PLFilter() 00022 {} 00023 00024 00025 PLFilterMirror::~PLFilterMirror() 00026 {} 00027 00028 00029 void PLFilterMirror::Apply(PLBmp * pBmpSource, PLBmp * pBmpDest) const 00030 { 00031 PLASSERT (pBmpSource->GetBitsPerPixel() == 32); 00032 00033 int nWidth = pBmpSource->GetWidth(); 00034 int nHeight= pBmpSource->GetHeight(); 00035 00036 int x,y; 00037 00038 //ROTATE the bitmap 00039 pBmpDest->Create (nWidth, nHeight, pBmpSource->GetBitsPerPixel(), 00040 pBmpSource->HasAlpha(), pBmpSource->GetResolution()); 00041 PLPixel32 pix; 00042 00043 for (y = 0; y<nHeight; y++) 00044 { 00045 for (x = 0; x<nWidth; x++) 00046 { 00047 pix = pBmpSource->GetPixel(x,y); 00048 pBmpDest->SetPixel((nWidth- x)-1,y,pix); 00049 } 00050 } 00051 00052 PLPixel32 * pPalette = pBmpSource->GetPalette(); 00053 if ((pBmpSource->GetBitsPerPixel()<16) && (pPalette)) 00054 pBmpDest->SetPalette(pPalette); 00055 } 00056 00057 /* 00058 /-------------------------------------------------------------------- 00059 | 00060 | $Log: plfiltermirror.cpp,v $ 00061 | Revision 1.1 2004/05/21 21:02:53 maxx 00062 | Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine. 00063 | 00064 | Revision 1.1 2002/11/13 01:59:48 mspindle 00065 | *** empty log message *** 00066 | 00067 | Revision 1.3 2002/02/24 13:00:47 uzadow 00068 | Documentation update; removed buggy PLFilterRotate. 00069 | 00070 | Revision 1.2 2001/10/16 17:12:26 uzadow 00071 | Added support for resolution information (Luca Piergentili) 00072 | 00073 | Revision 1.1 2001/09/16 19:03:23 uzadow 00074 | Added global name prefix PL, changed most filenames. 00075 | 00076 | Revision 1.3 2001/02/04 14:31:52 uzadow 00077 | Member initialization list cleanup (Erik Hoffmann). 00078 | 00079 | Revision 1.2 2001/01/15 15:05:31 uzadow 00080 | Added PLBmp::ApplyFilter() and PLBmp::CreateFilteredCopy() 00081 | 00082 | Revision 1.1 2001/01/13 20:06:16 uzadow 00083 | Added Flip and Mirror filters. 00084 | 00085 | 00086 | 00087 \-------------------------------------------------------------------- 00088 */