public abstract class AbstractLight extends java.lang.Object implements Light
Constructor and Description |
---|
AbstractLight(java.awt.Color color) |
Modifier and Type | Method and Description |
---|---|
double[] |
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.
|
boolean |
isConstant() |
void |
setColor(java.awt.Color newColor)
Sets the new light color,
newColor should be in sRGB. |
static double |
sRGBToLsRGB(double value)
Conversion function for light values.
|
public static final double sRGBToLsRGB(double value)
public double[] getColor(boolean linear)
public void setColor(java.awt.Color newColor)
newColor
should be in sRGB.public boolean isConstant()
isConstant
in interface Light
public double[][][] getLightMap(double x, double y, double dx, double dy, int width, int height, double[][][] z)
getLightMap
in interface Light
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 pointspublic double[][] getLightRow(double x, double y, double dx, int width, double[][] z, double[][] lightRow)
getLightRow
in interface Light
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.Copyright © 2022 Apache Software Foundation. All Rights Reserved.