|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.util.NativeObject
com.jme3.texture.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
|
Field Summary | |
---|---|
protected java.util.ArrayList<java.nio.ByteBuffer> |
data
|
protected int |
depth
|
protected java.lang.Object |
efficientData
|
protected Image.Format |
format
|
protected int |
height
|
protected int[] |
mipMapSizes
|
protected int |
multiSamples
|
protected int |
width
|
Fields inherited from class com.jme3.util.NativeObject |
---|
handleRef, id, type, updateNeeded |
Constructor Summary | |
---|---|
|
Image()
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
java.nio.ByteBuffer data)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
java.nio.ByteBuffer data,
int[] mipMapSizes)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
int depth,
java.util.ArrayList<java.nio.ByteBuffer> data)
Constructor instantiates a new Image object. |
|
Image(Image.Format format,
int width,
int height,
int depth,
java.util.ArrayList<java.nio.ByteBuffer> data,
int[] mipMapSizes)
Constructor instantiates a new Image object. |
protected |
Image(int id)
|
Method Summary | |
---|---|
void |
addData(java.nio.ByteBuffer data)
|
Image |
clone()
This should create a deep clone. |
NativeObject |
createDestructableClone()
Creates a shallow clone of this GL Object. |
void |
deleteObject(java.lang.Object rendererObject)
Deletes the GL object from the GPU when it is no longer used. |
boolean |
equals(java.lang.Object other)
|
java.util.List<java.nio.ByteBuffer> |
getData()
getData returns the data for this image. |
java.nio.ByteBuffer |
getData(int index)
getData returns the data for this image. |
int |
getDepth()
getDepth returns the depth of this image (for 3d images). |
java.lang.Object |
getEfficentData()
|
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 |
getMultiSamples()
|
int |
getWidth()
getWidth returns the width of this image. |
int |
hashCode()
|
boolean |
hasMipmaps()
Returns whether the image data contains mipmaps. |
void |
read(JmeImporter e)
|
void |
resetObject()
Called when the GL context is restarted to reset all IDs. |
void |
setData(java.util.ArrayList<java.nio.ByteBuffer> data)
setData sets the data that makes up the image. |
void |
setData(java.nio.ByteBuffer data)
setData sets the data that makes up the image. |
void |
setData(int index,
java.nio.ByteBuffer data)
|
void |
setDepth(int depth)
setDepth sets the depth value of the image. |
void |
setEfficentData(java.lang.Object efficientData)
Set the efficient data representation of this 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 |
setMultiSamples(int multiSamples)
|
void |
setWidth(int width)
setWidth sets the width value of the image. |
java.lang.String |
toString()
|
void |
write(JmeExporter e)
|
Methods inherited from class com.jme3.util.NativeObject |
---|
clearUpdateNeeded, getId, isUpdateNeeded, setId, setUpdateNeeded |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Image.Format format
protected int width
protected int height
protected int depth
protected int[] mipMapSizes
protected java.util.ArrayList<java.nio.ByteBuffer> data
protected transient java.lang.Object efficientData
protected int multiSamples
Constructor Detail |
---|
public Image()
Image
object. All values
are undefined.
protected Image(int id)
public Image(Image.Format format, int width, int height, int depth, java.util.ArrayList<java.nio.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, java.nio.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, java.util.ArrayList<java.nio.ByteBuffer> data)
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.public Image(Image.Format format, int width, int height, java.nio.ByteBuffer data)
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.Method Detail |
---|
public void resetObject()
NativeObject
resetObject
in class NativeObject
public void deleteObject(java.lang.Object rendererObject)
NativeObject
deleteObject
in class NativeObject
rendererObject
- The renderer to be used to delete the objectpublic NativeObject createDestructableClone()
NativeObject
createDestructableClone
in class NativeObject
public Image clone()
NativeObject
clone
in class NativeObject
public int getMultiSamples()
setMultiSamples(int)
public void setMultiSamples(int multiSamples)
multiSamples
- Set the number of samples to use for this image,
setting this to a value higher than 1 turns this image/texture
into a multisample texture (on OpenGL3.1 and higher).public void setData(java.util.ArrayList<java.nio.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(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 addData(java.nio.ByteBuffer data)
public void setData(int index, java.nio.ByteBuffer data)
public void setEfficentData(java.lang.Object efficientData)
Some system implementations are more efficient at operating on data other than ByteBuffers, in that case, this method can be used.
efficientData
- public java.lang.Object getEfficentData()
setEfficentData(java.lang.Object)
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.
java.lang.NullPointerException
- if format is nullImage.Format
public Image.Format getFormat()
getFormat
returns the image format for this image.
Image.Format
public 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 java.util.List<java.nio.ByteBuffer> getData()
getData
returns the data for this image. If the data is
undefined, null will be returned.
public java.nio.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 java.lang.String toString()
toString
in class NativeObject
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void write(JmeExporter e) throws java.io.IOException
write
in interface Savable
java.io.IOException
public void read(JmeImporter e) throws java.io.IOException
read
in interface Savable
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |