org.apache.batik.ext.awt.image

Class DistantLight

public class DistantLight extends AbstractLight

A light source placed at the infinity, such that the light angle is constant over the whole surface.
Constructor Summary
DistantLight(double azimuth, double elevation, Color color)
Method Summary
doublegetAzimuth()
doublegetElevation()
voidgetLight(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.
booleanisConstant()

Constructor Detail

DistantLight

public DistantLight(double azimuth, double elevation, Color color)

Method Detail

getAzimuth

public double getAzimuth()

Returns: the DistantLight's azimuth

getElevation

public double getElevation()

Returns: the DistantLight's elevation

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 computed y y-axis coordinate where the light should be computed L array of length 3 where the result is stored

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.

Parameters: x x-axis coordinate where the light should be computed y y-axis coordinate where the light should be computed dx delta x for computing light vectors in user space width number of samples to compute on the x axis z array containing the z elevation for all the points lightRow 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.

isConstant

public boolean isConstant()

Returns: true if the light is constant over the whole surface

Copyright B) 2007 Apache Software Foundation. All Rights Reserved.