|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brackeen.javagamebook.graphics3D.texture.Texture
com.brackeen.javagamebook.graphics3D.texture.ShadedTexture
The ShadedTexture class is a Texture that has multiple shades. The texture source image is stored as a 8-bit image with a palette for every shade.
Field Summary | |
static int |
MAX_LEVEL
|
static int |
NUM_SHADE_LEVELS
|
Constructor Summary | |
ShadedTexture(byte[] buffer,
int widthBits,
int heightBits,
java.awt.image.IndexColorModel palette)
Creates a new ShadedTexture from the specified 8-bit image buffer and palette. |
|
ShadedTexture(byte[] buffer,
int widthBits,
int heightBits,
java.awt.image.IndexColorModel palette,
java.awt.Color targetShade)
Creates a new ShadedTexture from the specified 8-bit image buffer, palette, and target shaded. |
Method Summary | |
short |
getColor(int x,
int y)
Gets the 16-bit color of this Texture at the specified (x,y) location, using the default shade level. |
short |
getColor(int x,
int y,
int shadeLevel)
Gets the 16-bit color of this Texture at the specified (x,y) location, using the specified shade level. |
short |
getColorCurrRow(int x,
int shadeLevel)
Gets the color at the specified x location at the specified shade level. |
int |
getDefaultShadeLevel()
Gets the default shade level that is used when getColor() is called. |
void |
makeShadeTable(java.awt.Color targetShade)
Creates the shade table for this ShadedTexture. |
void |
setCurrRow(int y)
Sets the current row for getColorCurrRow(). |
void |
setDefaultShadeLevel(int level)
Sets the default shade level that is used when getColor() is called. |
Methods inherited from class com.brackeen.javagamebook.graphics3D.texture.Texture |
countbits, createTexture, createTexture, createTexture, createTexture, getHeight, getWidth, isPowerOfTwo |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NUM_SHADE_LEVELS
public static final int MAX_LEVEL
Constructor Detail |
public ShadedTexture(byte[] buffer, int widthBits, int heightBits, java.awt.image.IndexColorModel palette)
public ShadedTexture(byte[] buffer, int widthBits, int heightBits, java.awt.image.IndexColorModel palette, java.awt.Color targetShade)
Method Detail |
public void makeShadeTable(java.awt.Color targetShade)
public void setDefaultShadeLevel(int level)
public int getDefaultShadeLevel()
public short getColor(int x, int y)
getColor
in class Texture
public short getColor(int x, int y, int shadeLevel)
public void setCurrRow(int y)
public short getColorCurrRow(int x, int shadeLevel)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |