org.apache.batik.ext.awt.image.renderable
Class DiffuseLightingRable8Bit

java.lang.Object
  extended by org.apache.batik.ext.awt.image.renderable.AbstractRable
      extended by org.apache.batik.ext.awt.image.renderable.AbstractColorInterpolationRable
          extended by org.apache.batik.ext.awt.image.renderable.DiffuseLightingRable8Bit
All Implemented Interfaces:
RenderableImage, DiffuseLightingRable, Filter, FilterColorInterpolation

public class DiffuseLightingRable8Bit
extends AbstractColorInterpolationRable
implements DiffuseLightingRable

Implementation of the DiffuseLightRable interface.


Field Summary
 
Fields inherited from class org.apache.batik.ext.awt.image.renderable.AbstractColorInterpolationRable
csLinear
 
Fields inherited from class org.apache.batik.ext.awt.image.renderable.AbstractRable
props, srcs, stamp
 
Fields inherited from interface java.awt.image.renderable.RenderableImage
HINTS_OBSERVED
 
Constructor Summary
DiffuseLightingRable8Bit(Filter src, Rectangle2D litRegion, Light light, double kd, double surfaceScale, double[] kernelUnitLength)
           
 
Method Summary
 RenderedImage createRendering(RenderContext rc)
           
 Rectangle2D getBounds2D()
          Returns this filter's bounds
 double getKd()
           
 double[] getKernelUnitLength()
          Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.
 Light getLight()
           
 Rectangle2D getLitRegion()
          Returns this filter's litRegion
 Filter getSource()
          Returns the source to be filtered
 double getSurfaceScale()
           
 void setKd(double kd)
          Sets the diffuse constant, or kd
 void setKernelUnitLength(double[] kernelUnitLength)
          Sets the min [dx,dy] distance in user space for evaluation of the sobel gradient.
 void setLight(Light light)
           
 void setLitRegion(Rectangle2D litRegion)
          Set this filter's litRegion
 void setSource(Filter src)
          Sets the source to be filtered
 void setSurfaceScale(double surfaceScale)
          Sets the surface scale
 
Methods inherited from class org.apache.batik.ext.awt.image.renderable.AbstractColorInterpolationRable
convertSourceCS, convertSourceCS, getOperationColorSpace, isColorSpaceLinear, setColorSpaceLinear
 
Methods inherited from class org.apache.batik.ext.awt.image.renderable.AbstractRable
createDefaultRendering, createScaledRendering, getDependencyRegion, getDirtyRegion, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getTimeStamp, getWidth, init, init, init, init, isDynamic, touch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.ext.awt.image.renderable.FilterColorInterpolation
getOperationColorSpace, isColorSpaceLinear, setColorSpaceLinear
 
Methods inherited from interface org.apache.batik.ext.awt.image.renderable.Filter
getDependencyRegion, getDirtyRegion, getTimeStamp
 
Methods inherited from interface java.awt.image.renderable.RenderableImage
createDefaultRendering, createScaledRendering, getHeight, getMinX, getMinY, getProperty, getPropertyNames, getSources, getWidth, isDynamic
 

Constructor Detail

DiffuseLightingRable8Bit

public DiffuseLightingRable8Bit(Filter src,
                                Rectangle2D litRegion,
                                Light light,
                                double kd,
                                double surfaceScale,
                                double[] kernelUnitLength)
Method Detail

getSource

public Filter getSource()
Returns the source to be filtered

Specified by:
getSource in interface DiffuseLightingRable

setSource

public void setSource(Filter src)
Sets the source to be filtered

Specified by:
setSource in interface DiffuseLightingRable

getBounds2D

public Rectangle2D getBounds2D()
Returns this filter's bounds

Specified by:
getBounds2D in interface Filter
Overrides:
getBounds2D in class AbstractRable

getLitRegion

public Rectangle2D getLitRegion()
Returns this filter's litRegion

Specified by:
getLitRegion in interface DiffuseLightingRable
Returns:
the litRegion for this filter

setLitRegion

public void setLitRegion(Rectangle2D litRegion)
Set this filter's litRegion

Specified by:
setLitRegion in interface DiffuseLightingRable

getLight

public Light getLight()
Specified by:
getLight in interface DiffuseLightingRable
Returns:
Light object used for the diffuse lighting

setLight

public void setLight(Light light)
Specified by:
setLight in interface DiffuseLightingRable
Parameters:
light - New Light object

getSurfaceScale

public double getSurfaceScale()
Specified by:
getSurfaceScale in interface DiffuseLightingRable
Returns:
surfaceScale

setSurfaceScale

public void setSurfaceScale(double surfaceScale)
Sets the surface scale

Specified by:
setSurfaceScale in interface DiffuseLightingRable

getKd

public double getKd()
Specified by:
getKd in interface DiffuseLightingRable
Returns:
diffuse constant, or kd.

setKd

public void setKd(double kd)
Sets the diffuse constant, or kd

Specified by:
setKd in interface DiffuseLightingRable

getKernelUnitLength

public double[] getKernelUnitLength()
Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.

Specified by:
getKernelUnitLength in interface DiffuseLightingRable

setKernelUnitLength

public void setKernelUnitLength(double[] kernelUnitLength)
Sets the min [dx,dy] distance in user space for evaluation of the sobel gradient. If set to zero or null then device space will be used.

Specified by:
setKernelUnitLength in interface DiffuseLightingRable

createRendering

public RenderedImage createRendering(RenderContext rc)
Specified by:
createRendering in interface RenderableImage


Copyright © 2008 Apache Software Foundation. All Rights Reserved.