com.sun.scenario.effect
Class Source

java.lang.Object
  extended by com.sun.scenario.effect.Effect
      extended by com.sun.scenario.effect.Source

public class Source
extends Effect

An effect that simply returns either the transformed (device space) image or untransformed (original) image from a SourceContent instance. This is mainly useful in a scene graph environment where the source content is generated/modified at runtime, outside the user's control.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.scenario.effect.Effect
Effect.AccelType
 
Field Summary
 
Fields inherited from class com.sun.scenario.effect.Effect
BOTH, NONE, TRANSFORMED, UNTRANSFORMED
 
Constructor Summary
Source(boolean transformed)
          Constructs a new Source instance.
 
Method Summary
 java.awt.Image filter(java.awt.GraphicsConfiguration config)
          Applies this filter effect to the series of images represented by the input Effects and/or SourceContent, and then returns the resulting Image.
 Effect.AccelType getAccelType(java.awt.GraphicsConfiguration config)
          Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given GraphicsConfiguration.
 java.awt.geom.Rectangle2D getBounds()
          Returns the bounding box that will be affected by this filter operation, given the list of input Effects and/or the current SourceContent.
 boolean isInDeviceSpace()
          Returns true if this Effect produces an Image in device space, or false if the Image will need to be converted into device space in a later stage.
 int needsSourceContent()
          Returns an integer indicating whether the effect implementation needs access to the TRANSFORMED source, UNTRANSFORMED source, BOTH, or NONE.
 
Methods inherited from class com.sun.scenario.effect.Effect
addPropertyChangeListener, createCompatibleImage, filter, firePropertyChange, getCompatibleImage, getInputs, getSourceContent, getTransformedBounds, releaseCompatibleImage, removePropertyChangeListener, render, setInput, setSourceContent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Source

public Source(boolean transformed)
Constructs a new Source instance.

Parameters:
transformed - if true, return the transformed (device space) image from the current SourceContent; otherwise, return the untransformed (original) image
Method Detail

isInDeviceSpace

public boolean isInDeviceSpace()
Description copied from class: Effect
Returns true if this Effect produces an Image in device space, or false if the Image will need to be converted into device space in a later stage.

Effects that inherently work in pixel space, such as a convolution, will typically operate only on untransformed sources. The result of such Effects can be transformed into device space in a later stage (e.g. prior to display), ideally using a high-quality scaling algorithm.

Overrides:
isInDeviceSpace in class Effect
Returns:
true if this Effect is in device space; false otherwise

needsSourceContent

public int needsSourceContent()
Description copied from class: Effect
Returns an integer indicating whether the effect implementation needs access to the TRANSFORMED source, UNTRANSFORMED source, BOTH, or NONE.

Overrides:
needsSourceContent in class Effect
Returns:
one of TRANSFORMED, UNTRANSFORMED, BOTH, or NONE

getBounds

public java.awt.geom.Rectangle2D getBounds()
Description copied from class: Effect
Returns the bounding box that will be affected by this filter operation, given the list of input Effects and/or the current SourceContent. Note that the returned bounds can be smaller or larger than one or more of the inputs.

Specified by:
getBounds in class Effect
Returns:
the bounding box of this filter

filter

public java.awt.Image filter(java.awt.GraphicsConfiguration config)
Description copied from class: Effect
Applies this filter effect to the series of images represented by the input Effects and/or SourceContent, and then returns the resulting Image.

Specified by:
filter in class Effect
Parameters:
config - the GraphicsConfiguration that will be used for creating images and for performing the filter operation
Returns:
the result of this filter operation

getAccelType

public Effect.AccelType getAccelType(java.awt.GraphicsConfiguration config)
Description copied from class: Effect
Returns one of the AccelType values, indicating whether this Effect is accelerated in hardware for the given GraphicsConfiguration.

Specified by:
getAccelType in class Effect
Parameters:
config - the GraphicsConfiguration that will be used for performing the filter operation
Returns:
one of the AccelType values