Table of Contents

Class Jbig2Globals

Namespace
Egami.Formats.Jbig2
Assembly
Egami.dll

A parsed JBIG2 globals stream: the symbol dictionaries, pattern dictionaries and code tables a PDF shares between the JBIG2 images of a document. Parsing decodes them once; the object is immutable and safe to share across threads, so every page that refers to it reuses the decoded symbols.

public sealed class Jbig2Globals
Inheritance
Jbig2Globals
Inherited Members

Examples

// A PDF's JBIG2Decode image has no file header, so name the format. Parse the JBIG2Globals stream once and share it:
// every image of the document that refers to it reuses its decoded symbols.
Jbig2Globals globals = Jbig2Globals.Parse(globalsStream);
using Raster image = Raster.Load(imageStream, Jbig2Format.Info, options: new Jbig2ReaderOptions { Globals = globals });

Properties

SegmentCount

Gets the number of segments in the globals stream.

public int SegmentCount { get; }

Property Value

int

Methods

Parse(ReadOnlySpan<byte>, EgamiContext?)

Parses a globals stream and decodes its dictionaries.

public static Jbig2Globals Parse(ReadOnlySpan<byte> data, EgamiContext? context = null)

Parameters

data ReadOnlySpan<byte>

The globals stream's bytes, as the PDF's JBIG2Globals stream holds them after its filters.

context EgamiContext

The context whose safety limits apply, or null for Default.

Returns

Jbig2Globals

The parsed globals.

Examples

// A PDF's JBIG2Decode image has no file header, so name the format. Parse the JBIG2Globals stream once and share it:
// every image of the document that refers to it reuses its decoded symbols.
Jbig2Globals globals = Jbig2Globals.Parse(globalsStream);
using Raster image = Raster.Load(imageStream, Jbig2Format.Info, options: new Jbig2ReaderOptions { Globals = globals });

Exceptions

CorruptDataException

The data breaks T.88's rules.

LimitExceededException

The dictionaries break a safety limit.