public static enum Blend.Mode extends java.lang.Enum<Blend.Mode>
Mode
describes a mathematical equation that
combines premultiplied inputs to produce some premultiplied result.Enum Constant and Description |
---|
ADD
The color and alpha components from the top input are
added to those from the bottom input.
|
BLUE
The blue component of the bottom input is replaced with the
blue component of the top input; the other color components
are unaffected.
|
COLOR_BURN
The inverse of the bottom input color components are divided by
the top input color components, all of which is then inverted
to produce the resulting color.
|
COLOR_DODGE
The bottom input color components are divided by the inverse
of the top input color components to produce the resulting color.
|
DARKEN
REMIND: cross check this formula with OpenVG spec...
|
DIFFERENCE
The darker of the color components from the two inputs are
subtracted from the lighter ones to produce the resulting color.
|
EXCLUSION
The color components from the two inputs are multiplied and
doubled, and then subtracted from the sum of the bottom input
color components, to produce the resulting color.
|
GREEN
The green component of the bottom input is replaced with the
green component of the top input; the other color components
are unaffected.
|
HARD_LIGHT
The input color components are either multiplied or screened,
depending on the top input color.
|
LIGHTEN
REMIND: cross check this formula with OpenVG spec...
|
MULTIPLY
The color components from the first input are multiplied with those
from the second input.
|
OVERLAY
The input color components are either multiplied or screened,
depending on the bottom input color.
|
RED
The red component of the bottom input is replaced with the
red component of the top input; the other color components
are unaffected.
|
SCREEN
The color components from both of the inputs are
inverted, multiplied with each other, and that result
is again inverted to produce the resulting color.
|
SOFT_LIGHT
REMIND: this is a complicated formula, TBD...
|
SRC_ATOP
The part of the top input lying inside of the bottom input
is blended with the bottom input.
|
SRC_IN
The part of the top input lying inside of the bottom input
is kept in the resulting image.
|
SRC_OUT
The part of the top input lying outside of the bottom input
is kept in the resulting image.
|
SRC_OVER
The top input is blended over the bottom input.
|
Modifier and Type | Method and Description |
---|---|
static Blend.Mode |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Blend.Mode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Blend.Mode SRC_OVER
Thus:
Ar = Atop + Abot*(1-Atop) Cr = Ctop + Cbot*(1-Atop)
public static final Blend.Mode SRC_IN
Thus:
Ar = Atop*Abot Cr = Ctop*Abot
public static final Blend.Mode SRC_OUT
Thus:
Ar = Atop*(1-Abot) Cr = Ctop*(1-Abot)
public static final Blend.Mode SRC_ATOP
Thus:
Ar = Atop*Abot + Abot*(1-Atop) = Abot Cr = Ctop*Abot + Cbot*(1-Atop)
public static final Blend.Mode ADD
Thus:
Ar = min(1, Atop+Abot) Cr = min(1, Ctop+Cbot)
Notes:
public static final Blend.Mode MULTIPLY
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = Ctop * Cbot
Notes:
SCREEN
mode.
public static final Blend.Mode SCREEN
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = 1 - ((1-Ctop) * (1-Cbot))
Notes:
MULTIPLY
mode.
public static final Blend.Mode OVERLAY
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) REMIND: not sure how to express this succinctly yet...
Notes:
SCREEN
and
MULTIPLY
, depending on the bottom input color.
HARD_LIGHT
mode.
public static final Blend.Mode DARKEN
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = min(Ctop, Cbot)
Notes:
LIGHTEN
mode.
public static final Blend.Mode LIGHTEN
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = max(Ctop, Cbot)
Notes:
DARKEN
mode.
public static final Blend.Mode COLOR_DODGE
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = Cbot / (1-Ctop)
public static final Blend.Mode COLOR_BURN
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = 1-((1-Cbot) / Ctop)
public static final Blend.Mode HARD_LIGHT
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) REMIND: not sure how to express this succinctly yet...
Notes:
public static final Blend.Mode SOFT_LIGHT
public static final Blend.Mode DIFFERENCE
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = abs(Ctop-Cbot)
Notes:
public static final Blend.Mode EXCLUSION
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Cr = Ctop + Cbot - (2*Ctop*Cbot)
Notes:
DIFFERENCE
, except with lower contrast.
public static final Blend.Mode RED
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Rr = Rtop Gr = Gbot Br = Bbot
public static final Blend.Mode GREEN
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Rr = Rbot Gr = Gtop Br = Bbot
public static final Blend.Mode BLUE
SRC_OVER
equation.
Thus:
Ar = Atop + Abot*(1-Atop) Rr = Rbot Gr = Gbot Br = Btop
public static Blend.Mode[] values()
for (Blend.Mode c : Blend.Mode.values()) System.out.println(c);
public static Blend.Mode valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null