The image facet of a stream filter: an image codec (DCT, CCITT fax, JBIG2, JPEG 2000) that can also decode straight into a DecodedImage and report what it learned about the samples, beside the plain bytes-to-bytes path of IStreamFilter.
public interface IImageFilter : IStreamFilter
ISO 32000-2 §7.4.6 to §7.4.9 and §8.9. Register the codec like any filter, with UseFilter(IStreamFilter). When an image is decoded and the last filter of its chain implements this interface, the image layer decodes the filters before it as bytes, then calls TryReadHeader(ReadOnlySpan<Byte>, ImageFilterContext, out ImageHeader) (to check the codestream's size against the engine's limits before anything is allocated) and DecodeImage(ReadOnlyMemory<Byte>, ImageFilterContext). Anywhere else (a stream decoded as bytes, a codec that is not last in its chain) the filter's Decode(ReadOnlyMemory<Byte>, IBufferWriter<Byte>, FilterContext) runs, and must then deliver the §8.9.3 layout in PDF polarity.
What the codec reports wins over the image dictionary where §7.4.9 and the codec formats say so: the image's width, height and
bits per component come from the codestream (a mismatch with the dictionary is recorded as a diagnostic); the dictionary's
ColorSpace wins over ColorModel; an alpha plane is kept only when the dictionary's
SMaskInData asks for it (WantsAlpha).
Thread safety and leniency as for IStreamFilter: stateless, every call self-contained.
kind:method, kind:property, kind:ctor. Press Esc to clear.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.