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

public Class BoxBlur

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.BoxBlurState, .LinearConvolveKernel

A blur effect using a box-shaped convolution kernel, with a configurable size for each dimension of the kernel and a number of passes to control the quality of the blur.

Field Summary

Modifier and TypeField and Description
private final BoxBlurState

Constructor Summary

AccessConstructor and Description
public
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.

public
BoxBlur(int
the horizontal size of the BoxBlur kernel
hsize
,
int
the vertical size of the BoxBlur kernel
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.

public
BoxBlur(int
the horizontal size of the BoxBlur kernel
hsize
,
int
the vertical size of the BoxBlur kernel
vsize
,
int
the number of blur passes to execute
passes
)

Constructs a new BoxBlur effect with the given blur sizes and number of passes, using the default input for source data.

public
BoxBlur(int
the horizontal size of the BoxBlur kernel
hsize
,
int
the vertical size of the BoxBlur kernel
vsize
,
int
the number of blur passes to execute
passes
,
Effect
the single input 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.

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 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 int

Returns:

the horizontal size of the effect kernel
getHorizontalSize
()

Returns the horizontal size of the effect kernel.

public final Effect

Returns:

the input for this Effect
getInput
()

Returns the input for this Effect.

public int

Returns:

the number of passes of the effect kernel
getPasses
()

Returns the number of passes of the effect kernel to control the quality of the blur.

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 int

Returns:

the vertical size of the effect kernel
getVerticalSize
()

Returns the vertical size of the effect kernel.

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 final void
setHorizontalSize(int
the horizontal size of the effect kernel
hsize
)

Sets the horizontal size of the effect kernel.

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

Sets the input for this Effect.

public final void
setPasses(int passes)

Sets the number of passes of the effect kernel to control the quality of the blur.

public final void
setVerticalSize(int
the vertical size of the effect kernel
vsize
)

Sets the vertical size of the effect kernel.

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

Field Detail

stateback to summary
private final BoxBlurState state

Constructor Detail

BoxBlurback to summary
public 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. This is a shorthand equivalent to:

    new BoxBlur(1, 1, 1, DefaultInput)
BoxBlurback to summary
public 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. This is a shorthand equivalent to:

    new BoxBlur(hsize, vsize, 1, DefaultInput)
Parameters
hsize:int

the horizontal size of the BoxBlur kernel

vsize:int

the vertical size of the BoxBlur kernel

Exceptions
IllegalArgumentException:
if either hsize or vsize is outside the allowable range
BoxBlurback to summary
public 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. This is a shorthand equivalent to:

    new BoxBlur(hsize, vsize, passes, DefaultInput)
Parameters
hsize:int

the horizontal size of the BoxBlur kernel

vsize:int

the vertical size of the BoxBlur kernel

passes:int

the number of blur passes to execute

Exceptions
IllegalArgumentException:
if either hsize or vsize or passes is outside the allowable range
BoxBlurback to summary
public 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.

Parameters
hsize:int

the horizontal size of the BoxBlur kernel

vsize:int

the vertical size of the BoxBlur kernel

passes:int

the number of blur passes to execute

input:Effect

the single input Effect

Exceptions
IllegalArgumentException:
if either hsize or vsize or passes 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
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
getHorizontalSizeback to summary
public int getHorizontalSize()

Returns the horizontal size of the effect kernel.

Returns:int

the horizontal size of the effect kernel

getInputback to summary
public final Effect getInput()

Returns the input for this Effect.

Returns:Effect

the input for this Effect

getPassesback to summary
public int getPasses()

Returns the number of passes of the effect kernel to control the quality of the blur.

Returns:int

the number of passes of the effect 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
getVerticalSizeback to summary
public int getVerticalSize()

Returns the vertical size of the effect kernel.

Returns:int

the vertical size of the effect kernel

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
setHorizontalSizeback to summary
public final void setHorizontalSize(int hsize)

Sets the horizontal size of the effect kernel.

      Min:   0
      Max: 255
  Default:   1
 Identity:   0
Parameters
hsize:int

the horizontal size of the effect kernel

Exceptions
IllegalArgumentException:
if hsize is outside the allowable range
setInputback to summary
public void setInput(Effect input)

Sets the input for this Effect. 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

setPassesback to summary
public final void setPasses(int passes)

Sets the number of passes of the effect kernel to control the quality of the blur.

      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.
Exceptions
IllegalArgumentException:
if passes is outside the allowable range
setVerticalSizeback to summary
public final void setVerticalSize(int vsize)

Sets the vertical size of the effect kernel.

      Min:   0
      Max: 255
  Default:   1
 Identity:   0
Parameters
vsize:int

the vertical size of the effect kernel

Exceptions
IllegalArgumentException:
if vsize is outside the allowable range