Class SpecularLightingRable8Bit
- 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.SpecularLightingRable8Bit
-
- All Implemented Interfaces:
java.awt.image.renderable.RenderableImage
,Filter
,FilterColorInterpolation
,SpecularLightingRable
public class SpecularLightingRable8Bit extends AbstractColorInterpolationRable implements SpecularLightingRable
Implementation of the SpecularLightRable interface.- Version:
- $Id: SpecularLightingRable8Bit.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description private float[]
kernelUnitLength
The dx/dy to use in user space for the sobel gradient.private double
ks
Specular constantprivate Light
light
Light used for the specular lighting computationsprivate java.awt.geom.Rectangle2D
litRegion
Lit Areaprivate double
specularExponent
Specular exponentprivate double
surfaceScale
Surface 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 SpecularLightingRable8Bit(Filter src, java.awt.geom.Rectangle2D litRegion, Light light, double ks, double specularExponent, double surfaceScale, double[] kernelUnitLength)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.RenderedImage
createRendering(java.awt.image.renderable.RenderContext rc)
java.awt.geom.Rectangle2D
getBounds2D()
Returns this filter's boundsdouble[]
getKernelUnitLength()
Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.double
getKs()
Light
getLight()
java.awt.geom.Rectangle2D
getLitRegion()
Returns this filter's litRegionFilter
getSource()
Returns the source to be filtereddouble
getSpecularExponent()
double
getSurfaceScale()
void
setKernelUnitLength(double[] kernelUnitLength)
Sets the min [dx,dy] distance in user space for evaluation of the sobel gradient.void
setKs(double ks)
Sets the specular constant, or ksvoid
setLight(Light light)
void
setLitRegion(java.awt.geom.Rectangle2D litRegion)
Set this filter's litRegionvoid
setSource(Filter src)
Sets the source to be filteredvoid
setSpecularExponent(double specularExponent)
Sets the specular exponentvoid
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.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
-
ks
private double ks
Specular constant
-
specularExponent
private double specularExponent
Specular exponent
-
light
private Light light
Light used for the specular 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:
getSource
in interfaceSpecularLightingRable
-
setSource
public void setSource(Filter src)
Sets the source to be filtered- Specified by:
setSource
in interfaceSpecularLightingRable
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
Returns this filter's bounds- Specified by:
getBounds2D
in interfaceFilter
- Overrides:
getBounds2D
in classAbstractRable
-
getLitRegion
public java.awt.geom.Rectangle2D getLitRegion()
Returns this filter's litRegion- Specified by:
getLitRegion
in interfaceSpecularLightingRable
- Returns:
- the litRegion for this filter
-
setLitRegion
public void setLitRegion(java.awt.geom.Rectangle2D litRegion)
Set this filter's litRegion- Specified by:
setLitRegion
in interfaceSpecularLightingRable
-
getLight
public Light getLight()
- Specified by:
getLight
in interfaceSpecularLightingRable
- Returns:
- Light object used for the specular lighting
-
setLight
public void setLight(Light light)
- Specified by:
setLight
in interfaceSpecularLightingRable
- Parameters:
light
- New Light object
-
getSurfaceScale
public double getSurfaceScale()
- Specified by:
getSurfaceScale
in interfaceSpecularLightingRable
- Returns:
- surfaceScale
-
setSurfaceScale
public void setSurfaceScale(double surfaceScale)
Sets the surface scale- Specified by:
setSurfaceScale
in interfaceSpecularLightingRable
-
getKs
public double getKs()
- Specified by:
getKs
in interfaceSpecularLightingRable
- Returns:
- specular constant, or ks.
-
setKs
public void setKs(double ks)
Sets the specular constant, or ks- Specified by:
setKs
in interfaceSpecularLightingRable
-
getSpecularExponent
public double getSpecularExponent()
- Specified by:
getSpecularExponent
in interfaceSpecularLightingRable
- Returns:
- specular exponent
-
setSpecularExponent
public void setSpecularExponent(double specularExponent)
Sets the specular exponent- Specified by:
setSpecularExponent
in interfaceSpecularLightingRable
-
getKernelUnitLength
public double[] getKernelUnitLength()
Returns the min [dx,dy] distance in user space for evalutation of the sobel gradient.- Specified by:
getKernelUnitLength
in interfaceSpecularLightingRable
-
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 interfaceSpecularLightingRable
-
createRendering
public java.awt.image.RenderedImage createRendering(java.awt.image.renderable.RenderContext rc)
- Specified by:
createRendering
in interfacejava.awt.image.renderable.RenderableImage
-
-