public class BoxBlur extends LinearConvolveCoreEffect
Effect.AccelType| Modifier and Type | Field and Description |
|---|---|
private BoxBlurState |
state |
DefaultInput| Constructor and Description |
|---|
BoxBlur()
Constructs a new
BoxBlur effect with
the default blur sizes (1, 1)
and the default number of passes (1),
using the default input for source data. |
BoxBlur(int hsize,
int vsize)
Constructs a new
BoxBlur effect with
the given blur sizes
and the default number of passes (1),
using the default input for source data. |
BoxBlur(int hsize,
int vsize,
int passes)
Constructs a new
BoxBlur effect with
the given blur sizes
and number of passes,
using the default input for source data. |
BoxBlur(int hsize,
int vsize,
int passes,
Effect input)
Constructs a new
BoxBlur 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. |
DirtyRegionContainer |
getDirtyRegions(Effect defaultInput,
DirtyRegionPool regionPool)
Returns the dirty region container containing dirty regions affected
by this filter operation.
|
int |
getHorizontalSize()
Returns the horizontal size of the effect kernel.
|
Effect |
getInput()
Returns the input for this
Effect. |
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) |
(package private) LinearConvolveKernel |
getState()
Returns state object that is associated with this effect instance.
|
int |
getVerticalSize()
Returns the vertical size of the effect kernel.
|
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
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 |
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 BoxBlurState state
public BoxBlur()
BoxBlur 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 BoxBlur(1, 1, 1, DefaultInput)
public BoxBlur(int hsize,
int vsize)
BoxBlur 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 BoxBlur(hsize, vsize, 1, DefaultInput)
hsize - the horizontal size of the BoxBlur kernelvsize - the vertical size of the BoxBlur kerneljava.lang.IllegalArgumentException - if either hsize
or vsize is outside the allowable rangepublic BoxBlur(int hsize,
int vsize,
int passes)
BoxBlur effect with
the given blur sizes
and number of passes,
using the default input for source data.
This is a shorthand equivalent to:
new BoxBlur(hsize, vsize, passes, DefaultInput)
hsize - the horizontal size of the BoxBlur kernelvsize - the vertical size of the BoxBlur kernelpasses - the number of blur passes to executejava.lang.IllegalArgumentException - if either hsize
or vsize or passes
is outside the allowable rangepublic BoxBlur(int hsize,
int vsize,
int passes,
Effect input)
BoxBlur 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 BoxBlur kernelvsize - the vertical size of the BoxBlur 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.Effectpublic void setInput(Effect input)
Effect.
Sets the input for this Effect to a specific
Effect or to the default input if input is
null.input - 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 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