Skip to content

Decode an uncompressed raw image - #16

Merged
sputier merged 1 commit into
mainfrom
feature/decode-uncompressed
Nov 19, 2026
Merged

sputier merged 1 commit into
mainfrom
feature/decode-uncompressed

Conversation

@sputier

@sputier sputier commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Adds RawFile.Decode() (new RawImage) and Decode(Span<ushort>) for uncompressed 12 and 14 bit samples, packed most significant bit first with each row on a byte boundary (the TIFF packing rules).

  • The Nikon compression is reported with an UnsupportedCompressionException; it is decoded in a later change.
  • Hostile headers: the sample count, overlapping strips and strips that are too short are refused before anything is allocated.
  • Tests: round trips (both byte orders, odd widths), strips ending inside a row, block sizes, stream source, cancellation, damaged files.
  • The packing is checked with synthetic files only; it has not been checked on a camera file.

Part of the decoding work tracked in #4.

Add RawFile.Decode, returning a RawImage or filling a buffer of the caller, for
uncompressed 12 and 14 bit samples. The image is checked before anything is
allocated: sample count, overlapping strips, strips too short.
@sputier
sputier merged commit b926178 into main Nov 19, 2026
4 checks passed
@sputier
sputier deleted the feature/decode-uncompressed branch November 19, 2026 00:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant