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

plfiltergetalpha.cpp

Go to the documentation of this file.
00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: plfiltergetalpha.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 "plfiltergetalpha.h"
00013 #include "plbitmap.h"
00014 
00015 
00016 PLFilterGetAlpha::PLFilterGetAlpha() : PLFilter()
00017 {
00018 }
00019 
00020 PLFilterGetAlpha::~PLFilterGetAlpha()
00021 {
00022 
00023 }
00024 
00025 void PLFilterGetAlpha::Apply(PLBmp * pBmpSource, PLBmp * pBmpDest) const
00026 {
00027   // Only works for 32 bpp bitmaps.
00028   PLASSERT (pBmpSource->GetBitsPerPixel() == 32);
00029 
00030   PLASSERT (pBmpSource->HasAlpha());
00031 
00032   pBmpDest->Create (pBmpSource->GetWidth(), pBmpSource->GetHeight(), 8, false,
00033                     pBmpSource->GetResolution());
00034   PLPixel32 ** pSrcLines = pBmpSource->GetLineArray32();
00035   PLBYTE ** pDstLines = pBmpDest->GetLineArray();
00036 
00037   for (int y = 0; y<pBmpDest->GetHeight(); ++y)
00038   { // For each line
00039     PLPixel32 * pSrcPixel = pSrcLines[y];
00040     PLBYTE * pDstPixel = pDstLines[y];
00041 
00042     for (int x = 0; x < pBmpDest->GetWidth(); ++x)
00043     { // For each pixel
00044       *pDstPixel = pSrcPixel->GetA();
00045       ++pSrcPixel;
00046       ++pDstPixel;
00047     }
00048   }
00049 }
00050 
00051 /*
00052 /--------------------------------------------------------------------
00053 |
00054 |      $Log: plfiltergetalpha.cpp,v $
00055 |      Revision 1.1  2004/05/21 21:02:53  maxx
00056 |      Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine.
00057 |
00058 |      Revision 1.1  2002/11/13 01:59:47  mspindle
00059 |      *** empty log message ***
00060 |
00061 |      Revision 1.4  2001/10/21 17:12:40  uzadow
00062 |      Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel.
00063 |
00064 |      Revision 1.3  2001/10/16 17:12:26  uzadow
00065 |      Added support for resolution information (Luca Piergentili)
00066 |
00067 |      Revision 1.2  2001/10/06 22:37:08  uzadow
00068 |      Linux compatibility.
00069 |
00070 |      Revision 1.1  2001/09/16 19:03:23  uzadow
00071 |      Added global name prefix PL, changed most filenames.
00072 |
00073 |      Revision 1.7  2001/02/04 14:31:52  uzadow
00074 |      Member initialization list cleanup (Erik Hoffmann).
00075 |
00076 |      Revision 1.6  2001/01/15 15:05:31  uzadow
00077 |      Added PLBmp::ApplyFilter() and PLBmp::CreateFilteredCopy()
00078 |
00079 |      Revision 1.5  2000/12/18 22:42:53  uzadow
00080 |      Replaced RGBAPIXEL with PLPixel32.
00081 |
00082 |      Revision 1.4  2000/01/16 20:43:15  anonymous
00083 |      Removed MFC dependencies
00084 |
00085 |      Revision 1.3  1999/12/08 16:31:40  Ulrich von Zadow
00086 |      Unix compatibility
00087 |
00088 |      Revision 1.2  1999/10/21 18:48:03  Ulrich von Zadow
00089 |      no message
00090 |
00091 |      Revision 1.1  1999/10/21 16:05:17  Ulrich von Zadow
00092 |      Moved filters to separate directory. Added Crop, Grayscale and
00093 |      GetAlpha filters.
00094 |
00095 |      Revision 1.1  1999/10/19 21:29:44  Ulrich von Zadow
00096 |      Added filters.
00097 |
00098 |
00099 \--------------------------------------------------------------------
00100 */

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