Hi!

Thanks a lot for the information. I guess I will have to play with it to really 
figure it out.
I think that what I want is really just color-keying...
 
Am I right in assuming that color keying will usually be hardware accellerated 
- since most video cards support a color keyed overlay plane, while 
alpha-blending will not be accellerated, since alpha-overlays are not supported 
by most hardware? Or is it a lot more complicated than that?
 
I'm going to have to get into the code more deeply to answer most of my 
questions I think, but it is slow going...
 
Thanks!
 
Richard Unger
 
 
 
 

________________________________

From: Denis Oliver Kropp [mailto:[EMAIL PROTECTED]
Sent: Tue 9/13/2005 12:14 PM
To: Unger Richard
Cc: [email protected]
Subject: Re: [directfb-users] DFB Questions: Understanding Window Translucency



Quoting Unger Richard:
> I can set a window's opacity using SetOpacity() -> I assume this is also
> what is mapped to <meta>+<alt>+mouse

Yes.

> Docs: "Set it to "0" to hide a window. Setting it to "0xFF" makes the
> window opaque if it has no alpha channel."
> I can also set a ColorKey for a window using SetColorKey()
> Docs: "If a pixel of the window matches this color the underlying window
> or the background is visible at this point."
>
> How do these two settings affect each other?

First color keying is applied, then the remaining pixels are blended.

> I observe that in the default setup, when I change a windows opacity, it
> is the black areas of the window that become most transparent. The white
> areas remain mostly opaque. Why is this?

It might look like that, but all colors are equally blended.

If you have a bright background you might find it the other way around.

> Is there a way to set up the following modes?
>
> A) Window blending based only on color key - ie all blue (#0000ff) areas
> of a window are 100% transparent, all non-blue areas are 100% opaque.

That's color keying only, i.e. create the window and set DWOP_COLORKEYING
using SetOptions().

> B) Window blending based only on alpha value of window pixels - window
> is blended according to values of the alpha channel. (Would this require
> the window to use an ARGB drawing surface?).

That's blending only, i.e. create the window with the DWCAPS_ALPHACHANNEL
capability in the window description's "caps" field. Make sure you set
the DWDESC_CAPS flag in "flags".

Any format with an alpha channel can be used, but the default is ARGB.

If you want another format, just set the DWDESC_PIXELFORMAT flag and
the "pixelformat" field.

--
Best regards,
  Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"



_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to