Dinu Madau(deleted)
|
QNX SCREEN alpha blending
|
Dinu Madau(deleted)
07/13/2017 3:57 PM
post117878
|
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
|
|
|