nanogui: problems with colors in Nano-X, nxlib and Fltk-UTF8-1.1.6


Previous by date: 9 Aug 2006 09:03:46 +0100 Re: nxclient : Wrong packet type? nano-X, nxlib and fltk, k6-2.freakmail.de
Next by date: 9 Aug 2006 09:03:46 +0100 how to correct hzx12 chinese font, Alan Chuang
Previous in thread: 9 Aug 2006 09:03:46 +0100 problems with colors in Nano-X, nxlib and Fltk-UTF8-1.1.6, k6-2.freakmail.de
Next in thread:

Subject: Re: [nanogui] problems with colors in Nano-X, nxlib and Fltk-UTF8-1.1.6
From: ####@####.####
Date: 9 Aug 2006 09:03:46 +0100
Message-Id: <E1GAj2V-0006mZ-Nv@www14.emo.freenet-rz.de>

Hi Greg,

the problem is solved!

In subdriver i used the wrong psi->rmask, psi->gmask and psi->bmask.

In the graphic driver function: 
GetScreenInfo(PSD psd, PMWSCREENINFO psi) { ...

i replaced the 
case MWPF_PALETTE:
		psi->rmask 	= 0xff;
		psi->gmask 	= 0xff;
		psi->bmask	= 0xff;
		break;

through the 
case MWPF_PALETTE:
		psi->rmask 	= 0xff0000;
		psi->gmask 	= 0x00ff00;
		psi->bmask	= 0x0000ff;
		break;
 ... }

and all window colors works correct :)

But the image colors don't works correct after this change!!!
To patch the image problem i changed in 
/engine/devdraw.c, 

void GdArea(PSD psd, MWCOORD x, MWCOORD y, MWCOORD width, MWCOORD height, void *pixels, int pixtype)
{
...  
case MWPF_TRUECOLOR888:
		r = *PIXELS++;
		g = *PIXELS++;
		b = *PIXELS++;
		gr_foreground = RGB2PIXEL888(r, g, b);		
		break;

through

case MWPF_TRUECOLOR888:
		r = *PIXELS++;
		g = *PIXELS++;
		b = *PIXELS++;
		gr_foreground = GdFindColor(psd, RGB2PIXEL888(r, g, b));
		break;
...
}

Regards,

K


> 
> iuse nano-X 0.91, nxlib 0.45 and fltk-utf8-1.1.6 on my embedded board.
> Myproblem is the wrong coloring of fltk applications.
> All fltk-apps(for instance "fltk hello app") are drawn with blue colors,
> thebackground is dark blue, the button is dark blue and text edit boxesare
> light blue.
> 
> Mygraphic hardware has a hardware palette, a color lookup table with256
> colors each 24 bit (8 bit red , 8 bit green , 8 bit blue). Thescreen size
> is
> 640 x 480 pixel.
> Myself written graphic driver is specified for palletized graphichardware.
> It writes only color indexes into the memory
> e.g.: 1... 255.
> 
> 
> Thedriver PSD structure is set to:
> psd->pixtype= MWPF_PALETTE;
> psd->ncolors= 256;
> psd->size= 307200; //VGA 640 x 480
> psd->bpp= 24;
> 
> 
> Inthe graphic driver a Setpalette(...)function, fills the hardware lookup
> table with valid color values!The "nxview" application works absolutely
> correctwithout a coloring problem. But a fltk application is drawn with
> bluecolors?
> TheGdFindNearestColor(...) function gets already wrong color
> valuessupplied!
> 
> 
> Ithink the fltk palette differs from nano-X palette.
> Cananybody help my why only a fltk application is draw in blue colors???
> 
> 
> 
> 
> Regards
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 
> 
> 
> 

--- original Nachricht Ende ----




"Jetzt Handykosten senken mit klarmobil - 14 Ct./Min.! Hier klicken"
http://www.klarmobil.de/index.html?pid=73025


Previous by date: 9 Aug 2006 09:03:46 +0100 Re: nxclient : Wrong packet type? nano-X, nxlib and fltk, k6-2.freakmail.de
Next by date: 9 Aug 2006 09:03:46 +0100 how to correct hzx12 chinese font, Alan Chuang
Previous in thread: 9 Aug 2006 09:03:46 +0100 problems with colors in Nano-X, nxlib and Fltk-UTF8-1.1.6, k6-2.freakmail.de
Next in thread:


Powered by ezmlm-browse 0.20.