Enum Class BlendMode
- All Implemented Interfaces:
Serializable
,Comparable<BlendMode>
,Constable
- Since:
- 3.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionDestination pixels covered by the source are cleared to 0.Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged.Makes destination darker to reflect source.Makes destination brighter to reflect source.Retains the smallest component of the source and destination pixels.Similar toDARKEN
, but darkens on the composite channel, instead of separate RGB color channels.Subtracts darker from lighter with higher contrast.Divides the destination pixels by the source pixels and saturates the result.The source pixels are discarded, leaving the destination intact.Discards the destination pixels that are not covered by source pixels.Keeps the destination pixels that cover source pixels, discards the remaining source and destination pixels.Keeps the destination pixels that are not covered by source pixels.The source pixels are drawn behind the destination pixels.Subtracts darker from lighter with lower contrast.Makes destination lighter or darker, depending on source.Adds two images together, setting each color channel value to either 0 or 1.Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged.Retains the largest component of the source and destination pixel.Similar toLIGHTEN
, but lightens on the composite channel, instead of separate RGB color channels.Darkens the destination pixels to reflect the source pixels while also increasing contrast.Lightens the destination pixels to reflect the source pixels while also increasing contrast.Burns or dodges colors by changing brightness, depending on the blend color.Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged.Subtracts the source pixels from the destination pixels, without alpha blending.Subtracts the source pixels from the destination pixels and saturates the result, without alpha blending.Multiplies the source and destination pixels.Multiplies the source and destination pixels. This isMODULATE
with alpha blending.Multiplies or screens the source and destination depending on the destination color.Conditionally replaces destination pixels with source pixels depending on the brightness of the source pixels.Adds the source pixels to the destination pixels. For floating-point textures, color components may be greater than 1.0.Adds the source pixels to the destination pixels and saturates the result. For unsigned fixed-point textures, this is the same asPLUS
.Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged.Adds the source and destination pixels, then subtracts the source pixels multiplied by the destination.Makes destination lighter or darker, depending on source.The source pixels replace the destination pixels.Discards the source pixels that do not cover destination pixels.Keeps the source pixels that cover the destination pixels, discards the remaining source and destination pixels.Keeps the source pixels that do not cover destination pixels.The source pixels are drawn over the destination pixels.Subtracts the source pixels from the destination pixels and saturates the result, with alpha blending.Burns or dodges colors by changing contrast, depending on the blend color.Discards the source and destination pixels where source pixels cover destination pixels. -
Field Summary
-
Method Summary
-
Enum Constant Details
-
CLEAR
Destination pixels covered by the source are cleared to 0. aout = 0
Cout = 0
-
SRC
The source pixels replace the destination pixels. aout = asrc
Cout = Csrc
-
DST
The source pixels are discarded, leaving the destination intact. aout = adst
Cout = Cdst
-
SRC_OVER
The source pixels are drawn over the destination pixels. aout = asrc + (1 - asrc) * adst
Cout = Csrc + (1 - asrc) * Cdst
-
DST_OVER
The source pixels are drawn behind the destination pixels. aout = adst + (1 - adst) * asrc
Cout = Cdst + (1 - adst) * Csrc
-
SRC_IN
Keeps the source pixels that cover the destination pixels, discards the remaining source and destination pixels. aout = asrc * adst
Cout = Csrc * adst
-
DST_IN
Keeps the destination pixels that cover source pixels, discards the remaining source and destination pixels. aout = adst * asrc
Cout = Cdst * asrc
-
SRC_OUT
Keeps the source pixels that do not cover destination pixels. Discards source pixels that cover destination pixels. Discards all destination pixels. aout = (1 - adst) * asrc
Cout = (1 - adst) * Csrc
-
DST_OUT
Keeps the destination pixels that are not covered by source pixels. Discards destination pixels that are covered by source pixels. Discards all source pixels. aout = (1 - asrc) * adst
Cout = (1 - asrc) * Cdst
-
SRC_ATOP
Discards the source pixels that do not cover destination pixels. Draws remaining source pixels over destination pixels. aout = adst
Cout = adst * Csrc + (1 - asrc) * Cdst
-
DST_ATOP
Discards the destination pixels that are not covered by source pixels. Draws remaining destination pixels over source pixels. aout = asrc
Cout = asrc * Cdst + (1 - adst) * Csrc
-
XOR
Discards the source and destination pixels where source pixels cover destination pixels. Draws remaining source pixels. aout = (1 - adst) * asrc + (1 - asrc) * adst
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdst
-
PLUS
Adds the source pixels to the destination pixels. For floating-point textures, color components may be greater than 1.0.aout = asrc + adst
Cout = Csrc + Cdst
- See Also:
-
PLUS_CLAMPED
Adds the source pixels to the destination pixels and saturates the result. For unsigned fixed-point textures, this is the same asPLUS
. This is an advanced blend equation.aout = max(0, min(asrc + adst, 1))
Cout = max(0, min(Csrc + Cdst, 1))
- See Also:
-
MINUS
Subtracts the source pixels from the destination pixels, without alpha blending. For floating-point textures, color components may be less than 0.0.
aout = adst - asrc
Cout = Cdst - Csrc
- See Also:
-
MINUS_CLAMPED
Subtracts the source pixels from the destination pixels and saturates the result, without alpha blending. For unsigned fixed-point textures, this is the same as
MINUS
. This is an advanced blend equation.aout = max(0, min(adst - asrc, 1))
Cout = max(0, min(Cdst - Csrc, 1))
- See Also:
-
MODULATE
Multiplies the source and destination pixels. aout = asrc * adst
Cout = Csrc * Cdst
- See Also:
-
MULTIPLY
Multiplies the source and destination pixels. This isMODULATE
with alpha blending. If both the source and destination are opaque, then this is the same asMODULATE
. This is an advanced blend equation.aout = asrc + adst - asrc * adst
Cout = Csrc * Cdst + (1 - adst) * Csrc + (1 - asrc) * Cdst
- See Also:
-
SCREEN
Adds the source and destination pixels, then subtracts the source pixels multiplied by the destination. aout = asrc + adst - asrc * adst
Cout = Csrc + Cdst - Csrc * Cdst
-
OVERLAY
Multiplies or screens the source and destination depending on the destination color. aout = asrc + adst - asrc * adst
if Cdst ≤ 0.5 * adst:
Cout = 2 * Csrc * Cdst + (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = asrc * adst - 2 * (asrc - Csrc) * (adst - Cdst) + (1 - adst) * Csrc + (1 - asrc) * Cdst -
DARKEN
Retains the smallest component of the source and destination pixels. aout = asrc + adst - asrc * adst
Cout = min(Csrc, Cdst) + (1 - adst) * Csrc + (1 - asrc) * Cdst
-
LIGHTEN
Retains the largest component of the source and destination pixel. aout = asrc + adst - asrc * adst
Cout = max(Csrc, Cdst) + (1 - adst) * Csrc + (1 - asrc) * Cdst
-
COLOR_DODGE
Makes destination brighter to reflect source. aout = asrc + adst - asrc * adst
if Cdst ≤ 0:
Cout = Csrc * (1 - adst)if Csrc ≥ asrc:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = asrc * min(adst, Cdst * asrc / (asrc - Csrc)) + (1 - adst) * Csrc + (1 - asrc) * Cdst -
COLOR_BURN
Makes destination darker to reflect source. aout = asrc + adst - asrc * adst
if Cdst ≥ adst:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstif Csrc ≤ 0:
Cout = Csrc * (1 - adst)otherwise:
Cout = asrc * (adst - min(adst, (adst - Cdst) * asrc / Cdst)) + (1 - adst) * Csrc + (1 - asrc) * Cdst -
HARD_LIGHT
Makes destination lighter or darker, depending on source. aout = asrc + adst - asrc * adst
if Csrc ≤ 0.5 * asrc:
Cout = 2 * Csrc * Cdst + (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = asrc * adst - 2 * (asrc - Csrc) * (adst - Cdst) + (1 - adst) * Csrc + (1 - asrc) * Cdst -
SOFT_LIGHT
Makes destination lighter or darker, depending on source. aout = asrc + adst - asrc * adst
if Csrc ≤ 0.5 * asrc:
Cout = Cdst * Cdst * (asrc - 2 * Csrc) / adst + (1 - adst) * Csrc + Cdst * (2 * Csrc + 1 - asrc)if Cdst ≤ 0.25 * adst:
Cout = (adst * adst * (Csrc + Cdst * (6 * Csrc - 3 * asrc + 1)) + 12 * adst * Cdst * Cdst * (asrc - 2 * Csrc) - 16 * Cdst * Cdst * Cdst * (asrc - 2 * Csrc) - adst * adst * adst * Csrc) / adst * adstotherwise:
Cout = Cdst * (asrc - 2 * Csrc + 1) + Csrc * (1 - adst) - sqrt(Cdst * adst) * (asrc - 2 * Csrc) -
DIFFERENCE
Subtracts darker from lighter with higher contrast. aout = asrc + adst - asrc * adst
Cout = Csrc + Cdst - 2 * min(Csrc * adst, Cdst * asrc)
-
EXCLUSION
Subtracts darker from lighter with lower contrast. aout = asrc + adst - asrc * adst
Cout = Csrc + Cdst - 2 * Csrc * Cdst
-
SUBTRACT
Subtracts the source pixels from the destination pixels and saturates the result, with alpha blending. If both the source and destination are opaque, then this is the same as
MINUS_CLAMPED
. This is a custom blend equation.aout = asrc + adst - asrc * adst
if Cdst / adst - Csrc / asrc ≥ 0:
Cout = Csrc + Cdst - 2 * Csrc * adstotherwise:
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdst- See Also:
-
DIVIDE
Divides the destination pixels by the source pixels and saturates the result. For negative and NaN values, the result color is black (XOR). This is a custom blend equation.
aout = asrc + adst - asrc * adst
Cout = pin((Cdst * asrc) / (Csrc * adst), 0, 1) * asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdst
-
LINEAR_DODGE
Lightens the destination pixels to reflect the source pixels while also increasing contrast. This is
PLUS_CLAMPED
with alpha blending. If both the source and destination are opaque, then this is the same asPLUS_CLAMPED
. This is an extended advanced blend equation.aout = asrc + adst - asrc * adst
if Csrc / asrc + Cdst / adst ≤ 1:
Cout = Csrc + Cdstotherwise:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdst- See Also:
-
LINEAR_BURN
Darkens the destination pixels to reflect the source pixels while also increasing contrast. This is an extended advanced blend equation.
aout = asrc + adst - asrc * adst
if Csrc / asrc + Cdst / adst > 1:
Cout = Csrc + Cdst - asrc * adstotherwise:
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdst -
VIVID_LIGHT
Burns or dodges colors by changing contrast, depending on the blend color. This is an extended advanced blend equation.
aout = asrc + adst - asrc * adst
if Csrc ≤ 0:
Cout = Cdst * (1 - asrc)if Csrc < 0.5 * asrc:
Cout = asrc * (adst - min(adst, (adst - Cdst) * asrc / (2 * Cdst))) + (1 - adst) * Csrc + (1 - asrc) * Cdstif Csrc ≥ asrc:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = asrc * min(adst, Cdst * asrc / (2 * (asrc - Csrc))) + (1 - adst) * Csrc + (1 - asrc) * Cdst -
LINEAR_LIGHT
Burns or dodges colors by changing brightness, depending on the blend color. This is an extended advanced blend equation.
aout = asrc + adst - asrc * adst
if 2 * Csrc / asrc + Cdst / adst > 2:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstif 2 * Csrc / asrc + Cdst / adst ≤ 1:
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = 2 * Csrc * adst + Cdst * asrc - asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdst -
PIN_LIGHT
Conditionally replaces destination pixels with source pixels depending on the brightness of the source pixels. This is an extended advanced blend equation.
aout = asrc + adst - asrc * adst
if 2 * Csrc / asrc - Cdst / adst > 1 && Csrc < 0.5 * asrc:
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdstif 2 * Csrc / asrc - Cdst / adst > 1 && Csrc ≥ 0.5 * asrc:
Cout = 2 * Csrc * adst - asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstif 2 * Csrc / asrc - Cdst / adst ≤ 1 && Csrc * adst < 0.5 * Cdst * asrc:
Cout = 2 * Csrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = Cdst * asrc + (1 - adst) * Csrc + (1 - asrc) * Cdst -
HARD_MIX
Adds two images together, setting each color channel value to either 0 or 1. This is an extended advanced blend equation.
aout = asrc + adst - asrc * adst
if Csrc / asrc + Cdst / adst < 1:
Cout = (1 - adst) * Csrc + (1 - asrc) * Cdstotherwise:
Cout = asrc * adst + (1 - adst) * Csrc + (1 - asrc) * Cdst -
DARKER_COLOR
-
LIGHTER_COLOR
-
HUE
Replaces hue of destination with hue of source, leaving saturation and luminosity unchanged. -
SATURATION
Replaces saturation of destination saturation hue of source, leaving hue and luminosity unchanged. -
COLOR
Replaces hue and saturation of destination with hue and saturation of source, leaving luminosity unchanged. -
LUMINOSITY
Replaces luminosity of destination with luminosity of source, leaving hue and saturation unchanged.
-
-
Field Details
-
ADD
Name alias ofLINEAR_DODGE
.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-