On Fri, 1 Dec 2000, Christoph Egger wrote:
>
> Hi!
>
> I just found a in ggiUnmapPixel():
>
>
> These code-lines:
>
> -----------------------------------------------
> ...
> ggi_color col;
> ggi_pixel pix;
> ...
>
> col.r = col.g = col.b = col.a = 0xFFFF;
> pix = ggiMapColor(vis, &col);
> printf("pixel-value: %i\n", pix);
>
> ggiUnmapPixel(vis, pix, &col);
> printf("rgba (%X,%X,%X,%X)\n",
> col.r,col.g,col.b,col.a);
> ...
>
> -----------------------------------------------
>
> ... give this output:
> -----------------------------------------------
> pixel-value: 16777215
> rgba (FF00,FF00,FF00,FFFF)
> -----------------------------------------------
>
> ... instead of:
> -----------------------------------------------
> pixel-value: 16777215
> rgba (FFFF,FFFF,FFFF,FFFF)
> -----------------------------------------------
I've attached a patch, which fixes at least the blue-part.
The fix results in:
-----------------------------------------------
pixel-value: 16777215
rgba (FF00,FF00,FFFF,FFFF)
-----------------------------------------------
I don't know, why the red and green-part isn't correctly, too.
Anyone here, who commits the patch into CVS, please?
Christoph Egger
E-Mail: [EMAIL PROTECTED]
--- 20001126/degas/lib/libggi/default/color/color.c Mon Aug 30 07:17:36 1999
+++ degas/lib/libggi/default/color/color.c Sat Dec 2 10:01:35 2000
@@ -31,7 +31,7 @@
#define DOSHIFT(val, shift) \
- (((shift) >= 0) ? (val) << (shift) : (val) >> -(shift))
+ (((shift) >= 0) ? (val) << (shift) | (val) : (val) >> -(shift))
int GGI_color_getpalvec(ggi_visual *vis, int start, int len, ggi_color *colmap)