Class JPEGImage
- java.lang.Object
-
- com.jogamp.opengl.util.texture.spi.JPEGImage
-
public class JPEGImage extends Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBytesPerPixel()Returns the bytes per pixelTextureData.ColorSpacegetColorSpace()Returns the color space of the pixel dataintgetComponentCount()Returns the number of components of the pixel dataByteBuffergetData()Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D.intgetGLFormat()Returns the OpenGL format for this texture; e.g.intgetGLType()Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE.booleangetHasReversedChannels()Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected.intgetHeight()Returns the height of the image.intgetWidth()Returns the width of the image.static JPEGImageread(InputStream in)Reads a JPEG image from the specified InputStream, using theTextureData.ColorSpace.RGB.static JPEGImageread(InputStream in, TextureData.ColorSpace cs)Reads a JPEG image from the specified InputStream, using the given color space for storage.StringtoString()
-
-
-
Method Detail
-
read
public static JPEGImage read(InputStream in, TextureData.ColorSpace cs) throws IOException
Reads a JPEG image from the specified InputStream, using the given color space for storage.- Parameters:
in-cs- Storage color space, eitherTextureData.ColorSpace.RGBorTextureData.ColorSpace.YCbCr.TextureData.ColorSpace.YCCKandTextureData.ColorSpace.CMYKwill throw an exception!- Returns:
- Throws:
IOException
-
read
public static JPEGImage read(InputStream in) throws IOException
Reads a JPEG image from the specified InputStream, using theTextureData.ColorSpace.RGB.- Throws:
IOException
-
getColorSpace
public TextureData.ColorSpace getColorSpace()
Returns the color space of the pixel data
-
getComponentCount
public int getComponentCount()
Returns the number of components of the pixel data
-
getWidth
public int getWidth()
Returns the width of the image.
-
getHeight
public int getHeight()
Returns the height of the image.
-
getHasReversedChannels
public boolean getHasReversedChannels()
Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected.
-
getGLFormat
public int getGLFormat()
Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA.
-
getGLType
public int getGLType()
Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE.
-
getBytesPerPixel
public int getBytesPerPixel()
Returns the bytes per pixel
-
getData
public ByteBuffer getData()
Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D.
-
-