Modes.
| Modifier and Type | Class and Description |
|---|---|
| public static enum | Blend.
A blending mode that defines the manner in which the inputs are composited together. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public final Effect | |
| public Blend. | Returns: theMode used to blend the two inputs together.Returns the |
| public float | Returns: the opacity valueReturns the opacity value, which is modulated with the top input prior to blending. |
| public RenderState | getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)
Implements abstract com. Returns the object representing the rendering strategy and state for the filter operation characterized by the specified arguments. |
| public final Effect | |
| public boolean | reducesOpaquePixels()
Implements abstract com. Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input. |
| public void | setBottomInput(Effect
the bottom input for this bottomInput)EffectSets the bottom input for this |
| public void | |
| public void | setOpacity(float
the opacity value opacity)Sets the opacity value, which is modulated with the top input prior to blending. |
| public void | setTopInput(Effect
the top input for this topInput)EffectSets the top input for this |
| public Point2D | Returns: the transformed point in the coordinate space of the resultthe point in the coordinate space of the primary content
input to be transformed p, Effect the default input defaultInput)Effect to be used in
all cases where a filter has a null inputOverrides com. Transform the specified point |
| public Point2D | Returns: the untransformed point in the coordinate space of the primary content inputthe point in the coordinate space of the result output
to be transformed p, Effect the default input defaultInput)Effect to be used in
all cases where a filter has a null inputOverrides com. Transform the specified point |
| mode | back to summary |
|---|---|
| private Blend. | |
| opacity | back to summary |
|---|---|
| private float opacity | |
| Blend | back to summary |
|---|---|
| public Blend(Blend. Constructs a new
| |
| getBottomInput | back to summary |
|---|---|
| public final Effect getBottomInput() Returns the bottom input for this
| |
| getMode | back to summary |
|---|---|
| public Blend. Returns the | |
| getOpacity | back to summary |
|---|---|
| public float getOpacity() Returns the opacity value, which is modulated with the top input prior to blending.
| |
| getRenderState | back to summary |
|---|---|
| public RenderState getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput) Implements abstract com. Doc from com. Returns the object representing the rendering strategy and state for
the filter operation characterized by the specified arguments.
This call can also be used to get a state object for non-rendering
cases like querying the bounds of an operation in which case the
| |
| getTopInput | back to summary |
|---|---|
| public final Effect getTopInput() Returns the top input for this
| |
| reducesOpaquePixels | back to summary |
|---|---|
| public boolean reducesOpaquePixels() Implements abstract com. Doc from com. Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input. It is always safe to return true from this method, though the consequences may be that the caller chooses to not utilize a planned optimization.
| |
| setBottomInput | back to summary |
|---|---|
| public void setBottomInput(Effect bottomInput) Sets the bottom input for this
| |
| setMode | back to summary |
|---|---|
| public void setMode(Blend. Sets the
Min: n/a
Max: n/a
Default: Mode.SRC_OVER
Identity: n/a
| |
| setOpacity | back to summary |
|---|---|
| public void setOpacity(float opacity) Sets the opacity value, which is modulated with the top input prior to blending.
Min: 0.0
Max: 1.0
Default: 1.0
Identity: 1.0
| |
| setTopInput | back to summary |
|---|---|
| public void setTopInput(Effect topInput) Sets the top input for this
| |
| transform | back to summary |
|---|---|
| public Point2D transform(Point2D p, Effect defaultInput) Overrides com. Transform the specified point
The | |
| untransform | back to summary |
|---|---|
| public Point2D untransform(Point2D p, Effect defaultInput) Overrides com. Transform the specified point
The
| |
Mode describes a mathematical equation that
combines premultiplied inputs to produce some premultiplied result.
| Modifier and Type | Field and Description |
|---|---|
| public static final Blend. | ADD
The color and alpha components from the top input are added to those from the bottom input. |
| public static final Blend. | BLUE
The blue component of the bottom input is replaced with the blue component of the top input; the other color components are unaffected. |
| public static final Blend. | 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. |
| public static final Blend. | COLOR_DODGE
The bottom input color components are divided by the inverse of the top input color components to produce the resulting color. |
| public static final Blend. | DARKEN
REMIND: cross check this formula with OpenVG spec... |
| public static final Blend. | DIFFERENCE
The darker of the color components from the two inputs are subtracted from the lighter ones to produce the resulting color. |
| public static final Blend. | 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. |
| public static final Blend. | GREEN
The green component of the bottom input is replaced with the green component of the top input; the other color components are unaffected. |
| public static final Blend. | HARD_LIGHT
The input color components are either multiplied or screened, depending on the top input color. |
| public static final Blend. | LIGHTEN
REMIND: cross check this formula with OpenVG spec... |
| public static final Blend. | MULTIPLY
The color components from the first input are multiplied with those from the second input. |
| public static final Blend. | OVERLAY
The input color components are either multiplied or screened, depending on the bottom input color. |
| public static final Blend. | RED
The red component of the bottom input is replaced with the red component of the top input; the other color components are unaffected. |
| public static final Blend. | 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. |
| public static final Blend. | SOFT_LIGHT
REMIND: this is a complicated formula, TBD... |
| public static final Blend. | SRC_ATOP
The part of the top input lying inside of the bottom input is blended with the bottom input. |
| public static final Blend. | SRC_IN
The part of the top input lying inside of the bottom input is kept in the resulting image. |
| public static final Blend. | SRC_OUT
The part of the top input lying outside of the bottom input is kept in the resulting image. |
| public static final Blend. | SRC_OVER
The top input is blended over the bottom input. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Blend. | |
| public static Blend. |
| ADD | back to summary |
|---|---|
| public static final Blend. The color and alpha components from the top input are added to those from the bottom input. The result is clamped to 1.0 if it exceeds the logical maximum of 1.0. Thus:
Ar = min(1, Atop+Abot)
Cr = min(1, Ctop+Cbot)
Notes:
| |
| BLUE | back to summary |
|---|---|
| public static final Blend. The blue component of the bottom input is replaced with the
blue component of the top input; the other color components
are unaffected.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Rr = Rbot
Gr = Gbot
Br = Btop
| |
| COLOR_BURN | back to summary |
|---|---|
| public static final Blend. 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.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = 1-((1-Cbot) / Ctop)
| |
| COLOR_DODGE | back to summary |
|---|---|
| public static final Blend. The bottom input color components are divided by the inverse
of the top input color components to produce the resulting color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = Cbot / (1-Ctop)
| |
| DARKEN | back to summary |
|---|---|
| public static final Blend. REMIND: cross check this formula with OpenVG spec...
The darker of the color components from the two inputs are
selected to produce the resulting color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = min(Ctop, Cbot)
Notes:
| |
| DIFFERENCE | back to summary |
|---|---|
| public static final Blend. The darker of the color components from the two inputs are
subtracted from the lighter ones to produce the resulting color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = abs(Ctop-Cbot)
Notes:
| |
| EXCLUSION | back to summary |
|---|---|
| public static final Blend. 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.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = Ctop + Cbot - (2*Ctop*Cbot)
Notes:
| |
| GREEN | back to summary |
|---|---|
| public static final Blend. The green component of the bottom input is replaced with the
green component of the top input; the other color components
are unaffected.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Rr = Rbot
Gr = Gtop
Br = Bbot
| |
| HARD_LIGHT | back to summary |
|---|---|
| public static final Blend. The input color components are either multiplied or screened,
depending on the top input color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
REMIND: not sure how to express this succinctly yet...
Notes: | |
| LIGHTEN | back to summary |
|---|---|
| public static final Blend. REMIND: cross check this formula with OpenVG spec...
The lighter of the color components from the two inputs are
selected to produce the resulting color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = max(Ctop, Cbot)
Notes:
| |
| MULTIPLY | back to summary |
|---|---|
| public static final Blend. The color components from the first input are multiplied with those
from the second input.
The alpha components are blended according to
the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = Ctop * Cbot
Notes:
| |
| OVERLAY | back to summary |
|---|---|
| public static final Blend. The input color components are either multiplied or screened,
depending on the bottom input color.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
REMIND: not sure how to express this succinctly yet...
Notes:
| |
| RED | back to summary |
|---|---|
| public static final Blend. The red component of the bottom input is replaced with the
red component of the top input; the other color components
are unaffected.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Rr = Rtop
Gr = Gbot
Br = Bbot
| |
| SCREEN | back to summary |
|---|---|
| public static final Blend. 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.
The alpha components are blended according
to the Thus:
Ar = Atop + Abot*(1-Atop)
Cr = 1 - ((1-Ctop) * (1-Cbot))
Notes:
| |
| SOFT_LIGHT | back to summary |
|---|---|
| public static final Blend. REMIND: this is a complicated formula, TBD... | |
| SRC_ATOP | back to summary |
|---|---|
| public static final Blend. The part of the top input lying inside of the bottom input is blended with the bottom input. (Equivalent to the Porter-Duff "source atop destination" rule.) Thus:
Ar = Atop*Abot + Abot*(1-Atop) = Abot
Cr = Ctop*Abot + Cbot*(1-Atop)
| |
| SRC_IN | back to summary |
|---|---|
| public static final Blend. The part of the top input lying inside of the bottom input is kept in the resulting image. (Equivalent to the Porter-Duff "source in destination" rule.) Thus:
Ar = Atop*Abot
Cr = Ctop*Abot
| |
| SRC_OUT | back to summary |
|---|---|
| public static final Blend. The part of the top input lying outside of the bottom input is kept in the resulting image. (Equivalent to the Porter-Duff "source held out by destination" rule.) Thus:
Ar = Atop*(1-Abot)
Cr = Ctop*(1-Abot)
| |
| SRC_OVER | back to summary |
|---|---|
| public static final Blend. The top input is blended over the bottom input. (Equivalent to the Porter-Duff "source over destination" rule.) Thus:
Ar = Atop + Abot*(1-Atop)
Cr = Ctop + Cbot*(1-Atop)
| |
| Mode | back to summary |
|---|---|
| private Mode() | |
| valueOf | back to summary |
|---|---|
| public static Blend. | |
| values | back to summary |
|---|---|
| public static Blend. | |