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

pltgadec.h

Go to the documentation of this file.
00001 /*
00002 /--------------------------------------------------------------------
00003 |
00004 |      $Id: pltgadec.h,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 #ifndef INCL_PLTGADEC
00012 #define INCL_PLTGADEC
00013 
00014 #ifndef INCL_PLPICDEC
00015 #include "plpicdec.h"
00016 #endif
00017 
00018 #ifndef INCL_PLTGA
00019 #include "pltga.h"
00020 #endif
00021 
00025 class PLTGADecoder : public PLPicDecoder
00026 {
00027 
00028 
00029 public:
00031   PLTGADecoder
00032     ();
00033 
00035   virtual ~PLTGADecoder
00036     ();
00037 
00038 protected:
00041   virtual void DoDecode
00042     ( PLBmp * pBmp,
00043       PLDataSource * pDataSrc
00044     );
00045 
00046 private:
00047 
00048   // Fills TGAHEADER structure with the information in the file.
00049   void readTgaHeader
00050     ( TGAHEADER * pTgaHead,       // Pointer to TGA header structure
00051       PLDataSource * pDataSrc
00052     );
00053 
00054   // Reads the TGA palette and creates a windows palette.
00055   void readPalette
00056     ( int StartIndex,           // Index of first palette entry.
00057       int Length,               // Number of palette entries stored.
00058       int EntrySize,            // Size of palette entries in bits.
00059       PLBmp * pBmp,
00060       PLDataSource * pDataSrc
00061     );
00062 
00063 
00064   // Determines compression type and calls readData.
00065   void readImage
00066     ( TGAHEADER * pTgaHead,       // Pointer to TGA header structure
00067       PLBmp * pBmp,
00068       PLDataSource * pDataSrc
00069     );
00070 
00071   // Reads image data line-by-line.
00072   void readData
00073     ( TGAHEADER * pTgaHead,       // Pointer to TGA header structure
00074       bool bCompressed,
00075       PLBmp * pBmp,
00076       PLDataSource * pDataSrc
00077     );
00078 
00079   // Decodes one line of uncompressed image data.
00080   void expandUncompressedLine
00081     ( PLBYTE * pDest,
00082       int Width,
00083       bool bReversed,
00084       int bpp,
00085       PLDataSource * pDataSrc
00086     );
00087 
00088   // Decodes one line of compressed image data.
00089   void expandCompressedLine
00090     ( PLBYTE * pDest,
00091       int Width,
00092       bool bReversed,
00093       int bpp,
00094       PLDataSource * pDataSrc
00095     );
00096 
00097   // Reads one image pixel and returns it in RGBA format.
00098   PLPixel32 readPixel32
00099     ( int bpp,
00100       PLDataSource * pDataSrc
00101     );
00102 
00103   // Reads one image pixel and returns it in 8-bit format.
00104   PLBYTE readPixel8
00105     ( int bpp,
00106       PLDataSource * pDataSrc
00107     );
00108 };
00109 
00110 #endif
00111 /*
00112 /--------------------------------------------------------------------
00113 |
00114 |      $Log: pltgadec.h,v $
00115 |      Revision 1.1  2004/05/21 21:02:53  maxx
00116 |      Initial Version of vuVolume, moderatly changed to make it compile on my windows and linux machine.
00117 |
00118 |      Revision 1.1  2002/11/13 01:58:22  mspindle
00119 |      *** empty log message ***
00120 |
00121 |      Revision 1.3  2001/10/21 17:12:40  uzadow
00122 |      Added PSD decoder beta, removed BPPWanted from all decoders, added PLFilterPixel.
00123 |
00124 |      Revision 1.2  2001/10/06 22:37:08  uzadow
00125 |      Linux compatibility.
00126 |
00127 |      Revision 1.1  2001/09/16 19:03:22  uzadow
00128 |      Added global name prefix PL, changed most filenames.
00129 |
00130 |
00131 \--------------------------------------------------------------------
00132 */

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