Top Description Constructors Methods
com.sun.scenario.effect

public Class Crop

extends CoreEffect<RenderState>
Class Inheritance
Imports
com.sun.javafx.geom.Point2D, .BaseBounds, .DirtyRegionContainer, .DirtyRegionPool, .Rectangle, com.sun.javafx.geom.transform.BaseTransform, com.sun.scenario.effect.impl.state.RenderState

An effect that returns a cropped version of the input.

Constructor Summary

AccessConstructor and Description
public
Crop(Effect
the input Effect for image data
source
)

Constructs a new Crop effect which crops the output of the specified source Effect to the bounds of the default input.

public
Crop(Effect
the input Effect for image data
source
,
Effect
the input Effect that controls bounds
boundsInput
)

Constructs a new Crop effect to crop the output of the specified source Effect to the bounds of the specified bounds Effect.

Method Summary

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

Overrides com.sun.scenario.effect.FilterEffect.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 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 final Effect

Returns:

the bounds input for this Effect
getBoundsInput
()

Returns the bounds input for this Effect.

private Effect
getBoundsInput(Effect defaultInput)

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 RenderState
getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)

Implements abstract com.sun.scenario.effect.FilterEffect.getRenderState.

Returns the object representing the rendering strategy and state for the filter operation characterized by the specified arguments.

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
setBoundsInput(Effect
the bounds input for this Effect
input
)

Sets the bounds input for this Effect.

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

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

public Point2D

Returns:

the transformed point in the coordinate space of the result
transform
(Point2D
the point in the coordinate space of the primary content input to be transformed
p
,
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.transform.

Transform the specified point p from the coordinate space of the primary content input to the coordinate space of the effect output.

public Point2D

Returns:

the untransformed point in the coordinate space of the primary content input
untransform
(Point2D
the point in the coordinate space of the result output to be transformed
p
,
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.untransform.

Transform the specified point p from the coordinate space of the output of the effect into the coordinate space of the primary content input.

Inherited from com.sun.scenario.effect.CoreEffect:
filterImageDatasgetAccelTypegetPeerupdatePeerKeyupdatePeerKey

Constructor Detail

Cropback to summary
public Crop(Effect source)

Constructs a new Crop effect which crops the output of the specified source Effect to the bounds of the default input.

Parameters
source:Effect

the input Effect for image data

Cropback to summary
public Crop(Effect source, Effect boundsInput)

Constructs a new Crop effect to crop the output of the specified source Effect to the bounds of the specified bounds Effect.

Parameters
source:Effect

the input Effect for image data

boundsInput:Effect

the input Effect that controls bounds

Method Detail

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

Overrides com.sun.scenario.effect.FilterEffect.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
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
getBoundsInputback to summary
public final Effect getBoundsInput()

Returns the bounds input for this Effect.

Returns:Effect

the bounds input for this Effect

getBoundsInputback to summary
private Effect getBoundsInput(Effect defaultInput)
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

getRenderStateback to summary
public RenderState getRenderState(FilterContext fctx, BaseTransform transform, Rectangle outputClip, Object renderHelper, Effect defaultInput)

Implements abstract com.sun.scenario.effect.FilterEffect.getRenderState.

Doc from com.sun.scenario.effect.FilterEffect.getRenderState.

Returns the object representing the rendering strategy and state for the filter operation characterized by the specified arguments. This call can also be used to get a state object for non-rendering cases like querying the bounds of an operation in which case the FilterContext object may be null. outputClip and renderHelper may always be null just as they may be null for a given filter operation.

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
setBoundsInputback to summary
public void setBoundsInput(Effect input)

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

Parameters
input:Effect

the bounds input for this Effect

setInputback to summary
public void setInput(Effect input)

Sets the source 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

transformback to summary
public Point2D transform(Point2D p, Effect defaultInput)

Overrides com.sun.scenario.effect.FilterEffect.transform.

Transform the specified point p from the coordinate space of the primary content input to the coordinate space of the effect output. In essence, this method asks the question "Which output coordinate is most affected by the data at the specified coordinate in the primary source input?"

The Crop effect delegates this operation to its primary (non-bounds) input, or the defaultInput if the primary input is null.

Parameters
p:Point2D

the point in the coordinate space of the primary content input to be transformed

defaultInput:Effect

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

Returns:Point2D

the transformed point in the coordinate space of the result

Annotations
@Override
untransformback to summary
public Point2D untransform(Point2D p, Effect defaultInput)

Overrides com.sun.scenario.effect.FilterEffect.untransform.

Transform the specified point p from the coordinate space of the output of the effect into the coordinate space of the primary content input. In essence, this method asks the question "Which source coordinate contributes most to the definition of the output at the specified coordinate?"

The Crop effect delegates this operation to its primary (non-bounds) input, or the defaultInput if the primary input is null.

Parameters
p:Point2D

the point in the coordinate space of the result output to be transformed

defaultInput:Effect

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

Returns:Point2D

the untransformed point in the coordinate space of the primary content input

Annotations
@Override