png

package
v0.0.0-...-e758773 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2011 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package png implements a PNG image decoder and encoder.

The PNG specification is at http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, os.Error)

Decode reads a PNG image from r and returns it as an image.Image. The type of Image returned depends on the PNG contents.

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, os.Error)

DecodeConfig returns the color model and dimensions of a PNG image without decoding the entire image.

func Encode

func Encode(w io.Writer, m image.Image) os.Error

Encode writes the Image m to w in PNG format. Any Image may be encoded, but images that are not image.NRGBA might be encoded lossily.

Types

type FormatError

type FormatError string

A FormatError reports that the input is not a valid PNG.

func (FormatError) String

func (e FormatError) String() string

type IDATDecodingError

type IDATDecodingError struct {
	Err os.Error
}

An IDATDecodingError wraps an inner error (such as a ZLIB decoding error) encountered while processing an IDAT chunk.

func (IDATDecodingError) String

func (e IDATDecodingError) String() string

type UnsupportedError

type UnsupportedError string

An UnsupportedError reports that the input uses a valid but unimplemented PNG feature.

func (UnsupportedError) String

func (e UnsupportedError) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL