nanogui: Is it Microwindows(nanoX) supporting Alpha blending?


Previous by date: 4 Apr 2001 14:33:19 -0000 Announce: Chinese Input Method Editor for nanoX, Hsien-Li Lin
Next by date: 4 Apr 2001 14:33:19 -0000 Re: Announce: sdl-nanox-patch, Alex Holden
Previous in thread: 4 Apr 2001 14:33:19 -0000 Is it Microwindows(nanoX) supporting Alpha blending?, Sadeesh Kumar
Next in thread: 4 Apr 2001 14:33:19 -0000 Re: Is it Microwindows(nanoX) supporting Alpha blending?, Greg Haerr

Subject: Re: Is it Microwindows(nanoX) supporting Alpha blending?
From: Jordan Crouse ####@####.####
Date: 4 Apr 2001 14:33:19 -0000
Message-Id: <3AC9DF84.370F1841@censoft.com>

One of the very first things to remember is that the alpha blending is
kind of limbo right now.  It works, but nobody has cared enough to
really put some time into it.

Since the win32 API and the Nano-X API both use the same engine, you can
usually assume that if one API supports a particular drawing function,
so does the other one (or it can be added quickly).

The Microwindows support for alphablending has been provided as a
function of the blit routines.  In Microwindows, each blit can be
specified with a flag that indicates how the blit is to be performed,
mainly MWROP_SRCCOPY, MWROP_SRCAND, MWROP_SRCINVERT, and MWROP_BLACKNESS
(I will leave it to you to guess what these do.  Check the source code
in drivers/ if you have any doubts).  For alpha blending, we add one
more operation MWROP_BLENDCONSTANT.  (Actually, there are two more
operations defined for alpha blending, but they are not handled in the
code:  MWROP_BLENDFGBG and MWROP_BLENDCHANNEL). BLENDCONSTANT should
cause the area being copied to be alpha blended with the destination.  


From the Nano-X API, you can take advantage of this by using the
GrCopyArea call, which takes one of the above operations as its
parameter.  So in theory, you could take a given area in a drawable, and
alpha blend it by copying it using GrCopyArea() and specifying the
MWROP_BLENDCONSTANT operation.   But does it actually work?

Your mileage will vary depending on the driver and the bits per pixel
that you are working with.  I have seen it work very well on the X11
driver, but very poorly on the 8 bit framebuffer.  I think that it is
broken completely with any palletized depths.  But please feel free to
try it out, and let us know.

Jordan

Sadeesh Kumar wrote:
> 
> Hi,
>     Does  microwindos ( NanoX based APIs ) supports Alphablending and
> transparency?. I went thru' the demo code malpha.c which is the demo
> code for mwin apis. Is there any similiar thing available for nanox
> also?.
> 
> With regards,
> sadeesh.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

Previous by date: 4 Apr 2001 14:33:19 -0000 Announce: Chinese Input Method Editor for nanoX, Hsien-Li Lin
Next by date: 4 Apr 2001 14:33:19 -0000 Re: Announce: sdl-nanox-patch, Alex Holden
Previous in thread: 4 Apr 2001 14:33:19 -0000 Is it Microwindows(nanoX) supporting Alpha blending?, Sadeesh Kumar
Next in thread: 4 Apr 2001 14:33:19 -0000 Re: Is it Microwindows(nanoX) supporting Alpha blending?, Greg Haerr


Powered by ezmlm-browse 0.20.