public class DropShadow extends DelegateEffect
Effect.AccelType
Modifier and Type | Field and Description |
---|---|
private Merge |
merge |
private Offset |
offset |
private AbstractShadow |
shadow |
DefaultInput
Constructor and Description |
---|
DropShadow()
Constructs a new
DropShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0), using the
default input for source data. |
DropShadow(Effect input)
Constructs a new
DropShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0). |
DropShadow(Effect shadowSourceInput,
Effect contentInput)
Constructs a new
DropShadow effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0). |
Modifier and Type | Method and Description |
---|---|
Effect.AccelType |
getAccelType(FilterContext fctx)
Returns one of the
AccelType values, indicating
whether this Effect is accelerated in hardware for the
given FilterContext . |
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 . |
float |
getSpread()
Gets the spread of the shadow effect.
|
void |
setColor(Color4f color)
Sets the shadow color.
|
void |
setContentInput(Effect contentInput)
Sets the content input for this
Effect . |
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 . |
void |
setSpread(float spread)
Sets the spread of the shadow effect.
|
filter, getBounds, getDirtyRegions, reducesOpaquePixels, transform, untransform
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDefaultedInput, getDefaultedInput, getInputs, getNumInputs, getResultBounds, getState, releaseCompatibleImage, setInput, transformBounds
private AbstractShadow shadow
private final Offset offset
private final Merge merge
public DropShadow()
DropShadow
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 DropShadow(DefaultInput, DefaultInput)
public DropShadow(Effect input)
DropShadow
effect, with the default
blur radius (10.0), x offset (0.0), and y offset (0.0).
This is a shorthand equivalent to:
new DropShadow(input, input);
input
- the single input Effect
public DropShadow(Effect shadowSourceInput, Effect contentInput)
DropShadow
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 final Effect getShadowSourceInput()
Effect
.Effect
public void setShadowSourceInput(Effect shadowSourceInput)
Effect
.shadowSourceInput
- the shadow source input for this Effect
java.lang.IllegalArgumentException
- if shadowSourceInput
is nullpublic final Effect getContentInput()
Effect
.Effect
public void setContentInput(Effect contentInput)
Effect
.contentInput
- the content input for this Effect
java.lang.IllegalArgumentException
- if contentInput
is nullpublic 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 kerneljava.lang.IllegalArgumentException
- 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 getSpread()
public void setSpread(float spread)
0.0
will result in a pure Gaussian distribution
of the shadow.
A spread of 1.0
will result in a solid growth outward of the
source material opacity to the limit of the radius with a very sharp
cutoff to transparency at the radius.
Min: 0.0 Max: 1.0 Default: 0.0 Identity: 0.0
spread
- the spread of the shadow effectjava.lang.IllegalArgumentException
- if spread
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 colorjava.lang.IllegalArgumentException
- 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 Effect.AccelType getAccelType(FilterContext fctx)
Effect
AccelType
values, indicating
whether this Effect
is accelerated in hardware for the
given FilterContext
.getAccelType
in class DelegateEffect
AccelType
values