public final class NodeEffectInput extends Effect
Modifier and Type | Class and Description |
---|---|
static class |
NodeEffectInput.RenderType |
Effect.AccelType
Modifier and Type | Field and Description |
---|---|
private ImageData |
cachedIdentityImageData |
private BaseTransform |
cachedTransform |
private ImageData |
cachedTransformedImageData |
private NGNode |
node |
private NodeEffectInput.RenderType |
renderType |
private BaseBounds |
tempBounds |
DefaultInput
Constructor and Description |
---|
NodeEffectInput(NGNode node) |
NodeEffectInput(NGNode node,
NodeEffectInput.RenderType renderType) |
Modifier and Type | Method and Description |
---|---|
(package private) static boolean |
contains(ImageData cachedImage,
Rectangle imgbounds) |
ImageData |
filter(FilterContext fctx,
BaseTransform transform,
Rectangle outputClip,
java.lang.Object renderHelper,
Effect defaultInput)
Applies this filter effect to the series of images represented by
the input
Effect s and/or the given defaultInput
viewed under the given transform . |
void |
flush() |
void |
flushIdentityImage() |
void |
flushTransformedImage() |
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.
|
(package private) static Rectangle |
getImageBoundsForNode(NGNode node,
NodeEffectInput.RenderType type,
BaseTransform transform,
Rectangle clip) |
private static ImageData |
getImageDataForBoundedNode(FilterContext fctx,
NGNode node,
NodeEffectInput.RenderType renderType,
BaseTransform transform,
Rectangle bounds)
bounds parameter must be a non-static unshared object which can be
saved in the returned ImageData object.
|
(package private) static ImageData |
getImageDataForNode(FilterContext fctx,
NGNode node,
boolean contentOnly,
BaseTransform transform,
Rectangle clip) |
NGNode |
getNode() |
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
render(Graphics g,
BaseTransform transform) |
void |
setNode(NGNode node) |
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getInputs, getNumInputs, getResultBounds, releaseCompatibleImage, setInput, transform, transformBounds, untransform
private NGNode node
private NodeEffectInput.RenderType renderType
private BaseBounds tempBounds
private ImageData cachedIdentityImageData
private ImageData cachedTransformedImageData
private BaseTransform cachedTransform
public NodeEffectInput(NGNode node)
public NodeEffectInput(NGNode node, NodeEffectInput.RenderType renderType)
public NGNode getNode()
public void setNode(NGNode node)
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.public ImageData filter(FilterContext fctx, BaseTransform transform, Rectangle outputClip, java.lang.Object renderHelper, Effect defaultInput)
Effect
Effect
s and/or the given defaultInput
viewed under the given transform
.
The filter does not need to create pixel data for any pixels that
fall outside of the destination device-space (pixel) bounds specified
by the outputClip
Rectangle
.
The filter might be able to use the renderHelper
object to
render the results directly on its own if the object is not null and
implements an interface, such as ImageHelper
, that the filter
recognizes.
If the effect renders itself then it will return a null
for
the ImageData
result.
Note that the ImageData
object returned by this method must be
validated prior to use with
ImageData.validate(com.sun.scenario.effect.FilterContext)
method.
boolean valid; do { ImageData res = filter(fctx, transform, clip, renderer, defaultInput); if (res == null) { break; } if (valid = res.validate(fctx)) { // Render res.getImage() to the appropriate destination // or use it as an input to another chain of effects. } res.unref(); } while (!valid);
filter
in class Effect
fctx
- the FilterContext
that determines the
environment (e.g. the graphics device or code path) on which
the filter operation will be performedtransform
- an optional transform under which the filter and
its inputs will be viewedoutputClip
- the device space (pixel) bounds of the output
image or window or clip into which the result of the Effect will
be rendered, or null if the output dimensions are not known.renderHelper
- an object which might be used to render
the results of the effect directly.defaultInput
- the default input Effect
to be used in
all cases where a filter has a null input.ImageData
holding the result of this filter
operation or null
if the filter had no output or used the
renderHelper
to render its results directly.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
valuespublic void flushIdentityImage()
public void flushTransformedImage()
public void flush()
public void render(Graphics g, BaseTransform transform)
static ImageData getImageDataForNode(FilterContext fctx, NGNode node, boolean contentOnly, BaseTransform transform, Rectangle clip)
static Rectangle getImageBoundsForNode(NGNode node, NodeEffectInput.RenderType type, BaseTransform transform, Rectangle clip)
private static ImageData getImageDataForBoundedNode(FilterContext fctx, NGNode node, NodeEffectInput.RenderType renderType, BaseTransform transform, Rectangle bounds)
public 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 regions