Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

PLPicDecoder Class Reference

#include <plpicdec.h>

Inheritance diagram for PLPicDecoder:

PLBmpInfo PLAnyPicDecoder PLBmpDecoder PLGIFDecoder PLIFF85Decoder PLJPEGDecoder PLPCXDecoder PLPGMDecoder PLPictDecoder PLPNGDecoder PLPPMDecoder PLPSDDecoder PLSGIDecoder PLTGADecoder PLTIFFDecoder List of all members.

Public Member Functions

 PLPicDecoder ()
virtual ~PLPicDecoder ()
 Destructor. Frees memory allocated.

virtual void MakeBmpFromFile (const char *pszFName, PLBmp *pBmp, const PLPixelFormat &pfWanted=PLPixelFormat::DONTCARE, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromURL (const char *pszURL, PLBmp *pBmp, const PLPixelFormat &pf=PLPixelFormat::DONTCARE, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromMemory (unsigned char *ucMemSrc, int MemSrcSize, PLBmp *pBmp, const PLPixelFormat &pf=PLPixelFormat::DONTCARE, PLIProgressNotification *pProgNot=NULL)
void OpenFile (const char *pszFName, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmp (PLBmp *pBmp, const PLPixelFormat &pf=PLPixelFormat::DONTCARE)
virtual void Close ()
virtual void Open (PLDataSource *pDataSrc)=0
virtual void GetImage (PLBmpBase &Bmp)=0
void SetDataSrc (PLDataSource *pDataSrc)

Static Public Member Functions

void SetTraceConfig (int Level, char *pszFName)
void raiseError (int Code, char *pszErr)
void Trace (int TraceLevel, const char *pszMessage)
 Called to output status messages to the current debug console.


Protected Member Functions

PLBYTE * unpackPictRow (PLBYTE *pLineBuf, PLDataSource *pDataSrc, int Width, int rowBytes, int SrcBytes)
PLBYTE ReadByte (PLDataSource *pDataSrc)
PLWORD ReadIWord (PLDataSource *pDataSrc)
PLWORD ReadMWord (PLDataSource *pDataSrc)
PLLONG ReadILong (PLDataSource *pDataSrc)
PLLONG ReadMLong (PLDataSource *pDataSrc)

Protected Attributes

PLDataSourcem_pDataSrc

Detailed Description

PLPicDecoder is an abstract base class. It defines common routines for all decoders. Decoders for specific file formats can be derived from this class. Objects of this class interact with a PLDataSource to decode bitmaps.

Definition at line 26 of file plpicdec.h.


Constructor & Destructor Documentation

PLPicDecoder::PLPicDecoder  ) 
 

Empty constructor. The actual initialization takes place in a derived class.


Member Function Documentation

virtual void PLPicDecoder::GetImage PLBmpBase Bmp  )  [pure virtual]
 

Decodes an image. Assumes that Open() and Bmp.Create() have already been called.

Implemented in PLAnyPicDecoder, PLBmpDecoder, PLGIFDecoder, PLIFF85Decoder, PLJPEGDecoder, PLPCXDecoder, PLPGMDecoder, PLPictDecoder, PLPNGDecoder, PLPPMDecoder, PLPSDDecoder, PLSGIDecoder, PLTGADecoder, and PLTIFFDecoder.

virtual void PLPicDecoder::MakeBmp PLBmp pBmp,
const PLPixelFormat &  pf = PLPixelFormat::DONTCARE
[virtual]
 

Decodes an image in an already-opened data source and stores the results in pBmp. Open should be called before, close after this routine is called.

virtual void PLPicDecoder::MakeBmpFromFile const char *  pszFName,
PLBmp pBmp,
const PLPixelFormat &  pfWanted = PLPixelFormat::DONTCARE,
PLIProgressNotification pProgNot = NULL
[virtual]
 

Decodes a picture in a file and stores the results in pBmp. BPPWanted is the number of bits per pixel in the bitmap returned. Valid values for BPPWanted are 8, 16, 24, 32 and 0. 0 will result in either an 8 or a 32 bpp bitmap being returned, depending on the source bitmap. Of course, if BPPWanted is less than the bpp of the file, some data is lost. Note that internally, all data is decoded to 8 or 32 bpp first in all cases, so using 16 or 24 as BPPWanted will cause in a copy and format conversion operation.

As an exception, BPPWanted can be 1 for b/w tiff files.

virtual void PLPicDecoder::MakeBmpFromMemory unsigned char *  ucMemSrc,
int  MemSrcSize,
PLBmp pBmp,
const PLPixelFormat &  pf = PLPixelFormat::DONTCARE,
PLIProgressNotification pProgNot = NULL
[virtual]
 

Decodes a picture from a memory location which directly resembles the image file as it would be on disc. The result is stored in pBmp. BPPWanted is the number of bits per pixel in the bitmap returned. Valid values for BPPWanted are 8, 16, 24, 32 and 0. 0 will result in either an 8 or a 32 bpp bitmap being returned, depending on the source bitmap. Of course, if BPPWanted is less than the bpp of the file, some data is lost. Note that internally, all data is decoded to 8 or 32 bpp first in all cases, so using 16 or 24 as BPPWanted will cause in a copy and format conversion operation.

As an exception, BPPWanted can be 1 for b/w tiff files.

virtual void PLPicDecoder::MakeBmpFromURL const char *  pszURL,
PLBmp pBmp,
const PLPixelFormat &  pf = PLPixelFormat::DONTCARE,
PLIProgressNotification pProgNot = NULL
[virtual]
 

Decodes a picture in an url (http://, ftp:://, ...) and stores the results in pBmp. BPPWanted is the number of bits per pixel in the bitmap returned. Valid values for BPPWanted are 8, 16, 24, 32 and 0. 0 will result in either an 8 or a 32 bpp bitmap being returned, depending on the source bitmap. Of course, if BPPWanted is less than the bpp of the file, some data is lost. Note that internally, all data is decoded to 8 or 32 bpp first in all cases, so using 16 or 24 as BPPWanted will cause in a copy and format conversion operation.

As an exception, BPPWanted can be 1 for b/w tiff files.

void PLPicDecoder::SetTraceConfig int  Level,
char *  pszFName
[static]
 

Sets the amount and destination of debug traces output by the debug version. pszFName contains either a valid file name or is NULL. If it contains a file name, this file is used to store debug information. If pszFName is NULL, the destination is either the MSVC debug console or stderr depending on the version of the library. Valid values for Level are:

0: Trace only errors.
1: Trace top-level calls.
2: Trace picture format information
3: Trace all miscellaneous info.

The trace configuration is global to all decoders.


The documentation for this class was generated from the following file:
Generated on Mon Sep 13 16:16:42 2004 for paintlib by doxygen 1.3.2