Table of Contents

Class TileJpegDecoder

Namespace
LansMap.Core.Decode

Decodes baseline JPEG tiles on a worker thread into packed 8-bit RGBA.

public static class TileJpegDecoder
Inheritance
object
TileJpegDecoder

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

data byte[]

JPEG bytes; only the first length are read.

length int

Valid byte count in data.

rgba byte[]

Output buffer, at least widthheight4 bytes, caller-owned.

width int

Decoded width in pixels on success.

height int

Decoded height in pixels on success.

reason TileJpegDecoder.FailReason

Why decode failed; None on success.

Returns

bool

True when rgba holds a full frame; never throws.