Skip to content

Instantly share code, notes, and snippets.

@PaulChana
Last active September 13, 2017 13:27
Show Gist options
  • Save PaulChana/f7deeae1e44f2c2022bc89d7a4cdbe3c to your computer and use it in GitHub Desktop.
Save PaulChana/f7deeae1e44f2c2022bc89d7a4cdbe3c to your computer and use it in GitHub Desktop.
[RGB565 to RGB888] Conversion of RGB565 to RGB888 #cpp
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