Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stefan Haun
firmware
Commits
59099455
Commit
59099455
authored
Oct 06, 2019
by
Stefan Haun
Browse files
Fix RGB888 to RGB565 conversion
according to
https://afterthoughtsoftware.com/posts/convert-rgb888-to-rgb565
parent
c1899be2
Pipeline
#4142
passed with stages
in 51 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
epicardium/epicardium.h
View file @
59099455
...
...
@@ -1296,9 +1296,9 @@ enum disp_fillstyle {
* :return: RGB565 color
*/
#define COLOR_TO_565(c) \
((COLOR_GET_RED(c) >> 3) | \
(COLOR_GET_GREEN(c) >> 2) | \
(COLOR_GET_BLUE(c) >> 3))
((
((COLOR_GET_RED(c)
>> 3)
& 0x1f) << 11)
| \
((
(COLOR_GET_GREEN(c) >> 2)
& 0x3f) << 5)
| \
(
(COLOR_GET_BLUE(c)
>> 3)
& 0x1f)
)
/** CCCamp 2019 Color CHAOSBLUE */
#define COLOR_CHAOSBLUE 0x0076ba
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment