Top Fields Constructors Methods
com.jogamp.opengl.util.texture.awt

public Class AWTTextureData

extends TextureData
Class Inheritance
Imports
java.awt.AlphaComposite, .Graphics2D, .Transparency, java.awt.image.BufferedImage, .ComponentColorModel, .ComponentSampleModel, .DataBuffer, .DataBufferByte, .DataBufferDouble, .DataBufferFloat, .DataBufferInt, .DataBufferShort, .DataBufferUShort, .MultiPixelPackedSampleModel, .SampleModel, .SinglePixelPackedSampleModel, .WritableRaster, java.nio.Buffer, .ByteBuffer, .FloatBuffer, .IntBuffer, .ShortBuffer, com.jogamp.opengl.GL, .GL2, .GL2GL3, .GLException, .GLProfile, com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes, com.jogamp.opengl.util.texture.TextureData

Field Summary

Modifier and TypeField and Description
private boolean
private boolean
private BufferedImage
private static final ColorModel
private static final ColorModel
Inherited from com.jogamp.opengl.util.texture.TextureData:
alignmentbufferestimatedMemorySizeglProfilehaveEXTABGRhaveGL12heightinternalFormatmipmapmustFlipVerticallypixelAttributespixelCSrowLengthwidth

Constructor Summary

AccessConstructor and Description
public
AWTTextureData(final GLProfile
the OpenGL Profile this texture data should be created for.
glp
,
final int
the OpenGL internal format for the resulting texture; may be 0, in which case it is inferred from the image's type
internalFormat
,
final int
the OpenGL internal format for the resulting texture; may be 0, in which case it is inferred from the image's type (note: this argument is currently always ignored)
pixelFormat
,
final boolean
indicates whether mipmaps should be autogenerated (using GLU) for the resulting texture
mipmap
,
final BufferedImage
the image containing the texture data
image
)

Constructs a new TextureData object with the specified parameters and data contained in the given BufferedImage.

Method Summary

Modifier and TypeMethod and Description
private void
private void
createFromImage(final GLProfile glp, final BufferedImage image)

private void
public Buffer
getBuffer()

Overrides com.jogamp.opengl.util.texture.TextureData.getBuffer.

Returns the texture data, or null if it is specified as a set of mipmaps.
public GLPixelBuffer.GLPixelAttributes
getPixelAttributes()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelAttributes.

Returns the intended OpenGL GLPixelAttributes of the texture data, i.e. format and type.
public int
getPixelFormat()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelFormat.

Returns the intended OpenGL pixel format of the texture data using getPixelAttributes().
public int
getPixelType()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelType.

Returns the intended OpenGL pixel type of the texture data using getPixelAttributes().
private boolean
private void
private void
private void
private Buffer
Inherited from com.jogamp.opengl.util.texture.TextureData:
destroyestimatedMemorySizeflushgetAlignmentgetBordergetColorSpacegetEstimatedMemorySizegetGLProfilegetHeightgetInternalFormatgetMipmapgetMipmapDatagetMustFlipVerticallygetRowLengthgetSourceImageTypegetWidthisDataCompressedsetAlignmentsetBordersetBuffersetColorSpacesetHaveEXTABGRsetHaveGL12setHeightsetInternalFormatsetIsDataCompressedsetMipmapsetMustFlipVerticallysetPixelAttributessetPixelFormatsetPixelTypesetRowLengthsetWidthtoString

Field Detail

expectingEXTABGRback to summary
private boolean expectingEXTABGR
expectingGL12back to summary
private boolean expectingGL12
imageForLazyCustomConversionback to summary
private BufferedImage imageForLazyCustomConversion
rgbaColorModelback to summary
private static final ColorModel rgbaColorModel
rgbColorModelback to summary
private static final ColorModel rgbColorModel

Constructor Detail

AWTTextureDataback to summary
public AWTTextureData(final GLProfile glp, final int internalFormat, final int pixelFormat, final boolean mipmap, final BufferedImage image)

Constructs a new TextureData object with the specified parameters and data contained in the given BufferedImage. The resulting TextureData "wraps" the contents of the BufferedImage, so if a modification is made to the BufferedImage between the time the TextureData is constructed and when a Texture is made from the TextureData, that modification will be visible in the resulting Texture.

Parameters
glp:GLProfile

the OpenGL Profile this texture data should be created for.

internalFormat:int

the OpenGL internal format for the resulting texture; may be 0, in which case it is inferred from the image's type

pixelFormat:int

the OpenGL internal format for the resulting texture; may be 0, in which case it is inferred from the image's type (note: this argument is currently always ignored)

mipmap:boolean

indicates whether mipmaps should be autogenerated (using GLU) for the resulting texture

image:BufferedImage

the image containing the texture data

Method Detail

createFromCustomback to summary
private void createFromCustom(final BufferedImage image)
createFromImageback to summary
private void createFromImage(final GLProfile glp, final BufferedImage image)
createNIOBufferFromImageback to summary
private void createNIOBufferFromImage(final BufferedImage image)
getBufferback to summary
public Buffer getBuffer()

Overrides com.jogamp.opengl.util.texture.TextureData.getBuffer.

Doc from com.jogamp.opengl.util.texture.TextureData.getBuffer.

Returns the texture data, or null if it is specified as a set of mipmaps.

Annotations
@Override
getPixelAttributesback to summary
public GLPixelBuffer.GLPixelAttributes getPixelAttributes()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelAttributes.

Doc from com.jogamp.opengl.util.texture.TextureData.getPixelAttributes.

Returns the intended OpenGL GLPixelAttributes of the texture data, i.e. format and type.

Annotations
@Override
getPixelFormatback to summary
public int getPixelFormat()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelFormat.

Doc from com.jogamp.opengl.util.texture.TextureData.getPixelFormat.

Returns the intended OpenGL pixel format of the texture data using getPixelAttributes().

Annotations
@Override
getPixelTypeback to summary
public int getPixelType()

Overrides com.jogamp.opengl.util.texture.TextureData.getPixelType.

Doc from com.jogamp.opengl.util.texture.TextureData.getPixelType.

Returns the intended OpenGL pixel type of the texture data using getPixelAttributes().

Annotations
@Override
isPackedIntback to summary
private boolean isPackedInt(final BufferedImage image)
revertPixelAttributesback to summary
private void revertPixelAttributes()
setupLazyCustomConversionback to summary
private void setupLazyCustomConversion(final BufferedImage image)
validatePixelAttributesback to summary
private void validatePixelAttributes()
wrapImageDataBufferback to summary
private Buffer wrapImageDataBuffer(final BufferedImage image)