Top Inners Fields Constructors Methods
com.jogamp.opengl.util.texture.spi

public Class JPEGImage

extends Object
Class Inheritance
Imports
java.io.IOException, .InputStream, java.nio.ByteBuffer, com.jogamp.opengl.GL, jogamp.opengl.Debug, jogamp.opengl.util.jpeg.JPEGDecoder, com.jogamp.common.nio.Buffers, com.jogamp.opengl.util.texture.TextureData.ColorSpace

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final int
private final ByteBuffer
private static final boolean
private final int
private final int
private final JPEGImage.JPEGColorSink
private final int
private final boolean

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public int
getBytesPerPixel()

Returns the bytes per pixel

public TextureData.ColorSpace
getColorSpace()

Returns the color space of the pixel data

public int
getComponentCount()

Returns the number of components of the pixel data

public ByteBuffer
getData()

Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D.

public int
getGLFormat()

Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA.

public int
getGLType()

Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE.

public boolean
getHasReversedChannels()

Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected.

public int
getHeight()

Returns the height of the image.

public int
getWidth()

Returns the width of the image.

public static JPEGImage
read(final InputStream in, final TextureData.ColorSpace
Storage color space, either ColorSpace#RGB or ColorSpace#YCbCr. ColorSpace#YCCK and ColorSpace#CMYK will throw an exception!
cs
)

Reads a JPEG image from the specified InputStream, using the given color space for storage.

public static JPEGImage
read(final InputStream in)

Reads a JPEG image from the specified InputStream, using the ColorSpace#RGB.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bytesPerPixelback to summary
private final int bytesPerPixel
databack to summary
private final ByteBuffer data
DEBUGback to summary
private static final boolean DEBUG
glFormatback to summary
private final int glFormat
pixelHeightback to summary
private final int pixelHeight
pixelStorageback to summary
private final JPEGImage.JPEGColorSink pixelStorage
pixelWidthback to summary
private final int pixelWidth
reversedChannelsback to summary
private final boolean reversedChannels

Constructor Detail

JPEGImageback to summary
private JPEGImage(final InputStream in, final TextureData.ColorSpace cs) throws IOException

Method Detail

getBytesPerPixelback to summary
public int getBytesPerPixel()

Returns the bytes per pixel

getColorSpaceback to summary
public TextureData.ColorSpace getColorSpace()

Returns the color space of the pixel data

getComponentCountback to summary
public int getComponentCount()

Returns the number of components of the pixel data

getDataback to summary
public ByteBuffer getData()

Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D.

getGLFormatback to summary
public int getGLFormat()

Returns the OpenGL format for this texture; e.g. GL.GL_LUMINANCE, GL.GL_RGB or GL.GL_RGBA.

getGLTypeback to summary
public int getGLType()

Returns the OpenGL data type: GL.GL_UNSIGNED_BYTE.

getHasReversedChannelsback to summary
public boolean getHasReversedChannels()

Returns true if data has the channels reversed to BGR or BGRA, otherwise RGB or RGBA is expected.

getHeightback to summary
public int getHeight()

Returns the height of the image.

getWidthback to summary
public int getWidth()

Returns the width of the image.

readback to summary
public static JPEGImage read(final InputStream in, final TextureData.ColorSpace cs) throws IOException

Reads a JPEG image from the specified InputStream, using the given color space for storage.

Parameters
cs:TextureData.ColorSpace

Storage color space, either ColorSpace#RGB or ColorSpace#YCbCr. ColorSpace#YCCK and ColorSpace#CMYK will throw an exception!

readback to summary
public static JPEGImage read(final InputStream in) throws IOException

Reads a JPEG image from the specified InputStream, using the ColorSpace#RGB.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
com.jogamp.opengl.util.texture.spi back to summary

private Class JPEGImage.JPEGColorSink

extends Object
implements ColorSink
Class Inheritance
All Implemented Interfaces
jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink

Field Summary

Modifier and TypeField and Description
pack-priv ByteBuffer
pack-priv int
pack-priv int
pack-priv TextureData.ColorSpace
pack-priv int
pack-priv final TextureData.ColorSpace
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public final TextureData.ColorSpace
allocate(final int width, final int height, final TextureData.ColorSpace
the color-space of the decoded JPEG
sourceCM
,
final int
number of components used for the given source color-space
sourceComponents
)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.allocate.

public final void
store2(final int x, final int y, final byte c1, final byte c2)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.store2.

public final void
storeRGB(final int x, final int y, final byte r, final byte g, final byte b)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.storeRGB.

public final void
storeYCbCr(final int x, final int y, final byte Y, final byte Cb, final byte Cr)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.storeYCbCr.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

databack to summary
pack-priv ByteBuffer data
heightback to summary
pack-priv int height
sourceComponentsback to summary
pack-priv int sourceComponents
sourceCSback to summary
pack-priv TextureData.ColorSpace sourceCS
storageComponentsback to summary
pack-priv int storageComponents
storageCSback to summary
pack-priv final TextureData.ColorSpace storageCS
widthback to summary
pack-priv int width

Constructor Detail

JPEGColorSinkback to summary
pack-priv JPEGColorSink(final TextureData.ColorSpace storageCM)

Method Detail

allocateback to summary
public final TextureData.ColorSpace allocate(final int width, final int height, final TextureData.ColorSpace sourceCM, final int sourceComponents) throws RuntimeException

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.allocate.

Parameters
sourceCM:TextureData.ColorSpace

Doc from jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.allocate.

the color-space of the decoded JPEG

sourceComponents:int

Doc from jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.allocate.

number of components used for the given source color-space

Returns:TextureData.ColorSpace

Doc from jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.allocate.

Either TextureData.ColorSpace#RGB or TextureData.ColorSpace#YCbCr. TextureData.ColorSpace#YCCK and TextureData.ColorSpace#CMYK will throw an exception!

Annotations
@Override
store2back to summary
public final void store2(final int x, final int y, final byte c1, final byte c2)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.store2.

Annotations
@Override
storeRGBback to summary
public final void storeRGB(final int x, final int y, final byte r, final byte g, final byte b)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.storeRGB.

Annotations
@Override
storeYCbCrback to summary
public final void storeYCbCr(final int x, final int y, final byte Y, final byte Cb, final byte Cr)

Implements jogamp.opengl.util.jpeg.JPEGDecoder.ColorSink.storeYCbCr.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override