This is a query regarding overlay blending functionality in GC320 driver using Vivante 2D APIs.
Our requirement is to overlay an ARGB surface(src) on top of another ARGB surface (dst) with blending.
When the src surface pixel alpha value is 0x00, a completely transparent src surface, with no components of src contributing to final output is required.
Also when src surface alpha is 0xff, a completely opaque src surface, with no components of dst in the overlapping area in the final output is required.
We are able to implement blending using two methods:
1) Pixel level alpha value adjustment, with global alpha disabled
2) Global alpha value adjustment, with pixel alpha values set to 0xff for both src and dst surfaces.
Our observation is that when blending is done using pixel level alpha with global alpha disabled(method 1), src surface components were not completely transparent when src pixel alpha values were 0x00. Please note in this case the dst pixel alpha value is always 0xFF.
When we were adjusting global alpha value, with individual pixel alpha values set to 0xff(method 2), we were able to achieve the desired result.
Can the same be achieved using individual pixel level alpha value?
Sample code snippet used for both modes, and the respective outputs are attached in this mail.
Gal2DAlphaBlending_pixelAlpha.c has the code which implements the blending using pixel level alpha values with global alpha disabled.
Corresponding output is gal2DAlphaBlending_PixelAlpha.bmp
Gal2DAlphaBlending_globalAlpha.c has the global alpha mode enabled and pixel level alpha for both src and dst are set to 0xff.
Corresponding output is gal2DAlphaBlendingGlobalAlpha.bmp
In the above code snippet, desiredSrcAlpha is the alpha value needed for src surface overlay.
The desired output in our use case is gal2DAlphaBlendingGlobalAlpha.bmp (method 2).
Is it possible to achieve the same result with pixel level alpha blending(method 1) as it is in global alpha blending(method 2).
Note:
The code snippet is modified version of AlphaBlending /001 sample from ti_dra7x_gc320-unified-driver example.