Commit Graph
7 Commits
Author SHA1 Message Date
Claude f2c0709ef2 refactor(codecs): pool luminance rows and gate timing on optimised builds
EncodeRow8/16 reuse one pooled scratch row for RGB-to-gray output
instead of allocating per row; drop unused JPEG marker constants; the
24 MP timing test skips itself when the JIT optimiser is disabled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:12:49 +00:00
Claude 78dad093ab fix(codecs): read TIFF strips larger than the 64 MB per-read cap
Single-strip uncompressed files (Photoshop's default) exceed
TiffReader's bounded read; such strips are now read in pieces, the
uncompressed path skips a copy, and hostile strip/tile counts are
rejected up front.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:12:49 +00:00
Claude c7d8dcd0bd feat(codecs): add linear DNG writer
16-bit LinearRaw DNG 1.4 with tiles (lossless JPEG or uncompressed),
ColorMatrix1 = XYZ(D65) to linear sRGB, ForwardMatrix1 to XYZ(D50),
D65 illuminant, neutral AsShotNeutral, WhiteLevel 65535 and optional
Exif. LibRaw renders test patches back to the exact source values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:02:27 +00:00
Claude 6d9ede0c47 feat(codecs): add TIFF raster reader and TIFF writer
TiffImageReader decodes strips and tiles (chunky or planar) with none,
LZW (old-style bit order tolerated), Deflate, PackBits and JPEG
compression (JPEGTables, YCbCr or RGB, lossless SOF3 tiles reshaped as
DNG writes them), predictors 2/3 and the DNG x2/x4 variants, 1-16 bit
integer and 16/32-bit float samples; tiles decode in parallel. Output
is a raw TiffRaster or a linear ImageBuffer. JPEG strips match libtiff
bit for bit.

TiffWriter writes 8/16-bit gray/RGB/RGBA, uncompressed or Deflate with
horizontal predictor, and embeds capture metadata from an Exif block.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 10:02:27 +00:00
Claude 016a06d147 feat(codecs): add PNG decoder and ImageBuffer PNG encoding
Every colour type and bit depth (1/2/4/8/16), PLTE + tRNS (palette alpha
and colour keys), Adam7, all five filters, zlib via ZLibStream; CRC
mismatches and truncated data are tolerated with warnings. PngEncoder
gains an additive ImageBuffer overload (8/16-bit sRGB with sRGB chunk)
and the Palette colour type for decoding.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 09:47:44 +00:00
Claude 990c515b3b feat(codecs): add baseline and lossless JPEG encoders
Baseline encoder: IJG quality scaling, 4:4:4/4:2:2/4:2:0, optional
optimised Huffman tables, restart intervals, caller APP1 segments,
ImageBuffer input with optional ordered dither; parallel colour
conversion and float FDCT per MCU row, sequential entropy coding.
Lossless (SOF3) encoder with predictors 1-7 and point transform for DNG.

Tests: round-trip PSNR gates, monotonic quality, lossless round trips
for every predictor and precision, seeded fuzzing, restart resync,
DCT scaling and a 24 MP single-core decode benchmark.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 09:44:20 +00:00
Claude 64e4fb3df6 feat(codecs): add managed JPEG decoder and pixel conversions
Baseline, extended 12-bit, progressive and lossless (SOF3) Huffman
decoding; 1/3/4 components with Adobe CMYK/YCCK; all integral sampling
factors with libjpeg fancy upsampling; restart resynchronisation;
DCT-domain scaling. Full-size blocks use a port of libjpeg's ISLOW IDCT,
so output is bit-identical to djpeg on the cjpeg fixtures.

PixelConvert maps interleaved 8/16-bit samples to linear ImageBuffers and
back, gray/RGB, Exif orientation and clamping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
2026-10-02 09:37:15 +00:00