nanogui: Thread: how to set the CMAP fot frame buffer?


[<<] [<] Page 1 of 1 [>] [>>]
Subject: how to set the CMAP fot frame buffer?
From: Cheng Bor-wen ####@####.####
Date: 23 Jun 1999 11:44:30 -0000
Message-Id: <3770C629.744F102C@paradise.ccl.itri.org.tw>

Hello all:

I've tried to set the color map for frame buffer using FBIOPUTCMAP.
but I never did it!

How do I tell the system to use the color map that I give to him???

Is there any sample code for setting the color map for frame buffer?

THANX!!!!!!

Subject: RE: how to set the CMAP fot frame buffer?
From: Greg Haerr ####@####.####
Date: 23 Jun 1999 16:23:09 -0000
Message-Id: <01BEBD61.D9FC4AA0.greg@censoft.com>

On Wednesday, June 23, 1999 5:34 AM, Cheng Bor-wen ####@####.#### wrote:
:  << File: ATT00000.txt; charset = big5 >> 

	The microwindows source code handles palettes in the way you desire.

Check out the file mwin/server/drivers/scr_bogl.c and mwin/server/drivers/bogl/bogl.c.

Greg

Subject: Re: how to set the CMAP fot frame buffer?
From: Cheng Bor-wen ####@####.####
Date: 24 Jun 1999 08:35:15 -0000
Message-Id: <3771EBC8.6827043B@paradise.ccl.itri.org.tw>

Greg Haerr wrote:

> On Wednesday, June 23, 1999 5:34 AM, Cheng Bor-wen ####@####.#### wrote:
> :  << File: ATT00000.txt; charset = big5 >>
>
>         The microwindows source code handles palettes in the way you desire.
>
> Check out the file mwin/server/drivers/scr_bogl.c and mwin/server/drivers/bogl/bogl.c.
>
> Greg

Hello:

I am very sure that I've written my own color map(fome 0 ~ 255) into kernel's frame buffer
successfully by using FBIOPUTCMAP,

but nothing happens??????

How can I tell the kernel's frame buffer to use my color map filled into it?

Thanx!

Chris


Subject: RE: how to set the CMAP fot frame buffer?
From: Greg Haerr ####@####.####
Date: 24 Jun 1999 17:01:18 -0000
Message-Id: <01BEBE30.600DD720.greg@censoft.com>

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");
}

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

Subject: RE: how to set the CMAP fot frame buffer?
From: Greg Haerr ####@####.####
Date: 25 Jun 1999 18:21:22 -0000
Message-Id: <01BEBF04.ACF8E640.greg@censoft.com>

On Thursday, June 24, 1999 5:43 PM, Cheng Bor-wen ####@####.#### wrote:
:  << File: ATT00010.txt; charset = big5 >> 

	The palette setting code works, so you've got more debugging
to do with your code.  Remember that a palette is a packed array of
three characters, r, g, b.

Microwindows is at ftp://microwindows.censoft.com/pub/microwindows

Greg




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

[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.