public class BoxShadow extends AbstractShadow
AbstractShadow.ShadowModeEffect.AccelType| Modifier and Type | Field and Description |
|---|---|
private BoxShadowState |
state |
DefaultInput| Constructor and Description |
|---|
BoxShadow()
Constructs a new
BoxShadow effect with
the default blur sizes (1, 1)
and the default number of passes (1),
using the default input for source data. |
BoxShadow(int hsize,
int vsize)
Constructs a new
BoxShadow effect with
the given blur sizes
and the default number of passes (1),
using the default input for source data. |
BoxShadow(int hsize,
int vsize,
int passes)
Constructs a new
BoxShadow effect with
the given blur sizes
and number of passes,
using the default input for source data. |
BoxShadow(int hsize,
int vsize,
int passes,
Effect input)
Constructs a new
BoxShadow effect with
the given blur sizes
and number of passes,
using the output of the specified effect for source data. |
| 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 Effects 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() |
int |
getHorizontalSize()
Returns the horizontal size of the effect kernel.
|
Effect |
getInput()
Returns the input for this
Effect. |
AbstractShadow.ShadowMode |
getMode() |
int |
getPasses()
Returns the number of passes of the effect kernel to control the
quality of the blur.
|
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.
|
int |
getVerticalSize()
Returns the vertical size of the effect 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 |
setHorizontalSize(int hsize)
Sets the horizontal size of the effect kernel.
|
void |
setInput(Effect input)
Sets the input for this
Effect. |
void |
setPasses(int passes)
Sets the number of passes of the effect kernel to control the
quality of the blur.
|
void |
setSpread(float spread)
Sets the spread of the shadow effect.
|
void |
setVerticalSize(int vsize)
Sets the vertical size of the effect kernel.
|
filterImageDatas, getRenderStategetPeer, updatePeerKey, updatePeerKeyfilter, transform, untransform, untransformClipcombineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDefaultedInput, getDefaultedInput, getInputs, getNumInputs, releaseCompatibleImage, setInput, transformBoundsprivate final BoxShadowState state
public BoxShadow()
BoxShadow effect with
the default blur sizes (1, 1)
and the default number of passes (1),
using the default input for source data.
This is a shorthand equivalent to:
new BoxShadow(1, 1, 1, DefaultInput)
public BoxShadow(int hsize,
int vsize)
BoxShadow effect with
the given blur sizes
and the default number of passes (1),
using the default input for source data.
This is a shorthand equivalent to:
new BoxShadow(hsize, vsize, 1, DefaultInput)
hsize - the horizontal size of the BoxShadow kernelvsize - the vertical size of the BoxShadow kerneljava.lang.IllegalArgumentException - if either hsize
or vsize is outside the allowable rangepublic BoxShadow(int hsize,
int vsize,
int passes)
BoxShadow effect with
the given blur sizes
and number of passes,
using the default input for source data.
This is a shorthand equivalent to:
new BoxShadow(hsize, vsize, passes, DefaultInput)
hsize - the horizontal size of the BoxShadow kernelvsize - the vertical size of the BoxShadow kernelpasses - the number of blur passes to executejava.lang.IllegalArgumentException - if either hsize
or vsize or passes
is outside the allowable rangepublic BoxShadow(int hsize,
int vsize,
int passes,
Effect input)
BoxShadow effect with
the given blur sizes
and number of passes,
using the output of the specified effect for source data.hsize - the horizontal size of the BoxShadow kernelvsize - the vertical size of the BoxShadow kernelpasses - the number of blur passes to executeinput - the single input Effectjava.lang.IllegalArgumentException - if either hsize
or vsize or passes
is outside the allowable rangeLinearConvolveKernel getState()
EffectgetState in class LinearConvolveCoreEffectpublic final Effect getInput()
Effect.getInput in class AbstractShadowEffectpublic void setInput(Effect input)
Effect.
Sets the input for this Effect to a specific
Effect or to the default input if input is
null.setInput in class AbstractShadowinput - the input for this Effectpublic int getHorizontalSize()
public final void setHorizontalSize(int hsize)
Min: 0
Max: 255
Default: 1
Identity: 0
hsize - the horizontal size of the effect kerneljava.lang.IllegalArgumentException - if hsize
is outside the allowable rangepublic int getVerticalSize()
public final void setVerticalSize(int vsize)
Min: 0
Max: 255
Default: 1
Identity: 0
vsize - the vertical size of the effect kerneljava.lang.IllegalArgumentException - if vsize
is outside the allowable rangepublic int getPasses()
public final void setPasses(int passes)
Min: 0
Max: 3
Default: 1
Identity: 0
A setting of 1 creates a low quality blur. A setting of 3 creates
a blur that is very close to a Gaussian blur.passes - java.lang.IllegalArgumentException - if passes is outside the
allowable rangepublic Color4f getColor()
getColor in class AbstractShadowpublic final void setColor(Color4f color)
Min: n/a
Max: n/a
Default: Color4f.BLACK
Identity: n/a
setColor in class AbstractShadowcolor - the shadow colorjava.lang.IllegalArgumentException - if color is nullpublic float getSpread()
getSpread in class AbstractShadowpublic final void setSpread(float spread)
0.0 will result in a pure box-blur 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 kernel sizes with a very
sharp cutoff to transparency at the edge of the kernel.
Min: 0.0
Max: 1.0
Default: 0.0
Identity: 0.0
setSpread in class AbstractShadowspread - the spread of the shadow effectjava.lang.IllegalArgumentException - if spread is outside the
allowable rangepublic float getGaussianRadius()
getGaussianRadius in class AbstractShadowpublic float getGaussianWidth()
getGaussianWidth in class AbstractShadowpublic float getGaussianHeight()
getGaussianHeight in class AbstractShadowpublic void setGaussianRadius(float r)
setGaussianRadius in class AbstractShadowpublic void setGaussianWidth(float w)
setGaussianWidth in class AbstractShadowpublic void setGaussianHeight(float h)
setGaussianHeight in class AbstractShadowpublic AbstractShadow.ShadowMode getMode()
getMode in class AbstractShadowpublic AbstractShadow implFor(AbstractShadow.ShadowMode mode)
implFor in class AbstractShadowpublic Effect.AccelType getAccelType(FilterContext fctx)
EffectAccelType values, indicating
whether this Effect is accelerated in hardware for the
given FilterContext.getAccelType in class CoreEffect<LinearConvolveRenderState>AccelType valuespublic BaseBounds getBounds(BaseTransform transform, Effect defaultInput)
Effecttransform,
given its list of input Effects 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 Effectpublic boolean reducesOpaquePixels()
EffectreducesOpaquePixels in class Effectpublic DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool)
EffectgetDirtyRegions in class EffectdefaultInput - the default input Effect to be used in
all cases where a filter has a null inputregionPool - the pool of dirty regions