Présentation
Les fonctions ci-dessous peuvent être utilisées pour créer des allocations à partir d'un script.
Ces fonctions peuvent être appelées directement ou indirectement à partir d'une fonction pouvant être appelée. Si un chemin de flux de contrôle peut entraîner un appel à ces fonctions à partir d'une fonction de noyau RenderScript, une erreur de compilateur sera générée.
Résumé
| Fonctions | |
|---|---|
| rsCreateAllocation | Crée un objet "rs_allocation" du type donné. | 
| rsCreateElement | Crée un objet rs_element avec le type de données spécifié | 
| rsCreatePixelElement | Crée un objet rs_element avec le type de données et le genre de données spécifiés | 
| Type rsCreate | Crée un objet rs_type avec les attributs d'élément et de forme spécifiés. | 
| rsCreateVectorElement. | Crée un objet rs_element avec le type de données et la largeur vectorielle spécifiés | 
Fonctions
rsCreateAllocation : crée un objet rs_allocation du type donné.
| rs_allocation rsCreateAllocation(rs_type type); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation(type rs_type, rs_allocation_mipmap_control mipmap, uint32_t utilisations, void* ptr); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation(type rs_type, utilisation de uint32_t); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_char4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_double4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_float4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_half4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_int4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_long4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_short4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uchar4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_uint4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ulong4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort2(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort2(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort3(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort3(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort4(uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort4(uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_allocation rsCreateAllocation_ushort4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
Paramètres
| type | Type d'allocation | 
|---|---|
| utilisation | Option d'utilisation pour l'allocation | 
| mipmap | |
| utilisations | |
| pttr | |
| dimX | |
| dimY | |
| dimZ | 
Crée un objet rs_allocation du type et de l'utilisation indiqués.
RS_ALLOCATION_USAGE_SCRIPT et RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE sont les seuls indicateurs d'utilisation acceptés pour les allocations créées à partir d'un script RenderScript.
  Vous pouvez également utiliser les fonctions de wrapper rsCreateAllocation_
Par exemple, rsCreateAllocation_int4() renvoie une allocation de type de données int4 pour les dimensions spécifiées.
rsCreateElement : crée un objet rs_element avec le type de données spécifié
| rs_element rsCreateElement(int32_t data_type, int32_t data_kind, bool isNormalized, uint32_t vecSize); | Ajouté au niveau d'API 24 | 
| rs_element rsCreateElement(rs_data_type data_type); | Ajouté au niveau d'API 24 | 
Paramètres
| type_données | Type de données de l'élément | 
|---|---|
| genre_données | |
| ISNormalisée | |
| vecSize | 
Crée un objet rs_element avec le type de données spécifié. Le type de données de l'élément sera défini sur RS_KIND_USER et la largeur de données sur 1, indiquant une valeur non vectorielle.
rsCreatePixelElement : crée un objet rs_element avec le type et le genre de données spécifiés
| rs_element rsCreatePixelElement(rs_data_type data_type, rs_data_kind data_kind); | Ajouté au niveau d'API 24 | 
Paramètres
| type_données | Type de données de l'élément | 
|---|---|
| genre_données | Type de données de l'élément | 
Crée un objet rs_element avec le type et le genre de données spécifiés. La valeur "Vector_width" de l'élément est définie sur 1, ce qui indique une valeur non vectorielle.
rsCreateType : crée un objet rs_type avec les attributs d'élément et de forme spécifiés
| rs_type rsCreateType(élément rs_element, uint32_t dimX); | Ajouté au niveau d'API 24 | 
| rs_type rsCreateType(élément rs_element, uint32_t dimX, uint32_t dimY); | Ajouté au niveau d'API 24 | 
| rs_type rsCreateType(élément rs_element, uint32_t dimX, uint32_t dimY, uint32_t dimZ); | Ajouté au niveau d'API 24 | 
| rs_type rsCreateType(élément rs_element, uint32_t dimX, uint32_t dimY, uint32_t dimZ, bool mipmaps, bool faces, rs_yuv_format yuv_format); | Ajouté au niveau d'API 24 | 
Paramètres
| élément | Élément à associer au type | 
|---|---|
| dimX | Taille le long de la dimension X | 
| dimY | Taille le long de la dimension Y | 
| dimZ | Taille le long de la dimension Z | 
| mipmaps | Indicateur indiquant si le type comporte une chaîne de mipmaps | 
| visages | Indicateur indiquant si le type est un cubemap | 
| yuv_format | Mise en page YUV pour le type | 
Crée un objet rs_type avec les attributs d'élément et de forme spécifiés.
dimX spécifie la taille de la dimension X.
dimY, si présente et non nulle, indique que la dimension Y est présente et indique sa taille.
dimZ, si présente et non nulle, indique que la dimension Z est présente et indique sa taille.
mipmaps indique la présence de niveau de détail (LOD).
"faces" indique la présence de faces cubemap.
yuv_format indique le format YUV associé (ou RS_YUV_NONE).
rsCreateVectorElement : crée un objet rs_element avec le type de données et la largeur vectorielle spécifiés
| rs_element rsCreateVectorElement(rs_data_type data_type, uint32_t vector_width); | Ajouté au niveau d'API 24 | 
Paramètres
| type_données | Type de données de l'élément | 
|---|---|
| largeur_vectorielle | Largeur du vecteur (2, 3 ou 4) | 
Crée un objet rs_element avec le type de données et la largeur vectorielle spécifiés. La valeur de vector_width doit être 2, 3 ou 4. Le genre de données de l'élément est défini sur RS_KIND_USER.
