Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

plfilterflip.cpp

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

Generated on Wed Dec 15 21:20:30 2004 for vuVolume by  doxygen 1.3.9.1