Package org.apache.batik.ext.awt.image
Class DistantLight
java.lang.Object
org.apache.batik.ext.awt.image.AbstractLight
org.apache.batik.ext.awt.image.DistantLight
- All Implemented Interfaces:
Light
A light source placed at the infinity, such that the light angle is
constant over the whole surface.
- Version:
- $Id: DistantLight.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
The azimuth of the distant light, i.e., the angle of the light vector on the (X, Y) planeprivate double
The elevation of the distant light, i.e., the angle of the light vector on the (X, Z) plane.private double
Light vectorprivate double
Light vectorprivate double
Light vector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
double
void
getLight
(double x, double y, double z, double[] L) Computes the light vector in (x, y)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
Methods inherited from class org.apache.batik.ext.awt.image.AbstractLight
getColor, getLightMap, setColor, sRGBToLsRGB
-
Field Details
-
azimuth
private double azimuthThe azimuth of the distant light, i.e., the angle of the light vector on the (X, Y) plane -
elevation
private double elevationThe elevation of the distant light, i.e., the angle of the light vector on the (X, Z) plane. -
Lx
private double LxLight vector -
Ly
private double LyLight vector -
Lz
private double LzLight vector
-
-
Constructor Details
-
DistantLight
-
-
Method Details
-
getAzimuth
public double getAzimuth()- Returns:
- the DistantLight's azimuth
-
getElevation
public double getElevation()- Returns:
- the DistantLight's elevation
-
isConstant
public boolean isConstant()- Specified by:
isConstant
in interfaceLight
- Overrides:
isConstant
in classAbstractLight
- Returns:
- true if the light is constant over the whole surface
-
getLight
public void getLight(double x, double y, double z, double[] L) Computes the light vector in (x, y)- Parameters:
x
- x-axis coordinate where the light should be computedy
- y-axis coordinate where the light should be computedL
- array of length 3 where the result is storedz
- z-axis coordinate where the light should be computed
-
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:
getLightRow
in interfaceLight
- Overrides:
getLightRow
in classAbstractLight
- 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.
-