Add raw pixel data regression tests#161
Merged
Merged
Conversation
Adds harness coverage for loadFromRawPixelData and toRawPixelData across all pixel formats, in both directions. The test images use a coordinate-keyed color pattern on a non-square (4x8) image instead of a solid fill, so the checks catch stride/row padding, transpose/row-vs-column-major and width/height-swap bugs, not just channel permutations. Each channel lives in a disjoint value range, so any channel swap pushes a value out of its expected range. The load and export sides are anchored independently (an export byte- order check against a ground-truth fill, and a PNG-cycle load check that reads through the codec), so a load bug and an export bug cannot cancel out in a plain roundtrip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Harness regression tests for raw pixel data, covering
loadFromRawPixelDataandtoRawPixelDataacross all pixel formats in both directions.What makes them meaningful:
rdepends onx,g/bony, so the checks also catch stride/row-padding, transpose/row-vs-column-major and width/height-swap bugs, not just channel permutations.r < g < b), so any channel swap pushes a value out of its expected range.createBlankImagefill, plus a PNG-cycle load check that reads through the codec. A load bug and an export bug therefore cannot cancel out in a plain roundtrip.Verified locally on Android (Pixel emulator) and iOS (iPhone 17 Pro simulator): 13/13 passing with all three fixes applied.
Depends on
These tests validate the fixes in the following PRs and go green once they are merged, so this should merge last:
The harness CI here will be red until those are merged and this branch is rebased onto
main.🤖 Generated with Claude Code