ImageBlender¶
Provides advanced image blending methods (derived from OpenGL specification).
Description¶
Sets up custom blending options which builds upon Image blending methods. This class uses two equations: one for the RGB values, and another one for the alpha value. The default behavior of this class is the same as Image.blend_rect.
Properties¶
BlendFactor | alpha_dst_factor | 7 |
BlendEquation | alpha_equation | 0 |
BlendFactor | alpha_src_factor | 1 |
BlendFactor | rgb_dst_factor | 10 |
BlendEquation | rgb_equation | 0 |
BlendFactor | rgb_src_factor | 6 |
Methods¶
void | blend_rect ( Image src, Rect2 src_rect, Image dst, Vector2 dst_pos ) const |
void | stamp_rect ( Image src, Rect2 src_rect, Image dst, Vector2 dst_init_pos, Vector2 dst_end_pos, float spacing ) const |
Enumerations¶
enum BlendEquation:
- FUNC_ADD = 0 — Adds the
src
anddst
values. - FUNC_SUBTRACT = 1 — Substracts the
dst
value from thesrc
value. - FUNC_REVERSE_SUBTRACT = 2 — Substracts the
src
value from thedst
value. - FUNC_MIN = 3 — Selects the minimum from the
src
anddst
values. - FUNC_MAX = 4 — Selects the maximum from the
src
anddst
values.
enum BlendFactor:
- FACTOR_ZERO = 0 — Factor is equal to 0.
- FACTOR_ONE = 1 — Factor is equal to 1.
- FACTOR_SRC_COLOR = 2 — Factor is equal to the
src
color. - FACTOR_ONE_MINUS_SRC_COLOR = 3 — Factor is equal to 1 minus the
src
color. - FACTOR_DST_COLOR = 4 — Factor is equal to the
dst
color. - FACTOR_ONE_MINUS_DST_COLOR = 5 — Factor is equal to 1 minus the
dst
color. - FACTOR_SRC_ALPHA = 6 — Factor is equal to the alpha value of the
src
color. - FACTOR_ONE_MINUS_SRC_ALPHA = 7 — Factor is equal to 1 minus the alpha value of the
src
color. - FACTOR_DST_ALPHA = 8 — Factor is equal to the alpha value of the
dst
color. - FACTOR_ONE_MINUS_DST_ALPHA = 9 — Factor is equal to 1 minus the alpha value of the
dst
color. - FACTOR_DST_ALPHA_TIMES_ONE_MINUS_SRC_ALPHA = 10 — Factor is equal to
FACTOR_DST_ALPHA
timesFACTOR_ONE_MINUS_SRC_ALPHA
.
Property Descriptions¶
- BlendFactor alpha_dst_factor
Default | 7 |
Setter | set_alpha_dst_factor(value) |
Getter | get_alpha_dst_factor() |
Determines the value that multiply the dst
alpha value on those equations that require it.
- BlendEquation alpha_equation
Default | 0 |
Setter | set_alpha_equation(value) |
Getter | get_alpha_equation() |
Determines the equation that blends the alpha values.
- BlendFactor alpha_src_factor
Default | 1 |
Setter | set_alpha_src_factor(value) |
Getter | get_alpha_src_factor() |
Determines the value that multiply the src
alpha value on those equations that require it.
- BlendFactor rgb_dst_factor
Default | 10 |
Setter | set_rgb_dst_factor(value) |
Getter | get_rgb_dst_factor() |
Determines the values that multiply the dst
RGB values on those equations that require it.
- BlendEquation rgb_equation
Default | 0 |
Setter | set_rgb_equation(value) |
Getter | get_rgb_equation() |
Determines the equation that blends the RGB values.
- BlendFactor rgb_src_factor
Default | 6 |
Setter | set_rgb_src_factor(value) |
Getter | get_rgb_src_factor() |
Determines the values that multiply the src
RGB values on those equations that require it.
Method Descriptions¶
Blends src_rect
from src
image to dst
image at coordinates dst_pos
.
- void stamp_rect ( Image src, Rect2 src_rect, Image dst, Vector2 dst_init_pos, Vector2 dst_end_pos, float spacing ) const
Stamps src_rect
from src
image to dst
image in a straight line from dst_init_pos
to dst_end_pos
, with a certain spacing
between stamps. You may use it to draw strokes.