Top Description Inners Fields Constructors Methods
com.jogamp.opengl.util

public Class GLPixelBuffer

extends Object
Class Inheritance
Known Direct Subclasses
com.jogamp.opengl.util.awt.AWTGLPixelBuffer
Imports
java.nio.Buffer, .ByteBuffer, com.jogamp.nativewindow.util.PixelFormat, com.jogamp.opengl.GL, .GL2ES2, .GL2ES3, .GL2GL3, .GLContext, .GLException, .GLProfile, com.jogamp.common.nio.Buffers, com.jogamp.opengl.util.texture.TextureData

OpenGL pixel data buffer, allowing user to provide buffers via their GLPixelBufferProvider implementation.

GLPixelBufferProvider produces a GLPixelBuffer.

You may use defaultProviderNoRowStride.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static interface
GLPixelBuffer.GLPixelBufferProvider

Allows user to interface with another toolkit to define GLPixelAttributes and memory buffer to produce TextureData.

public static interface

Field Summary

Modifier and TypeField and Description
public final boolean
public final Buffer
buffer

Buffer holding the pixel data.

public final int
bufferElemSize

Buffer element size in bytes.

public final int
byteSize

Byte size of the buffer.

public static final GLPixelBuffer.GLPixelBufferProvider
public static final GLPixelBuffer.GLPixelBufferProvider
public final int
depth

Depth in pixels.

private boolean
public final int
height

Height in pixels, representing buffer's byteSize.

public final boolean
pack

Data packing direction.

public final GLPixelBuffer.GLPixelAttributes
public final int
width

Width in pixels, representing buffer's byteSize.

Constructor Summary

AccessConstructor and Description
public
GLPixelBuffer(final GLPixelBuffer.GLPixelAttributes
the desired GLPixelAttributes
pixelAttributes
,
final boolean
true for read mode GPU -> CPU, e.g. glReadPixels. false for write mode CPU -> GPU, e.g. glTexImage2D.
pack
,
final int
in pixels
width
,
final int
in pixels
height
,
final int
in pixels
depth
,
final Buffer
the backing array
buffer
,
final boolean
If true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int).
allowRowStride
)

Method Summary

Modifier and TypeMethod and Description
public int
capacity()

Returns the byte capacity of the buffer.

public Buffer
public void
dispose()

Dispose resources.

public Buffer
public final boolean
public boolean
isValid()

Is not disposed and has byteSize > 0.

public int
limit()

Returns the byte limit of the buffer.

public int
position()

Returns the byte position of the buffer.

public Buffer
position(final int bytePos)

Sets the byte position of the buffer.

public boolean
requiresNewBuffer(final GL
the corresponding current GL context object
gl
,
final int
new width in pixels
newWidth
,
final int
new height in pixels
newHeight
,
int
if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
newByteSize
)

Returns true, if invalid or implementation requires a new buffer based on the new size due to pixel alignment or byte size, otherwise false.

public Buffer
public StringBuilder
public String
toString()

Overrides java.lang.Object.toString.

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