|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.j3d.threeD.raytracer.textures.ImageTexture
public class ImageTexture
An ImageTexture object can be used to provide an image as the color data for a surface.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface net.sf.j3d.threeD.raytracer.util.Editable |
|---|
Editable.Selection |
| Field Summary | |
|---|---|
static int |
SPHERICAL_PROJECTION
|
static int |
XY_PLANAR_PROJECTION
|
static int |
XZ_PLANAR_PROJECTION
|
static int |
YZ_PLANAR_PROJECTION
|
| Constructor Summary | |
|---|---|
ImageTexture()
Constructs a new ImageTexture object. |
|
ImageTexture(int type,
URL url)
Constructs a new ImageTexture object of unit square size. |
|
ImageTexture(int type,
URL url,
double xScale,
double yScale,
double xOff,
double yOff)
Constrcts a new ImageTexture object with the specified scaling factors. |
|
| Method Summary | |
|---|---|
RGB |
evaluate(Object[] args)
Produces a color using the specified arguments. |
RGB |
getColorAt(double u,
double v)
Returns the an RGB object representing the color of this ImageTexture object at the specified u, v coordinates. |
RGB |
getColorAt(double u,
double v,
double xScale,
double yScale,
double xOff,
double yOff)
Returns the an RGB object representing the color of this ImageTexture object at the specified u, v coordinates. |
RGB |
getColorAt(Vector point)
Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the arguments stored by this Texture object. |
RGB |
getColorAt(Vector point,
Object[] args)
Returns the color of the texture represented by this Texture object at the specified point as an RGB object using the specified arguments. |
Producer[] |
getInputPropertyValues()
|
String[] |
getPropertyDescriptions()
Returns an array of String objects with descriptions for each editable property of this Editable object. |
String[] |
getPropertyNames()
Returns an array of String objects with names for each editable property of this Editable object. |
Class[] |
getPropertyTypes()
Returns an array of Class objects representing the class types of each editable property of this Editable object. |
Object[] |
getPropertyValues()
Returns the values of the properties of this Editable object as an Object array. |
void |
setInputPropertyValue(int index,
Producer p)
Does nothing. |
void |
setPropertyValue(Object value,
int index)
Sets the value of the property of this Editable object at the specified index to the specified value. |
void |
setPropertyValues(Object[] values)
Sets the values of properties of this Editable object to those specified. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SPHERICAL_PROJECTION
public static final int XY_PLANAR_PROJECTION
public static final int XZ_PLANAR_PROJECTION
public static final int YZ_PLANAR_PROJECTION
| Constructor Detail |
|---|
public ImageTexture()
public ImageTexture(int type,
URL url)
type - Integer code that specifies the method to use for "wrapping" the image on a surface.url - URL object pointing to image.
IllegalArgumentException - If the value for type is not valid.
RuntimeException - If image fails to load properly.
public ImageTexture(int type,
URL url,
double xScale,
double yScale,
double xOff,
double yOff)
type - Integer code that specified the method to use for "wrapping" the image on a surface.url - URL object pointing to image.xScale - X scale factor.yScale - Y scale factor.xOff - X offset.yOff - Y offset.
IllegalArgumentException - If the value for type is not valid.
RuntimeException - If image fails to load properly.| Method Detail |
|---|
public RGB getColorAt(double u,
double v)
u - u coordinate between 0.0 and 1.0v - v coordinate between 0.0 and 1.0
public RGB getColorAt(double u,
double v,
double xScale,
double yScale,
double xOff,
double yOff)
u - u coordinate between 0.0 and 1.0v - v coordinate between 0.0 and 1.0xScale - X scale factoryScale - Y scale factorxOff - X offsetyOff - Y offset
NullPointerException - If pixel data is not loaded.public RGB getColorAt(Vector point)
Texture
getColorAt in interface TextureNullPointerException - If pixel data is not loaded.Texture.getColorAt(net.sf.j3d.util.Vector)
public RGB getColorAt(Vector point,
Object[] args)
Texture
getColorAt in interface Textureargs[] - {Double, Double, Double, Double} X scale factor, Y scale factor, X offset, Y offset.
IllegalArgumentException - If args does not contain the correct object types.
NullPointerException - If pixel data is not loaded.Texture.getColorAt(net.sf.j3d.util.Vector, java.lang.Object[])public RGB evaluate(Object[] args)
ColorProducer
evaluate in interface ColorProducerargs[] - {Vector, Double, Double, Double, Double} Point, X scale factor, Y scale factor, X offset, Y offset.
IllegalArgumentException - If args does not contain the correct object types.ColorProducer.evaluate(java.lang.Object[])public String[] getPropertyNames()
Editable
getPropertyNames in interface EditableEditable.getPropertyNames()public String[] getPropertyDescriptions()
Editable
getPropertyDescriptions in interface EditableEditable.getPropertyDescriptions()public Class[] getPropertyTypes()
Editable
getPropertyTypes in interface EditableEditable.getPropertyTypes()public Object[] getPropertyValues()
Editable
getPropertyValues in interface EditableEditable.getPropertyValues()
public void setPropertyValue(Object value,
int index)
Editable
setPropertyValue in interface EditableEditable.setPropertyValue(java.lang.Object, int)public void setPropertyValues(Object[] values)
Editable
setPropertyValues in interface EditableEditable.setPropertyValues(java.lang.Object[])public Producer[] getInputPropertyValues()
getInputPropertyValues in interface Editable
public void setInputPropertyValue(int index,
Producer p)
setInputPropertyValue in interface Editableindex - Index of input property (array index from this.getInputPropertyValue).p - Producer object to use for input property.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||