public class InnerShadow extends DelegateEffect
Effect.AccelType
DefaultInput
Constructor and Description |
---|
InnerShadow()
Constructs a new
InnerShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0), using the
default input for source data. |
InnerShadow(Effect input)
Constructs a new
InnerShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0). |
InnerShadow(Effect shadowSourceInput,
Effect contentInput)
Constructs a new
InnerShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0). |
Modifier and Type | Method and Description |
---|---|
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. |
float |
getChoke()
Gets the choke of the shadow effect.
|
Color4f |
getColor()
Returns the shadow color.
|
Effect |
getContentInput()
Returns the content input for this
Effect . |
protected Effect |
getDelegate()
Returns the
Effect object to delegate all operations to. |
float |
getGaussianHeight() |
float |
getGaussianRadius() |
float |
getGaussianWidth() |
int |
getOffsetX()
Returns the offset in the x direction, in pixels.
|
int |
getOffsetY()
Returns the offset in the x direction, in pixels.
|
float |
getRadius()
Returns the radius of the Gaussian kernel.
|
AbstractShadow.ShadowMode |
getShadowMode() |
Effect |
getShadowSourceInput()
Returns the shadow source input for this
Effect . |
void |
setChoke(float choke)
Sets the choke of the shadow effect.
|
void |
setColor(Color4f color)
Sets the shadow color.
|
void |
setContentInput(Effect contentInput)
Sets the content input for this
Effect to a specific
Effect or to the default input if input is
null . |
void |
setGaussianHeight(float h) |
void |
setGaussianRadius(float r) |
void |
setGaussianWidth(float w) |
void |
setOffsetX(int xoff)
Sets the offset in the x direction, in pixels.
|
void |
setOffsetY(int yoff)
Sets the offset in the y direction, in pixels.
|
void |
setRadius(float radius)
Sets the radius of the shadow blur kernel.
|
void |
setShadowMode(AbstractShadow.ShadowMode mode) |
void |
setShadowSourceInput(Effect shadowSourceInput)
Sets the shadow source 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, getAccelType, getDirtyRegions, reducesOpaquePixels
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getInputs, getNumInputs, getResultBounds, releaseCompatibleImage, setInput, transformBounds
public InnerShadow()
InnerShadow
effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0), using the
default input for source data.
This is a shorthand equivalent to:
new InnerShadow(DefaultInput, DefaultInput)
public InnerShadow(Effect input)
InnerShadow
effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0).
This is a shorthand equivalent to:
new InnerShadow(input, input);
input
- the single input Effect
public InnerShadow(Effect shadowSourceInput, Effect contentInput)
InnerShadow
effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0).
This constructor is intended for advanced developers only. Most developers will only ever need to use the default constructor.
The shadowSourceInput
is used to create the background shadow,
and the contentInput
is used to render the content over that
shadow.
shadowSourceInput
- the input Effect
used to create
the background shadowcontentInput
- the input Effect
used to render the content
over the shadowpublic AbstractShadow.ShadowMode getShadowMode()
public void setShadowMode(AbstractShadow.ShadowMode mode)
protected Effect getDelegate()
DelegateEffect
Effect
object to delegate all operations to.getDelegate
in class DelegateEffect
Effect
object to delegate to.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 DelegateEffect
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 final Effect getShadowSourceInput()
Effect
.Effect
public void setShadowSourceInput(Effect shadowSourceInput)
Effect
to a specific
Effect
or to the default input if input
is
null
.shadowSourceInput
- the shadow source input for this Effect
public final Effect getContentInput()
Effect
.Effect
public void setContentInput(Effect contentInput)
Effect
to a specific
Effect
or to the default input if input
is
null
.contentInput
- the content input for this Effect
public float getRadius()
public void setRadius(float radius)
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
radius
- the radius of the shadow blur kernelIllegalArgumentException
- if radius
is outside the
allowable rangepublic float getGaussianRadius()
public float getGaussianWidth()
public float getGaussianHeight()
public void setGaussianRadius(float r)
public void setGaussianWidth(float w)
public void setGaussianHeight(float h)
public float getChoke()
public void setChoke(float choke)
0.0
will result in a pure Gaussian distribution
of the shadow.
A choke of 1.0
will result in a solid growth inward of the
shadow from the edges to the limit of the radius with a very sharp
cutoff to transparency inside the radius.
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
choke
- the choke of the shadow effectIllegalArgumentException
- if choke
is outside the
allowable rangepublic Color4f getColor()
public void setColor(Color4f color)
Min: n/a Max: n/a Default: Color4f.BLACK Identity: n/a
color
- the shadow colorIllegalArgumentException
- if color
is nullpublic int getOffsetX()
public void setOffsetX(int xoff)
Min: Integer.MIN_VALUE Max: Integer.MAX_VALUE Default: 0 Identity: 0
xoff
- the offset in the x direction, in pixelspublic int getOffsetY()
public void setOffsetY(int yoff)
Min: Integer.MIN_VALUE Max: Integer.MAX_VALUE Default: 0 Identity: 0
yoff
- the offset in the y direction, in pixelspublic 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 DelegateEffect
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 DelegateEffect
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 inputCopyright © 2020. All rights reserved.