nanogui: GrArea


Previous by date: 1 Dec 2000 13:50:32 -0000 Re: Improved keyboard event handler and mouse motion event handler for flnx, Morten Rolland
Next by date: 1 Dec 2000 13:50:32 -0000 Re: Cannot Compile 0.89pre5, Jordan Crouse
Previous in thread: 1 Dec 2000 13:50:32 -0000 GrArea, wangls.cape.com.cn
Next in thread:

Subject: Re: GrArea
From: Morten Rolland ####@####.####
Date: 1 Dec 2000 13:50:32 -0000
Message-Id: <3A27ADB5.CDB000B5@screenmedia.no>

####@####.#### wrote:
> 
>         what is the meaning of the variable psd->ncolors ?
> 

Number of colors.  It would be 16, 256, 65536 and huge for 4,8,16 and 24
bits respectively IIRC.

If you have an 8-bit display, and send color values larger than 255, then
the assert fails.  I guess this is what goes wrong in your case.

> I read the source code the definition of MWPF_PIXELVAL is
> #define MWPF_RGB           0    /* pseudo, convert from packed 32 bit RGB*/
> #define MWPF_PIXELVAL      1    /* pseudo, no convert from packed PIXELVAL*/
> #define MWPF_PALETTE       2    /* pixel is packed 8 bits 1, 4 or 8 pal index*/
> #define MWPF_TRUECOLOR0888 3    /* pixel is packed 32 bits 8/8/8 truecolor*/
> #define MWPF_TRUECOLOR888  4    /* pixel is packed 24 bits 8/8/8 truecolor*/
> #define MWPF_TRUECOLOR565  5    /* pixel is packed 16 bits 5/6/5 truecolor*/
> #define MWPF_TRUECOLOR332  6    /* pixel is packed 8 bits 3/3/2 truecolor*/.

Notice that the packing that you use for the GrArea call should match
the number of bits per pixel of the display, unless MWPF_RGB is used.
In this case, I believe you can rely on a translation (possibly slow).

We (screen media) uses MWPF_TRUECOLOR565 to avoid translations, and send
only as much image bits as needed (16 bit color display).

I don't have any experience with GrReadArea.

Regards,
Morten Rolland

Previous by date: 1 Dec 2000 13:50:32 -0000 Re: Improved keyboard event handler and mouse motion event handler for flnx, Morten Rolland
Next by date: 1 Dec 2000 13:50:32 -0000 Re: Cannot Compile 0.89pre5, Jordan Crouse
Previous in thread: 1 Dec 2000 13:50:32 -0000 GrArea, wangls.cape.com.cn
Next in thread:


Powered by ezmlm-browse 0.20.