Texture
Class Texture

java.lang.Object
  |
  +--Texture.Texture

public class Texture
extends Object

This class provides tools for creating textures.

Version:
1.0.
Author:
Sebastien Baehni
See Also:
TextureError

Field Summary
protected  int[] arraytexture
          The array in which is the texture (rgb mode)
protected  Color color
          The color of the texture.
protected  int height
          The height of the array texture.
protected  float heightGrayIncrement
          The height increment for the texture.
protected  int mode
          The mode of the texture.
protected  int width
          The width of the array texture.
protected  float widthGrayIncrement
          The width increment for the texture.
 
Constructor Summary
Texture(int color)
          The first constructor.
Texture(int width, int height, int mode)
          The second constructor.
 
Method Summary
 int[] arraytexture()
          This method return the array of the texture.
 Color color()
          This method returns the color of the texture.
 int height()
          This method return the height of the texture.
 int mode()
          This method returns the mode of the texture.
 int width()
          This method return the width of the texture.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

arraytexture

protected int[] arraytexture
The array in which is the texture (rgb mode)

width

protected int width
The width of the array texture.

height

protected int height
The height of the array texture.

mode

protected int mode
The mode of the texture.

color

protected Color color
The color of the texture.

widthGrayIncrement

protected final float widthGrayIncrement
The width increment for the texture.

heightGrayIncrement

protected final float heightGrayIncrement
The height increment for the texture.
Constructor Detail

Texture

public Texture(int color)
The first constructor. It creates a uniform texture with a specified color.
Parameters:
color - The color of the texture.

Texture

public Texture(int width,
               int height,
               int mode)
The second constructor. It creates a "true texture" in the specified mode.
Parameters:
width - The width of the texture.
height - The height of the texture.
mode - The texture's type.
Method Detail

width

public int width()
          throws TextureError
This method return the width of the texture.
Returns:
The width of the texture or an exception if the texture is a uniform texture or if there is no texture.
Throws:
TextureError -  

height

public int height()
           throws TextureError
This method return the height of the texture.
Returns:
The height of the texture or an exception if the texture is a uniform texture or if there is no texture.
Throws:
TextureError -  

arraytexture

public int[] arraytexture()
                   throws TextureError
This method return the array of the texture.
Returns:
The array of the texture or an exception if the texture is a uniform texture or if there is no texture.
Throws:
TextureError -  

mode

public int mode()
This method returns the mode of the texture.
Returns:
The mode of the texture. If the mode is <= 0 then we have a uniform texture. If the mode is == 1 then we have no texture. If the mode is > 1 then we have a "true" texture.

color

public Color color()
            throws TextureError
This method returns the color of the texture.
Returns:
The color of the texture or an error if there is no texture or if the texture is a "true" texture.
Throws:
TextureError -