Class AbstractLight
java.lang.Object
org.apache.batik.ext.awt.image.AbstractLight
- All Implemented Interfaces:
Light
- Direct Known Subclasses:
DistantLight, PointLight, SpotLight
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getColor(boolean linear) double[][][]getLightMap(double x, double y, double dx, double dy, int width, int height, double[][][] z) Returns a light map, starting in (x, y) with dx, dy increments, a given width and height, and z elevations stored in the fourth component on the N array.double[][]getLightRow(double x, double y, double dx, int width, double[][] z, double[][] lightRow) Returns a row of the light map, starting at (x, y) with dx increments, a given width, and z elevations stored in the fourth component on the N array.booleanvoidSets the new light color,newColorshould be in sRGB.static final doublesRGBToLsRGB(double value) Conversion function for light values.
-
Field Details
-
color
private double[] colorLight color in linear sRGB
-
-
Constructor Details
-
AbstractLight
-
-
Method Details
-
sRGBToLsRGB
public static final double sRGBToLsRGB(double value) Conversion function for light values. -
getColor
-
setColor
-
isConstant
public boolean isConstant()- Specified by:
isConstantin interfaceLight- Returns:
- true if the light is constant over the whole surface
-
getLightMap
public double[][][] getLightMap(double x, double y, double dx, double dy, int width, int height, double[][][] z) Returns a light map, starting in (x, y) with dx, dy increments, a given width and height, and z elevations stored in the fourth component on the N array.- Specified by:
getLightMapin interfaceLight- Parameters:
x- x-axis coordinate where the light should be computedy- y-axis coordinate where the light should be computeddx- delta x for computing light vectors in user spacedy- delta y for computing light vectors in user spacewidth- number of samples to compute on the x axisheight- number of samples to compute on the y axisz- array containing the z elevation for all the points- Returns:
- an array of height rows, width columns where each element is an array of three components representing the x, y and z components of the light vector.
-
getLightRow
public double[][] getLightRow(double x, double y, double dx, int width, double[][] z, double[][] lightRow) Returns a row of the light map, starting at (x, y) with dx increments, a given width, and z elevations stored in the fourth component on the N array.- Specified by:
getLightRowin interfaceLight- Parameters:
x- x-axis coordinate where the light should be computedy- y-axis coordinate where the light should be computeddx- delta x for computing light vectors in user spacewidth- number of samples to compute on the x axisz- array containing the z elevation for all the pointslightRow- array to store the light info to, if null it will be allocated for you and returned.- Returns:
- an array width columns where each element is an array of three components representing the x, y and z components of the light vector.
-