nanogui: how to set the CMAP fot frame buffer?


Previous by date: 25 Jun 1999 05:46:32 -0000 Re: CVS, Bradley D. LaRonde
Next by date: 25 Jun 1999 05:46:32 -0000 Re: nano-X 0.6, Alex Holden
Previous in thread: 25 Jun 1999 05:46:32 -0000 Re: how to set the CMAP fot frame buffer?, Greg Haerr
Next in thread: 25 Jun 1999 05:46:32 -0000 Re: how to set the CMAP fot frame buffer?, Greg Haerr

Subject: Re: how to set the CMAP fot frame buffer?
From: Cheng Bor-wen ####@####.####
Date: 25 Jun 1999 05:46:32 -0000
Message-Id: <3772C269.9B7DA6DE@paradise.ccl.itri.org.tw>

Greg Haerr wrote:

> Try this
>
> /* Set NC color palettes values starting at C to red-green-blue value
>    specified in PALETTE.  Use 8-bit color values as input. */
> void
> bogl_set_palette (int c, int nc, const unsigned char (*palette)[3])
> {
>   struct fb_cmap cmap;
>
>   __u16 red[nc];
>   __u16 green[nc];
>   __u16 blue[nc];
>
>   int i;
>
>   for (i = 0; i < nc; i++)
>     {
>       const unsigned char *e = palette[i];
>
>       if (gray)
>         red[i] = green[i] = blue[i] = (e[0] * 77 + e[1] * 151 + e[2] * 28);
>       else
>         {
>           red[i] = e[0] << 8;
>           green[i] = e[1] << 8;
>           blue[i] = e[2] << 8;
>         }
>     }
>
>   cmap.start = c;
>   cmap.len = nc;
>   cmap.red = red;
>   cmap.green = green;
>   cmap.blue = blue;
>   cmap.transp = NULL;
>
>   if(ioctl (fb, FBIOPUTCMAP, &cmap) == -1)
>           printf("putcmap fail\n");
> }

Hello Greg:

thanx for ur replying me so soon!

my code is just the same as yours! (the are both from bogl)
I've checked the value in CMAP before and after calling FBIOPUTCMAP,
and I am very sure that I have set different color map into system's frame
buffer succesfully,

after setting my color map successfully, I draw a rectangle with the same
color value,
but the rectangle shown on my screen is the same as the one shown before
setting color map,
why???
(I'm sure my system's fram buffer is FB_TYPE_PACKED_PIXELS and
FV_VISUAL_PSEUDOCOLOR)

would U please give me more information about microwindows?
I need to know if it has its own web site, where to download its code!

Chris


Previous by date: 25 Jun 1999 05:46:32 -0000 Re: CVS, Bradley D. LaRonde
Next by date: 25 Jun 1999 05:46:32 -0000 Re: nano-X 0.6, Alex Holden
Previous in thread: 25 Jun 1999 05:46:32 -0000 Re: how to set the CMAP fot frame buffer?, Greg Haerr
Next in thread: 25 Jun 1999 05:46:32 -0000 Re: how to set the CMAP fot frame buffer?, Greg Haerr


Powered by ezmlm-browse 0.20.