GLPixelBuffer backed by an BufferedImage of type
BufferedImage#TYPE_INT_ARGB or BufferedImage#TYPE_INT_RGB.
Implementation uses an array backed IntBuffer.
AWTGLPixelBuffer can be produced via AWTGLPixelBufferProvider's
allocate(..
See AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int) for allowRowStride details.
If using allowRowStride == true, user may needs to get the aligned image
since requiresNewBuffer(GL, int, int, int) will allow different width in this case.
| Modifier and Type | Class and Description |
|---|---|
| public static class | AWTGLPixelBuffer.
Provider for |
| public static class | AWTGLPixelBuffer.
Provider for singleton |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private static final GLPixelBuffer. | awtPixelAttributesIntBGRA
Ignoring componentCount, since otherwise no AWT/GL matching types are found. |
| private static final GLPixelBuffer. | |
| private final PixelFormat. | |
| public final BufferedImage | image
The underlying |
| Access | Constructor and Description |
|---|---|
| public | AWTGLPixelBuffer(final PixelFormat.
the host hostPixelComp,PixelFormat.the desired pixelAttributes,GLPixelAttributestrue for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.the used AWT format, i.e. awtFormat, final int AWTGLPixelBufferProvider#getAWTFormat(GLProfile, int)in pixels width, final int in pixels height, final int in pixels depth, final BufferedImage the AWT image image, final Buffer the backing array buffer, final boolean If allowRowStride)true, allow row-stride, otherwise not. See requiresNewBuffer(GL, int, int, int).
If true, user shall decide whether to use a width-aligned image.
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public BufferedImage | getAlignedImage(final int width, final int height)
Returns a width- and height-aligned image representation sharing data w/ |
| public final int | |
| public final PixelFormat. | |
| public final boolean | |
| public StringBuilder | |
| public String | toString()
Returns a string representation of the object.
|
| awtFormat | back to summary |
|---|---|
| private final int awtFormat | |
| awtPixelAttributesIntBGRA | back to summary |
|---|---|
| private static final GLPixelBuffer. Ignoring componentCount, since otherwise no AWT/GL matching types are found. Due to using RGBA and BGRA, pack/unpack usage has makes no difference. | |
| awtPixelAttributesIntRGBA | back to summary |
|---|---|
| private static final GLPixelBuffer. | |
| hostPixelComp | back to summary |
|---|---|
| private final PixelFormat. | |
| image | back to summary |
|---|---|
| public final BufferedImage image The underlying | |
| AWTGLPixelBuffer | back to summary |
|---|---|
public AWTGLPixelBuffer(final PixelFormat.
| |
| dispose | back to summary |
|---|---|
| public void dispose() Overrides com. Doc from com. Dispose resources. See
| |
| getAlignedImage | back to summary |
|---|---|
| public BufferedImage getAlignedImage(final int width, final int height) throws IllegalArgumentException Returns a width- and height-aligned image representation sharing data w/
| |
| getAWTFormat | back to summary |
|---|---|
| public final int getAWTFormat() | |
| getHostPixelComp | back to summary |
|---|---|
| public final PixelFormat. | |
| isDataBufferSource | back to summary |
|---|---|
| public final boolean isDataBufferSource(final BufferedImage imageU) | |
| toString | back to summary |
|---|---|
| public StringBuilder toString(StringBuilder sb) Overrides com.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides com. Doc from java. Returns a string representation of the object. | |
AWTGLPixelBuffer instances.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean |
| Access | Constructor and Description |
|---|---|
| public | AWTGLPixelBufferProvider(final boolean
If allowRowStride)true, allow row-stride, otherwise not.
See getAllowRowStride() and AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int).
If true, user shall decide whether to use a width-aligned image.
|
| Modifier and Type | Method and Description |
|---|---|
| public AWTGLPixelBuffer | allocate(final GL
the corresponding current gl, final PixelFormat.GL context objecthost hostPixComp,pixel format, i.e. of the source or sink depending on pack,
e.g. fetched via getHostPixelComp(GLProfile, int).
If null, pixelAttributes instance maybe used or an exception is thrown,
depending on implementation semantics.the desired pixelAttributes,GLPixelAttributes, e.g. fetched via getAttributes(GL, int, boolean)true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.in pixels width, final int in pixels height, final int in pixels depth, final int if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore. minByteSize)Implements com. GLPixelBuffer object.
|
| public boolean | |
| public GLPixelBuffer. | getAttributes(final GL
the corresponding current gl, final int GL context objectRGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA) componentCount, final boolean true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.Implements com. GLPixelAttributes matching GL, componentCount and pack.
|
| public GLPixelBuffer. | |
| public int | getAWTFormat(final GLProfile glp, final int componentCount)
Returns one of
|
| public PixelFormat | |
| public PixelFormat. | getHostPixelComp(final GLProfile
the corresponding current glp, final int GL context objectRGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA) componentCount)Implements com. PixelFormat. matching GL and componentCount
if required by implementation, otherwise null.
|
| allowRowStride | back to summary |
|---|---|
| private final boolean allowRowStride | |
| AWTGLPixelBufferProvider | back to summary |
|---|---|
public AWTGLPixelBufferProvider(final boolean allowRowStride)
| |
| allocate | back to summary |
|---|---|
| public AWTGLPixelBuffer allocate(final GL gl, final PixelFormat. Implements com. Doc from com. Allocates a new
The minimum required
Returns an array backed width*height*
| |
| getAllowRowStride | back to summary |
|---|---|
| public boolean getAllowRowStride() Implements com. Doc from com. Allow
| |
| getAttributes | back to summary |
|---|---|
| public GLPixelBuffer. Implements com. Doc from com. Returns RGB[A]
| |
| getAttributes | back to summary |
|---|---|
| public GLPixelBuffer. | |
| getAWTFormat | back to summary |
|---|---|
| public int getAWTFormat(final GLProfile glp, final int componentCount) Returns one of
| |
| getAWTPixelFormat | back to summary |
|---|---|
| public PixelFormat getAWTPixelFormat(final GLProfile glp, final int componentCount) | |
| getHostPixelComp | back to summary |
|---|---|
| public PixelFormat. Implements com. Doc from com. Returns the host
Returns a valid | |
AWTGLPixelBuffer instances.
Provider instance holds the last AWTGLPixelBuffer instance
allocated.
A new allocation
will return same instance, if a new buffer is not required.
The latter is true if size are compatible, hence allowRowStride should be enabled, if possible.
| Modifier and Type | Field and Description |
|---|---|
| private final IntObjectHashMap |
| Access | Constructor and Description |
|---|---|
| public | SingleAWTGLPixelBufferProvider(final boolean
If allowRowStride)true, allow row-stride, otherwise not. See AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int).
|
| Modifier and Type | Method and Description |
|---|---|
| public AWTGLPixelBuffer | allocate(final GL
the corresponding current gl, PixelFormat.GL context objecthost hostPixComp,pixel format, i.e. of the source or sink depending on pack,
e.g. fetched via getHostPixelComp(GLProfile, int).
If null, pixelAttributes instance maybe used or an exception is thrown,
depending on implementation semantics.the desired pixelAttributes,GLPixelAttributes, e.g. fetched via getAttributes(GL, int, boolean)true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.in pixels width, final int in pixels height, final int in pixels depth, final int if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore. minByteSize)Overrides com. Implements com. GLPixelBuffer object.
|
| private AWTGLPixelBuffer | allocateImpl(final PixelFormat.
|
| public void | dispose()
Implements com. |
| private static int | getHashCode(final PixelFormat.
|
| public AWTGLPixelBuffer | getSingleBuffer(final PixelFormat.
host hostPixelComp,pixel format, i.e. of the source or sink depending on pack,
e.g. fetched via getHostPixelComp(GLProfile, int).
If null, pixelAttributes instance maybe used or an exception is thrown,
depending on implementation semantics.the desired pixelAttributes,GLPixelAttributes, e.g. fetched via getAttributes(GL, int, boolean)true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.Implements com. allocated
AWTGLPixelBuffer, if compatible w/ the given PixelFormat. and GLPixelAttributes.
|
| public AWTGLPixelBuffer | Returns: the newly initialized singleAWTGLPixelBuffer, or null if already allocated.RGBA component count, i.e. 1 (luminance, alpha or red), 3 (RGB) or 4 (RGBA) componentCount, final boolean true for read mode GPU -> CPU, e.g. glReadPixels.
false for write mode CPU -> GPU, e.g. glTexImage2D.Implements com. AWTGLPixelBuffer w/ a given size, if not yet allocated.
|
| bufferMap | back to summary |
|---|---|
| private final IntObjectHashMap bufferMap | |
| SingleAWTGLPixelBufferProvider | back to summary |
|---|---|
public SingleAWTGLPixelBufferProvider(final boolean allowRowStride)
| |
| allocateImpl | back to summary |
|---|---|
| private AWTGLPixelBuffer allocateImpl(final PixelFormat. | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com. Doc from com. Dispose all resources.
| |
| getHashCode | back to summary |
|---|---|
| private static int getHashCode(final PixelFormat. | |
| initSingleton | back to summary |
|---|---|
| public AWTGLPixelBuffer initSingleton(final GLProfile glp, final int componentCount, final boolean pack, final int width, final int height, final int depth) Implements com. Initializes the single
| |