Documentation
¶
Index ¶
- Variables
- func NewListReader(chunkLen uint32, chunkData io.Reader) (listType FourCC, data *Reader, err error)
- func NewReader(r io.Reader) (formType FourCC, data *Reader, err error)
- func RegisterFormat(name, magic string, decodeSize func(io.Reader) (Size, error))
- type FormatError
- type FourCC
- type Reader
- type Size
- type UnsupportedError
Constants ¶
This section is empty.
Variables ¶
var ErrFormat = errors.New("image: unknown format")
ErrFormat indicates that decoding encountered an unknown format.
Functions ¶
func NewListReader ¶
NewListReader returns a LIST chunk's list type, such as "movi" or "wavl", and its chunks as a *Reader.
func NewReader ¶
NewReader returns the RIFF stream's form type, such as "AVI " or "WAVE", and its chunks as a *Reader.
func RegisterFormat ¶
RegisterFormat registers an image format for use by Decode. Name is the name of the format, like "jpeg" or "png". Magic is the magic prefix that identifies the format's encoding. The magic string can contain "?" wildcards that each match any one byte. Decode is the function that decodes the encoded image. DecodeSize is the function that decodes just its configuration.
Types ¶
type FormatError ¶
type FormatError string
A FormatError reports that the input is not a valid JPEG.
func (FormatError) Error ¶
func (e FormatError) Error() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads chunks from an underlying io.Reader.
type Size ¶
type Size struct {
Width, Height int
}
func DecodeSize ¶
DecodeSize decodes the dimensions of an image that has been encoded in a registered format. The string returned is the format name used during format registration. Format registration is typically done by an init function in the codec-specific package.
type UnsupportedError ¶
type UnsupportedError string
An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature.
func (UnsupportedError) Error ¶
func (e UnsupportedError) Error() string