Display Control Unit (DCU)
MPC5606S Microcontroller Reference Manual, Rev. 7
414 Freescale Semiconductor
Section 12.4.5.1, Blending priority of layers), these bit fields and registers define how pixels from different
layers are blended together.
The AB and BB bit fields define whether blending is active and whether the whole graphic or a selected
portion is blended. Registers 5 and 6 define the range of RGB colors that define the selected pixels. The
TRANS bit field defines the transparency of the selected pixels.
The BB bit field defines whether the whole graphic, or only certain pixels, should be blended. When this
bit is set, pixels that have an RGB value that falls into the range defined by registers 5 and 6 are considered
to be selected and treated differently to the non-selected pixels in the graphic. This is a process known as
chroma-keying since it is the color of the pixel that defines the selection. The selected pixels must be
within the range defined by each color component of registers 5 and 6. See Table 12-60 for examples of
pixels that are selected and not selected when the given range is defined as 0x0080C0 to 0x0FB0FF.
The AB bit field defines how any selected and non-selected pixels are blended. By combining this control
with the BB bit field it is possible to define 11 unique ways of blending the pixels on a layer dependent on
the type of layer. Depending on the configuration defined by the AB and BB bit fields, the TRANS bit field
combines the two pixels in every blend stage using the alpha value of the upper pixel (which has the effect
of making this pixel more or less transparent and revealing more or less of the lower pixel).
The result of each blend stage is calculated for all three color components as shown in Equation 12-3.
A = (LPixel × (255 – alpha)) + (HPixel × alpha) Eqn. 12-3
where:
• A is a 16-bit value
• LPixel is the lower priority pixel in the blend
• HPixel is the higher priority pixel in the blend
• alpha is the alpha value of the higher priority pixel
The value of A is then normalized back to an 8-bit value by the approximation shown in Equation 12-4:
BPixel = A>>8 + 1 Eqn. 12-4
where BPixel is the blended pixel output.
The output value for each of the RGB components is therefore obtained by right-shifting A by 8 and then
adding 1 to the result.
The blend can apply to pixels with no alpha channel (RGB) or with an alpha channel (ARGB) in different
ways.
Table 12-60. Example of how chroma-key range selects pixels
Source pixel Red 00–0F Green 80–B0 Blue C0–FF Comment
0x000000 P X X Not selected
0x08C0C0 P X P Not selected
0x08A0C0 P P P Pixel is selected