BlendAccuracy

Alpha-blending accuracy level

This primarily exists for performance reasons. In my tests LLVM manages to auto-vectorize the RGB-only codepath significantly better, while the codegen for the accurate RGBA path is pretty conservative.

This provides an optimization opportunity for use-cases that don’t require an alpha-channel on the result.

Values

ValueMeaning
rgbfalse

Only RGB channels will have the correct result.

A(lpha) channel can contain any value.

Suitable for blending into non-transparent targets (e.g. framebuffer, canvas) where the resulting alpha-channel (opacity) value does not matter.

rgbatrue

All RGBA channels will have the correct result.

Suitable for blending into transparent targets (e.g. images) where the resulting alpha-channel (opacity) value matters.

Use this mode for image manipulation.

Meta