The alpha blending value is defined by:
- The component value A when using an ARGB or RGBA pixel format (alpha in the source pixel data is converted to 8-bit alpha value in the input pipeline logic):
- For ARGB-1555, the alpha blending is defined using a 1-bit value. It is converted into an 8-bit value by duplicating the 1-bit value (see Table 12-429).
- For ARGB-4444, the alpha blending is defined using a 4-bit value. It is converted into an 8-bit value by duplicating the 4-bit value (see Table 12-429).
- If the pixel format contains no alpha blending value, the pixel alpha value is considered to be 0xFF, and if alpha is equal to 0xFF, there is no multiplication.
- For BITMAP or YUV formats, there is no alpha blending factor associated with each pixel value. Only the global alpha blending factor associated with the window displaying the BITMAP or YUV format is used.
- The global alpha blending value can be set in the
DSS0_VID_GLOBAL_ALPHA register of the input pipeline, and is updated in
synch with the selected output channel.
- The modulated alpha blending value (that is, a total alpha blending value, when a combination of the pixel alpha blending value A and a global alpha blending are present) is determined as: Alpha = (Pixel Alpha × Global Alpha) / 256.
Table 12-429 shows the remapping and the percentage of alpha blending achieved.
Table 12-429 DISPC Overlay Alpha Blending – ARGBAlpha Blending 1-Bit Value (ARGB16-1555) | Alpha Blending 4-Bit Value (ARGB16-4444) | Alpha Blending 8-Bit Value (Converted Value) | % Blending |
---|
0x0 | 0x0 | 0x00 | 100% (transparent) |
N/A | 0x1 | 0x11 | 93.33% |
N/A | 0x2 | 0x22 | 86.6% |
N/A | ... | ... | ... |
N/A | 0xE | 0xEE | 6.6% |
0x1 | 0xF | 0xFF | 0% (opaque) |
Premultiplied Alpha
The image ARGB may have its RGB component already premultiplied with the alpha (AR'G'B') where:
In that case, the processing is as follows:
- Color components of premultiplied layers are multiplied with the global alpha, if global alpha is not equal to 0.
- Color components of the composed underlying layer are multiplied with (1 - A*global alpha).
The additional premultiplied alpha option is
accessible through the DSS0_VID_ATTRIBUTES [28] PREMULTIPLYALPHA register bit of the
input pipeline. The following settings are available:
- PREMULTIPLYALPHA bit = 0:
Source is not premultiplied with alpha. Full blending is done in the overlay
manager.
- PREMULTIPLYALPHA bit = 1:
Source is premultiplied with alpha. Partial blending is done.
Note: There is no alpha blending between the background and the next layer (layer-0) above it.
Layer-0 cannot be pre-multiplied, if the overlay output is driving the display, since that layer (or the background color) defines the bottom most layer. In this case, layer-0 alpha is 1 always.