AllocationAdapter

public class AllocationAdapter
extends Allocation

java.lang.Object
   ↳ android.renderscript.BaseObj
     ↳ android.renderscript.Allocation
       ↳ android.renderscript.AllocationAdapter


This class was deprecated in API level 31.
Renderscript has been deprecated in API level 31. Please refer to the migration guide for the proposed alternatives.

Only intended for use by generated reflected code.

Summary

Inherited constants

Public methods

static AllocationAdapter create1D(RenderScript rs, Allocation a)
static AllocationAdapter create2D(RenderScript rs, Allocation a)
static AllocationAdapter createTyped(RenderScript rs, Allocation a, Type t)

Create an arbitrary window into the base allocation.

void resize(int dimX)

This method is deprecated. RenderScript objects should be immutable once created. The replacement is to create a new allocation and copy the contents. This function will throw an exception if API 21 or higher is used.

void setFace(Type.CubemapFace cf)

Set the active Face.

void setLOD(int lod)

Set the active LOD.

void setX(int x)

Set the active X.

void setY(int y)

Set the active Y.

void setZ(int z)

Set the active Z.

Inherited methods

Public methods

create1D

Added in API level 14
Deprecated in API level 31
public static AllocationAdapter create1D (RenderScript rs, 
                Allocation a)

Parameters
rs RenderScript

a Allocation

Returns
AllocationAdapter

create2D

Added in API level 11
public static AllocationAdapter create2D (RenderScript rs, 
                Allocation a)

Parameters
rs RenderScript

a Allocation

Returns
AllocationAdapter

createTyped

Added in API level 23
Deprecated in API level 31
public static AllocationAdapter createTyped (RenderScript rs, 
                Allocation a, 
                Type t)

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.

Parameters
rs RenderScript

a Allocation

t Type

Returns
AllocationAdapter

resize

Added in API level 11
public void resize (int dimX)

This method is deprecated.
RenderScript objects should be immutable once created. The replacement is to create a new allocation and copy the contents. This function will throw an exception if API 21 or higher is used.

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

Parameters
dimX int: ignored.

setFace

Added in API level 11
public void setFace (Type.CubemapFace cf)

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
public void setLOD (int lod)

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
public void setX (int x)

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
public void setY (int y)

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
public void setZ (int z)

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.