feat: import common BMP formats with lossiness reporting - #4
Merged
Merged
Conversation
Retain the expanded BMP decoder and lossiness contract while adopting master’s CI, release tooling, and isolated test runner. Run both baseline and decoder regression suites.
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.
Summary
Bitmap::isLossy()with the confirmed alpha, color-precision, and color-metadata semanticsBI_RGBsave outputSupported input
BITMAPCOREHEADER: 1/4/8/24-bpp uncompressedBI_RGB: 1/4/8/16/24/32-bppBI_BITFIELDS: 16/32-bpp, including declared alpha masksBI_RLE4andBI_RLE8: encoded/absolute runs, EOL, EOB, delta, and alignmentEmbedded JPEG/PNG, CMYK, later OS/2-specific variants, and color-profile transforms remain explicitly unsupported and are documented in the README.
Lossiness contract
isLossy()is true when import discards color information or precision:Palette/RLE expansion, lower-depth RGB expansion, row orientation, padding removal, opaque alpha, and BGRX reserved bytes remain lossless. Spatial dimensions are never resampled.
Safety
Verification
./test_runner.shg++ -std=c++11 -Wall -Wextra -pedantic -c bitmap.cpp -o /tmp/bitmap.og++ -std=c++11 -Wall -Wextra -pedantic -fsanitize=address,undefined -fno-omit-frame-pointer bitmap.cpp tests/bitmap_tests.cpp -o /tmp/bitmap-tests-sanitized/tmp/bitmap-tests-sanitizedg++ -std=c++11 -Wall -Wextra -pedantic example.cpp bitmap.cpp -o /tmp/bitmap-example(only the pre-existing untracked example emits signed/unsigned loop warnings)git diff --check master...HEADCloses #1