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

public Class GLPixelStorageModes

extends Object
Class Inheritance
Imports
com.jogamp.opengl.GL, .GL2, .GL2ES2, .GL2ES3, .GL2GL3, .GLContext, .GLException

Utility to safely set and restore the PACK and UNPACK pixel storage mode, regardless of the GLProfile.

PACK for GPU to CPU transfers, e.g. ReadPixels, etc.

UNPACK for CPU o GPU transfers, e.g. TexImage2D, etc

Field Summary

Modifier and TypeField and Description
private final int[]
private final int[]
private boolean
private boolean

Constructor Summary

AccessConstructor and Description
public
GLPixelStorageModes()

Create instance w/o saveAll(GL)

public
GLPixelStorageModes(final GL gl)

Create instance w/ saveAll(GL)

Method Summary

Modifier and TypeMethod and Description
public final void
resetAll(final GL gl)

Resets PACK and UNPACK pixel storage modes to their default value, i.e. issues resetPack(GL) and resetUnpack(GL).

public final void
resetPack(final GL gl)

Resets PACK pixel storage modes to their default value.

public final void
resetUnpack(final GL gl)

Resets UNPACK pixel storage modes to their default value.

public final void
restore(final GL gl)

Restores PACK and UNPACK pixel storage mode previously saved w/ saveAll(GL) or savePack(GL) and saveUnpack(GL).

private final void
restorePack(final GL gl)

private final void
restoreUnpack(final GL gl)

public final void
saveAll(final GL gl)

Saves PACK and UNPACK pixel storage modes and resets them, i.e. issues savePack(GL) and saveUnpack(GL).

public final void
savePack(final GL gl)

Saves PACK pixel storage modes and resets them.

public final void
saveUnpack(final GL gl)

Saves UNPACK pixel storage modes and resets them.

public final void
setAlignment(final GL gl, final int packAlignment, final int unpackAlignment)

Sets the GL#GL_PACK_ALIGNMENT and GL#GL_UNPACK_ALIGNMENT.

public final void
setPackAlignment(final GL gl, final int packAlignment)

Sets the GL#GL_PACK_ALIGNMENT.

public final void
setPackRowLength(final GL2ES3 gl, final int packRowLength)

Sets the GL2ES3#GL_PACK_ROW_LENGTH.

public final void
setRowLength(final GL2ES3 gl, final int packRowLength, final int unpackRowLength)

Sets the GL2ES3#GL_PACK_ROW_LENGTH and GL2ES2#GL_UNPACK_ROW_LENGTH if GL#isGL2ES3().

public final void
setUnpackAlignment(final GL gl, final int unpackAlignment)

Sets the GL#GL_UNPACK_ALIGNMENT.

public final void
setUnpackRowLength(final GL2ES3 gl, final int unpackRowLength)

Sets the GL2ES2#GL_UNPACK_ROW_LENGTH.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cachePackback to summary
private final int[] cachePack
cacheUnpackback to summary
private final int[] cacheUnpack
savedPackback to summary
private boolean savedPack
savedUnpackback to summary
private boolean savedUnpack

Constructor Detail

GLPixelStorageModesback to summary
public GLPixelStorageModes()

Create instance w/o saveAll(GL)

GLPixelStorageModesback to summary
public GLPixelStorageModes(final GL gl)

Create instance w/ saveAll(GL)

Method Detail

resetAllback to summary
public final void resetAll(final GL gl)

Resets PACK and UNPACK pixel storage modes to their default value, i.e. issues resetPack(GL) and resetUnpack(GL).

resetPackback to summary
public final void resetPack(final GL gl)

Resets PACK pixel storage modes to their default value.

resetUnpackback to summary
public final void resetUnpack(final GL gl)

Resets UNPACK pixel storage modes to their default value.

restoreback to summary
public final void restore(final GL gl) throws GLException

Restores PACK and UNPACK pixel storage mode previously saved w/ saveAll(GL) or savePack(GL) and saveUnpack(GL).

Exceptions
GLException:
if neither PACK nor UNPACK modes were saved.
restorePackback to summary
private final void restorePack(final GL gl)
restoreUnpackback to summary
private final void restoreUnpack(final GL gl)
saveAllback to summary
public final void saveAll(final GL gl)

Saves PACK and UNPACK pixel storage modes and resets them, i.e. issues savePack(GL) and saveUnpack(GL).

Operation is skipped, if the modes were already saved.

Restore via restore(GL)

savePackback to summary
public final void savePack(final GL gl)

Saves PACK pixel storage modes and resets them.

Operation is skipped, if the modes were already saved.

Restore via restore(GL)

saveUnpackback to summary
public final void saveUnpack(final GL gl)

Saves UNPACK pixel storage modes and resets them.

Operation is skipped, if the modes were already saved.

Restore via restore(GL)

setAlignmentback to summary
public final void setAlignment(final GL gl, final int packAlignment, final int unpackAlignment)

Sets the GL#GL_PACK_ALIGNMENT and GL#GL_UNPACK_ALIGNMENT.

Saves the PACK and UNPACK pixel storage modes and resets them if not saved yet, see saveAll(GL).

setPackAlignmentback to summary
public final void setPackAlignment(final GL gl, final int packAlignment)

Sets the GL#GL_PACK_ALIGNMENT.

Saves the PACK pixel storage modes and resets them if not saved yet, see savePack(GL).

setPackRowLengthback to summary
public final void setPackRowLength(final GL2ES3 gl, final int packRowLength)

Sets the GL2ES3#GL_PACK_ROW_LENGTH.

Saves the PACK pixel storage modes and resets them if not saved yet, see savePack(GL).

setRowLengthback to summary
public final void setRowLength(final GL2ES3 gl, final int packRowLength, final int unpackRowLength)

Sets the GL2ES3#GL_PACK_ROW_LENGTH and GL2ES2#GL_UNPACK_ROW_LENGTH if GL#isGL2ES3().

Saves the PACK and UNPACK pixel storage modes and resets them if not saved yet, see saveAll(GL).

setUnpackAlignmentback to summary
public final void setUnpackAlignment(final GL gl, final int unpackAlignment)

Sets the GL#GL_UNPACK_ALIGNMENT.

Saves the UNPACK pixel storage modes and resets them if not saved yet, see saveUnpack(GL).

setUnpackRowLengthback to summary
public final void setUnpackRowLength(final GL2ES3 gl, final int unpackRowLength)

Sets the GL2ES2#GL_UNPACK_ROW_LENGTH.

Saves the UNPACK pixel storage modes and resets them if not saved yet, see saveUnpack(GL).