|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jme.image.Image
public class Image
Image defines a data format for a graphical image. The image
is defined by a format, a height and width, and the image data. 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.
| Nested Class Summary | |
|---|---|
static class |
Image.Format
|
| Constructor Summary | |
|---|---|
Image()
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
ByteBuffer data)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
ByteBuffer data,
int[] mipMapSizes)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
int depth,
ArrayList<ByteBuffer> data)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
int depth,
ArrayList<ByteBuffer> data,
int[] mipMapSizes)
Constructor instantiates a new Image object. |
|
| Method Summary | |
|---|---|
void |
addData(ByteBuffer data)
|
boolean |
equals(Object other)
|
Class |
getClassTag()
|
ArrayList<ByteBuffer> |
getData()
getData returns the data for this image. |
ByteBuffer |
getData(int index)
getData returns the data for this image. |
int |
getDepth()
getDepth returns the depth of this image (for 3d images). |
static int |
getEstimatedByteSize(Image.Format format)
|
Image.Format |
getFormat()
getFormat returns the image format for this image. |
int |
getHeight()
getHeight returns the height of this image. |
int[] |
getMipMapSizes()
Returns the mipmap sizes for this image. |
int |
getWidth()
getWidth returns the width of this image. |
boolean |
hasMipmaps()
Returns whether the image data contains mipmaps. |
void |
read(JMEImporter e)
|
void |
setData(ArrayList<ByteBuffer> data)
setData sets the data that makes up the image. |
void |
setData(ByteBuffer data)
setData sets the data that makes up the image. |
void |
setData(int index,
ByteBuffer data)
|
void |
setDepth(int depth)
setDepth sets the depth value of the image. |
void |
setFormat(Image.Format format)
setFormat sets the image format for this 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 |
setWidth(int width)
setWidth sets the width value of the image. |
void |
write(JMEExporter e)
|
| Methods inherited from class java.lang.Object |
|---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Image()
Image object. All values
are undefined.
public Image(Image.Format format,
int width,
int height,
int depth,
ArrayList<ByteBuffer> data,
int[] mipMapSizes)
Image object. The
attributes of the image are defined during construction.
format - the data format of the image.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(Image.Format format,
int width,
int height,
ByteBuffer data,
int[] mipMapSizes)
Image object. The
attributes of the image are defined during construction.
format - the data format of the image.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(Image.Format format,
int width,
int height,
int depth,
ArrayList<ByteBuffer> data)
Image object. The
attributes of the image are defined during construction.
type - the data format of the image.width - the width of the image.height - the height of the image.data - the image data.
public Image(Image.Format format,
int width,
int height,
ByteBuffer data)
Image object. The
attributes of the image are defined during construction.
type - the data format of the image.width - the width of the image.height - the height of the image.data - the image data.| Method Detail |
|---|
public void setData(ArrayList<ByteBuffer> data)
setData sets the data that makes up the image. This data
is packed into an array of ByteBuffer objects.
data - the data that contains the image information.public void setData(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 addData(ByteBuffer data)
public void setData(int index,
ByteBuffer data)
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 setDepth(int depth)
setDepth sets the depth value of the image. It is
typically a good idea to try to keep this as a multiple of 2. This is
used for 3d images.
depth - the depth 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 setFormat(Image.Format format)
setFormat sets the image format for this image.
format - the image format.
NullPointerException - if format is nullImage.Formatpublic Image.Format getFormat()
getFormat returns the image format for this image.
Image.Formatpublic int getWidth()
getWidth returns the width of this image.
public int getHeight()
getHeight returns the height of this image.
public int getDepth()
getDepth returns the depth of this image (for 3d images).
public ArrayList<ByteBuffer> getData()
getData returns the data for this image. If the data is
undefined, null will be returned.
public ByteBuffer getData(int index)
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(Object other)
equals in class Object
public void write(JMEExporter e)
throws IOException
write in interface SavableIOException
public void read(JMEImporter e)
throws IOException
read in interface SavableIOExceptionpublic Class getClassTag()
getClassTag in interface Savablepublic static int getEstimatedByteSize(Image.Format format)
format - image data format
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||