public class Type extends BaseObj
A Type describes the Element
and
dimensions used for an Allocation
or
a parallel operation. Types are created through
Type.Builder
.
A Type always includes an Element
and an X dimension. A Type may be multidimensional, up to three dimensions.
A nonzero value in the Y or Z dimensions indicates that the dimension is
present. Note that a Type with only a given X dimension and a Type with the
same X dimension but Y = 1 are not equivalent.
A Type also supports inclusion of level of detail (LOD) or cube map faces. LOD and cube map faces are booleans to indicate present or not present.
A Type also supports YUV format information to support an Allocation
in a YUV format. The YUV formats
supported are ImageFormat.YV12
and ImageFormat.NV21
.
For more information about creating an application that uses RenderScript, read the RenderScript developer guide.
Modifier and Type | Class and Description |
---|---|
static class |
Type.Builder
Builder class for Type.
|
static class |
Type.CubemapFace |
Modifier and Type | Method and Description |
---|---|
static Type |
createX(RenderScript rs,
Element e,
int dimX)
Utility function for creating basic 1D types.
|
static Type |
createXY(RenderScript rs,
Element e,
int dimX,
int dimY)
Utility function for creating basic 2D types.
|
static Type |
createXYZ(RenderScript rs,
Element e,
int dimX,
int dimY,
int dimZ)
Utility function for creating basic 3D types.
|
int |
getCount()
Return the total number of accessable cells in the Type.
|
long |
getDummyType(RenderScript mRS,
long eid) |
Element |
getElement()
Return the element associated with this Type.
|
int |
getX()
Return the value of the X dimension.
|
int |
getY()
Return the value of the Y dimension or 0 for a 1D allocation.
|
int |
getYuv()
Get the YUV format
|
int |
getZ()
Return the value of the Z dimension or 0 for a 1D or 2D allocation.
|
boolean |
hasFaces()
Return if the Type is a cube map.
|
boolean |
hasMipmaps()
Return if the Type has a mipmap chain.
|
public Element getElement()
public int getX()
public int getY()
public int getZ()
public int getYuv()
public boolean hasMipmaps()
public boolean hasFaces()
public int getCount()
public long getDummyType(RenderScript mRS, long eid)
public static Type createX(RenderScript rs, Element e, int dimX)
rs
- The RenderScript contexte
- The Element for the TypedimX
- The X dimension, must be > 0public static Type createXY(RenderScript rs, Element e, int dimX, int dimY)
rs
- The RenderScript contexte
- The Element for the TypedimX
- The X dimension, must be > 0dimY
- The Y dimension, must be > 0public static Type createXYZ(RenderScript rs, Element e, int dimX, int dimY, int dimZ)
rs
- The RenderScript contexte
- The Element for the TypedimX
- The X dimension, must be > 0dimY
- The Y dimension, must be > 0dimZ
- The Z dimension, must be > 0