public class JPEGImage extends Object
Modifier and Type | Method and Description |
---|---|
int |
getBytesPerPixel()
Returns the bytes per pixel
|
TextureData.ColorSpace |
getColorSpace()
Returns the color space of the pixel data
|
int |
getComponentCount()
Returns the number of components of the pixel data
|
ByteBuffer |
getData()
Returns the raw data for this texture in the correct
(bottom-to-top) order for calls to glTexImage2D.
|
int |
getGLFormat()
Returns the OpenGL format for this texture; e.g.
|
int |
getGLType()
Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE.
|
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 JPEGImage |
read(InputStream in)
Reads a JPEG image from the specified InputStream, using the
TextureData.ColorSpace.RGB . |
static JPEGImage |
read(InputStream in,
TextureData.ColorSpace cs)
Reads a JPEG image from the specified InputStream, using the given color space for storage.
|
String |
toString() |
public static JPEGImage read(InputStream in, TextureData.ColorSpace cs) throws IOException
in
- cs
- Storage color space, either TextureData.ColorSpace.RGB
or TextureData.ColorSpace.YCbCr
. TextureData.ColorSpace.YCCK
and TextureData.ColorSpace.CMYK
will throw an exception!IOException
public static JPEGImage read(InputStream in) throws IOException
TextureData.ColorSpace.RGB
.IOException
public TextureData.ColorSpace getColorSpace()
public int getComponentCount()
public int getWidth()
public int getHeight()
public boolean getHasReversedChannels()
public int getGLFormat()
public int getGLType()
public int getBytesPerPixel()
public ByteBuffer getData()
Copyright 2010 JogAmp Community.