Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - QNX SCREEN alpha blending: (2 Items)
   
QNX SCREEN alpha blending  
Hi,
I am having issues with getting correct alpha blending using QNX Screen. I am using QNX 6.6.0.  From the documentation:

There are 3 parameters that  control how transparency (alpha blending) is done in QNX Screen.
SCREEN_PROPERTY_TRANSPARENCY
SCREEN_PROPERTY_ALPHA_MODE
SCREEN_PROPERTY_GLOBAL_ALPHA   This value must be between 0 and 255.  If the global alpha value is 255 it is opaque

SCREEN_PROPERTY_TRANSPARENCY is set to SCREEN_TRANSPARENCY_SOURCE_OVER = 3 (typical alpha blending)

SCREEN_PROPERTY_ALPHA_MODE
     alpha-mode = pre-multipled
     alpha-mode = non-pre-multipled
SCREEN_NON_PRE_MULTIPLIED_ALPHA The non pre-multiplied alpha content. This is the default. In this case, the source 
blending is done using the equation: 
c(r,g,b) = s(r,g,b) * s(a) + d(r,g,b) * (1 - s(a)) 
SCREEN_PRE_MULTIPLIED_ALPHA The pre-multiplied alpha content. In this case, the source blending is done using the 
equation: 
c(r,g,b) = s(r,g,b) + d(r,g,b) * (1 - s(a))


I am trying to do a simple background (BG) and foreground (FG) blend.

I did few tests and it showed that s(a) in the SCREEN_PROPERTY_ALPHA_MODE equations proved to be controlled by the value
 set to SCREEN_PROPERTY_GLOBAL_ALPHA.

Tests:
1.)	SCREEN_PROPERTY_GLOBAL_ALPHA = 0
a.	SCREEN_PROPERTY_ALPHA_MODE was set to Non_pre_multipled and pre_multiplied: Only background was visible.
2.)	 SCREEN_PROPERTY_GLOBAL_ALPHA = 1 to 255
a.	SCREEN_PROPERTY_ALPHA_MODE was set to Non_pre_multipled and pre_multiplied: Only foreground was visible.

I didn’t get any blend between the FG & BG with any combination with above tests. 

what am I missing?  Is it possible that this is related to the hardware (i.MX6D)?

Any suggestions would be appreciated.

Dinu
Re: QNX SCREEN alpha blending  
Hi Dinu,

I tested the window blending on another platform with a newer version of
Screen, and don't see any obvious problems.  For example, a value of 128
looked about 50% blended with the background, and the alpha-mode setting
had some visible effect.  I didn't check the calculations, but there was
no abrupt transition between zero/non-zero alpha like you're describing.

Please contact customer support for further assistance.  Include your
graphics.conf file and some more information about your test case, such
as how you set up the foreground and background (I used two separate
application windows for my test).

-- Michael