Top Description Fields Constructors Methods
com.sun.scenario.effect

public Class GaussianShadow

extends AbstractShadow
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.GaussianShadowState, .LinearConvolveKernel

A blurred shadow effect using a Gaussian convolution kernel, with a configurable radius and shadow color. Only the alpha channel of the input is used to create the shadow effect. The alpha value of each pixel from the result of the blur operation is modulated with the specified shadow color to produce the resulting image.

Field Summary

Modifier and TypeField and Description
private GaussianShadowState

Constructor Summary

AccessConstructor and Description
public
GaussianShadow()

Constructs a new GaussianShadow effect with the default radius (10.0) and the default color (Color4f.BLACK), using the default input for source data.

public
GaussianShadow(float
the radius of the Gaussian kernel
radius
)

Constructs a new GaussianShadow effect with the given radius and the default color (Color4f.BLACK), using the default input for source data.

public
GaussianShadow(float
the radius of the Gaussian kernel
radius
,
Color4f
the shadow Color4f
color
)

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

public
GaussianShadow(float
the radius of the Gaussian kernel
radius
,
Color4f
the shadow Color4f
color
,
Effect
the single input Effect
input
)

Constructs a new GaussianShadow effect with the given radius and color.

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
the transform the effect will be viewed under
transform
,
Effect
the default input Effect to be used in all cases where a filter has a null input
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 Color4f

Returns:

the shadow color
getColor
()

Implements abstract com.sun.scenario.effect.AbstractShadow.getColor.

Returns the shadow color.

public DirtyRegionContainer
getDirtyRegions(Effect
the default input Effect to be used in all cases where a filter has a null input
defaultInput
,
DirtyRegionPool
the pool of dirty regions
regionPool
)

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

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

public float
public float
public float
public float

Returns:

the horizontal radius of the Gaussian kernel
getHRadius
()

Returns the horizontal radius of the Gaussian kernel.

public final Effect

Returns:

the input for this Effect
getInput
()

Implements abstract com.sun.scenario.effect.AbstractShadow.getInput.

Returns the input for this Effect.

public AbstractShadow.ShadowMode
public float

Returns:

the radius of the Gaussian kernel
getRadius
()

Returns the radius of the Gaussian kernel.

public Rectangle
public float

Returns:

the spread of the shadow effect
getSpread
()

Implements abstract com.sun.scenario.effect.AbstractShadow.getSpread.

Gets the spread of the shadow effect.

pack-priv LinearConvolveKernel
getState()

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

Returns state object that is associated with this effect instance.

public float

Returns:

the vertical radius of the Gaussian kernel
getVRadius
()

Returns the vertical radius of the Gaussian kernel.

public AbstractShadow
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
setColor(Color4f
the shadow color
color
)

Implements abstract com.sun.scenario.effect.AbstractShadow.setColor.

Sets the shadow color.

public void
public void
public void
public void
setHRadius(float
the horizontal radius of the Gaussian kernel
hradius
)

Sets the horizontal radius of the Gaussian kernel.

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

Implements abstract com.sun.scenario.effect.AbstractShadow.setInput.

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.

public void
setSpread(float
the spread of the shadow effect
spread
)

Implements abstract com.sun.scenario.effect.AbstractShadow.setSpread.

Sets the spread of the shadow effect.

public void
setVRadius(float
the vertical radius of the Gaussian kernel
vradius
)

Sets the vertical radius of the Gaussian kernel.

Field Detail

stateback to summary
private GaussianShadowState state

Constructor Detail

GaussianShadowback to summary
public GaussianShadow()

Constructs a new GaussianShadow effect with the default radius (10.0) and the default color (Color4f.BLACK), using the default input for source data. This is a shorthand equivalent to:

    new GaussianShadow(10f, Color4f.BLACK, DefaultInput)
GaussianShadowback to summary
public GaussianShadow(float radius)

Constructs a new GaussianShadow effect with the given radius and the default color (Color4f.BLACK), using the default input for source data. This is a shorthand equivalent to:

    new GaussianShadow(radius, Color4f.BLACK, DefaultInput)
Parameters
radius:float

the radius of the Gaussian kernel

Exceptions
IllegalArgumentException:
if radius is outside the allowable range
GaussianShadowback to summary
public GaussianShadow(float radius, Color4f color)

Constructs a new GaussianShadow effect with the given radius and color, using the default input for source data. This is a shorthand equivalent to:

    new GaussianShadow(radius, color, DefaultInput)
Parameters
radius:float

the radius of the Gaussian kernel

color:Color4f

the shadow Color4f

Exceptions
IllegalArgumentException:
if radius is outside the allowable range
GaussianShadowback to summary
public GaussianShadow(float radius, Color4f color, Effect input)

Constructs a new GaussianShadow effect with the given radius and color.

Parameters
radius:float

the radius of the Gaussian kernel

color:Color4f

the shadow Color4f

input:Effect

the single input Effect

Exceptions
IllegalArgumentException:
if radius is outside the allowable range, or if color is null

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.

Returns:Effect.AccelType

one of the AccelType values

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.

Parameters
transform:BaseTransform

the transform the effect will be viewed under

defaultInput:Effect

the default input Effect to be used in all cases where a filter has a null input

Returns:BaseBounds

the bounding box of this filter

Annotations
@Override
getColorback to summary
public Color4f getColor()

Implements abstract com.sun.scenario.effect.AbstractShadow.getColor.

Returns the shadow color.

Returns:Color4f

the shadow color

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.

Parameters
defaultInput:Effect

the default input Effect to be used in all cases where a filter has a null input

regionPool:DirtyRegionPool

the pool of dirty regions

Returns:DirtyRegionContainer

the dirty region container

Annotations
@Override
getGaussianHeightback to summary
public float getGaussianHeight()

Implements abstract com.sun.scenario.effect.AbstractShadow.getGaussianHeight.

Annotations
@Override
getGaussianRadiusback to summary
public float getGaussianRadius()

Implements abstract com.sun.scenario.effect.AbstractShadow.getGaussianRadius.

Annotations
@Override
getGaussianWidthback to summary
public float getGaussianWidth()

Implements abstract com.sun.scenario.effect.AbstractShadow.getGaussianWidth.

Annotations
@Override
getHRadiusback to summary
public float getHRadius()

Returns the horizontal radius of the Gaussian kernel.

Returns:float

the horizontal radius of the Gaussian kernel

getInputback to summary
public final Effect getInput()

Implements abstract com.sun.scenario.effect.AbstractShadow.getInput.

Returns the input for this Effect.

Returns:Effect

the input for this Effect

Annotations
@Override
getModeback to summary
public AbstractShadow.ShadowMode getMode()

Implements abstract com.sun.scenario.effect.AbstractShadow.getMode.

Annotations
@Override
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
getSpreadback to summary
public float getSpread()

Implements abstract com.sun.scenario.effect.AbstractShadow.getSpread.

Gets the spread of the shadow effect.

Returns:float

the spread of the shadow effect

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
getVRadiusback to summary
public float getVRadius()

Returns the vertical radius of the Gaussian kernel.

Returns:float

the vertical radius of the Gaussian kernel

implForback to summary
public AbstractShadow implFor(AbstractShadow.ShadowMode mode)

Implements abstract com.sun.scenario.effect.AbstractShadow.implFor.

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.

Returns:boolean

true if this effect may reduce opacity of some pixels of one of it's input (and thus the default input) or it's relevant input(s) might have reduced opaque pixels of the default input already.

Annotations
@Override
setColorback to summary
public void setColor(Color4f color)

Implements abstract com.sun.scenario.effect.AbstractShadow.setColor.

Sets the shadow color.

      Min: n/a
      Max: n/a
  Default: Color4f.BLACK
 Identity: n/a
Parameters
color:Color4f

the shadow color

Annotations
@Override
Exceptions
IllegalArgumentException:
if color is null
setGaussianHeightback to summary
public void setGaussianHeight(float h)

Implements abstract com.sun.scenario.effect.AbstractShadow.setGaussianHeight.

Annotations
@Override
setGaussianRadiusback to summary
public void setGaussianRadius(float r)

Implements abstract com.sun.scenario.effect.AbstractShadow.setGaussianRadius.

Annotations
@Override
setGaussianWidthback to summary
public void setGaussianWidth(float w)

Implements abstract com.sun.scenario.effect.AbstractShadow.setGaussianWidth.

Annotations
@Override
setHRadiusback to summary
public void setHRadius(float hradius)

Sets the horizontal radius of the Gaussian kernel.

      Min:   0.0
      Max: 127.0
  Default:  10.0
 Identity:   0.0
Parameters
hradius:float

the horizontal radius of the Gaussian kernel

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

Implements abstract com.sun.scenario.effect.AbstractShadow.setInput.

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

Annotations
@Override
setRadiusback to summary
public void setRadius(float radius)

Sets the radius of the Gaussian kernel.

      Min:   0.0
      Max: 127.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
setSpreadback to summary
public void setSpread(float spread)

Implements abstract com.sun.scenario.effect.AbstractShadow.setSpread.

Sets the spread of the shadow effect. The spread is the portion of the radius where the contribution of the source material will be 100%. The remaining portion of the radius will have a contribution controlled by the Gaussian kernel. A spread of 0.0 will result in a pure Gaussian 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 radius with a very sharp cutoff to transparency at the radius.

      Min: 0.0
      Max: 1.0
  Default: 0.0
 Identity: 0.0
Parameters
spread:float

the spread of the shadow effect

Annotations
@Override
Exceptions
IllegalArgumentException:
if spread is outside the allowable range
setVRadiusback to summary
public void setVRadius(float vradius)

Sets the vertical radius of the Gaussian kernel.

      Min:   0.0
      Max: 127.0
  Default:  10.0
 Identity:   0.0
Parameters
vradius:float

the vertical radius of the Gaussian kernel

Exceptions
IllegalArgumentException:
if radius is outside the allowable range