public class GaussianShadow extends AbstractShadow
AbstractShadow.ShadowMode
Effect.AccelType
Modifier and Type | Field and Description |
---|---|
private GaussianShadowState |
state |
DefaultInput
Constructor and Description |
---|
GaussianShadow()
Constructs a new
GaussianShadow effect with the default radius
(10.0) and the default color (Color4f.BLACK ), using the
default input for source data. |
GaussianShadow(float radius)
Constructs a new
GaussianShadow effect with the given radius
and the default color (Color4f.BLACK ), using the
default input for source data. |
GaussianShadow(float radius,
Color4f color)
Constructs a new
GaussianShadow effect with the given radius
and color, using the default input for source data. |
GaussianShadow(float radius,
Color4f color,
Effect input)
Constructs a new
GaussianShadow effect with the given
radius and color. |
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 . |
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. |
Color4f |
getColor()
Returns the shadow color.
|
DirtyRegionContainer |
getDirtyRegions(Effect defaultInput,
DirtyRegionPool regionPool)
Returns the dirty region container containing dirty regions affected
by this filter operation.
|
float |
getGaussianHeight() |
float |
getGaussianRadius() |
float |
getGaussianWidth() |
float |
getHRadius()
Returns the horizontal radius of the Gaussian kernel.
|
Effect |
getInput()
Returns the input for this
Effect . |
AbstractShadow.ShadowMode |
getMode() |
float |
getRadius()
Returns the radius of the Gaussian kernel.
|
Rectangle |
getResultBounds(BaseTransform transform,
Rectangle outputClip,
ImageData... inputDatas) |
float |
getSpread()
Gets the spread of the shadow effect.
|
(package private) LinearConvolveKernel |
getState()
Returns state object that is associated with this effect instance.
|
float |
getVRadius()
Returns the vertical radius of the Gaussian kernel.
|
AbstractShadow |
implFor(AbstractShadow.ShadowMode mode) |
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
setColor(Color4f color)
Sets the shadow color.
|
void |
setGaussianHeight(float h) |
void |
setGaussianRadius(float r) |
void |
setGaussianWidth(float w) |
void |
setHRadius(float hradius)
Sets the horizontal radius of the Gaussian kernel.
|
void |
setInput(Effect input)
Sets the input for this
Effect to a specific Effect
or to the default input if input is null . |
void |
setRadius(float radius)
Sets the radius of the Gaussian kernel.
|
void |
setSpread(float spread)
Sets the spread of the shadow effect.
|
void |
setVRadius(float vradius)
Sets the vertical radius of the Gaussian kernel.
|
filterImageDatas, getRenderState
getPeer, updatePeerKey, updatePeerKey
filter, transform, untransform, untransformClip
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDefaultedInput, getDefaultedInput, getInputs, getNumInputs, releaseCompatibleImage, setInput, transformBounds
private GaussianShadowState state
public GaussianShadow()
GaussianShadow
effect with the default radius
(10.0) and the default color (Color4f.BLACK
), using the
default input for source data.
This is a shorthand equivalent to:
new GaussianShadow(10f, Color4f.BLACK, DefaultInput)
public GaussianShadow(float radius)
GaussianShadow
effect with the given radius
and the default color (Color4f.BLACK
), using the
default input for source data.
This is a shorthand equivalent to:
new GaussianShadow(radius, Color4f.BLACK, DefaultInput)
radius
- the radius of the Gaussian kerneljava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic GaussianShadow(float radius, Color4f color)
GaussianShadow
effect with the given radius
and color, using the default input for source data.
This is a shorthand equivalent to:
new GaussianShadow(radius, color, DefaultInput)
radius
- the radius of the Gaussian kernelcolor
- the shadow Color4f
java.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic GaussianShadow(float radius, Color4f color, Effect input)
GaussianShadow
effect with the given
radius and color.radius
- the radius of the Gaussian kernelcolor
- the shadow Color4f
input
- the single input Effect
java.lang.IllegalArgumentException
- if radius
is outside the
allowable range, or if color
is nullLinearConvolveKernel getState()
Effect
getState
in class LinearConvolveCoreEffect
public Effect.AccelType getAccelType(FilterContext fctx)
Effect
AccelType
values, indicating
whether this Effect
is accelerated in hardware for the
given FilterContext
.getAccelType
in class CoreEffect<LinearConvolveRenderState>
AccelType
valuespublic final Effect getInput()
Effect
.getInput
in class AbstractShadow
Effect
public void setInput(Effect input)
Effect
to a specific Effect
or to the default input if input
is null
.setInput
in class AbstractShadow
input
- the 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 Gaussian kerneljava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic float getHRadius()
public void setHRadius(float hradius)
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
hradius
- the horizontal radius of the Gaussian kerneljava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic float getVRadius()
public void setVRadius(float vradius)
Min: 0.0 Max: 127.0 Default: 10.0 Identity: 0.0
vradius
- the vertical radius of the Gaussian kerneljava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic float getSpread()
getSpread
in class AbstractShadow
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
setSpread
in class AbstractShadow
spread
- the spread of the shadow effectjava.lang.IllegalArgumentException
- if spread
is outside the
allowable rangepublic Color4f getColor()
getColor
in class AbstractShadow
public void setColor(Color4f color)
Min: n/a Max: n/a Default: Color4f.BLACK Identity: n/a
setColor
in class AbstractShadow
color
- the shadow colorjava.lang.IllegalArgumentException
- if color
is nullpublic float getGaussianRadius()
getGaussianRadius
in class AbstractShadow
public float getGaussianWidth()
getGaussianWidth
in class AbstractShadow
public float getGaussianHeight()
getGaussianHeight
in class AbstractShadow
public void setGaussianRadius(float r)
setGaussianRadius
in class AbstractShadow
public void setGaussianWidth(float w)
setGaussianWidth
in class AbstractShadow
public void setGaussianHeight(float h)
setGaussianHeight
in class AbstractShadow
public AbstractShadow.ShadowMode getMode()
getMode
in class AbstractShadow
public AbstractShadow implFor(AbstractShadow.ShadowMode mode)
implFor
in class AbstractShadow
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<LinearConvolveRenderState>
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 Rectangle getResultBounds(BaseTransform transform, Rectangle outputClip, ImageData... inputDatas)
getResultBounds
in class Effect
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