Class DiffuseLightingRable8Bit
- java.lang.Object
-
- org.apache.batik.ext.awt.image.renderable.AbstractRable
-
- org.apache.batik.ext.awt.image.renderable.AbstractColorInterpolationRable
-
- org.apache.batik.ext.awt.image.renderable.DiffuseLightingRable8Bit
-
- All Implemented Interfaces:
java.awt.image.renderable.RenderableImage,DiffuseLightingRable,Filter,FilterColorInterpolation
public class DiffuseLightingRable8Bit extends AbstractColorInterpolationRable implements DiffuseLightingRable
Implementation of the DiffuseLightRable interface.- Version:
- $Id: DiffuseLightingRable8Bit.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description private doublekdDiffuse constantprivate float[]kernelUnitLengthThe dx/dy to use in user space for the sobel gradient.private LightlightLight used for the diffuse lighting computationsprivate java.awt.geom.Rectangle2DlitRegionLit Areaprivate doublesurfaceScaleSurface Scale-
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
-
-
Constructor Summary
Constructors Constructor Description DiffuseLightingRable8Bit(Filter src, java.awt.geom.Rectangle2D litRegion, Light light, double kd, double surfaceScale, double[] kernelUnitLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.RenderedImagecreateRendering(java.awt.image.renderable.RenderContext rc)java.awt.geom.Rectangle2DgetBounds2D()Returns this filter's boundsdoublegetKd()double[]getKernelUnitLength()Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.LightgetLight()java.awt.geom.Rectangle2DgetLitRegion()Returns this filter's litRegionFiltergetSource()Returns the source to be filtereddoublegetSurfaceScale()voidsetKd(double kd)Sets the diffuse constant, or kdvoidsetKernelUnitLength(double[] kernelUnitLength)Sets the min [dx,dy] distance in user space for evaluation of the sobel gradient.voidsetLight(Light light)voidsetLitRegion(java.awt.geom.Rectangle2D litRegion)Set this filter's litRegionvoidsetSource(Filter src)Sets the source to be filteredvoidsetSurfaceScale(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.Filter
getDependencyRegion, getDirtyRegion, getTimeStamp
-
Methods inherited from interface org.apache.batik.ext.awt.image.renderable.FilterColorInterpolation
getOperationColorSpace, isColorSpaceLinear, setColorSpaceLinear
-
-
-
-
Field Detail
-
surfaceScale
private double surfaceScale
Surface Scale
-
kd
private double kd
Diffuse constant
-
light
private Light light
Light used for the diffuse lighting computations
-
litRegion
private java.awt.geom.Rectangle2D litRegion
Lit Area
-
kernelUnitLength
private float[] kernelUnitLength
The dx/dy to use in user space for the sobel gradient.
-
-
Method Detail
-
getSource
public Filter getSource()
Returns the source to be filtered- Specified by:
getSourcein interfaceDiffuseLightingRable
-
setSource
public void setSource(Filter src)
Sets the source to be filtered- Specified by:
setSourcein interfaceDiffuseLightingRable
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
Returns this filter's bounds- Specified by:
getBounds2Din interfaceFilter- Overrides:
getBounds2Din classAbstractRable
-
getLitRegion
public java.awt.geom.Rectangle2D getLitRegion()
Returns this filter's litRegion- Specified by:
getLitRegionin interfaceDiffuseLightingRable- Returns:
- the litRegion for this filter
-
setLitRegion
public void setLitRegion(java.awt.geom.Rectangle2D litRegion)
Set this filter's litRegion- Specified by:
setLitRegionin interfaceDiffuseLightingRable
-
getLight
public Light getLight()
- Specified by:
getLightin interfaceDiffuseLightingRable- Returns:
- Light object used for the diffuse lighting
-
setLight
public void setLight(Light light)
- Specified by:
setLightin interfaceDiffuseLightingRable- Parameters:
light- New Light object
-
getSurfaceScale
public double getSurfaceScale()
- Specified by:
getSurfaceScalein interfaceDiffuseLightingRable- Returns:
- surfaceScale
-
setSurfaceScale
public void setSurfaceScale(double surfaceScale)
Sets the surface scale- Specified by:
setSurfaceScalein interfaceDiffuseLightingRable
-
getKd
public double getKd()
- Specified by:
getKdin interfaceDiffuseLightingRable- Returns:
- diffuse constant, or kd.
-
setKd
public void setKd(double kd)
Sets the diffuse constant, or kd- Specified by:
setKdin interfaceDiffuseLightingRable
-
getKernelUnitLength
public double[] getKernelUnitLength()
Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.- Specified by:
getKernelUnitLengthin interfaceDiffuseLightingRable
-
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:
setKernelUnitLengthin interfaceDiffuseLightingRable
-
createRendering
public java.awt.image.RenderedImage createRendering(java.awt.image.renderable.RenderContext rc)
- Specified by:
createRenderingin interfacejava.awt.image.renderable.RenderableImage
-
-