public class Flood extends FilterEffect<T>
Identity
effect,
except that it is more convenient and potentially much more efficient.Effect.AccelType
DefaultInput
Constructor and Description |
---|
Flood(Object paint)
Constructs a new
Flood effect using the given platform-specific
paint object with an empty bounds for the flood region. |
Flood(Object paint,
RectBounds bounds)
Constructs a new
Flood effect using the given platform-specific
paint object to cover the indicated rectangular bounds . |
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 . |
BaseBounds |
getBounds(BaseTransform transform,
Effect defaultInput)
Returns the bounding box that will be affected by this filter
operation when viewed under the specified
transform ,
given its list of input Effect s and the specified
defaultInput effect. |
DirtyRegionContainer |
getDirtyRegions(Effect defaultInput,
DirtyRegionPool regionPool)
Returns the dirty region container containing dirty regions affected
by this filter operation.
|
RectBounds |
getFloodBounds() |
Object |
getPaint()
Returns the platform-specific paint object used to flood the region.
|
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.
|
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
setFloodBounds(RectBounds bounds) |
void |
setPaint(Object paint)
Sets the platform-specific paint object used to flood the region.
|
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, untransformClip
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getInputs, getNumInputs, getResultBounds, releaseCompatibleImage, setInput, transformBounds
public Flood(Object paint)
Flood
effect using the given platform-specific
paint object with an empty bounds for the flood region.paint
- the platform-specific paint object used to flood the regionIllegalArgumentException
- if paint
is nullpublic Flood(Object paint, RectBounds bounds)
Flood
effect using the given platform-specific
paint object to cover the indicated rectangular bounds
.paint
- the platform-specific paint object used to flood the regionbounds
- the rectangular area to coverIllegalArgumentException
- if either paint
or
bounds
is nullpublic Object getPaint()
public void setPaint(Object paint)
paint
- the flood paintIllegalArgumentException
- if paint
is nullpublic RectBounds getFloodBounds()
public void setFloodBounds(RectBounds bounds)
public BaseBounds getBounds(BaseTransform transform, Effect defaultInput)
Effect
transform
,
given its list of input Effect
s and the specified
defaultInput
effect.
Note that the returned bounds can be smaller or larger than one
or more of the inputs.getBounds
in class FilterEffect<RenderState>
transform
- the transform the effect will be viewed underdefaultInput
- the default input Effect
to be used in
all cases where a filter has a null inputpublic 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?"
Since no source input is used, any output coordinate is equally
affected, or unaffected, by any source coordinate so an undefined
point (NaN, NaN)
is returned.
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 input(NaN, NaN)
public 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?"
Since the Flood effect does not use any source data it returns
an undefined coordinate (NaN, NaN)
for all requests.
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 input(NaN, NaN)
public 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 DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool)
Effect
getDirtyRegions
in class Effect
defaultInput
- the default input Effect
to be used in
all cases where a filter has a null inputregionPool
- the pool of dirty regionspublic 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.