|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jme.image.Image
Image defines a data format for a graphical image. The image
is defined by a type, a height and width, and the image data. The type can
be any one of the following types: RGBA4444, RGB888, RGBA5551, RGBA8888.
The width and height must be greater than 0. The data is contained in a
byte buffer, and should be packed before creation of the image object.
| Field Summary | |
protected java.nio.ByteBuffer |
data
|
static int |
DXT1_NATIVE
DXT-1 compressed format, no alpha. |
static int |
DXT1A_NATIVE
DXT-1 compressed format, one bit alpha. |
static int |
DXT3_NATIVE
DXT-3 compressed format, with alpha. |
static int |
DXT5_NATIVE
DXT-5 compressed format, with alpha. |
static int |
GUESS_FORMAT
When used in texture loading, this indicates to let jME guess the format. |
static int |
GUESS_FORMAT_NO_S3TC
When used in texture loading, this indicates to let jME guess the format, but not to use S3TC compression, even if available. |
protected int |
height
|
static int |
LAST_TYPE
|
static int |
LAST_UNCOMPRESSED_TYPE
|
protected int[] |
mipMapSizes_
|
static int |
RA88
16-bit RA with 8 bits for red and 8 bits for alpha. |
static int |
RGB888
24-bit RGB with 8 bits for each component. |
static int |
RGB888_DXT1
RGB888, compressed to DXT-1 internally. |
static int |
RGBA4444
16-bit RGBA with 4 bits for each component. |
static int |
RGBA5551
16-bit RGBA with 5 bits for color components and 1 bit for alpha. |
static int |
RGBA8888
32-bit RGBA with 8 bits for each component. |
static int |
RGBA8888_DXT1A
RGBA8888, compressed to DXT-1A internally. |
static int |
RGBA8888_DXT3
RGBA8888, compressed to DXT-3 internally. |
static int |
RGBA8888_DXT5
RGBA8888, compressed to DXT-5 internally. |
protected int |
type
|
protected int |
width
|
| Constructor Summary | |
Image()
Constructor instantiates a new Image object. |
|
Image(int type,
int width,
int height,
java.nio.ByteBuffer data)
Constructor instantiates a new Image object. |
|
Image(int type,
int width,
int height,
java.nio.ByteBuffer data,
int[] mipMapSizes)
Constructor instantiates a new Image object. |
|
| Method Summary | |
boolean |
equals(java.lang.Object other)
|
java.nio.ByteBuffer |
getData()
getData returns the data for this image. |
int |
getHeight()
getHeight returns the height of this image. |
int[] |
getMipMapSizes()
Returns the mipmap sizes for this image. |
int |
getType()
getType returns the image format for this image. |
int |
getWidth()
getWidth returns the width of this image. |
boolean |
hasMipmaps()
Returns whether the image data contains mipmaps. |
boolean |
isCompressedType()
Returns whether the image type is compressed. |
void |
setData(java.nio.ByteBuffer data)
setData sets the data that makes up the image. |
void |
setHeight(int height)
setHeight sets the height value of the image. |
void |
setMipMapSizes(int[] mipMapSizes)
Sets the mipmap sizes stored in this image's data buffer. |
void |
setType(int type)
setType sets the image format for this image. |
void |
setWidth(int width)
setWidth sets the width value of the image. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int GUESS_FORMAT_NO_S3TC
public static final int GUESS_FORMAT
public static final int RGBA4444
public static final int RGB888
public static final int RGBA5551
public static final int RGBA8888
public static final int RA88
public static final int RGB888_DXT1
public static final int RGBA8888_DXT1A
public static final int RGBA8888_DXT3
public static final int RGBA8888_DXT5
public static final int LAST_UNCOMPRESSED_TYPE
public static final int DXT1_NATIVE
public static final int DXT1A_NATIVE
public static final int DXT3_NATIVE
public static final int DXT5_NATIVE
public static final int LAST_TYPE
protected int type
protected int width
protected int height
protected int[] mipMapSizes_
protected java.nio.ByteBuffer data
| Constructor Detail |
public Image()
Image object. All values are
undefined.
public Image(int type,
int width,
int height,
java.nio.ByteBuffer data,
int[] mipMapSizes)
Image object. The attributes
of the image are defined during construction.
type - the type of image format.width - the width of the image.height - the height of the image.data - the image data.mipMapSizes - the array of mipmap sizes, or null for no mipmaps.
public Image(int type,
int width,
int height,
java.nio.ByteBuffer data)
Image object. The attributes
of the image are defined during construction.
type - the type of image format.width - the width of the image.height - the height of the image.data - the image data.| Method Detail |
public void setData(java.nio.ByteBuffer data)
setData sets the data that makes up the image. This data
is packed into a single ByteBuffer.
data - the data that contains the image information.public void setMipMapSizes(int[] mipMapSizes)
mipMapSizes - the mipmap sizes array, or null for a single image map.public void setHeight(int height)
setHeight sets the height value of the image. It is
typically a good idea to try to keep this as a multiple of 2.
height - the height of the image.public void setWidth(int width)
setWidth sets the width value of the image. It is
typically a good idea to try to keep this as a multiple of 2.
width - the width of the image.public void setType(int type)
setType sets the image format for this image. If an
invalid value is passed, the type defaults to RGBA4444.
type - the image format.public int getType()
getType returns the image format for this image.
public boolean isCompressedType()
public int getWidth()
getWidth returns the width of this image.
public int getHeight()
getHeight returns the height of this image.
public java.nio.ByteBuffer getData()
getData returns the data for this image. If the data
is undefined, null will be returned.
public boolean hasMipmaps()
public int[] getMipMapSizes()
public boolean equals(java.lang.Object other)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||