Skip to content

feat(j2k-c): decode shared component grids through the C and C++ APIs - #394

Merged
jcwal1516 merged 1 commit into
fix/shared-sampling-c-prereqsfrom
feat/c-component-grid
Dec 3, 2026
Merged

jcwal1516 merged 1 commit into
fix/shared-sampling-c-prereqsfrom
feat/c-component-grid

Conversation

@jcwal1516

Copy link
Copy Markdown
Member

What and why

A valid 23×17 JPEG 2000 image sampled every second column and row contains 12×9 samples. The general C decoder previously rejected that layout. Use the decoder's component grid when admitting packed output, planning regions, and reporting or streaming rows. C++17 callers get the same behavior through the existing wrapper methods.

Region inputs remain relative to the full-resolution image. Output rectangles are relative to the first sample on the component grid. The optional direct whole-image and Metal C entry points retain their documented layout restrictions.

Impact

  • Extends the general C/C++ full-image, region, reduced and row-streaming decode APIs.
  • Sizes output limits against the actual sample layout, including caller stride when writing a region.
  • ABI 1 and both public headers are unchanged. The release package keeps its existing shared and static linking interfaces.

Testing

  • All 63 C binding tests passed locally on an M5 Max with the Metal feature and runtime required.
  • Built the relocatable macOS archive and ran the packaged C11/C++17 consumer tests, including static linking.
  • Compiled a separate C++17 program against the packaged headers and library and compared its full-image, region, and streamed output with OpenJPEG 2.5.4. Both zero-origin and odd-origin fixtures passed, including untouched stride padding and exact/one-byte-short output limits. Public main rejected the zero-origin fixture.
  • Regression coverage and an Unreleased C/C++ entry are included.

@jcwal1516
jcwal1516 added this pull request to stack #395 December 3, 2026 15:13
@jcwal1516
jcwal1516 marked this pull request as ready for review December 3, 2026 15:34
@jcwal1516
jcwal1516 merged commit edf600b into main Dec 3, 2026
14 checks passed
@jcwal1516
jcwal1516 deleted the feat/c-component-grid branch December 3, 2026 16:57
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