image: golang.org/x/image/ccitt Index | Files

package ccitt

import "golang.org/x/image/ccitt"

Package ccitt implements a CCITT (fax) image decoder.

Index

Package Files

reader.go table.go writer.go

func DecodeIntoGray Uses

func DecodeIntoGray(dst *image.Gray, r io.Reader, order Order, sf SubFormat, opts *Options) error

DecodeIntoGray decodes the CCITT-formatted data in r into dst.

It returns an error if dst's width and height don't match the implied width and height of CCITT-formatted data.

func NewReader Uses

func NewReader(r io.Reader, order Order, sf SubFormat, width int, height int, opts *Options) io.Reader

NewReader returns an io.Reader that decodes the CCITT-formatted data in r. The resultant byte stream is one bit per pixel (MSB first), with 1 meaning white and 0 meaning black. Each row in the result is byte-aligned.

type Options Uses

type Options struct {
    // Align means that some variable-bit-width codes are byte-aligned.
    Align bool
    // Invert means that black is the 1 bit or 0xFF byte, and white is 0.
    Invert bool
}

Options are optional parameters.

type Order Uses

type Order uint32

Order specifies the bit ordering in a CCITT data stream.

const (
    // LSB means Least Significant Bits first.
    LSB Order = iota
    // MSB means Most Significant Bits first.
    MSB
)

type SubFormat Uses

type SubFormat uint32

SubFormat represents that the CCITT format consists of a number of sub-formats. Decoding or encoding a CCITT data stream requires knowing the sub-format context. It is not represented in the data stream per se.

const (
    Group3 SubFormat = iota
    Group4
)

Package ccitt imports 5 packages (graph) and is imported by 4 packages. Updated 2019-10-11. Refresh now. Tools for package owners.