C# Class ImageTools.IO.Png.PngDecoder

Encoder for generating a image out of a png stream.
At the moment the following features are supported:

Filters: all filters are supported.

Pixel formats: RGB (Truecolor) with alpha (8 bit). RGB (Truecolor) without alpha (8 bit). Greyscale with alpha (8 bit). Greyscale without alpha (8 bit). Palette Index with alpha (8 bit). Palette Index without alpha (8 bit).

Inheritance: IImageDecoder
Exibir arquivo Open project: prepare/HTML-Renderer Class Usage Examples

Public Methods

Method Description
Decode ( ExtendedImage image, Stream stream ) : void

Decodes the image from the specified stream and sets the data to image.

IsSupportedFileExtension ( string extension ) : bool

Indicates if the image decoder supports the specified file extension.

IsSupportedFileFormat ( byte header ) : bool

Indicates if the image decoder supports the specified file header.

Private Methods

Method Description
CalculateScanlineLength ( PngColorTypeInformation colorTypeInformation ) : int
CalculateScanlineStep ( PngColorTypeInformation colorTypeInformation ) : int
PaethPredicator ( byte a, byte b, byte c ) : byte
PngDecoder ( ) : System
ReadChunk ( ) : PngChunk
ReadChunkCrc ( PngChunk chunk, byte typeBuffer ) : void
ReadChunkData ( PngChunk chunk ) : void
ReadChunkLength ( PngChunk chunk ) : int
ReadChunkType ( PngChunk chunk ) : byte[]
ReadHeaderChunk ( byte data ) : void
ReadPhysicalChunk ( byte data ) : void
ReadScanlines ( MemoryStream dataStream, byte pixels, IColorReader colorReader, PngColorTypeInformation colorTypeInformation ) : void
ReadTextChunk ( byte data ) : void
ValidateHeader ( ) : void

Method Details

Decode() public method

Decodes the image from the specified stream and sets the data to image.
/// is null (Nothing in Visual Basic). /// - or - /// is null (Nothing in Visual Basic). ///
public Decode ( ExtendedImage image, Stream stream ) : void
image ExtendedImage The image, where the data should be set to. /// Cannot be null (Nothing in Visual Basic).
stream Stream The stream, where the image should be /// decoded from. Cannot be null (Nothing in Visual Basic).
return void

IsSupportedFileExtension() public method

Indicates if the image decoder supports the specified file extension.
/// is null (Nothing in Visual Basic). is a string /// of length zero or contains only blanks.
public IsSupportedFileExtension ( string extension ) : bool
extension string The file extension.
return bool

IsSupportedFileFormat() public method

Indicates if the image decoder supports the specified file header.
/// is null (Nothing in Visual Basic).
public IsSupportedFileFormat ( byte header ) : bool
header byte The file header.
return bool