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

PLPicDecoder Class Reference

PLPicDecoder is an abstract base class. More...

#include <plpicdec.h>

Inheritance diagram for PLPicDecoder:

Inheritance graph
[legend]
Collaboration diagram for PLPicDecoder:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PLPicDecoder ()
 Empty constructor.
virtual ~PLPicDecoder ()
 Destructor. Frees memory allocated.
virtual void MakeBmpFromFile (const char *pszFName, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
 Decodes a picture in a file and stores the results in pBmp.
virtual void MakeBmpFromMemory (unsigned char *ucMemSrc, int MemSrcSize, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
 Decodes a picture from a memory location which directly resembles the image file as it would be on disc.
virtual void MakeBmp (PLDataSource *pDataSrc, PLBmp *pBmp, int BPPWanted=0)
 Decodes a picture by getting the encoded data from pDataSrc.
void OpenFile (const char *pszFName, PLIProgressNotification *pProgNot=NULL)
virtual void Close ()

Static Public Member Functions

void SetTraceConfig (int Level, char *pszFName)
 Sets the amount and destination of debug traces output by the debug version.
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

virtual void DoDecode (PLBmp *pBmp, PLDataSource *pDataSrc)
 Implements the actual decoding process.
PLBYTEunpackPictRow (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

Static Private Attributes

int m_TraceLevel = 0
char * m_pszTraceFName = NULL

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.

Definition at line 36 of file plpicdec.cpp.

PLPicDecoder::~PLPicDecoder  )  [virtual]
 

Destructor. Frees memory allocated.

Definition at line 44 of file plpicdec.cpp.


Member Function Documentation

void PLPicDecoder::Close  )  [virtual]
 

Definition at line 239 of file plpicdec.cpp.

References PLFileSource::Close().

Here is the call graph for this function:

void PLPicDecoder::DoDecode PLBmp pBmp,
PLDataSource pDataSrc
[protected, virtual]
 

Implements the actual decoding process.

Uses variables local to the object to retrieve and store the data. Implemented in derived classes.

This routine should never be called. It's here so derived classes can override MakeDIB directly if they want to. (CAnyDecoder does this).

Reimplemented in PLBmpDecoder, PLGIFDecoder, PLJPEGDecoder, PLPCXDecoder, PLPGMDecoder, PLPictDecoder, PLPNGDecoder, PLPPMDecoder, PLTGADecoder, PLTIFFDecoder, and PLTIFFDecoderEx.

Definition at line 289 of file plpicdec.cpp.

References PLASSERT.

void PLPicDecoder::MakeBmp PLDataSource pDataSrc,
PLBmp pBmp,
int  BPPWanted = 0
[virtual]
 

Decodes a picture by getting the encoded data from pDataSrc.

Stores the results in pBmp. BPPWanted is the number of bits per pixel in the bitmap returned. Valid values for BPPWanted are 8, 24, and 0. 0 means 'keep the input format'. Decoding a true-color image to 8 bpp is not supported.

Reimplemented in PLAnyPicDecoder.

Definition at line 162 of file plpicdec.cpp.

References PLBmp::CreateCopy(), and PL_ERRFORMAT_NOT_SUPPORTED.

Referenced by PLAnyPicDecoder::MakeBmp().

Here is the call graph for this function:

void PLPicDecoder::MakeBmpFromFile const char *  pszFName,
PLBmp pBmp,
int  BPPWanted = 0,
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, 24, and 0. 0 means 'keep the input format'. Decoding a true-color image to 8 bpp is not supported. As an exception, BPPWanted can be 1 for b/w tiff files.

Definition at line 53 of file plpicdec.cpp.

void PLPicDecoder::MakeBmpFromMemory unsigned char *  ucMemSrc,
int  MemSrcSize,
PLBmp pBmp,
int  BPPWanted = 0,
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, 24, and 0. 0 means 'keep the input format'. Decoding a true-color image to 8 bpp is not supported. As an exception, BPPWanted can be 1 for b/w tiff files.

Definition at line 120 of file plpicdec.cpp.

References PLMemSource::Close(), PLMemSource::Open(), and raiseError().

Here is the call graph for this function:

void PLPicDecoder::OpenFile const char *  pszFName,
PLIProgressNotification pProgNot = NULL
 

Definition at line 207 of file plpicdec.cpp.

References PLFileSource::Open(), and raiseError().

Here is the call graph for this function:

void PLPicDecoder::raiseError int  Code,
char *  pszErr
[static]
 

Definition at line 247 of file plpicdec.cpp.

Referenced by PLTIFFDecoder::DoDecode(), PLPCXDecoder::DoDecode(), PLTIFFDecoder::doHiColor(), PLTIFFDecoder::doLoColor(), error_exit(), PLAnyPicDecoder::MakeBmp(), PLPCXDecoder::PCX_PlanesToPixels(), PLPCXDecoder::PCX_UnpackPixels(), PLPicEncoder::raiseError(), PLPPMDecoder::readASCIILine(), and PLPGMDecoder::readASCIILine().

PLBYTE PLPicDecoder::ReadByte PLDataSource pDataSrc  )  [inline, protected]
 

Definition at line 201 of file plpicdec.h.

Referenced by PLPCXDecoder::DoDecode(), PLPPMDecoder::readASCIIDecimal(), PLPGMDecoder::readASCIIDecimal(), PLPPMDecoder::readASCIILine(), PLPGMDecoder::readASCIILine(), PLPPMDecoder::skipComment(), PLPGMDecoder::skipComment(), PLPGMDecoder::skipPgmASCIISeparators(), and PLPPMDecoder::skipPpmASCIISeparators().

PLLONG PLPicDecoder::ReadILong PLDataSource pDataSrc  )  [inline, protected]
 

Definition at line 229 of file plpicdec.h.

References PLBYTE.

PLWORD PLPicDecoder::ReadIWord PLDataSource pDataSrc  )  [inline, protected]
 

Definition at line 210 of file plpicdec.h.

References PLBYTE.

PLLONG PLPicDecoder::ReadMLong PLDataSource pDataSrc  )  [inline, protected]
 

Definition at line 237 of file plpicdec.h.

References PLBYTE.

PLWORD PLPicDecoder::ReadMWord PLDataSource pDataSrc  )  [inline, protected]
 

Definition at line 220 of file plpicdec.h.

References PLBYTE.

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.

Definition at line 182 of file plpicdec.cpp.

References PLASSERT.

Referenced by PLPicEncoder::SetTraceConfig().

void PLPicDecoder::Trace int  TraceLevel,
const char *  pszMessage
[static]
 

Called to output status messages to the current debug console.

Definition at line 261 of file plpicdec.cpp.

References PLTRACE.

Referenced by PLPCXDecoder::DoDecode(), PLTIFFDecoder::doLoColor(), PLAnyPicDecoder::MakeBmp(), PLPicEncoder::Trace(), PLTIFFDecoder::Win32ErrorHandler(), and PLTIFFDecoder::Win32WarningHandler().

PLBYTE * PLPicDecoder::unpackPictRow PLBYTE pLineBuf,
PLDataSource pDataSrc,
int  Width,
int  rowBytes,
int  SrcBytes
[protected]
 

Definition at line 303 of file plpicdec.cpp.

References PLBYTE, and PLFileSource::ReadNBytes().

Here is the call graph for this function:


Member Data Documentation

PLDataSource* PLPicDecoder::m_pDataSrc [protected]
 

Definition at line 185 of file plpicdec.h.

char * PLPicDecoder::m_pszTraceFName = NULL [static, private]
 

Definition at line 32 of file plpicdec.cpp.

int PLPicDecoder::m_TraceLevel = 0 [static, private]
 

Definition at line 31 of file plpicdec.cpp.


The documentation for this class was generated from the following files:
Generated on Wed Dec 15 21:21:01 2004 for vuVolume by  doxygen 1.3.9.1