The JPXDecode filter: JPEG 2000 images, from a JP2/JPX file or a raw codestream, decoded in managed code. Decode only.
public sealed class JpxDecodeFilter : IImageFilter, IStreamFilter
ISO 32000-2 §7.4.9 and Table 87; ITU-T T.800 | ISO/IEC 15444-1 Annexes A (codestream syntax), B (packets and progression),
C (MQ decoder), D (EBCOT tier-1), E (reconstruction), F (inverse wavelet transform), G (DC level shift and component
transformation) and I (JP2 boxes). The codestream's width, height and precision win over the image dictionary; with a
ColorSpace in the dictionary, the image has that many channels.
All of Part 1: main and tile-part headers (COD, COC, QCD, QCC, RGN, POC, PPM, PPT, with their precedence), any number of tiles, tile-parts (in TPsot order) and layers, any precinct and code-block partition, the five progressions and progression volumes, SOP and EPH markers, packed packet headers, tier-1 with every code-block style, region-of-interest Maxshift, the 5/3 and 9/7 filters with dequantization, the RCT and ICT, the DC level shift and sub-sampled components (replicated over the image grid).
The JP2 wrapper follows ISO 32000-2 §7.4.9: with an Indexed ColorSpace the codestream's indices are the samples; with
another ColorSpace its first N colour channels (in channel definition order) are, and the JP2 colour boxes are ignored; without
one, the palette and component mapping, the channel definitions and the colour specification of highest precedence decide the
channels and the colour model (ColorModel, IccProfile), sYCC, YCbCr and
CIELab converted to RGB. With SMaskInData the opacity channel becomes Alpha, premultiplied for
SMaskInData 2 or a premultiplied channel definition.
Reduced resolutions (issue #362): asked for a reduction d by Reduction, the image facet decodes
resolutions 0 to N_L − d of every tile-component (ITU-T T.800 B.5), skipping tier-1 for the code-blocks of the dropped sub-bands
and the inverse DWT of the dropped levels, which gives the image at 1/2^d, as opj_decompress -r d does. The header offers
the fewest decomposition levels of any tile-component (MaxReduction), and no more than keep the image
origin on the reduced grid. The packets of dropped resolutions are still read in order where the progression interleaves them
(PCRL, CPRL, LRCP with several layers, progression order changes); in RLCP, RPCL and LRCP with one layer they are the tile's
last and are not read (B.12.1). Only viewers ask for it.
Through Decode(ReadOnlyMemory<Byte>, IBufferWriter<Byte>, FilterContext) the output is the colour samples of DecodeImage(ReadOnlyMemory<Byte>, ImageFilterContext) in the §8.9.3 layout, at
the bits per component of the greatest precision (rounded up to 8 or 16 for 3 to 7 and 9 to 15).
Lenient repair: a truncated codestream decodes what is present (JpxCodestreamTruncated); strict mode throws instead.
Stateless and thread-safe.
kind:method, kind:property, kind:ctor. Press Esc to clear.NameGets the name the filter has in a Filter entry, such as FlateDecode: the key it is registered under.Decode(ReadOnlyMemory<Byte>, IBufferWriter<Byte>, FilterContext)Decodes encoded and writes the result to output.DecodeImage(ReadOnlyMemory<Byte>, ImageFilterContext)Decodes the codestream into an image.TryReadHeader(ReadOnlySpan<Byte>, ImageFilterContext, out ImageHeader)Reads the codestream's header without decoding the samples.