Class GLPixelStorageModes
- java.lang.Object
-
- com.jogamp.opengl.util.GLPixelStorageModes
-
public class GLPixelStorageModes extends Object
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
-
-
Constructor Summary
Constructors Constructor Description GLPixelStorageModes()Create instance w/osaveAll(GL)GLPixelStorageModes(GL gl)Create instance w/saveAll(GL)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidresetAll(GL gl)Resets PACK and UNPACK pixel storage modes to their default value, i.e.voidresetPack(GL gl)Resets PACK pixel storage modes to their default value.voidresetUnpack(GL gl)Resets UNPACK pixel storage modes to their default value.voidrestore(GL gl)Restores PACK and UNPACK pixel storage mode previously saved w/saveAll(GL)orsavePack(GL)andsaveUnpack(GL).voidsaveAll(GL gl)Saves PACK and UNPACK pixel storage modes andresetsthem, i.e.voidsavePack(GL gl)Saves PACK pixel storage modes andresetsthem.voidsaveUnpack(GL gl)Saves UNPACK pixel storage modes andresetsthem.voidsetAlignment(GL gl, int packAlignment, int unpackAlignment)Sets theGL.GL_PACK_ALIGNMENTandGL.GL_UNPACK_ALIGNMENT.voidsetPackAlignment(GL gl, int packAlignment)Sets theGL.GL_PACK_ALIGNMENT.voidsetPackRowLength(GL2ES3 gl, int packRowLength)Sets theGL2ES3.GL_PACK_ROW_LENGTH.voidsetRowLength(GL2ES3 gl, int packRowLength, int unpackRowLength)voidsetUnpackAlignment(GL gl, int unpackAlignment)Sets theGL.GL_UNPACK_ALIGNMENT.voidsetUnpackRowLength(GL2ES3 gl, int unpackRowLength)Sets theGL2ES2.GL_UNPACK_ROW_LENGTH.
-
-
-
Constructor Detail
-
GLPixelStorageModes
public GLPixelStorageModes()
Create instance w/osaveAll(GL)
-
GLPixelStorageModes
public GLPixelStorageModes(GL gl)
Create instance w/saveAll(GL)
-
-
Method Detail
-
setPackAlignment
public final void setPackAlignment(GL gl, int packAlignment)
Sets theGL.GL_PACK_ALIGNMENT.Saves the PACK pixel storage modes and
resetsthem if not saved yet, seesavePack(GL).
-
setUnpackAlignment
public final void setUnpackAlignment(GL gl, int unpackAlignment)
Sets theGL.GL_UNPACK_ALIGNMENT.Saves the UNPACK pixel storage modes and
resetsthem if not saved yet, seesaveUnpack(GL).
-
setAlignment
public final void setAlignment(GL gl, int packAlignment, int unpackAlignment)
Sets theGL.GL_PACK_ALIGNMENTandGL.GL_UNPACK_ALIGNMENT.Saves the PACK and UNPACK pixel storage modes and resets them if not saved yet, see
saveAll(GL).
-
setPackRowLength
public final void setPackRowLength(GL2ES3 gl, int packRowLength)
Sets theGL2ES3.GL_PACK_ROW_LENGTH.Saves the PACK pixel storage modes and
resetsthem if not saved yet, seesavePack(GL).
-
setUnpackRowLength
public final void setUnpackRowLength(GL2ES3 gl, int unpackRowLength)
Sets theGL2ES2.GL_UNPACK_ROW_LENGTH.Saves the UNPACK pixel storage modes and
resetsthem if not saved yet, seesaveUnpack(GL).
-
setRowLength
public final void setRowLength(GL2ES3 gl, int packRowLength, int unpackRowLength)
Sets theGL2ES3.GL_PACK_ROW_LENGTHandGL2ES2.GL_UNPACK_ROW_LENGTHifGLBase.isGL2ES3().Saves the PACK and UNPACK pixel storage modes and resets them if not saved yet, see
saveAll(GL).
-
saveAll
public final void saveAll(GL gl)
Saves PACK and UNPACK pixel storage modes andresetsthem, i.e. issuessavePack(GL)andsaveUnpack(GL).Operation is skipped, if the modes were already saved.
Restore via
restore(GL)
-
resetAll
public final void resetAll(GL gl)
Resets PACK and UNPACK pixel storage modes to their default value, i.e. issuesresetPack(GL)andresetUnpack(GL).
-
restore
public final void restore(GL gl) throws GLException
Restores PACK and UNPACK pixel storage mode previously saved w/saveAll(GL)orsavePack(GL)andsaveUnpack(GL).- Throws:
GLException- if neither PACK nor UNPACK modes were saved.
-
resetPack
public final void resetPack(GL gl)
Resets PACK pixel storage modes to their default value.
-
savePack
public final void savePack(GL gl)
Saves PACK pixel storage modes andresetsthem.Operation is skipped, if the modes were already saved.
Restore via
restore(GL)
-
resetUnpack
public final void resetUnpack(GL gl)
Resets UNPACK pixel storage modes to their default value.
-
saveUnpack
public final void saveUnpack(GL gl)
Saves UNPACK pixel storage modes andresetsthem.Operation is skipped, if the modes were already saved.
Restore via
restore(GL)
-
-