-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix BMP issues #1497
Fix BMP issues #1497
Conversation
CHANGELOG.md
Outdated
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](http://semver.org/). | |||
### Changed | |||
### Added | |||
### Fixed | |||
* Fix BMP issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would describe what BMP issues there were. It would add more clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix and for watching out for the image files!
blue = (val >> 8) << 3; | ||
green = ((val >> 13) | (val << 3)) << 3; | ||
red = (val >> 2) << 3; | ||
alpha = 255; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this just RGB555? (I Googled the comment line and got no results :))
What you have is fine with me if you're short on time, but if it's indeed RGB555 I think you can simplify it by constructing val
in the other byte order (untested):
val = U1UC();
val |= U1UC() << 8;
red = (val >> 10) << 3;
green = (val >> 5) << 3;
blue = val << 3;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great :)
Fixes #1492
Fixes #1495