Last active
September 13, 2017 13:27
-
-
Save PaulChana/f7deeae1e44f2c2022bc89d7a4cdbe3c to your computer and use it in GitHub Desktop.
[RGB565 to RGB888] Conversion of RGB565 to RGB888 #cpp
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
int convertRGB565ToRGB888 (int c) | |
{ | |
int a = 255; | |
int r5 = ((c >> 11) & 0x1F); | |
int g6 = ((c >> 5) & 0x3F); | |
int b5 = ((c) & 0x1F); | |
int r8 = (r5 * 255 + 15) / 31; | |
int g8 = (g6 * 255 + 31) / 63; | |
int b8 = (b5 * 255 + 15) / 31; | |
return makeARGB (255, r8, g8, b8); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment