- Constants
- func Decode(r io.Reader) (image.Image, error)
- func DecodeConfig(r io.Reader) (image.Config, error)
- func Encode(w io.Writer, m image.Image, o *Options) error
- type FormatError
- func (e FormatError) Error() string
- type Options
- type Reader
- type UnsupportedError
- func (e UnsupportedError) Error() string
Package files
fdct.go
huffman.go
idct.go
reader.go
writer.go
Constants
const DefaultQuality = 75
DefaultQuality is the default quality encoding parameter.
func Decode(r io.Reader) (image.Image, error)
Decode reads a JPEG image from r and returns it as an image.Image.
func DecodeConfig(r io.Reader) (image.Config, error)
DecodeConfig returns the color model and dimensions of a JPEG image without
decoding the entire image.
func Encode(w io.Writer, m image.Image, o *Options) error
Encode writes the Image m to w in JPEG 4:2:0 baseline format with the given
options. Default parameters are used if a nil *Options is passed.
type FormatError string
A FormatError reports that the input is not a valid JPEG.
func (e FormatError) Error() string
type Options struct {
Quality int
}
Options are the encoding parameters.
Quality ranges from 1 to 100 inclusive, higher is better.
type Reader interface {
io.Reader
ReadByte() (c byte, err error)
}
If the passed in io.Reader does not also have ReadByte, then Decode will introduce its own buffering.
type UnsupportedError string
An UnsupportedError reports that the input uses a valid but unimplemented JPEG feature.
func (UnsupportedError) Error
func (e UnsupportedError) Error() string