Next: , Previous: , Up: API Reference   [Contents][Index]


3.8 Blend Modes

(use-modules (sdl2 blend-mode))

SDL2 provides several of the most commonly used blend modes:

Variable: none

No blending.

Variable: blend

Alpha blending.

Variable: add

Additive blending.

Variable: mul

Multiplicative blending.

Variable: mod

Color modulation.

Custom blend modes can be created using the make-blend-mode procedure.

Procedure: make-blend-mode src-color-factor dst-color-factor color-operation src-alpha-factor dst-alpha-factor alpha-operation

Return a new custom blend mode for renderers.

src-color-factor applies to the red, green, and blue components of the source pixels.

dst-color-factor applies to the red, green, and blue components of the destination pixels.

color-operation specifies how to combine the red, green, and blue components of the source and destination pixels.

src-alpha-factor applies to the alpha component of the source pixels.

dst-alpha-factor applies to the alpha component of the destination pixels.

alpha-operation specifies how to combine the alpha component of the source and destination pixels.

Possible values for factors are zero, one, src-color, one-minus-src-color, src-alpha, one-minus-src-alpha, dst-color, one-minus-dst-color, dst-alpha, and one-minus-dst alpha.

Possible values for operations are add, subtract, rev-subtract, minimum, and maximum.

Procedure: blend-mode? obj

Return #t if obj is a blend mode object.

Procedure: blend-mode-src-color-factor blend-mode

Return the source red, green, and blue channel blend factor for blend-mode.

Procedure: blend-mode-dst-color-factor blend-mode

Return the destination red, green, and blue channel blend factor for blend-mode.

Procedure: blend-mode-color-operation blend-mode

Return the red, green, and blue channel blend operation for blend-mode.

Procedure: blend-mode-src-alpha-factor blend-mode

Return the source alpha channel blend factor for blend-mode.

Procedure: blend-mode-dst-alpha-factor blend-mode

Return the destination alpha channel blend factor for blend-mode.

Procedure: blend-mode-alpha-operation blend-mode

Return the alpha channel blend operation for blend-mode.


Next: , Previous: , Up: API Reference   [Contents][Index]