BrushPaint.TextureLayer.BlendMode
-
Cmn
class BrushPaint.TextureLayer.BlendMode
The method by which the combined texture layers (index <= i) are blended with the next layer. The blend mode on the final layer controls how the combined texture is blended with the brush color, and should typically be a mode whose output alpha is proportional to the destination alpha, so that it can be adjusted by anti-aliasing.
Summary
Public companion properties |
||
|---|---|---|
BrushPaint.TextureLayer.BlendMode |
Keeps the destination pixels and discards the source pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Discards destination pixels that aren't covered by source pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Keeps destination pixels that cover source pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Keeps the destination pixels not covered by source pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
The source pixels are drawn behind the destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Source and destination are component-wise multiplied, including opacity. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Keeps the source pixels and discards the destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Discards source pixels that do not cover destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Keeps the source pixels that cover destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Keeps the source pixels that do not cover destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
The source pixels are drawn over the destination pixels. |
Cmn
|
BrushPaint.TextureLayer.BlendMode |
Discards source and destination pixels that intersect; keeps source and destination pixels that do not intersect. |
Cmn
|
Public companion properties
DST
val DST: BrushPaint.TextureLayer.BlendMode
Keeps the destination pixels and discards the source pixels.
Alpha = Alpha_dst
Color = Color_dst
This mode is unlikely to be useful, since it effectively causes the renderer to just ignore this TextureLayer and all layers before it, but it is included for completeness.
DST_ATOP
val DST_ATOP: BrushPaint.TextureLayer.BlendMode
Discards destination pixels that aren't covered by source pixels. Remaining destination pixels are drawn over source pixels.
Alpha = Alpha_src
Color = Alpha_src * Color_dst + (1 - Alpha_dst) * Color_src
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
DST_IN
val DST_IN: BrushPaint.TextureLayer.BlendMode
Keeps destination pixels that cover source pixels. Discards remaining source and destination pixels.
Alpha = Alpha_src * Alpha_dst
Color = Alpha_src * Color_dst
DST_OUT
val DST_OUT: BrushPaint.TextureLayer.BlendMode
Keeps the destination pixels not covered by source pixels. Discards destination pixels that are covered by source pixels and all source pixels.
Alpha = (1 - Alpha_src) * Alpha_dst
Color = (1 - Alpha_src) * Color_dst
DST_OVER
val DST_OVER: BrushPaint.TextureLayer.BlendMode
The source pixels are drawn behind the destination pixels.
Alpha = Alpha_dst + (1 - Alpha_dst) * Alpha_src
Color = Color_dst + (1 - Alpha_dst) * Color_src
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
MODULATE
val MODULATE: BrushPaint.TextureLayer.BlendMode
Source and destination are component-wise multiplied, including opacity.
Alpha = Alpha_src * Alpha_dst
Color = Color_src * Color_dst
SRC
val SRC: BrushPaint.TextureLayer.BlendMode
Keeps the source pixels and discards the destination pixels.
Alpha = Alpha_src
Color = Color_src
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
SRC_ATOP
val SRC_ATOP: BrushPaint.TextureLayer.BlendMode
Discards source pixels that do not cover destination pixels. Draws remaining pixels over destination pixels.
Alpha = Alpha_dst
Color = Alpha_dst * Color_src + (1 - Alpha_src) * Color_dst
SRC_IN
val SRC_IN: BrushPaint.TextureLayer.BlendMode
Keeps the source pixels that cover destination pixels. Discards remaining source and destination pixels.
Alpha = Alpha_src * Alpha_dst
Color = Color_src * Alpha_dst
SRC_OUT
val SRC_OUT: BrushPaint.TextureLayer.BlendMode
Keeps the source pixels that do not cover destination pixels. Discards destination pixels and all source pixels that cover destination pixels.
Alpha = (1 - Alpha_dst) * Alpha_src
Color = (1 - Alpha_dst) * Color_src
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
SRC_OVER
val SRC_OVER: BrushPaint.TextureLayer.BlendMode
The source pixels are drawn over the destination pixels.
Alpha = Alpha_src + (1 - Alpha_src) * Alpha_dst
Color = Color_src + (1 - Alpha_src) * Color_dst
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
XOR
val XOR: BrushPaint.TextureLayer.BlendMode
Discards source and destination pixels that intersect; keeps source and destination pixels that do not intersect.
Alpha = (1 - Alpha_dst) * Alpha_src + (1 - Alpha_src) * Alpha_dst
Color = (1 - Alpha_dst) * Color_src + (1 - Alpha_src) * Color_dst
This mode shouldn't normally be used for the final TextureLayer, since its output alpha is not proportional to the destination alpha (so it wouldn't preserve alpha adjustments from anti-aliasing).
Public functions
calculateMinimumRequiredVersion
fun calculateMinimumRequiredVersion(): Version
Returns the minimum required Version for this BlendMode.
By default, decoding a BrushFamily containing a BlendMode with a minimum required version higher than Version.MAX_SUPPORTED will fail.