Top Description Inners Fields Constructors Methods
com.jogamp.nativewindow.awt

public final Class DirectDataBufferInt

extends DataBuffer
Class Inheritance
Imports
java.awt.Point, java.awt.color.ColorSpace, java.awt.image.BufferedImage, .ColorModel, .DataBuffer, .DirectColorModel, .SampleModel, .SinglePixelPackedSampleModel, .WritableRaster, java.nio.ByteBuffer, .IntBuffer, java.util.Hashtable, com.jogamp.common.nio.Buffers

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Field Summary

Modifier and TypeField and Description
private final ByteBuffer[]
bankdataBytes

All NIO data banks, ByteBuffer representation.

private final IntBuffer[]
bankdataInts

All NIO data banks, IntBuffer representation.

private final ByteBuffer
dataBytes

Default NIO data bank storage, ByteBuffer representation.

private final IntBuffer
dataInts

Default NIO data bank storage, IntBuffer representation.

Inherited from java.awt.image.DataBuffer:
banksdataTypeoffsetoffsetssizeTYPE_BYTETYPE_DOUBLETYPE_FLOATTYPE_INTTYPE_SHORTTYPE_UNDEFINEDTYPE_USHORT

Constructor Summary

AccessConstructor and Description
public
DirectDataBufferInt(final int
The size of the DataBuffer.
size
)

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

public
DirectDataBufferInt(final int
The size of the banks in the DataBuffer.
size
,
final int
The number of banks in the aDataBuffer.
numBanks
)

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

public
DirectDataBufferInt(final ByteBuffer
The NIO ByteBuffer array, holding the integer data for the DataBuffer.
dataArray
,
final int
The size of the DataBuffer bank.
size
)

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

Method Summary

Modifier and TypeMethod and Description
public static DirectDataBufferInt.BufferedImageInt
createBufferedImage(final int width, final int height, final int imageType, Point
origin, if null 0/0 is assumed.
location
,
final Hashtable<?, ?>
Hashtable of String/Object pairs. Used for BufferedImage#getProperty(String) etc.
properties
)

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

public IntBuffer

Returns:

The first integer data array.
getData
()

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

public IntBuffer

Returns:

The data array for the specified bank.
getData
(final int
The bank whose data array you want to get.
bank
)

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

public ByteBuffer

Returns:

The first integer data array.
getDataBytes
()

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

public ByteBuffer

Returns:

The data array for the specified bank.
getDataBytes
(final int
The bank whose data array you want to get.
bank
)

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

public int

Returns:

The requested data array element as an integer.
getElem
(final int
The data array element you want to get.
i
)

Overrides java.awt.image.DataBuffer.getElem.

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

Returns:

The requested data array element as an integer.
getElem
(final int
The bank from which you want to get a data array element.
bank
,
final int
The data array element you want to get.
i
)

Implements abstract java.awt.image.DataBuffer.getElem.

Returns the requested data array element from the specified bank.
public void
setElem(final int
The data array element you want to set.
i
,
final int
The integer value to which you want to set the data array element.
val
)

Overrides java.awt.image.DataBuffer.setElem.

Sets the requested data array element in the first (default) bank to the specified value.
public void
setElem(final int
The bank in which you want to set the data array element.
bank
,
final int
The data array element you want to set.
i
,
final int
The integer value to which you want to set the specified data array element.
val
)

Implements abstract java.awt.image.DataBuffer.setElem.

Sets the requested data array element in the specified bank to the integer value i.
Inherited from java.awt.image.DataBuffer:
getDataTypegetDataTypeSizegetElemDoublegetElemDoublegetElemFloatgetElemFloatgetNumBanksgetOffsetgetOffsetsgetSizesetElemDoublesetElemDoublesetElemFloatsetElemFloat

Field Detail

bankdataBytesback to summary
private final ByteBuffer[] bankdataBytes

All NIO data banks, ByteBuffer representation.

bankdataIntsback to summary
private final IntBuffer[] bankdataInts

All NIO data banks, IntBuffer representation.

dataBytesback to summary
private final ByteBuffer dataBytes

Default NIO data bank storage, ByteBuffer representation.

dataIntsback to summary
private final IntBuffer dataInts

Default NIO data bank storage, IntBuffer representation.

Constructor Detail

DirectDataBufferIntback to summary
public DirectDataBufferInt(final int size)

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

Parameters
size:int

The size of the DataBuffer.

DirectDataBufferIntback to summary
public 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
size:int

The size of the banks in the DataBuffer.

numBanks:int

The number of banks in the aDataBuffer.

DirectDataBufferIntback to summary
public 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
dataArray:ByteBuffer

The NIO ByteBuffer array, holding the integer data for the DataBuffer.

size:int

The size of the DataBuffer bank.

Method Detail

createBufferedImageback to summary
public static DirectDataBufferInt.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.
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
imageType:int

one of TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_RGB or TYPE_INT_BGR.

location:Point

origin, if null 0/0 is assumed.

properties:Hashtable<?, ?>

Hashtable of String/Object pairs. Used for BufferedImage#getProperty(String) etc.

getDataback to summary
public IntBuffer getData()

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

Returns:IntBuffer

The first integer data array.

See Also
getDataBytes()
getDataback to summary
public IntBuffer getData(final int bank)

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

Parameters
bank:int

The bank whose data array you want to get.

Returns:IntBuffer

The data array for the specified bank.

See Also
getDataBytes(int)
getDataBytesback to summary
public ByteBuffer getDataBytes()

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

Returns:ByteBuffer

The first integer data array.

See Also
getData()
getDataBytesback to summary
public ByteBuffer getDataBytes(final int bank)

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

Parameters
bank:int

The bank whose data array you want to get.

Returns:ByteBuffer

The data array for the specified bank.

See Also
getData(int)
getElemback to summary
public int getElem(final int i)

Overrides java.awt.image.DataBuffer.getElem.

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

Parameters
i:int

The data array element you want to get.

Returns:int

The requested data array element as an integer.

Annotations
@Override
See Also
setElem(int, int), setElem(int, int, int)
getElemback to summary
public int getElem(final int bank, final int i)

Implements abstract java.awt.image.DataBuffer.getElem.

Returns the requested data array element from the specified bank.

Parameters
bank:int

The bank from which you want to get a data array element.

i:int

The data array element you want to get.

Returns:int

The requested data array element as an integer.

Annotations
@Override
See Also
setElem(int, int), setElem(int, int, int)
setElemback to summary
public void setElem(final int i, final int val)

Overrides java.awt.image.DataBuffer.setElem.

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

Parameters
i:int

The data array element you want to set.

val:int

The integer value to which you want to set the data array element.

Annotations
@Override
See Also
getElem(int), getElem(int, int)
setElemback to summary
public void setElem(final int bank, final int i, final int val)

Implements abstract java.awt.image.DataBuffer.setElem.

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

Parameters
bank:int

The bank in which you want to set the data array element.

i:int

The data array element you want to set.

val:int

The integer value to which you want to set the specified data array element.

Annotations
@Override
See Also
getElem(int), getElem(int, int)
com.jogamp.nativewindow.awt back to summary

public Class DirectDataBufferInt.BufferedImageInt

extends BufferedImage
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final int
pack-priv final DirectDataBufferInt
Inherited from java.awt.image.BufferedImage:
TYPE_3BYTE_BGRTYPE_4BYTE_ABGRTYPE_4BYTE_ABGR_PRETYPE_BYTE_BINARYTYPE_BYTE_GRAYTYPE_BYTE_INDEXEDTYPE_CUSTOMTYPE_INT_ARGBTYPE_INT_ARGB_PRETYPE_INT_BGRTYPE_INT_RGBTYPE_USHORT_555_RGBTYPE_USHORT_565_RGBTYPE_USHORT_GRAY

Constructor Summary

AccessConstructor and Description
public
BufferedImageInt(final int customImageType, final ColorModel cm, final DirectDataBufferInt dataBuffer, final WritableRaster raster, final Hashtable<?, ?> properties)

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

one of the custom image-type values TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_RGB or TYPE_INT_BGR.
getCustomType
()

public DirectDataBufferInt
getDataBuffer()

Returns the underlying DirectDataBufferInt associated with this instance via Raster instance.

public String
toString()

Overrides java.awt.image.BufferedImage.toString.

Returns a String representation of this BufferedImage object and its values.
Inherited from java.awt.image.BufferedImage:
addTileObservercoerceDatacopyDatacreateGraphicsgetAlphaRastergetColorModelgetDatagetDatagetGraphicsgetHeightgetHeightgetMinTileXgetMinTileYgetMinXgetMinYgetNumXTilesgetNumYTilesgetPropertygetPropertygetPropertyNamesgetRastergetRGBgetRGBgetSampleModelgetSourcegetSourcesgetSubimagegetTilegetTileGridXOffsetgetTileGridYOffsetgetTileHeightgetTileWidthgetTransparencygetTypegetWidthgetWidthgetWritableTilegetWritableTileIndiceshasTileWritersisAlphaPremultipliedisTileWritablereleaseWritableTileremoveTileObserversetDatasetRGBsetRGB

Field Detail

customImageTypeback to summary
pack-priv final int customImageType
dataBufferback to summary
pack-priv final DirectDataBufferInt dataBuffer

Constructor Detail

BufferedImageIntback to summary
public BufferedImageInt(final int customImageType, final ColorModel cm, final DirectDataBufferInt dataBuffer, final WritableRaster raster, final Hashtable<?, ?> properties)

Method Detail

getCustomTypeback to summary
public int getCustomType()
Returns:int

one of the custom image-type values TYPE_INT_ARGB, TYPE_INT_ARGB_PRE, TYPE_INT_RGB or TYPE_INT_BGR.

getDataBufferback to summary
public DirectDataBufferInt getDataBuffer()

Returns the underlying DirectDataBufferInt associated with this instance via Raster instance.

toStringback to summary
public String toString()

Overrides java.awt.image.BufferedImage.toString.

Doc from java.awt.image.BufferedImage.toString.

Returns a String representation of this BufferedImage object and its values.

Returns:String

a String representing this BufferedImage.

Annotations
@Override
com.jogamp.nativewindow.awt back to summary

public Class DirectDataBufferInt.DirectWritableRaster

extends WritableRaster
Class Inheritance

Constructor Summary

AccessConstructor and Description
protected
DirectWritableRaster(final SampleModel sampleModel, final DirectDataBufferInt dataBuffer, final Point origin)

Method Summary

Inherited from java.awt.image.WritableRaster:
createWritableChildcreateWritableTranslatedChildgetWritableParentsetDataElementssetDataElementssetDataElementssetPixelsetPixelsetPixelsetPixelssetPixelssetPixelssetRectsetRectsetSamplesetSamplesetSamplesetSamplessetSamplessetSamples

Constructor Detail

DirectWritableRasterback to summary
protected DirectWritableRaster(final SampleModel sampleModel, final DirectDataBufferInt dataBuffer, final Point origin)