public class Reflection extends FilterEffect<T>
Effect.AccelType
DefaultInput
Constructor and Description |
---|
Reflection()
Constructs a new
Reflection effect with default values,
using the default input for source data. |
Reflection(Effect input)
Constructs a new
Reflection effect with default values. |
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 . |
float |
getBottomOpacity()
Returns the bottom opacity value, which is the opacity of the reflection
at its bottom extreme.
|
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.
|
float |
getFraction()
Returns the fraction of the input that is visible in the reflection.
|
Effect |
getInput()
Returns the input for this
Effect . |
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.
|
float |
getTopOffset()
Returns the top offset adjustment, which is the distance between the
bottom of the input and the top of the reflection.
|
float |
getTopOpacity()
Returns the top opacity value, which is the opacity of the reflection
at its top extreme.
|
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
setBottomOpacity(float bottomOpacity)
Sets the bottom opacity value, which is the opacity of the reflection
at its bottom extreme.
|
void |
setFraction(float fraction)
Sets the fraction of the input that is visible in the reflection.
|
void |
setInput(Effect input)
Sets the input for this
Effect to a specific
Effect or to the default input if input is
null . |
void |
setTopOffset(float topOffset)
Sets the top offset adjustment, which is the distance between the
bottom of the input and the top of the reflection.
|
void |
setTopOpacity(float topOpacity)
Sets the top opacity value, which is the opacity of the reflection
at its top extreme.
|
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 Reflection()
Reflection
effect with default values,
using the default input for source data.
This is a shorthand equivalent to:
new Reflection(DefaultInput)
public Reflection(Effect input)
Reflection
effect with default values.input
- the single input Effect
public final Effect getInput()
Effect
.Effect
public void setInput(Effect input)
Effect
to a specific
Effect
or to the default input if input
is
null
.input
- the input for this Effect
public float getTopOffset()
public void setTopOffset(float topOffset)
Min: n/a Max: n/a Default: 0.0 Identity: 0.0
topOffset
- the top offset adjustmentpublic float getTopOpacity()
public void setTopOpacity(float topOpacity)
Min: 0.0 Max: 1.0 Default: 0.5 Identity: 1.0
topOpacity
- the top opacity valueIllegalArgumentException
- if topOpacity
is outside the
allowable rangepublic float getBottomOpacity()
public void setBottomOpacity(float bottomOpacity)
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 1.0
bottomOpacity
- the bottom opacity valueIllegalArgumentException
- if bottomOpacity
is outside the
allowable rangepublic float getFraction()
public void setFraction(float fraction)
Min: 0.0 Max: 1.0 Default: 0.75 Identity: 1.0
fraction
- the fraction of the input that is visible
in the reflectionIllegalArgumentException
- if fraction
is outside the
allowable rangepublic 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)
Effect
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 definition of which input represents the primary content input
and how the coordinate space of that input compares to the coordinate
space of the result varies from effect to effect.
Note that some effects may have a reasonable definition of how to
map source coordinates to destination coordinates, but not the
reverse.
In particular, effects which map source coordinates discontiguously
into the result may have several output coordinates that are affected
by a given input coordinate and may choose to return one of many
equally valid answers, or an undefined result such as NaN
,
or some other anomalous value.
Most effects perform simple transformations of the color of each
pixel and so represent an identity transform and return the point
unchanged.
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)
Effect
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 definition of which input represents the primary content input
and how the coordinate space of that input compares to the coordinate
space of the result varies from effect to effect.
Note that some effects may have a reasonable definition of how to
map destination coordinates back to source coordinates, but not the
reverse.
In particular, effects which produce entirely synthetic results not
based on any content input may not be able to give a meaningful
result to this query and may return undefined coordinates such as
0
, Infinity
, or NaN
.
Most effects perform simple transformations of the color of each
pixel and so represent an identity transform and return the point
unchanged.
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 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.