Added in API level 11
Deprecated in API level 31

AllocationAdapter


open class AllocationAdapter : Allocation

Only intended for use by generated reflected code.

Summary

Inherited constants
Int USAGE_GRAPHICS_CONSTANTS

The Allocation will be used as the source of shader constants by one or more programs. This was deprecated in API level 16.

Int USAGE_GRAPHICS_RENDER_TARGET

The Allocation will be used as a target for offscreen rendering This was deprecated in API level 16.

Int USAGE_GRAPHICS_TEXTURE

The Allocation will be used as a texture source by one or more graphics programs.

Int USAGE_GRAPHICS_VERTEX

The Allocation will be used as a graphics mesh. This was deprecated in API level 16.

Int USAGE_IO_INPUT

The Allocation will be used as a android.view.Surface consumer. This usage will cause the Allocation to be created as read-only.

Int USAGE_IO_OUTPUT

The Allocation will be used as a android.view.Surface producer. The dimensions and format of the will be forced to those of the Allocation.

Int USAGE_SCRIPT

The Allocation will be bound to and accessed by scripts.

Int USAGE_SHARED

The Allocation's backing store will be inherited from another object (usually a android.graphics.Bitmap); copying to or from the original source Bitmap will cause a synchronization rather than a full copy. syncAll may also be used to synchronize the Allocation and the source Bitmap.

This is set by default for allocations created with #createFromBitmap in API version 18 and higher.

Public methods
open static AllocationAdapter!

open static AllocationAdapter!

open static AllocationAdapter!

Create an arbitrary window into the base allocation.

open Unit
resize(dimX: Int)

Override the Allocation resize.

open Unit

Set the active Face.

open Unit
setLOD(lod: Int)

Set the active LOD.

open Unit
setX(x: Int)

Set the active X.

open Unit
setY(y: Int)

Set the active Y.

open Unit
setZ(z: Int)

Set the active Z.

Inherited functions
Unit copy1DRangeFrom(off: Int, count: Int, data: Allocation!, dataOff: Int)

Copy part of an Allocation into this Allocation.

Unit copy1DRangeFrom(off: Int, count: Int, d: ByteArray!)

Copy an array into a 1D region of this Allocation. This variant is type checked and will generate exceptions if the Allocation's is not an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFrom(off: Int, count: Int, d: FloatArray!)

Copy an array into a 1D region of this Allocation. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFrom(off: Int, count: Int, d: IntArray!)

Copy an array into a 1D region of this Allocation. This variant is type checked and will generate exceptions if the Allocation's is not an 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFrom(off: Int, count: Int, array: Any!)

Copy an array into a 1D region of this Allocation. This variant is type checked and will generate exceptions if the Allocation's does not match the component type of the array passed in.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFrom(off: Int, count: Int, d: ShortArray!)

Copy an array into a 1D region of this Allocation. This variant is type checked and will generate exceptions if the Allocation's is not an 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFromUnchecked(off: Int, count: Int, d: ByteArray!)

Copy an array into a 1D region of this Allocation. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFromUnchecked(off: Int, count: Int, d: FloatArray!)

Copy an array into a 1D region of this Allocation. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFromUnchecked(off: Int, count: Int, d: IntArray!)

Copy an array into a 1D region of this Allocation. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFromUnchecked(off: Int, count: Int, array: Any!)

Copy an array into a 1D region of this Allocation. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeFromUnchecked(off: Int, count: Int, d: ShortArray!)

Copy an array into a 1D region of this Allocation. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeTo(off: Int, count: Int, d: ByteArray!)

Copy a 1D region of this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's is neither an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeTo(off: Int, count: Int, d: FloatArray!)

Copy a 1D region of this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeTo(off: Int, count: Int, d: IntArray!)

Copy a 1D region of this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeTo(off: Int, count: Int, array: Any!)

Copy a 1D region of this Allocation into an array. This method is type checked and will generate exceptions if the Allocation's does not match the component type of the array passed in.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeTo(off: Int, count: Int, d: ShortArray!)

Copy a 1D region of this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's is neither a 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeToUnchecked(off: Int, count: Int, d: ByteArray!)

Copy a 1D region of this Allocation into an array. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeToUnchecked(off: Int, count: Int, d: FloatArray!)

Copy a 1D region of this Allocation into an array. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeToUnchecked(off: Int, count: Int, d: IntArray!)

Copy a 1D region of this Allocation into an array. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeToUnchecked(off: Int, count: Int, array: Any!)

Copy a 1D region of this Allocation into an array. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy1DRangeToUnchecked(off: Int, count: Int, d: ShortArray!)

Copy a 1D region of this Allocation into an array. This method does not guarantee that the Allocation is compatible with the input buffer.

The size of the region is: count * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, data: Bitmap!)

Copy a android.graphics.Bitmap into an Allocation. The height and width of the update will use the height and width of the .

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, data: Allocation!, dataXoff: Int, dataYoff: Int)

Copy a rectangular region from an Allocation into a rectangular region in this Allocation.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, data: ByteArray!)

Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's is not an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, data: FloatArray!)

Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, data: IntArray!)

Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's is not a 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, array: Any!)

Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's does not match the input data type.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeFrom(xoff: Int, yoff: Int, w: Int, h: Int, data: ShortArray!)

Copy from an array into a rectangular region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's is not a 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeTo(xoff: Int, yoff: Int, w: Int, h: Int, data: ByteArray!)

Copy from a rectangular region in this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's android.renderscript.Element is neither an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeTo(xoff: Int, yoff: Int, w: Int, h: Int, data: FloatArray!)

Copy from a rectangular region in this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's android.renderscript.Element is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeTo(xoff: Int, yoff: Int, w: Int, h: Int, data: IntArray!)

Copy from a rectangular region in this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's android.renderscript.Element is neither a 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeTo(xoff: Int, yoff: Int, w: Int, h: Int, array: Any!)

Copy from a rectangular region in this Allocation into an array. This method is type checked and will generate exceptions if the Allocation's android.renderscript.Element does not match the component type of the array passed in.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy2DRangeTo(xoff: Int, yoff: Int, w: Int, h: Int, data: ShortArray!)

Copy from a rectangular region in this Allocation into an array. This variant is type checked and will generate exceptions if the Allocation's android.renderscript.Element is neither a 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

The size of the region is: w * h * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy3DRangeFrom(xoff: Int, yoff: Int, zoff: Int, w: Int, h: Int, d: Int, data: Allocation!, dataXoff: Int, dataYoff: Int, dataZoff: Int)

Copy a rectangular region into the allocation from another allocation.

Unit copy3DRangeFrom(xoff: Int, yoff: Int, zoff: Int, w: Int, h: Int, d: Int, array: Any!)

Copy from an array into a 3D region in this Allocation. The array is assumed to be tightly packed. This variant is type checked and will generate exceptions if the Allocation's does not match the input data type.

The size of the region is: w * h * d * getElement.android.renderscript.Element#getBytesSize.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the region.

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the region. The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the region. The padding bytes for the cells must not be part of the array.

Unit copy3DRangeTo(xoff: Int, yoff: Int, zoff: Int, w: Int, h: Int, d: Int, array: Any!)

Unit copyFrom(b: Bitmap!)

Copy into an Allocation from a android.graphics.Bitmap. The height, width, and format of the bitmap must match the existing allocation.

If the android.graphics.Bitmap is the same as the used to create the Allocation with #createFromBitmap and USAGE_SHARED is set on the Allocation, this will synchronize the Allocation with the latest data from the , potentially avoiding the actual copy.

Unit copyFrom(a: Allocation!)

Copy an Allocation from an Allocation. The types of both allocations must be identical.

Unit copyFrom(d: Array<BaseObj!>!)

Copy an array of RS objects to the Allocation.

Unit copyFrom(d: ByteArray!)

Copy into this Allocation from an array. This variant is type checked and will generate exceptions if the Allocation's is not an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFrom(d: FloatArray!)

Copy into this Allocation from an array. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFrom(d: IntArray!)

Copy into this Allocation from an array. This variant is type checked and will generate exceptions if the Allocation's is not a 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFrom(array: Any!)

Copy into this Allocation from an array. This variant is type checked and will generate exceptions if the Allocation's does not match the array's primitive type.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFrom(d: ShortArray!)

Copy into this Allocation from an array. This variant is type checked and will generate exceptions if the Allocation's is not a 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFromUnchecked(d: ByteArray!)

Copy into this Allocation from an array. This method does not guarantee that the Allocation is compatible with the input buffer; it copies memory without reinterpretation.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFromUnchecked(d: FloatArray!)

Copy into this Allocation from an array. This method does not guarantee that the Allocation is compatible with the input buffer; it copies memory without reinterpretation.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFromUnchecked(d: IntArray!)

Copy into this Allocation from an array. This method does not guarantee that the Allocation is compatible with the input buffer; it copies memory without reinterpretation.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFromUnchecked(array: Any!)

Copy into this Allocation from an array. This method does not guarantee that the Allocation is compatible with the input buffer; it copies memory without reinterpretation.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyFromUnchecked(d: ShortArray!)

Copy into this Allocation from an array. This method does not guarantee that the Allocation is compatible with the input buffer; it copies memory without reinterpretation.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells must be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyTo(b: Bitmap!)

Copy from the Allocation into a android.graphics.Bitmap. The bitmap must match the dimensions of the Allocation.

Unit copyTo(d: ByteArray!)

Copy from the Allocation into a byte array. This variant is type checked and will generate exceptions if the Allocation's is neither an 8 bit integer nor a vector of 8 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells will be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyTo(d: FloatArray!)

Copy from the Allocation into a float array. This variant is type checked and will generate exceptions if the Allocation's is neither a 32 bit float nor a vector of 32 bit floats android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells will be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyTo(d: IntArray!)

Copy from the Allocation into a int array. This variant is type checked and will generate exceptions if the Allocation's is not a 32 bit integer nor a vector of 32 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells will be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyTo(array: Any!)

Copy from the Allocation into an array. The method is type checked and will generate exceptions if the Allocation's does not match the input data type.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells will be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Unit copyTo(d: ShortArray!)

Copy from the Allocation into a short array. This variant is type checked and will generate exceptions if the Allocation's is not a 16 bit integer nor a vector of 16 bit integers android.renderscript.Element.DataType.

If the Allocation does not have Vec3 Elements, then the size of the array in bytes must be at least the size of the Allocation getBytesSize().

If the Allocation has Vec3 Elements and AutoPadding is disabled, then the size of the array in bytes must be at least the size of the Allocation getBytesSize(). The padding bytes for the cells will be part of the array.

If the Allocation has Vec3 Elements and AutoPadding is enabled, then the size of the array in bytes must be at least 3/4 the size of the Allocation getBytesSize(). The padding bytes for the cells must not be part of the array.

Array<Allocation!>! createAllocations(rs: RenderScript!, t: Type!, usage: Int, numAlloc: Int)

Creates a new Allocation Array with the given , and usage flags. Note: If the input allocation is of usage: USAGE_IO_INPUT, the created Allocation will be sharing the same BufferQueue.

Allocation! createCubemapFromBitmap(rs: RenderScript!, b: Bitmap!)

Creates a non-mipmapped cubemap Allocation for use as a graphics texture from a android.graphics.Bitmap containing the horizontal list of cube faces. Each face must be a square, have the same size as all other faces, and have a width that is a power of 2.

Allocation! createCubemapFromBitmap(rs: RenderScript!, b: Bitmap!, mips: Allocation.MipmapControl!, usage: Int)

Creates a cubemap Allocation from a android.graphics.Bitmap containing the horizontal list of cube faces. Each face must be a square, have the same size as all other faces, and have a width that is a power of 2.

Allocation! createCubemapFromCubeFaces(rs: RenderScript!, xpos: Bitmap!, xneg: Bitmap!, ypos: Bitmap!, yneg: Bitmap!, zpos: Bitmap!, zneg: Bitmap!)

Creates a non-mipmapped cubemap Allocation for use as a sampler input from 6 android.graphics.Bitmap objects containing the cube faces. Each face must be a square, have the same size as all other faces, and have a width that is a power of 2.

Allocation! createCubemapFromCubeFaces(rs: RenderScript!, xpos: Bitmap!, xneg: Bitmap!, ypos: Bitmap!, yneg: Bitmap!, zpos: Bitmap!, zneg: Bitmap!, mips: Allocation.MipmapControl!, usage: Int)

Creates a cubemap Allocation from 6 android.graphics.Bitmap objects containing the cube faces. Each face must be a square, have the same size as all other faces, and have a width that is a power of 2.

Allocation! createFromBitmap(rs: RenderScript!, b: Bitmap!)

Creates an Allocation from a android.graphics.Bitmap.

With target API version 18 or greater, this Allocation will be created with USAGE_SHARED, USAGE_SCRIPT, and USAGE_GRAPHICS_TEXTURE. With target API version 17 or lower, this Allocation will be created with USAGE_GRAPHICS_TEXTURE.

Allocation! createFromBitmap(rs: RenderScript!, b: Bitmap!, mips: Allocation.MipmapControl!, usage: Int)

Creates an Allocation from a android.graphics.Bitmap.

Allocation! createFromBitmapResource(rs: RenderScript!, res: Resources!, id: Int)

Creates a non-mipmapped Allocation to use as a graphics texture from the android.graphics.Bitmap referenced by resource ID.

With target API version 18 or greater, this allocation will be created with USAGE_SCRIPT and USAGE_GRAPHICS_TEXTURE. With target API version 17 or lower, this allocation will be created with USAGE_GRAPHICS_TEXTURE.

Allocation! createFromBitmapResource(rs: RenderScript!, res: Resources!, id: Int, mips: Allocation.MipmapControl!, usage: Int)

Creates an Allocation from the Bitmap referenced by resource ID.

Allocation! createFromString(rs: RenderScript!, str: String!, usage: Int)

Creates an Allocation containing string data encoded in UTF-8 format.

Allocation! createSized(rs: RenderScript!, e: Element!, count: Int)

Creates an Allocation with a specified number of given elements

Allocation! createSized(rs: RenderScript!, e: Element!, count: Int, usage: Int)

Creates an Allocation with a specified number of given elements

Allocation! createTyped(rs: RenderScript!, type: Type!)

Creates an Allocation for use by scripts with a given and no mipmaps

Allocation! createTyped(rs: RenderScript!, type: Type!, mips: Allocation.MipmapControl!, usage: Int)

Creates a new Allocation with the given , mipmap flag, and usage flags.

Allocation! createTyped(rs: RenderScript!, type: Type!, usage: Int)

Creates an Allocation with the size specified by the type and no mipmaps generated by default

Unit destroy()

For USAGE_IO_OUTPUT, destroy() implies setSurface(null).

Unit finalize()

Unit generateMipmaps()

Generate a mipmap chain. This is only valid if the Type of the Allocation includes mipmaps.

This function will generate a complete set of mipmaps from the top level LOD and place them into the script memory space.

If the Allocation is also using other memory spaces, a call to syncAll(Allocation.USAGE_SCRIPT) is required.

ByteBuffer! getByteBuffer()

Gets or creates a ByteBuffer that contains the raw data of the current Allocation.

If the Allocation is created with USAGE_IO_INPUT, the returned ByteBuffer would contain the up-to-date data as READ ONLY. For a 2D or 3D Allocation, the raw data maybe padded so that each row of the Allocation has certain alignment. The size of each row including padding, called stride, can be queried using the getStride() method. Note: Operating on the ByteBuffer of a destroyed Allocation will triger errors.

Int getBytesSize()

Get the size of the Allocation in bytes.

Element! getElement()

Get the android.renderscript.Element of the of the Allocation.

Long getStride()

Gets the stride of the Allocation. For a 2D or 3D Allocation, the raw data maybe padded so that each row of the Allocation has certain alignment. The size of each row including such padding is called stride.

Surface! getSurface()

Returns the handle to a raw buffer that is being managed by the screen compositor. This operation is only valid for Allocations with USAGE_IO_INPUT.

Long getTimeStamp()

Get the timestamp for the most recent buffer held by this Allocation. The timestamp is guaranteed to be unique and monotonically increasing. Default value: -1. The timestamp will be updated after each ioReceive() call. It can be used to identify the images by comparing the unique timestamps when used with android.hardware.camera2 APIs. Example steps: 1. Save android.hardware.camera2.TotalCaptureResult when the capture is completed. 2. Get the timestamp after ioReceive() call. 3. Comparing totalCaptureResult.get(CaptureResult.SENSOR_TIMESTAMP) with alloc.getTimeStamp().

Type! getType()

Get the android.renderscript.Type of the Allocation.

Int getUsage()

Get the usage flags of the Allocation.

Unit ioReceive()

Receive the latest input into the Allocation. This operation is only valid if USAGE_IO_INPUT is set on the Allocation.

Unit ioSend()

Send a buffer to the output stream. The contents of the Allocation will be undefined after this operation. This operation is only valid if USAGE_IO_OUTPUT is set on the Allocation.

Unit setAutoPadding(useAutoPadding: Boolean)

Specifies the mapping between the Allocation's cells and an array's elements when data is copied from the Allocation to the array, or vice-versa. Only applies to an Allocation whose Element is a vector of length 3 (such as Element.U8_3 or Element.RGB_888). Enabling this feature may make copying data from the Allocation to an array or vice-versa less efficient.

Vec3 Element cells are stored in an Allocation as Vec4 Element cells with the same android.renderscript.Element.DataType, with the fourth vector component treated as padding. When this feature is enabled, only the data components, i.e. the first 3 vector components of each cell, will be mapped between the array and the Allocation. When disabled, explicit mapping of the padding components is required, as described in the following example.

For example, when copying an integer array to an Allocation of two android.renderscript.Element#I32_3 cells using copyFrom(int[]):

When disabled: The array must have at least 8 integers, with the first 4 integers copied to the first cell of the Allocation, and the next 4 integers copied to the second cell. The 4th and 8th integers are mapped as the padding components.

When enabled: The array just needs to have at least 6 integers, with the first 3 integers copied to the the first cell as data components, and the next 3 copied to the second cell. There is no mapping for the padding components.

Similarly, when copying a byte array to an Allocation of two android.renderscript.Element#I32_3 cells, using copyFromUnchecked(int[]):

When disabled: The array must have at least 32 bytes, with the first 16 bytes copied to the first cell of the Allocation, and the next 16 bytes copied to the second cell. The 13th-16th and 29th-32nd bytes are mapped as padding components.

When enabled: The array just needs to have at least 24 bytes, with the first 12 bytes copied to the first cell of the Allocation, and the next 12 bytes copied to the second cell. There is no mapping for the padding components.

Similar to copying data to an Allocation from an array, when copying data from an Allocation to an array, the padding components for Vec3 Element cells will not be copied/mapped to the array if AutoPadding is enabled.

Default: Disabled.

Unit setFromFieldPacker(xoff: Int, fp: FieldPacker!)

This is only intended to be used by auto-generated code reflected from the RenderScript script files and should not be used by developers.

Unit setFromFieldPacker(xoff: Int, component_number: Int, fp: FieldPacker!)

This is only intended to be used by auto-generated code reflected from the RenderScript script files and should not be used by developers.

Unit setFromFieldPacker(xoff: Int, yoff: Int, zoff: Int, component_number: Int, fp: FieldPacker!)

This is only intended to be used by auto-generated code reflected from the RenderScript script files and should not be used by developers.

Unit setOnBufferAvailableListener(callback: Allocation.OnBufferAvailableListener!)

Set a notification handler for USAGE_IO_INPUT.

Unit setSurface(sur: Surface!)

Associate a android.view.Surface with this Allocation. This operation is only valid for Allocations with USAGE_IO_OUTPUT.

Unit syncAll(srcLocation: Int)

Propagate changes from one usage of the Allocation to the other usages of the Allocation.

Boolean equals(other: Any?)

Compare the current BaseObj with another BaseObj for equality.

String! getName()

Int hashCode()

Calculates the hash code value for a BaseObj.

Unit setName(name: String!)

setName assigns a name to an object. This object can later be looked up by this name.

Public methods

create1D

Added in API level 14
Deprecated in API level 31
open static fun create1D(
    rs: RenderScript!,
    a: Allocation!
): AllocationAdapter!

Deprecated: Deprecated in Java.

create2D

Added in API level 11
open static fun create2D(
    rs: RenderScript!,
    a: Allocation!
): AllocationAdapter!

Deprecated: Deprecated in Java.

createTyped

Added in API level 23
Deprecated in API level 31
open static fun createTyped(
    rs: RenderScript!,
    a: Allocation!,
    t: Type!
): AllocationAdapter!

Deprecated: Deprecated in Java.

Create an arbitrary window into the base allocation. The type describes the shape of the window. Any dimensions present in the type must be equal or smaller to the dimensions in the source allocation. A dimension present in the allocation that is not present in the type will be constrained away with the selectors. If a dimension is present in both the type and allocation, one of two things will happen. If the type is smaller than the allocation, a window will be created, the selected value in the adapter for that dimension will act as the base address, and the type will describe the size of the view starting at that point. If the type and allocation dimension are of the same size, then setting the selector for the dimension will be an error.

resize

Added in API level 11
open fun resize(dimX: Int): Unit

Deprecated: Deprecated in Java.

Override the Allocation resize. Resizing adapters is not allowed and will throw a RSInvalidStateException.

Parameters
dimX Int: ignored.

setFace

Added in API level 11
open fun setFace(cf: Type.CubemapFace!): Unit

Deprecated: Deprecated in Java.

Set the active Face. The base allocation must be of a type that includes faces.

Parameters
cf Type.CubemapFace!: The face to make active.

setLOD

Added in API level 11
open fun setLOD(lod: Int): Unit

Deprecated: Deprecated in Java.

Set the active LOD. The LOD must be within the range for the type being adapted. The base allocation must have mipmaps. Because this changes the dimensions of the adapter the current Y and Z will be reset.

Parameters
lod Int: The LOD to make active.

setX

Added in API level 23
Deprecated in API level 31
open fun setX(x: Int): Unit

Deprecated: Deprecated in Java.

Set the active X. The x value must be within the range for the allocation being adapted.

Parameters
x Int: The x to make active.

setY

Added in API level 11
open fun setY(y: Int): Unit

Deprecated: Deprecated in Java.

Set the active Y. The y value must be within the range for the allocation being adapted. The base allocation must contain the Y dimension.

Parameters
y Int: The y to make active.

setZ

Added in API level 11
open fun setZ(z: Int): Unit

Deprecated: Deprecated in Java.

Set the active Z. The z value must be within the range for the allocation being adapted. The base allocation must contain the Z dimension.

Parameters
z Int: The z to make active.