public class Blend extends CoreEffect<RenderState>
Modes.| Modifier and Type | Class and Description |
|---|---|
static class |
Blend.Mode
A blending mode that defines the manner in which the inputs
are composited together.
|
Effect.AccelType| Modifier and Type | Field and Description |
|---|---|
private Blend.Mode |
mode |
private float |
opacity |
DefaultInput| Constructor and Description |
|---|
Blend(Blend.Mode mode,
Effect bottomInput,
Effect topInput)
Constructs a new
Blend effect with the given mode and the
default opacity (1.0). |
| Modifier and Type | Method and Description |
|---|---|
Effect |
getBottomInput()
Returns the bottom input for this
Effect. |
Blend.Mode |
getMode()
Returns the
Mode used to blend the two inputs together. |
float |
getOpacity()
Returns the opacity value, which is modulated with the top input
prior to blending.
|
RenderState |
getRenderState(FilterContext fctx,
BaseTransform transform,
Rectangle outputClip,
java.lang.Object renderHelper,
Effect defaultInput)
Returns the object representing the rendering strategy and state for
the filter operation characterized by the specified arguments.
|
Effect |
getTopInput()
Returns the top input for this
Effect. |
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
setBottomInput(Effect bottomInput)
Sets the bottom input for this
Effect to a specific
Effect or to the default input if input is
null. |
void |
setMode(Blend.Mode mode)
Sets the
Mode used to blend the two inputs together. |
void |
setOpacity(float opacity)
Sets the opacity value, which is modulated with the top input prior
to blending.
|
void |
setTopInput(Effect topInput)
Sets the top input for this
Effect to a specific
Effect or to the default input if input is
null. |
Point2D |
transform(Point2D p,
Effect defaultInput)
Transform the specified point
p from the coordinate space
of the primary content input to the coordinate space of the effect
output. |
Point2D |
untransform(Point2D p,
Effect defaultInput)
Transform the specified point
p from the coordinate space
of the output of the effect into the coordinate space of the
primary content input. |
filterImageDatas, getAccelType, getPeer, updatePeerKey, updatePeerKeyfilter, getBounds, untransformClipcombineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDefaultedInput, getDefaultedInput, getDirtyRegions, getInputs, getNumInputs, getResultBounds, getState, releaseCompatibleImage, setInput, transformBoundsprivate Blend.Mode mode
private float opacity
public Blend(Blend.Mode mode, Effect bottomInput, Effect topInput)
Blend effect with the given mode and the
default opacity (1.0).
Either or both inputs may be null to indicate that the default
input should be used.mode - the blending modebottomInput - the bottom inputtopInput - the top inputjava.lang.IllegalArgumentException - if mode is nullpublic final Effect getBottomInput()
Effect.Effectpublic void setBottomInput(Effect bottomInput)
Effect to a specific
Effect or to the default input if input is
null.bottomInput - the bottom input for this Effectpublic final Effect getTopInput()
Effect.Effectpublic void setTopInput(Effect topInput)
Effect to a specific
Effect or to the default input if input is
null.topInput - the top input for this Effectpublic Blend.Mode getMode()
Mode used to blend the two inputs together.Mode used to blend the two inputs together.public void setMode(Blend.Mode mode)
Mode used to blend the two inputs together.
Min: n/a
Max: n/a
Default: Mode.SRC_OVER
Identity: n/a
mode - the blending modejava.lang.IllegalArgumentException - if mode is nullpublic float getOpacity()
public void setOpacity(float opacity)
Min: 0.0
Max: 1.0
Default: 1.0
Identity: 1.0
opacity - the opacity valuejava.lang.IllegalArgumentException - if opacity is outside the
allowable rangepublic Point2D transform(Point2D p, Effect defaultInput)
p from the coordinate space
of the primary content input to the coordinate space of the effect
output.
In essence, this method asks the question "Which output coordinate
is most affected by the data at the specified coordinate in the
primary source input?"
The Blend effect delegates this operation to its top
input, or the defaultInput if the top input is
null.
transform in class FilterEffect<RenderState>p - the point in the coordinate space of the primary content
input to be transformeddefaultInput - the default input Effect to be used in
all cases where a filter has a null inputpublic Point2D untransform(Point2D p, Effect defaultInput)
p from the coordinate space
of the output of the effect into the coordinate space of the
primary content input.
In essence, this method asks the question "Which source coordinate
contributes most to the definition of the output at the specified
coordinate?"
The Blend effect delegates this operation to its top
input, or the defaultInput if the top input is
null.
untransform in class FilterEffect<RenderState>p - the point in the coordinate space of the result output
to be transformeddefaultInput - the default input Effect to be used in
all cases where a filter has a null inputpublic RenderState getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, java.lang.Object renderHelper, Effect defaultInput)
FilterEffectFilterContext object may be null.
outputClip and renderHelper may always be null just
as they may be null for a given filter operation.getRenderState in class FilterEffect<RenderState>fctx - the context object that would be used by the Renderer
if this call is preparing for a render operation, or nulltransform - the transform for the output of this operationoutputClip - the clip rectangle that may restrict this operation, or nullrenderHelper - the rendering helper object that can be used to shortcut
this operation under certain conditions, or nulldefaultInput - the Effect to be used in place of any null inputspublic boolean reducesOpaquePixels()
EffectreducesOpaquePixels in class Effect