Logo Search packages:      
Sourcecode: paintlib version File versions

PLPNGDecoder Class Reference

#include <plpngdec.h>

Inheritance diagram for PLPNGDecoder:

PLPicDecoder PLBmpInfo

List of all members.


Detailed Description

PNG file decoder. Uses LibPng to do the actual decoding. PNG supports many pixel formats not supported by paintlib. These pixel formats are converted to the nearest paintlib equivalent. Images with less or more than 8 bits per channel are converted to 8 bits per channel. Images with 16-bit palettes or grayscale images with an alpha channel are returned as full 32-bit RGBA bitmaps.

Definition at line 31 of file plpngdec.h.


Public Member Functions

virtual void AssertValid () const
void AsString (char *psz, int len) const
virtual void Close ()
int GetBitsPerPixel () const
int GetHeight () const
virtual void GetImage (PLBmp &Bmp)
 Fills the bitmap with the image.
const PLPointGetResolution () const
const PLPointGetSize () const
int GetWidth () const
bool HasAlpha () const
bool IsGreyscale () const
virtual void MakeBmp (PLBmp *pBmp, int BPPWanted=0)
virtual void MakeBmpFromFile (const char *pszFName, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromMemory (unsigned char *ucMemSrc, int MemSrcSize, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void MakeBmpFromURL (const char *pszURL, PLBmp *pBmp, int BPPWanted=0, PLIProgressNotification *pProgNot=NULL)
virtual void Open (PLDataSource *pDataSrc)
void OpenFile (const char *pszFName, PLIProgressNotification *pProgNot=NULL)
bool operator== (const PLBmpInfo &Other) const
 PLPNGDecoder ()
 Creates a decoder.
void SetDataSrc (PLDataSource *pDataSrc)
virtual ~PLPNGDecoder ()
 Destroys a decoder.

Static Public Member Functions

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

Protected Member Functions

PLBYTE ReadByte (PLDataSource *pDataSrc)
PLLONG ReadILong (PLDataSource *pDataSrc)
PLWORD ReadIWord (PLDataSource *pDataSrc)
PLLONG ReadMLong (PLDataSource *pDataSrc)
PLWORD ReadMWord (PLDataSource *pDataSrc)
void SetBmpInfo (const PLBmpInfo &SrcInfo)
void SetBmpInfo (const PLPoint &Size, int bpp, const PLPoint &Resolution, bool bAlphaChannel, bool bIsGreyscale)
PLBYTE * unpackPictRow (PLBYTE *pLineBuf, PLDataSource *pDataSrc, int Width, int rowBytes, int SrcBytes)

Protected Attributes

bool m_bAlphaChannel
bool m_bIsGreyscale
int m_bpp
PLDataSourcem_pDataSrc
PLPoint m_Resolution
PLPoint m_Size

Static Private Member Functions

static void user_error_fn (png_structp png_ptr, png_const_charp error_msg)
static void user_warning_fn (png_structp png_ptr, png_const_charp warning_msg)

Private Attributes

int m_bit_depth
int m_color_type
png_infop m_info_ptr
png_structp m_png_ptr

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index