public class Blend extends FilterEffect<T>
Mode
s.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
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 |
---|---|
ImageData |
filterImageDatas(FilterContext fctx,
BaseTransform transform,
Rectangle outputClip,
T rstate,
ImageData... inputs)
Convenience method that sends the given input data through the
current peer, and then attempts to release the input image data.
|
Effect.AccelType |
getAccelType(FilterContext fctx)
Returns one of the
AccelType values, indicating
whether this Effect is accelerated in hardware for the
given FilterContext . |
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,
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. |
filter, getBounds, untransformClip
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDirtyRegions, getInputs, getNumInputs, getResultBounds, releaseCompatibleImage, setInput, transformBounds
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 inputIllegalArgumentException
- if mode
is nullpublic final Effect getBottomInput()
Effect
.Effect
public void setBottomInput(Effect bottomInput)
Effect
to a specific
Effect
or to the default input if input
is
null
.bottomInput
- the bottom input for this Effect
public final Effect getTopInput()
Effect
.Effect
public void setTopInput(Effect topInput)
Effect
to a specific
Effect
or to the default input if input
is
null
.topInput
- the top input for this Effect
public 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 modeIllegalArgumentException
- 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 valueIllegalArgumentException
- 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, Object renderHelper, Effect defaultInput)
FilterEffect
FilterContext
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()
Effect
reducesOpaquePixels
in class Effect
public ImageData filterImageDatas(FilterContext fctx, BaseTransform transform, Rectangle outputClip, T rstate, ImageData... inputs)
filterImageDatas
in class FilterEffect<T extends RenderState>
public Effect.AccelType getAccelType(FilterContext fctx)
Effect
AccelType
values, indicating
whether this Effect
is accelerated in hardware for the
given FilterContext
.getAccelType
in class Effect
AccelType
valuesCopyright © 2020. All rights reserved.