JOGL v2.6.0-rc-20250712
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.nativewindow.awt.DirectDataBufferInt Class Reference

DataBuffer specialization using NIO direct buffer of type DataBuffer#TYPE_INT as storage. More...

Inheritance diagram for com.jogamp.nativewindow.awt.DirectDataBufferInt:
Collaboration diagram for com.jogamp.nativewindow.awt.DirectDataBufferInt:

Classes

class  BufferedImageInt
 
class  DirectWritableRaster
 

Public Member Functions

 DirectDataBufferInt (final int size)
 Constructs an nio integer-based DataBuffer with a single bank and the specified size. More...
 
 DirectDataBufferInt (final int size, final int numBanks)
 Constructs an nio integer-based DataBuffer with the specified number of banks, all of which are the specified size. More...
 
 DirectDataBufferInt (final ByteBuffer dataArray, final int size)
 Constructs an nio integer-based DataBuffer with a single bank using the specified array. More...
 
IntBuffer getData ()
 Returns the default (first) int data array in DataBuffer as an IntBuffer representation. More...
 
ByteBuffer getDataBytes ()
 Returns the default (first) int data array in DataBuffer as a ByteBuffer representation. More...
 
IntBuffer getData (final int bank)
 Returns the data array for the specified bank as an IntBuffer representation. More...
 
ByteBuffer getDataBytes (final int bank)
 Returns the data array for the specified bank as a ByteBuffer representation. More...
 
int getElem (final int i)
 Returns the requested data array element from the first (default) bank. More...
 
int getElem (final int bank, final int i)
 Returns the requested data array element from the specified bank. More...
 
void setElem (final int i, final int val)
 Sets the requested data array element in the first (default) bank to the specified value. More...
 
void setElem (final int bank, final int i, final int val)
 Sets the requested data array element in the specified bank to the integer value i. More...
 

Static Public Member Functions

static BufferedImageInt createBufferedImage (final int width, final int height, final int imageType, Point location, final Hashtable<?,?> properties)
 Creates a BufferedImageInt using a direct color model in sRGB color space. More...
 

Detailed Description

DataBuffer specialization using NIO direct buffer of type DataBuffer#TYPE_INT as storage.

Definition at line 48 of file DirectDataBufferInt.java.

Constructor & Destructor Documentation

◆ DirectDataBufferInt() [1/3]

com.jogamp.nativewindow.awt.DirectDataBufferInt.DirectDataBufferInt ( final int  size)

Constructs an nio integer-based DataBuffer with a single bank and the specified size.

Parameters
sizeThe size of the DataBuffer.

Definition at line 194 of file DirectDataBufferInt.java.

Here is the caller graph for this function:

◆ DirectDataBufferInt() [2/3]

com.jogamp.nativewindow.awt.DirectDataBufferInt.DirectDataBufferInt ( final int  size,
final int  numBanks 
)

Constructs an nio integer-based DataBuffer with the specified number of banks, all of which are the specified size.

Parameters
sizeThe size of the banks in the DataBuffer.
numBanksThe number of banks in the aDataBuffer.

Definition at line 211 of file DirectDataBufferInt.java.

◆ DirectDataBufferInt() [3/3]

com.jogamp.nativewindow.awt.DirectDataBufferInt.DirectDataBufferInt ( final ByteBuffer  dataArray,
final int  size 
)

Constructs an nio integer-based DataBuffer with a single bank using the specified array.

Only the first size elements should be used by accessors of this DataBuffer. dataArray must be large enough to hold size elements.

Parameters
dataArrayThe NIO ByteBuffer array, holding the integer data for the DataBuffer.
sizeThe size of the DataBuffer bank.

Definition at line 235 of file DirectDataBufferInt.java.

Member Function Documentation

◆ createBufferedImage()

static BufferedImageInt com.jogamp.nativewindow.awt.DirectDataBufferInt.createBufferedImage ( final int  width,
final int  height,
final int  imageType,
Point  location,
final Hashtable<?,?>  properties 
)
static

Creates a BufferedImageInt using a direct color model in sRGB color space.


It uses a DirectWritableRaster utilizing DirectDataBufferInt storage.

Note that due to using the custom storage type DirectDataBufferInt, the resulting BufferedImage's image-type is of TYPE_CUSTOM. We are not able to change this detail, since the AWT image implementation associates the image-type with a build-in storage-type. Use BufferedImageInt#getCustomType() to retrieve the custom image-type, which will return the imageType value passed here.

Parameters
width
height
imageTypeone of TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_RGB or TYPE_INT_BGR.
locationorigin, if null 0/0 is assumed.
propertiesHashtable of String/Object pairs. Used for BufferedImage#getProperty(String) etc.
Returns

Definition at line 109 of file DirectDataBufferInt.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getData() [1/2]

IntBuffer com.jogamp.nativewindow.awt.DirectDataBufferInt.getData ( )

Returns the default (first) int data array in DataBuffer as an IntBuffer representation.

Returns
The first integer data array.
See also
getDataBytes()

Definition at line 251 of file DirectDataBufferInt.java.

◆ getData() [2/2]

IntBuffer com.jogamp.nativewindow.awt.DirectDataBufferInt.getData ( final int  bank)

Returns the data array for the specified bank as an IntBuffer representation.

Parameters
bankThe bank whose data array you want to get.
Returns
The data array for the specified bank.
See also
getDataBytes(int)

Definition at line 271 of file DirectDataBufferInt.java.

◆ getDataBytes() [1/2]

ByteBuffer com.jogamp.nativewindow.awt.DirectDataBufferInt.getDataBytes ( )

Returns the default (first) int data array in DataBuffer as a ByteBuffer representation.

Returns
The first integer data array.
See also
getData()

Definition at line 260 of file DirectDataBufferInt.java.

◆ getDataBytes() [2/2]

ByteBuffer com.jogamp.nativewindow.awt.DirectDataBufferInt.getDataBytes ( final int  bank)

Returns the data array for the specified bank as a ByteBuffer representation.

Parameters
bankThe bank whose data array you want to get.
Returns
The data array for the specified bank.
See also
getData(int)

Definition at line 281 of file DirectDataBufferInt.java.

◆ getElem() [1/2]

int com.jogamp.nativewindow.awt.DirectDataBufferInt.getElem ( final int  bank,
final int  i 
)

Returns the requested data array element from the specified bank.

Parameters
bankThe bank from which you want to get a data array element.
iThe data array element you want to get.
Returns
The requested data array element as an integer.
See also
setElem(int, int)
setElem(int, int, int)

Definition at line 308 of file DirectDataBufferInt.java.

◆ getElem() [2/2]

int com.jogamp.nativewindow.awt.DirectDataBufferInt.getElem ( final int  i)

Returns the requested data array element from the first (default) bank.

Parameters
iThe data array element you want to get.
Returns
The requested data array element as an integer.
See also
setElem(int, int)
setElem(int, int, int)

Definition at line 294 of file DirectDataBufferInt.java.

◆ setElem() [1/2]

void com.jogamp.nativewindow.awt.DirectDataBufferInt.setElem ( final int  bank,
final int  i,
final int  val 
)

Sets the requested data array element in the specified bank to the integer value i.

Parameters
bankThe bank in which you want to set the data array element.
iThe data array element you want to set.
valThe integer value to which you want to set the specified data array element.
See also
getElem(int)
getElem(int, int)

Definition at line 336 of file DirectDataBufferInt.java.

◆ setElem() [2/2]

void com.jogamp.nativewindow.awt.DirectDataBufferInt.setElem ( final int  i,
final int  val 
)

Sets the requested data array element in the first (default) bank to the specified value.

Parameters
iThe data array element you want to set.
valThe integer value to which you want to set the data array element.
See also
getElem(int)
getElem(int, int)

Definition at line 322 of file DirectDataBufferInt.java.


The documentation for this class was generated from the following file: