public class GLBuffers extends Buffers
SIZEOF_BYTE, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT
Constructor and Description |
---|
GLBuffers() |
Modifier and Type | Method and Description |
---|---|
static int |
bytesPerPixel(int format,
int type)
Returns the number of bytes required for one pixel with the the given OpenGL format and type.
|
static int |
componentCount(int format)
Returns the number of components required for the given OpenGL format.
|
static float[] |
getFloatArray(double[] source) |
static int |
getNextPowerOf2(int number) |
static boolean |
isGLTypeFixedPoint(int glType) |
static boolean |
isSignedGLType(int glType) |
static Buffer |
newDirectGLBuffer(int glType,
int numElements) |
static int |
sizeof(GL gl,
int[] tmp,
int bytesPerPixel,
int width,
int height,
int depth,
boolean pack)
Returns the number of bytes required to read/write a memory buffer via OpenGL
using the current GL pixel storage state and the given parameters.
|
static int |
sizeof(GL gl,
int[] tmp,
int format,
int type,
int width,
int height,
int depth,
boolean pack)
Returns the number of bytes required to read/write a memory buffer via OpenGL
using the current GL pixel storage state and the given parameters.
|
static int |
sizeOfGLType(int glType) |
static Buffer |
sliceGLBuffer(ByteBuffer parent,
int bytePos,
int byteLen,
int glType) |
copyByteBuffer, copyFloatBuffer, copyFloatBufferAsByteBuffer, copyIntBuffer, copyIntBufferAsByteBuffer, copyShortBuffer, copyShortBufferAsByteBuffer, getArray, getDirectBufferByteOffset, getDoubleArray, getDoubleBuffer, getFloatArray, getFloatBuffer, getIndirectBufferByteOffset, isDirect, nativeOrder, newDirectByteBuffer, newDirectByteBuffer, newDirectByteBuffer, newDirectByteBuffer, newDirectCharBuffer, newDirectCharBuffer, newDirectCharBuffer, newDirectCharBuffer, newDirectDoubleBuffer, newDirectDoubleBuffer, newDirectDoubleBuffer, newDirectDoubleBuffer, newDirectFloatBuffer, newDirectFloatBuffer, newDirectFloatBuffer, newDirectFloatBuffer, newDirectIntBuffer, newDirectIntBuffer, newDirectIntBuffer, newDirectIntBuffer, newDirectLongBuffer, newDirectLongBuffer, newDirectLongBuffer, newDirectLongBuffer, newDirectShortBuffer, newDirectShortBuffer, newDirectShortBuffer, newDirectShortBuffer, put, putb, putd, putf, puti, putNb, putNf, putNi, putNs, puts, rangeCheck, rangeCheck, rangeCheck, rangeCheck, rangeCheck, rangeCheck, rangeCheck, rangeCheck, rangeCheckBytes, remainingBytes, remainingElem, sizeOfBufferElem, slice, slice, slice2Float, slice2Float, toString
public static final boolean isSignedGLType(int glType)
glType
- GL primitive typepublic static final boolean isGLTypeFixedPoint(int glType)
glType
- GL primitive typepublic static final int sizeOfGLType(int glType)
glType
- shall be one of (31) public static final Buffer newDirectGLBuffer(int glType, int numElements)
glType
- shall be one of (31) public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType)
glType
- shall be one of (31) public static final int sizeof(GL gl, int[] tmp, int bytesPerPixel, int width, int height, int depth, boolean pack)
This method is security critical, hence it throws an exception (fail-fast) in case of an invalid alignment. In case we forgot to handle proper values, please contact the maintainer.
gl
- the current GL objecttmp
- a pass through integer array of size >= 1 used to store temp data (performance)bytesPerPixel
- bytes per pixel, i.e. via bytesPerPixel(int, int)
.width
- in pixelsheight
- in pixelsdepth
- in pixelspack
- true for read mode GPU -> CPU (pack), otherwise false for write mode CPU -> GPU (unpack)GLException
- if alignment is invalid. Please contact the maintainer if this is our bug.public static final int sizeof(GL gl, int[] tmp, int format, int type, int width, int height, int depth, boolean pack) throws GLException
This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.
gl
- the current GL objecttmp
- a pass through integer array of size >= 1 used to store temp data (performance)format
- must be one of (27) type
- must be one of (32) width
- in pixelsheight
- in pixelsdepth
- in pixelspack
- true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPUGLException
- if format, type or alignment is not handled. Please contact the maintainer if this is our bug.public static final int bytesPerPixel(int format, int type) throws GLException
This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.
See componentCount(int)
.
format
- must be one of (27) type
- must be one of (32) GLException
- if format or type alignment is not handled. Please contact the maintainer if this is our bug.public static final int componentCount(int format) throws GLException
This method is security critical, hence it throws an exception (fail-fast) in case either the format, type or alignment is unhandled. In case we forgot to handle proper values, please contact the maintainer.
format
- must be one of (27) GLException
- if format is not handled. Please contact the maintainer if this is our bug.public static final int getNextPowerOf2(int number)
public static final float[] getFloatArray(double[] source)
Copyright 2010 JogAmp Community.