Support saving 1- and 4-bit MSB indexed surfaces as BMP - #16211
Open
madebr wants to merge 3 commits into
Open
Conversation
Collaborator
|
Oh man, I literally ran into this today, good timing!! |
madebr
marked this pull request as draft
September 2, 2026 19:08
madebr
force-pushed
the
bmp-1-4-bit-indexed-formats
branch
from
September 2, 2026 19:42
d3162a0 to
b370865
Compare
madebr
marked this pull request as ready for review
September 2, 2026 19:42
Contributor
Author
|
I pushed a fix for widths that are a non-multiple of 2 (for 4MSB) and 8 (for 1MSB). |
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.
Description
1-bit LSB surfaces would have to be bit flipped, and 4-bit surfaces nibble swapped.
SDL_ReadSurfacePixeldoes not support 1-bit, 2-bit or 4-bit indexed surfaces, so I fixed that as well.Here's a little app showing what it generates:
1-bit BMP:
pattern_1bit.bmp
4-bit BMP:
pattern_4bit.bmp
Existing Issue(s)