nanogui: Alpha blending problem


Previous by date: 26 Oct 2006 18:32:28 +0100 Re: Alpha blending problem, Martin Kajdas
Next by date: 26 Oct 2006 18:32:28 +0100 Re: Touchscreen orientation, Greg Haerr
Previous in thread: 26 Oct 2006 18:32:28 +0100 Re: Alpha blending problem, Martin Kajdas
Next in thread:

Subject: Re: [nanogui] RE: Alpha blending problem
From: "Greg Haerr" ####@####.####
Date: 26 Oct 2006 18:32:28 +0100
Message-Id: <060d01c6f924$b2eb9400$2f01a8c0@HaydenLake>

> XGetImage expects 4 byte format and the GrReadArea returns hardware
format, in my case 5:6:5 RGB (2 bytes per pixel).
> There should be 2 unused bytes between every 2 data bytes.
> For 5:6:5 RGB, it should be:
0000:RGB 0000:RGB ... but is: RGB:RGB RGB:RGB ...

Yes, this is definitely a problem with the image routines
in nxlib.  I had to guess the format of color images, I didn't
find it in the Xlib manual.  Do you happen to know where
to find the return image format for 24 and 32bpp?  It would
be nice to have this fixed for all formats.

> This makes me believe that the XGetImage function does not work for
<=16bit resolutions.

Likely true

> Is there a conversion routine that does this?
Where the conversion should be done? (in XGetImage?)

Another option would be to change the return format
parameter in GrReadArea, and always return 32bpp
0RGB data.  Then, the conversion could be applied
to convert to the Xlib required format (docs needed)
in one place only.




> The second problem is with XPutImage function in nxlib-0.45.
It does not draw pixels when foreground and background are zero (black).
This problem is similar to XDrawString which would not draw for the same
condition.
I already reported and fixed this problem.

Definitely a bug,  but your earlier fix was for text drawing
only, right?  I asked about the fix and couldn't get a fully
accurate description of why it worked.



> This would be OK if the background was already black but in my case it
is not and the black pixels are simply not drawn (transparent).
I fixed it by changing the background color for this case but I think
there should be a better way to take care of this problem in XPutImage
and XDrawString.

I don't think Xlib supports transparent drawing, so this is just
a bug in the image code.  XDrawString will have to be handled
seperately.


Regards,

Greg



I have some more information.
The Alpha blending is done by the FLTK and not by the Microwindows.
Then, the FLTK calls the XputImage() to do the drawing with the blended
image.
The only problem with the image is that the blended pixels which should
be black are transparent and possibly other problems that I cannot see.
This appears to be one of those cases where the color conversion from
X11 to Microwindows colors (255 <-> 0) does not work.
I thought this was already fixed but there must be another case.

I believe that the black color is 0, what is the transparent color?
Any other suggestions where to look for this problem?

Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: ####@####.####
For additional commands, e-mail: ####@####.####



Previous by date: 26 Oct 2006 18:32:28 +0100 Re: Alpha blending problem, Martin Kajdas
Next by date: 26 Oct 2006 18:32:28 +0100 Re: Touchscreen orientation, Greg Haerr
Previous in thread: 26 Oct 2006 18:32:28 +0100 Re: Alpha blending problem, Martin Kajdas
Next in thread:


Powered by ezmlm-browse 0.20.