APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.scenario.effect

public Class MotionBlur

extends LinearConvolveCoreEffect
Class Inheritance
Imports
com.sun.javafx.geom.BaseBounds, .DirtyRegionContainer, .DirtyRegionPool, .RectBounds, .Rectangle, com.sun.javafx.geom.transform.BaseTransform, com.sun.scenario.effect.impl.Renderer, com.sun.scenario.effect.impl.state.LinearConvolveKernel, .MotionBlurState

A motion blur effect using a Gaussian convolution kernel, with a configurable radius and angle.

Field Summary

Modifier and TypeField and Description
private MotionBlurState

Constructor Summary

AccessConstructor and Description
public
MotionBlur()

Constructs a new MotionBlur effect with the default radius (10.0) and default angle (0.0), using the default input for source data.

public
MotionBlur(float
the radius of the Gaussian kernel
radius
,
float
the angle of the motion effect, in radians
angle
)

Constructs a new MotionBlur effect with the given radius and angle, using the default input for source data.

public
MotionBlur(float
the radius of the Gaussian kernel
radius
,
float
the angle of the motion effect, in radians
angle
,
Effect
the single input Effect
input
)

Constructs a new MotionBlur effect with the given radius and angle.

Method Summary

Modifier and TypeMethod and Description
public Effect.AccelType
getAccelType(FilterContext fctx)

Overrides com.sun.scenario.effect.CoreEffect.getAccelType.

Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given FilterContext.

public float

Returns:

the angle of the motion effect, in radians
getAngle
()

Returns the angle of the motion effect, in radians.

public BaseBounds
getBounds(BaseTransform transform, Effect defaultInput)

Overrides com.sun.scenario.effect.FilterEffect.getBounds.

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.

public DirtyRegionContainer
getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool)

Overrides com.sun.scenario.effect.Effect.getDirtyRegions.

Returns the dirty region container containing dirty regions affected by this filter operation.

public final Effect

Returns:

the input for this Effect
getInput
()

Returns the input for this Effect.

public float

Returns:

the radius of the Gaussian kernel
getRadius
()

Returns the radius of the Gaussian kernel.

public Rectangle
pack-priv LinearConvolveKernel
getState()

Implements abstract com.sun.scenario.effect.LinearConvolveCoreEffect.getState.

Returns state object that is associated with this effect instance.

public boolean
reducesOpaquePixels()

Implements abstract com.sun.scenario.effect.Effect.reducesOpaquePixels.

Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input.

public void
setAngle(float
the angle of the motion effect, in radians
angle
)

Sets the angle of the motion effect, in radians.

public void
setInput(Effect
the input for this Effect
input
)

Sets the input for this Effect to a specific Effect or to the default input if input is null.

public void
setRadius(float
the radius of the Gaussian kernel
radius
)

Sets the radius of the Gaussian kernel.

Inherited from com.sun.scenario.effect.LinearConvolveCoreEffect:
filterImageDatasgetRenderState

Field Detail

stateback to summary
private MotionBlurState state

Constructor Detail

MotionBlurback to summary
public MotionBlur()

Constructs a new 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)
MotionBlurback to summary
public MotionBlur(float radius, float angle)

Constructs a new 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)
Parameters
radius:float

the radius of the Gaussian kernel

angle:float

the angle of the motion effect, in radians

Exceptions
IllegalArgumentException:
if radius is outside the allowable range
MotionBlurback to summary
public MotionBlur(float radius, float angle, Effect input)

Constructs a new MotionBlur effect with the given radius and angle.

Parameters
radius:float

the radius of the Gaussian kernel

angle:float

the angle of the motion effect, in radians

input:Effect

the single input Effect

Exceptions
IllegalArgumentException:
if radius is outside the allowable range

Method Detail

getAccelTypeback to summary
public Effect.AccelType getAccelType(FilterContext fctx)

Overrides com.sun.scenario.effect.CoreEffect.getAccelType.

Doc from com.sun.scenario.effect.Effect.getAccelType.

Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given FilterContext.

Annotations
@Override
getAngleback to summary
public float getAngle()

Returns the angle of the motion effect, in radians.

Returns:float

the angle of the motion effect, in radians

getBoundsback to summary
public BaseBounds getBounds(BaseTransform transform, Effect defaultInput)

Overrides com.sun.scenario.effect.FilterEffect.getBounds.

Doc from com.sun.scenario.effect.Effect.getBounds.

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. Note that the returned bounds can be smaller or larger than one or more of the inputs.

Annotations
@Override
getDirtyRegionsback to summary
public DirtyRegionContainer getDirtyRegions(Effect defaultInput, DirtyRegionPool regionPool)

Overrides com.sun.scenario.effect.Effect.getDirtyRegions.

Doc from com.sun.scenario.effect.Effect.getDirtyRegions.

Returns the dirty region container containing dirty regions affected by this filter operation.

Annotations
@Override
getInputback to summary
public final Effect getInput()

Returns the input for this Effect.

Returns:Effect

the input for this Effect

getRadiusback to summary
public float getRadius()

Returns the radius of the Gaussian kernel.

Returns:float

the radius of the Gaussian kernel

getResultBoundsback to summary
public Rectangle getResultBounds(BaseTransform transform, Rectangle outputClip, ImageData... inputDatas)

Overrides com.sun.scenario.effect.Effect.getResultBounds.

Annotations
@Override
getStateback to summary
pack-priv LinearConvolveKernel getState()

Implements abstract com.sun.scenario.effect.LinearConvolveCoreEffect.getState.

Doc from com.sun.scenario.effect.Effect.getState.

Returns state object that is associated with this effect instance. Subclasses may override this method to return some sort of state object that contains implementation details that are hidden from the public API. Classes outside this package can use the AccessHelper class to get access to this package-private method.

Annotations
@Override
reducesOpaquePixelsback to summary
public boolean reducesOpaquePixels()

Implements abstract com.sun.scenario.effect.Effect.reducesOpaquePixels.

Doc from com.sun.scenario.effect.Effect.reducesOpaquePixels.

Whether an opacity for any pixel is different (lower) than the corresponding pixel in the default input. It is always safe to return true from this method, though the consequences may be that the caller chooses to not utilize a planned optimization.

Annotations
@Override
setAngleback to summary
public void setAngle(float angle)

Sets the angle of the motion effect, in radians.

      Min: n/a
      Max: n/a
  Default: 0.0
 Identity: n/a
Parameters
angle:float

the angle of the motion effect, in radians

setInputback to summary
public void setInput(Effect input)

Sets the input for this Effect to a specific Effect or to the default input if input is null.

Parameters
input:Effect

the input for this Effect

setRadiusback to summary
public void setRadius(float radius)

Sets the radius of the Gaussian kernel.

      Min:  0.0
      Max: 63.0
  Default: 10.0
 Identity:  0.0
Parameters
radius:float

the radius of the Gaussian kernel

Exceptions
IllegalArgumentException:
if radius is outside the allowable range