nanogui: wrong colors with 16bpp -- SOLVED
Subject:
wrong colors with 16bpp -- SOLVED
From:
Takács ####@####.####
Date:
14 Dec 2004 16:32:20 +0000
Message-Id: <200412141732.14714.takacs.aron@infracont.hu>
Hi,
the problem of the wrong colors has been solved. I have changed the following
lines in device.h:
Original:
#define COLOR2PIXEL565(c) \
((((c) & 0xf8) << 8) | (((c) & 0xfc00) >> 5) | (((c) & 0xf80000) >> 19))*/
Changed:
#define COLOR2PIXEL565(c) \
((((c) & 0xf8) >> 3) | (((c) & 0xfc00) >> 5) | (((c) & 0xf80000) >> 8))
Original:
#define PIXEL565RED8(pixelval) (((pixelval) >> 8) & 0xf8)
#define PIXEL565GREEN8(pixelval) (((pixelval) >> 3) & 0xfc)
#define PIXEL565BLUE8(pixelval) (((pixelval) << 3) & 0xf8)*/
Changed:
#define PIXEL565BLUE8(pixelval) (((pixelval) >> 8) & 0xf8)
#define PIXEL565GREEN8(pixelval) (((pixelval) >> 3) & 0xfc)
#define PIXEL565RED8(pixelval) (((pixelval) << 3) & 0xf8)
With theese modifications the red and blue colors are changed, and the colors
are correct.
Áron Takács