go/src/image/jpeg/reader.go

type FormatError

func (e FormatError) Error() string {}

type UnsupportedError

func (e UnsupportedError) Error() string {}

var errUnsupportedSubsamplingRatio

type component

const dcTable

const acTable

const maxTc

const maxTh

const maxTq

const maxComponents

const sof0Marker

const sof1Marker

const sof2Marker

const dhtMarker

const rst0Marker

const rst7Marker

const soiMarker

const eoiMarker

const sosMarker

const dqtMarker

const driMarker

const comMarker

const app0Marker

const app14Marker

const app15Marker

const adobeTransformUnknown

const adobeTransformYCbCr

const adobeTransformYCbCrK

var unzig

type Reader

type bits

type decoder

// fill fills up the d.bytes.buf buffer from the underlying io.Reader. It
// should only be called when there are no unread bytes in d.bytes.
func (d *decoder) fill() error {}

// unreadByteStuffedByte undoes the most recent readByteStuffedByte call,
// giving a byte of data back from d.bits to d.bytes. The Huffman look-up table
// requires at least 8 bits for look-up, which means that Huffman decoding can
// sometimes overshoot and read one or two too many bytes. Two-byte overshoot
// can happen when expecting to read a 0xff 0x00 byte-stuffed byte.
func (d *decoder) unreadByteStuffedByte() {}

// readByte returns the next byte, whether buffered or not buffered. It does
// not care about byte stuffing.
func (d *decoder) readByte() (x byte, err error) {}

var errMissingFF00

// readByteStuffedByte is like readByte but is for byte-stuffed Huffman data.
func (d *decoder) readByteStuffedByte() (x byte, err error) {}

// readFull reads exactly len(p) bytes into p. It does not care about byte
// stuffing.
func (d *decoder) readFull(p []byte) error {}

// ignore ignores the next n bytes.
func (d *decoder) ignore(n int) error {}

// Specified in section B.2.2.
func (d *decoder) processSOF(n int) error {}

// Specified in section B.2.4.1.
func (d *decoder) processDQT(n int) error {}

// Specified in section B.2.4.4.
func (d *decoder) processDRI(n int) error {}

func (d *decoder) processApp0Marker(n int) error {}

func (d *decoder) processApp14Marker(n int) error {}

// decode reads a JPEG image from r and returns it as an image.Image.
func (d *decoder) decode(r io.Reader, configOnly bool) (image.Image, error) {}

// applyBlack combines d.img3 and d.blackPix into a CMYK image. The formula
// used depends on whether the JPEG image is stored as CMYK or YCbCrK,
// indicated by the APP14 (Adobe) metadata.
//
// Adobe CMYK JPEG images are inverted, where 255 means no ink instead of full
// ink, so we apply "v = 255 - v" at various points. Note that a double
// inversion is a no-op, so inversions might be implicit in the code below.
func (d *decoder) applyBlack() (image.Image, error) {}

func (d *decoder) isRGB() bool {}

func (d *decoder) convertToRGB() (image.Image, error) {}

// Decode reads a JPEG image from r and returns it as an [image.Image].
func Decode(r io.Reader) (image.Image, error) {}

// DecodeConfig returns the color model and dimensions of a JPEG image without
// decoding the entire image.
func DecodeConfig(r io.Reader) (image.Config, error) {}

func init() {}