BrushPaint.TextureLayer.BlendMode


public final 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 fields

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps the destination pixels and discards the source pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Discards destination pixels that aren't covered by source pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps destination pixels that cover source pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps the destination pixels not covered by source pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

The source pixels are drawn behind the destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Source and destination are component-wise multiplied, including opacity.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps the source pixels and discards the destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Discards source pixels that do not cover destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps the source pixels that cover destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Keeps the source pixels that do not cover destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

The source pixels are drawn over the destination pixels.

static final @NonNull BrushPaint.TextureLayer.BlendMode

Discards source and destination pixels that intersect; keeps source and destination pixels that do not intersect.

Public methods

@NonNull String

Public fields

DST

public static final @NonNull BrushPaint.TextureLayer.BlendMode DST

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode DST_ATOP

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode DST_IN

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode DST_OUT

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode DST_OVER

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode MODULATE

Source and destination are component-wise multiplied, including opacity.

Alpha = Alpha_src * Alpha_dst
Color = Color_src *
Color_dst

SRC

public static final @NonNull BrushPaint.TextureLayer.BlendMode SRC

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode SRC_ATOP

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode SRC_IN

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode SRC_OUT

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode SRC_OVER

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

public static final @NonNull BrushPaint.TextureLayer.BlendMode XOR

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 methods

toString

public @NonNull String toString()