com.sun.scenario.effect
Class Brightpass

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

public class Brightpass
extends Effect

An effect that filters out (i.e., replaces with a transparent value) all pixels with brightness lower than the configurable threshold value.


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
Brightpass()
          Constructs a new Brightpass effect with the default threshold value (0.3), using the source content as the input.
Brightpass(Effect input)
          Constructs a new Brightpass effect with the default threshold value (0.3).
 
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.
 Effect getInput()
          Returns the input for this Effect.
 float getThreshold()
          Returns the threshold, which controls which pixels are included in the resulting image.
 void setInput(Effect input)
          Sets the input for this Effect.
 void setThreshold(float threshold)
          Sets the threshold, which controls which pixels are included in the resulting image.
 
Methods inherited from class com.sun.scenario.effect.Effect
addPropertyChangeListener, createCompatibleImage, filter, firePropertyChange, getCompatibleImage, getInputs, getSourceContent, getTransformedBounds, isInDeviceSpace, needsSourceContent, 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

Brightpass

public Brightpass()
Constructs a new Brightpass effect with the default threshold value (0.3), using the source content as the input. This is a shorthand equivalent to:
     new Brightpass(new Source(true))
 


Brightpass

public Brightpass(Effect input)
Constructs a new Brightpass effect with the default threshold value (0.3).

Parameters:
input - the single input Effect
Throws:
java.lang.IllegalArgumentException - if input is null
Method Detail

getInput

public final Effect getInput()
Returns the input for this Effect.

Returns:
the input for this Effect

setInput

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

Parameters:
input - the input for this Effect
Throws:
java.lang.IllegalArgumentException - if input is null

getThreshold

public float getThreshold()
Returns the threshold, which controls which pixels are included in the resulting image. Pixel values with brightness greater than this threshold value will be included.

Returns:
the threshold value

setThreshold

public void setThreshold(float threshold)
Sets the threshold, which controls which pixels are included in the resulting image. Pixel values with brightness greater than this threshold value will be included.
       Min: 0.0
       Max: 1.0
   Default: 0.3
  Identity: n/a
 

Parameters:
threshold - the threshold value
Throws:
java.lang.IllegalArgumentException - if threshold is outside the allowable range

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