public class MotionBlur extends LinearConvolveCoreEffect
Effect.AccelType
Modifier and Type | Field and Description |
---|---|
private MotionBlurState |
state |
DefaultInput
Constructor and Description |
---|
MotionBlur()
Constructs a new
MotionBlur effect with the default radius
(10.0) and default angle (0.0), using the default input for source
data. |
MotionBlur(float radius,
float angle)
Constructs a new
MotionBlur effect with the given radius
and angle, using the default input for source data. |
MotionBlur(float radius,
float angle,
Effect input)
Constructs a new
MotionBlur effect with the given radius
and angle. |
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 . |
float |
getAngle()
Returns the angle of the motion effect, in radians.
|
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. |
DirtyRegionContainer |
getDirtyRegions(Effect defaultInput,
DirtyRegionPool regionPool)
Returns the dirty region container containing dirty regions affected
by this filter operation.
|
Effect |
getInput()
Returns the input for this
Effect . |
float |
getRadius()
Returns the radius of the Gaussian kernel.
|
Rectangle |
getResultBounds(BaseTransform transform,
Rectangle outputClip,
ImageData... inputDatas) |
(package private) LinearConvolveKernel |
getState()
Returns state object that is associated with this effect instance.
|
boolean |
reducesOpaquePixels()
Whether an opacity for any pixel is different (lower)
than the corresponding pixel in the default input.
|
void |
setAngle(float angle)
Sets the angle of the motion effect, in radians.
|
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.
|
filterImageDatas, getRenderState
getPeer, updatePeerKey, updatePeerKey
filter, transform, untransform, untransformClip
combineBounds, combineBounds, createCompatibleImage, ensureTransform, getCompatibleImage, getDefaultedInput, getDefaultedInput, getInputs, getNumInputs, releaseCompatibleImage, setInput, transformBounds
private MotionBlurState state
public MotionBlur()
MotionBlur
effect with the default radius
(10.0) and default angle (0.0), using the default input for source
data.
This is a shorthand equivalent to:
new MotionBlur(10f, 0f, DefaultInput)
public MotionBlur(float radius, float angle)
MotionBlur
effect with the given radius
and angle, using the default input for source data.
This is a shorthand equivalent to:
new MotionBlur(radius, angle, DefaultInput)
radius
- the radius of the Gaussian kernelangle
- the angle of the motion effect, in radiansjava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic MotionBlur(float radius, float angle, Effect input)
MotionBlur
effect with the given radius
and angle.radius
- the radius of the Gaussian kernelangle
- the angle of the motion effect, in radiansinput
- the single input Effect
java.lang.IllegalArgumentException
- if radius
is outside the
allowable rangeLinearConvolveKernel 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
.Effect
public void setInput(Effect input)
Effect
to a specific Effect
or to the default input if input
is null
.input
- the input for this Effect
public float getRadius()
public void setRadius(float radius)
Min: 0.0 Max: 63.0 Default: 10.0 Identity: 0.0
radius
- the radius of the Gaussian kerneljava.lang.IllegalArgumentException
- if radius
is outside the
allowable rangepublic float getAngle()
public void setAngle(float angle)
Min: n/a Max: n/a Default: 0.0 Identity: n/a
angle
- the angle of the motion effect, in radianspublic 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