blob: 818d81dfd1cd71a39754df2cb502f3ac86199f2d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<TITLE>
Light (Apache Batik Javadoc)
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Light (Apache Batik Javadoc)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Light.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/batik/ext/awt/image/IdentityTransfer.html" title="class in org.apache.batik.ext.awt.image"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/batik/ext/awt/image/LinearTransfer.html" title="class in org.apache.batik.ext.awt.image"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/batik/ext/awt/image/Light.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Light.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.batik.ext.awt.image</FONT>
<BR>
Interface Light</H2>
<DL>
<DT><B>All Known Implementing Classes:</B> <DD><A HREF="../../../../../../org/apache/batik/ext/awt/image/AbstractLight.html" title="class in org.apache.batik.ext.awt.image">AbstractLight</A>, <A HREF="../../../../../../org/apache/batik/ext/awt/image/DistantLight.html" title="class in org.apache.batik.ext.awt.image">DistantLight</A>, <A HREF="../../../../../../org/apache/batik/ext/awt/image/PointLight.html" title="class in org.apache.batik.ext.awt.image">PointLight</A>, <A HREF="../../../../../../org/apache/batik/ext/awt/image/SpotLight.html" title="class in org.apache.batik.ext.awt.image">SpotLight</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public interface <B>Light</B></DL>
</PRE>
<P>
Top level interface to model a light element. A light is responsible for
computing the light vector on a given point of a surface. A light is
typically in a 3 dimensional space and the methods assumes the surface
is at elevation 0.
<P>
<P>
<HR>
<P>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#getColor(boolean)">getColor</A></B>(boolean&nbsp;linear)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#getLight(double, double, double, double[])">getLight</A></B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;z,
double[]&nbsp;L)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Computes the light vector in (x, y)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double[][][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#getLightMap(double, double, double, double, int, int, double[][][])">getLightMap</A></B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;dx,
double&nbsp;dy,
int&nbsp;width,
int&nbsp;height,
double[][][]&nbsp;z)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;double[][]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#getLightRow(double, double, double, int, double[][], double[][])">getLightRow</A></B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;dx,
int&nbsp;width,
double[][]&nbsp;z,
double[][]&nbsp;lightRow)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#isConstant()">isConstant</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../../org/apache/batik/ext/awt/image/Light.html#setColor(java.awt.Color)">setColor</A></B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the light color to a new value</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="isConstant()"><!-- --></A><H3>
isConstant</H3>
<PRE>
boolean <B>isConstant</B>()</PRE>
<DL>
<DD><DL>
<DT><B>Returns:</B><DD>true if the light is constant over the whole surface</DL>
</DD>
</DL>
<HR>
<A NAME="getLight(double, double, double, double[])"><!-- --></A><H3>
getLight</H3>
<PRE>
void <B>getLight</B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;z,
double[]&nbsp;L)</PRE>
<DL>
<DD>Computes the light vector in (x, y)
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - x-axis coordinate where the light should be computed<DD><CODE>y</CODE> - y-axis coordinate where the light should be computed<DD><CODE>z</CODE> - z-axis coordinate where the light should be computed<DD><CODE>L</CODE> - array of length 3 where the result is stored</DL>
</DD>
</DL>
<HR>
<A NAME="getLightMap(double, double, double, double, int, int, double[][][])"><!-- --></A><H3>
getLightMap</H3>
<PRE>
double[][][] <B>getLightMap</B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;dx,
double&nbsp;dy,
int&nbsp;width,
int&nbsp;height,
double[][][]&nbsp;z)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - x-axis coordinate where the light should be computed<DD><CODE>y</CODE> - y-axis coordinate where the light should be computed<DD><CODE>dx</CODE> - delta x for computing light vectors in user space<DD><CODE>dy</CODE> - delta y for computing light vectors in user space<DD><CODE>width</CODE> - number of samples to compute on the x axis<DD><CODE>height</CODE> - number of samples to compute on the y axis<DD><CODE>z</CODE> - array containing the z elevation for all the points
<DT><B>Returns:</B><DD>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.</DL>
</DD>
</DL>
<HR>
<A NAME="getLightRow(double, double, double, int, double[][], double[][])"><!-- --></A><H3>
getLightRow</H3>
<PRE>
double[][] <B>getLightRow</B>(double&nbsp;x,
double&nbsp;y,
double&nbsp;dx,
int&nbsp;width,
double[][]&nbsp;z,
double[][]&nbsp;lightRow)</PRE>
<DL>
<DD>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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x</CODE> - x-axis coordinate where the light should be computed<DD><CODE>y</CODE> - y-axis coordinate where the light should be computed<DD><CODE>dx</CODE> - delta x for computing light vectors in user space<DD><CODE>width</CODE> - number of samples to compute on the x axis<DD><CODE>z</CODE> - array containing the z elevation for all the points<DD><CODE>lightRow</CODE> - array to store the light info to, if null it will
be allocated for you and returned.
<DT><B>Returns:</B><DD>an array width columns where each element
is an array of three components representing the x, y and z
components of the light vector.</DL>
</DD>
</DL>
<HR>
<A NAME="getColor(boolean)"><!-- --></A><H3>
getColor</H3>
<PRE>
double[] <B>getColor</B>(boolean&nbsp;linear)</PRE>
<DL>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>linear</CODE> - if true the color is returned in the Linear sRGB
colorspace otherwise the color is in the gamma
corrected sRGB color space.
<DT><B>Returns:</B><DD>the light's color</DL>
</DD>
</DL>
<HR>
<A NAME="setColor(java.awt.Color)"><!-- --></A><H3>
setColor</H3>
<PRE>
void <B>setColor</B>(<A HREF="http://docs.oracle.com/javase/6/docs/api/java/awt/Color.html?is-external=true" title="class or interface in java.awt">Color</A>&nbsp;color)</PRE>
<DL>
<DD>Sets the light color to a new value
<P>
<DD><DL>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Light.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../../org/apache/batik/ext/awt/image/IdentityTransfer.html" title="class in org.apache.batik.ext.awt.image"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../../org/apache/batik/ext/awt/image/LinearTransfer.html" title="class in org.apache.batik.ext.awt.image"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../../index.html?org/apache/batik/ext/awt/image/Light.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="Light.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
Copyright © 2017 <a href='http://www.apache.org/'>Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>