public class PNGImage extends Object
Modifier and Type | Method and Description |
---|---|
static PNGImage |
createFromData(int width,
int height,
double dpiX,
double dpiY,
int bytesPerPixel,
boolean reversedChannels,
ByteBuffer data)
Creates a PNGImage from data supplied by the end user.
|
int |
getBytesPerPixel()
Returns the bytes per pixel
|
ByteBuffer |
getData()
Returns the raw data for this texture in the correct
(bottom-to-top) order for calls to glTexImage2D.
|
double[] |
getDpi()
Returns the dpi of the image.
|
int |
getGLFormat()
Returns the OpenGL format for this texture; e.g.
|
boolean |
getHasReversedChannels()
Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected.
|
int |
getHeight()
Returns the height of the image.
|
int |
getWidth()
Returns the width of the image.
|
static PNGImage |
read(InputStream in)
Reads a PNG image from the specified InputStream.
|
String |
toString() |
void |
write(File out,
boolean allowOverwrite) |
public static PNGImage createFromData(int width, int height, double dpiX, double dpiY, int bytesPerPixel, boolean reversedChannels, ByteBuffer data)
public static PNGImage read(InputStream in) throws IOException
IOException
public int getWidth()
public int getHeight()
public boolean getHasReversedChannels()
public double[] getDpi()
public int getGLFormat()
public int getBytesPerPixel()
public ByteBuffer getData()
public void write(File out, boolean allowOverwrite) throws IOException
IOException
Copyright 2010 JogAmp Community.