Class TileJpegDecoder
Decodes baseline JPEG tiles on a worker thread into packed 8-bit RGBA.
public static class TileJpegDecoder
- Inheritance
-
objectTileJpegDecoder
Remarks
SOF0 baseline DCT only, 8-bit, 1 or 3 components, one interleaved scan. Progressive, extended, lossless, arithmetic, 12-bit, CMYK, and multi-scan streams return false with Unsupported rather than throwing. Callers typically fall back to a main-thread decoder for those shapes.
Methods
TryDecode(byte[], int, byte[], out int, out int, out FailReason)
Decodes a baseline JPEG into packed 8-bit RGBA.
public static bool TryDecode(byte[] data, int length, byte[] rgba, out int width, out int height, out TileJpegDecoder.FailReason reason)
Parameters
databyte[]JPEG bytes; only the first
lengthare read.lengthintValid byte count in
data.rgbabyte[]Output buffer, at least widthheight4 bytes, caller-owned.
widthintDecoded width in pixels on success.
heightintDecoded height in pixels on success.
reasonTileJpegDecoder.FailReasonWhy decode failed; None on success.
Returns
- bool
True when
rgbaholds a full frame; never throws.