388 views
in Platform Packages by
Under certain conditions, colors become darker, if buffered objects are used in combination with semi-transparency. Why?

1 Answer

0 votes
by

Buffered objects are usually used for optimization purpose, to avoid a redraw of all contents while the object is animated (e.g.: move- or fade in/out). The described phenomenon can be observed, if a buffered object with semi transparency is drawn into the framebuffer.

The reason is that the buffer memory is pre-initialized with the RGBA8888 color #00000000 which is black color from the RGB value and full transparent from the alpha value. By default Embedded Wizard is drawing all content objects (rectangles, borders, text, images, etc.) in blend mode to the black (transparent) buffer. In a second step, the buffer is drawn into the framebuffer. At that time the second blending causes a darker appearance of the object.

If the same object is drawn without buffered mode, it will appear correct, since there is only one blending step.

This effect only happens on targets without support of pre-multiplied colors. Most Platform Packages contain the Graphics Engine 2.0 which operates by default with pre-multiplied colors. Only in cases, when a hardware graphics accelerator does not support graphics operations with pre-multiplied colors, the feature is disabled. In this case, one of the following hints may help to avoid this effect.

  • If possible, please avoid buffered mode together with blended, semi-transparent objects.
  • To eliminate the shading effect you can use the color of the semitransparent part as RGB value for the pre-initialization of the buffer memory. This means if the semitransparent part has RGBA color 0xFFFFFFC0, we use color 0xFFFFFF00 for the pre-initialization instead of 0x00000000. As shown in the image below "buffered semi-transparent with white pre-initialization 0xFFFFFF00" the effect can be totally eliminated by this trick.
  • Also by using the copy mode for buffered objects instead of blend mode the effect can be totally eliminated. The disadvantage is that this does only work on full transparent background. In copy mode everything behind the object is overwritten and the OSD semi-transparency will be directly to the video. In the image below you can see this in the object "buffered semi-transparent in copy mode".

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...