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

public Class Identity

extends Effect
Class Inheritance
Imports
java.util.HashMap, .Map, com.sun.scenario.effect.impl.Renderer, com.sun.javafx.geom.Point2D, .BaseBounds, .DirtyRegionContainer, .DirtyRegionPool, .RectBounds, .Rectangle, com.sun.javafx.geom.transform.BaseTransform

A type of source effect that returns a version of the given platform-specific image object (e.g. a BufferedImage) that is suitable for the destination FilterContext. No other processing is performed on the specified image object.

Field Summary

Modifier and TypeField and Description
private final Map<FilterContext, ImageData>
private Point2D
private Filterable
Inherited from com.sun.scenario.effect.Effect:
DefaultInput

Constructor Summary

AccessConstructor and Description
public
Identity(Filterable
the source image, or null
src
)

Constructs a new Identity effect with the given platform-specific image.

Method Summary

Modifier and TypeMethod and Description
private void
public ImageData
filter(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)

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

Applies this filter effect to the series of images represented by the input Effects and/or the given defaultInput viewed under the given transform.

public Effect.AccelType
getAccelType(FilterContext fctx)

Implements abstract com.sun.scenario.effect.Effect.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)

Implements abstract 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.

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 Point2D

Returns:

the location of the source image
getLocation
()

Returns the location of the source image, relative to the untransformed source content bounds.

public final Filterable

Returns:

the source image
getSource
()

Returns the source image (can be null).

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
setLocation(Point2D
the new location of the source image
pt
)

Sets the location of the source image, relative to the untransformed source content bounds.

public void
setSource(Filterable
the source image, or null
src
)

Sets the source image.

Inherited from com.sun.scenario.effect.Effect:
combineBoundscombineBoundscreateCompatibleImageensureTransformgetCompatibleImagegetDefaultedInputgetDefaultedInputgetInputsgetNumInputsgetResultBoundsgetStatereleaseCompatibleImagesetInputtransformtransformBoundsuntransform

Field Detail

datacacheback to summary
private final Map<FilterContext, ImageData> datacache
locback to summary
private Point2D loc
srcback to summary
private Filterable src

Constructor Detail

Identityback to summary
public Identity(Filterable src)

Constructs a new Identity effect with the given platform-specific image.

Parameters
src:Filterable

the source image, or null

Method Detail

clearCacheback to summary
private void clearCache()
filterback to summary
public ImageData filter(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)

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

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

Applies this filter effect to the series of images represented by the input Effects and/or the given defaultInput viewed under the given transform. The filter does not need to create pixel data for any pixels that fall outside of the destination device-space (pixel) bounds specified by the outputClip Rectangle.

The filter might be able to use the renderHelper object to render the results directly on its own if the object is not null and implements an interface, such as ImageHelper, that the filter recognizes. If the effect renders itself then it will return a null for the ImageData result.

Note that the ImageData object returned by this method must be validated prior to use with ImageData#validate(com.sun.scenario.effect.FilterContext) method.

      boolean valid;

      do {
          ImageData res = filter(fctx, transform, clip, renderer, defaultInput);
          if (res == null) {
              break;
          }
          if (valid = res.validate(fctx)) {
              // Render res.getImage() to the appropriate destination
              // or use it as an input to another chain of effects.
          }
          res.unref();
      } while (!valid);
      

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

Implements abstract com.sun.scenario.effect.Effect.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)

Implements abstract com.sun.scenario.effect.Effect.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
getLocationback to summary
public final Point2D getLocation()

Returns the location of the source image, relative to the untransformed source content bounds.

Returns:Point2D

the location of the source image

getSourceback to summary
public final Filterable getSource()

Returns the source image (can be null).

Returns:Filterable

the source image

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
setLocationback to summary
public void setLocation(Point2D pt)

Sets the location of the source image, relative to the untransformed source content bounds.

Parameters
pt:Point2D

the new location of the source image

Exceptions
IllegalArgumentException:
if pt is null
setSourceback to summary
public void setSource(Filterable src)

Sets the source image.

Parameters
src:Filterable

the source image, or null