com.jogamp.opengl.util.awt
Class AWTGLPixelBuffer.AWTGLPixelBufferProvider

java.lang.Object
  extended by com.jogamp.opengl.util.awt.AWTGLPixelBuffer.AWTGLPixelBufferProvider
All Implemented Interfaces:
GLPixelBuffer.GLPixelBufferProvider
Direct Known Subclasses:
AWTGLPixelBuffer.SingleAWTGLPixelBufferProvider
Enclosing class:
AWTGLPixelBuffer

public static class AWTGLPixelBuffer.AWTGLPixelBufferProvider
extends Object
implements GLPixelBuffer.GLPixelBufferProvider

Provider for AWTGLPixelBuffer instances.


Constructor Summary
AWTGLPixelBuffer.AWTGLPixelBufferProvider(boolean allowRowStride)
           
 
Method Summary
 AWTGLPixelBuffer allocate(GL gl, GLPixelBuffer.GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize)
          Allocates a new GLPixelBuffer object.
 boolean getAllowRowStride()
          Allow GL2ES3.GL_PACK_ROW_LENGTH, or GL2ES2.GL_UNPACK_ROW_LENGTH.
 GLPixelBuffer.GLPixelAttributes getAttributes(GL gl, int componentCount)
          Called first to determine GLPixelBuffer.GLPixelAttributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AWTGLPixelBuffer.AWTGLPixelBufferProvider

public AWTGLPixelBuffer.AWTGLPixelBufferProvider(boolean allowRowStride)
Parameters:
allowRowStride - If true, allow row-stride, otherwise not. See getAllowRowStride() and GLPixelBuffer.requiresNewBuffer(GL, int, int, int). If true, user shall decide whether to use a width-aligned image.
Method Detail

getAllowRowStride

public boolean getAllowRowStride()
Description copied from interface: GLPixelBuffer.GLPixelBufferProvider
Allow GL2ES3.GL_PACK_ROW_LENGTH, or GL2ES2.GL_UNPACK_ROW_LENGTH.

Specified by:
getAllowRowStride in interface GLPixelBuffer.GLPixelBufferProvider

getAttributes

public GLPixelBuffer.GLPixelAttributes getAttributes(GL gl,
                                                     int componentCount)
Description copied from interface: GLPixelBuffer.GLPixelBufferProvider
Called first to determine GLPixelBuffer.GLPixelAttributes.

Specified by:
getAttributes in interface GLPixelBuffer.GLPixelBufferProvider

allocate

public AWTGLPixelBuffer allocate(GL gl,
                                 GLPixelBuffer.GLPixelAttributes pixelAttributes,
                                 int width,
                                 int height,
                                 int depth,
                                 boolean pack,
                                 int minByteSize)
Allocates a new GLPixelBuffer object.

Being called to gather the initial GLPixelBuffer, or a new replacement GLPixelBuffer if GLPixelBuffer.requiresNewBuffer(GL, int, int, int).

The minimum required remaining byte size equals to minByteSize, if > 0, otherwise utilize GLBuffers.sizeof(GL, int[], int, int, int, int, int, boolean) to calculate it.

Returns an array backed IntBuffer of size

width*height*SIZEOF_INT.
 

Specified by:
allocate in interface GLPixelBuffer.GLPixelBufferProvider
Parameters:
gl - the corresponding current GL context object
pixelAttributes - the desired GLPixelBuffer.GLPixelAttributes
width - in pixels
height - in pixels
depth - in pixels
pack - true for read mode GPU -> CPU, otherwise false for write mode CPU -> GPU
minByteSize - if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.


Copyright 2010 JogAmp Community.