Package decoder

Overview ▾

Package decoder provides primitives used to decode the jbig2 data stream.

type Decoder

Decoder is the structure used to decode JBIG2 encoded byte streams.

type Decoder struct {
    // contains filtered or unexported fields

func Decode

func Decode(input []byte, parameters Parameters, globals *document.Globals) (*Decoder, error)

Decode prepares decoder for the jbig2 encoded 'input' data, with optional 'parameters' and optional Globally encoded data segments - 'globals'.

func (*Decoder) DecodeNextPage

func (d *Decoder) DecodeNextPage() ([]byte, error)

DecodeNextPage decodes next jbig2 encoded page and returns decoded byte stream

func (*Decoder) DecodePage

func (d *Decoder) DecodePage(pageNumber int) ([]byte, error)

DecodePage decodes jbig2 encoded page for provided 'pageNumber' in the document.

func (*Decoder) DecodePageImage

func (d *Decoder) DecodePageImage(pageNumber int) (image.Image, error)

DecodePageImage decodes page with 'pageNumber' from the document and stores it's result within go image.Image.

func (*Decoder) PageNumber

func (d *Decoder) PageNumber() (int, error)

PageNumber returns

type Parameters

Parameters are the parameters used by the jbig2 decoder.

type Parameters struct {
    UnpaddedData bool
    Color        bitmap.Color


Name Synopsis