public class TextureContentImage extends ReferenceCountedBase implements TextureContent
TextureContent.ContentFormat
Modifier and Type | Field and Description |
---|---|
static boolean |
DEFAULT_USE_POWER_OF_TWO |
Constructor and Description |
---|
TextureContentImage() |
TextureContentImage(java.awt.image.BufferedImage image) |
TextureContentImage(java.awt.image.BufferedImage image,
boolean powerOfTwo) |
Modifier and Type | Method and Description |
---|---|
TextureContentImage |
acquire()
Signal the resource that something is holding a reference to it.
|
void |
getData(java.nio.ByteBuffer buff)
Get raw byte data of content, rasterized in
row-major form, with (0,0) in the bottom-left
corner.
|
void |
getData(Rectangle region,
java.nio.ByteBuffer buff)
Get raw byte data for a region, rasterized in row-major
form with (0,0) in the bottom-left corner.
|
Rectangle |
getDirty()
The portion of the texture that has been modified (marked "dirty")
|
TextureContent.ContentFormat |
getFormat()
Format of data returned by
TextureContent.getData(java.nio.ByteBuffer) |
int |
getHeight()
Number of pixels across height in content
|
java.awt.image.BufferedImage |
getImage() |
java.lang.Object |
getKey()
A key for referring to this texture.
|
int |
getPixelSize()
Size of pixels in bytes
|
int |
getWidth()
Number of pixels across width in content
|
boolean |
isDirty()
All or part of the texture has been marked as "dirty" (i.e.
|
void |
markClean()
Mark the entire texture as being clean
|
acquireAndCount, getReferenceCount, release, releaseAndCount
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
acquireAndCount, getReferenceCount, release, releaseAndCount
public TextureContentImage()
public TextureContentImage(java.awt.image.BufferedImage image)
public TextureContentImage(java.awt.image.BufferedImage image, boolean powerOfTwo)
public int getWidth()
TextureContent
getWidth
in interface TextureContent
public int getHeight()
TextureContent
getHeight
in interface TextureContent
public int getPixelSize()
TextureContent
getPixelSize
in interface TextureContent
public java.awt.image.BufferedImage getImage()
public void getData(java.nio.ByteBuffer buff)
TextureContent
getData
in interface TextureContent
public void getData(Rectangle region, java.nio.ByteBuffer buff)
TextureContent
getData
in interface TextureContent
region
- rectangular region to acquire data forbuff
- buffer to fillpublic TextureContent.ContentFormat getFormat()
TextureContent
TextureContent.getData(java.nio.ByteBuffer)
getFormat
in interface TextureContent
TextureContent.getData(java.nio.ByteBuffer)
public TextureContentImage acquire()
ReferenceCounted
acquire
in interface TextureContent
acquire
in interface ReferenceCounted
acquire
in class ReferenceCountedBase
public boolean isDirty()
TextureContent
isDirty
in interface TextureContent
public Rectangle getDirty()
TextureContent
getDirty
in interface TextureContent
public void markClean()
TextureContent
markClean
in interface TextureContent
public java.lang.Object getKey()
TextureContent
getKey
in interface TextureContent