go/src/image/jpeg/writer.go

// div returns a/b rounded to the nearest integer, instead of rounded to zero.
func div(a, b int32) int32 {}

var bitCount

type quantIndex

const quantIndexLuminance

const quantIndexChrominance

const nQuantIndex

var unscaledQuant

type huffIndex

const huffIndexLuminanceDC

const huffIndexLuminanceAC

const huffIndexChrominanceDC

const huffIndexChrominanceAC

const nHuffIndex

type huffmanSpec

var theHuffmanSpec

type huffmanLUT

func (h *huffmanLUT) init(s huffmanSpec) {}

var theHuffmanLUT

func init() {}

type writer

type encoder

func (e *encoder) flush() {}

func (e *encoder) write(p []byte) {}

func (e *encoder) writeByte(b byte) {}

// emit emits the least significant nBits bits of bits to the bit-stream.
// The precondition is bits < 1<<nBits && nBits <= 16.
func (e *encoder) emit(bits, nBits uint32) {}

// emitHuff emits the given value with the given Huffman encoder.
func (e *encoder) emitHuff(h huffIndex, value int32) {}

// emitHuffRLE emits a run of runLength copies of value encoded with the given
// Huffman encoder.
func (e *encoder) emitHuffRLE(h huffIndex, runLength, value int32) {}

// writeMarkerHeader writes the header for a marker with the given length.
func (e *encoder) writeMarkerHeader(marker uint8, markerlen int) {}

// writeDQT writes the Define Quantization Table marker.
func (e *encoder) writeDQT() {}

// writeSOF0 writes the Start Of Frame (Baseline Sequential) marker.
func (e *encoder) writeSOF0(size image.Point, nComponent int) {}

// writeDHT writes the Define Huffman Table marker.
func (e *encoder) writeDHT(nComponent int) {}

// writeBlock writes a block of pixel data using the given quantization table,
// returning the post-quantized DC value of the DCT-transformed block. b is in
// natural (not zig-zag) order.
func (e *encoder) writeBlock(b *block, q quantIndex, prevDC int32) int32 {}

// toYCbCr converts the 8x8 region of m whose top-left corner is p to its
// YCbCr values.
func toYCbCr(m image.Image, p image.Point, yBlock, cbBlock, crBlock *block) {}

// grayToY stores the 8x8 region of m whose top-left corner is p in yBlock.
func grayToY(m *image.Gray, p image.Point, yBlock *block) {}

// rgbaToYCbCr is a specialized version of toYCbCr for image.RGBA images.
func rgbaToYCbCr(m *image.RGBA, p image.Point, yBlock, cbBlock, crBlock *block) {}

// yCbCrToYCbCr is a specialized version of toYCbCr for image.YCbCr images.
func yCbCrToYCbCr(m *image.YCbCr, p image.Point, yBlock, cbBlock, crBlock *block) {}

// scale scales the 16x16 region represented by the 4 src blocks to the 8x8
// dst block.
func scale(dst *block, src *[4]block) {}

var sosHeaderY

var sosHeaderYCbCr

// writeSOS writes the StartOfScan marker.
func (e *encoder) writeSOS(m image.Image) {}

const DefaultQuality

type Options

// 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.
func Encode(w io.Writer, m image.Image, o *Options) error {}