artofillusion.texture
Class ImageMapTexture

java.lang.Object
  extended by artofillusion.texture.Texture
      extended by artofillusion.texture.Texture2D
          extended by artofillusion.texture.ImageMapTexture

public class ImageMapTexture
extends Texture2D

ImageMapTexture represents a texture whose properties are defined by images.


Field Summary
 ImageOrValue bump
           
 ImageOrValue cloudiness
           
 ImageOrColor diffuseColor
           
 ImageOrValue displacement
           
 ImageOrColor emissiveColor
           
 boolean mirrorX
           
 boolean mirrorY
           
 ImageOrValue roughness
           
 ImageOrValue shininess
           
 ImageOrColor specularColor
           
 ImageOrValue specularity
           
 boolean tileX
           
 boolean tileY
           
 ImageOrValue transparency
           
 ImageOrColor transparentColor
           
 
Fields inherited from class artofillusion.texture.Texture
BUMP_COMPONENT, DIFFUSE_COLOR_COMPONENT, DISPLACEMENT_COMPONENT, EMISSIVE_COLOR_COMPONENT, HILIGHT_COLOR_COMPONENT, SPECULAR_COLOR_COMPONENT, TRANSPARENT_COLOR_COMPONENT
 
Constructor Summary
ImageMapTexture()
           
ImageMapTexture(java.io.DataInputStream in, Scene theScene)
          The following two methods are used for reading and writing files.
 
Method Summary
 Texture duplicate()
          Create a duplicate of the texture.
 void edit(BFrame fr, Scene sc)
          Allow the user to interactively edit the texture.
 void getAverageSpec(TextureSpec spec, double time, double[] param)
          Get a TextureSpec which represents the average surface properties of this texture.
 double getDisplacement(double x, double y, double xsize, double ysize, double t, double[] param)
          Textures which use displacement mapping should override this method to return the displacement at the given point.
 void getTextureSpec(TextureSpec spec, double x, double y, double xsize, double ysize, double angle, double t, double[] param)
          Get the surface properties at point in the texture.
 void getTransparency(RGBColor trans, double x, double y, double xsize, double ysize, double angle, double t, double[] param)
          Same as above, except only return the transparent color.
static java.lang.String getTypeName()
           
 boolean hasComponent(int component)
          Determine whether this texture has a non-zero value anywhere for a particular component.
 boolean usesImage(ImageMap image)
          Determine whether this Texture uses the specified image.
 void writeToFile(java.io.DataOutputStream out, Scene theScene)
          The following method writes the texture's data to an output stream.
 
Methods inherited from class artofillusion.texture.Texture2D
createComponentImage, displacementMapped, getDefaultMapping
 
Methods inherited from class artofillusion.texture.Texture
assignNewID, getID, getName, getParameters, setID, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diffuseColor

public ImageOrColor diffuseColor

specularColor

public ImageOrColor specularColor

transparentColor

public ImageOrColor transparentColor

emissiveColor

public ImageOrColor emissiveColor

roughness

public ImageOrValue roughness

cloudiness

public ImageOrValue cloudiness

transparency

public ImageOrValue transparency

specularity

public ImageOrValue specularity

shininess

public ImageOrValue shininess

bump

public ImageOrValue bump

displacement

public ImageOrValue displacement

tileX

public boolean tileX

tileY

public boolean tileY

mirrorX

public boolean mirrorX

mirrorY

public boolean mirrorY
Constructor Detail

ImageMapTexture

public ImageMapTexture()

ImageMapTexture

public ImageMapTexture(java.io.DataInputStream in,
                       Scene theScene)
                throws java.io.IOException,
                       java.io.InvalidObjectException
The following two methods are used for reading and writing files. The first is a constructor which reads the necessary data from an input stream. The other writes the object's representation to an output stream.

Throws:
java.io.IOException
java.io.InvalidObjectException
Method Detail

getTypeName

public static java.lang.String getTypeName()

getTextureSpec

public void getTextureSpec(TextureSpec spec,
                           double x,
                           double y,
                           double xsize,
                           double ysize,
                           double angle,
                           double t,
                           double[] param)
Description copied from class: Texture2D
Get the surface properties at point in the texture. The properties should be averaged over a region around the point.

Specified by:
getTextureSpec in class Texture2D
Parameters:
spec - the surface properties will be stored in this
x - the x coordinate at which to evaluate the texture
y - the y coordinate at which to evaluate the texture
xsize - the range of x over which to average the surface properties
ysize - the range of z over which to average the surface properties
angle - the dot product of the view direction with the surface normal
t - the time at which to evaluate the surface properties
param - the texture parameter values at the point

getTransparency

public void getTransparency(RGBColor trans,
                            double x,
                            double y,
                            double xsize,
                            double ysize,
                            double angle,
                            double t,
                            double[] param)
Description copied from class: Texture2D
Same as above, except only return the transparent color. This can save time in cases where only the transparency is required, for example, when tracing shadow rays.

Specified by:
getTransparency in class Texture2D

getDisplacement

public double getDisplacement(double x,
                              double y,
                              double xsize,
                              double ysize,
                              double t,
                              double[] param)
Description copied from class: Texture2D
Textures which use displacement mapping should override this method to return the displacement at the given point.

Overrides:
getDisplacement in class Texture2D

getAverageSpec

public void getAverageSpec(TextureSpec spec,
                           double time,
                           double[] param)
Description copied from class: Texture
Get a TextureSpec which represents the average surface properties of this texture. It will be used by Renderers and Translators which do not support the given texture type. This need not be an exact mathematical average, but should give a reasonable representation of the overall surface properties.

Specified by:
getAverageSpec in class Texture

usesImage

public boolean usesImage(ImageMap image)
Determine whether this Texture uses the specified image.

Overrides:
usesImage in class Texture

duplicate

public Texture duplicate()
Create a duplicate of the texture.

Specified by:
duplicate in class Texture

hasComponent

public boolean hasComponent(int component)
Determine whether this texture has a non-zero value anywhere for a particular component.

Specified by:
hasComponent in class Texture
Parameters:
component - the texture component to check for (one of the *_COMPONENT constants)

edit

public void edit(BFrame fr,
                 Scene sc)
Allow the user to interactively edit the texture.

Specified by:
edit in class Texture

writeToFile

public void writeToFile(java.io.DataOutputStream out,
                        Scene theScene)
                 throws java.io.IOException
Description copied from class: Texture
The following method writes the texture's data to an output stream. In addition to this method, every Texture must include a constructor with the signature public Classname(DataInputStream in, Scene theScene) throws IOException, InvalidObjectException which reconstructs the texture by reading its data from an input stream.

Specified by:
writeToFile in class Texture
Throws:
java.io.IOException


Copyright © 1999-2011 by Peter Eastman.