com.brackeen.javagamebook.graphics3D.texture
Class PowerOf2Texture
java.lang.Object
com.brackeen.javagamebook.graphics3D.texture.Texture
com.brackeen.javagamebook.graphics3D.texture.PowerOf2Texture
- public final class PowerOf2Texture
- extends Texture
The PowerOf2Texture class is a Texture with a width and height
that are a power of 2 (32, 128, etc.).
Constructor Summary |
PowerOf2Texture(short[] buffer,
int widthBits,
int heightBits)
Creates a new PowerOf2Texture with the specified buffer. |
Method Summary |
short |
getColor(int x,
int y)
Gets the 16-bit color of the pixel at location (x,y) in
the bitmap. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PowerOf2Texture
public PowerOf2Texture(short[] buffer,
int widthBits,
int heightBits)
- Creates a new PowerOf2Texture with the specified buffer.
The width of the bitmap is 2 to the power of widthBits, or
(1 << widthBits). Likewise, the height of the bitmap is 2
to the power of heightBits, or (1 << heightBits).
getColor
public short getColor(int x,
int y)
- Gets the 16-bit color of the pixel at location (x,y) in
the bitmap.
- Specified by:
getColor
in class Texture