סקירה כללית
אפשר להשתמש בפונקציות הבאות כדי ליצור הקצאות מסקריפט.
אפשר להפעיל את הפונקציות האלה באופן ישיר או עקיף מפונקציה שניתן להפעיל. אם נתיב כלשהו של תהליך הבקרה יכול לגרום לקריאה לפונקציות האלה מתוך פונקציית ליבה של RenderScript, תיווצר שגיאה במהדר.
סיכום
פונקציות | |
---|---|
rsCreateAllocation | יצירת אובייקט rs_allocation מסוג נתון. |
rsCreateElement | יצירת אובייקט rs_element מסוג הנתונים שצוין |
rsCreatePixelElement | יצירת אובייקט rs_element מסוג הנתונים וסוג הנתונים שצוינו |
rsCreateType | יצירת אובייקט rs_type עם מאפייני הרכיב והצורה שצוינו |
rsCreateVectorElement | יצירת אובייקט rs_element מסוג הנתונים ורוחבו של הווקטור שצוינו |
פונקציות
rsCreateAllocation : יצירת אובייקט rs_allocation מסוג נתון.
rs_allocation rsCreateAllocation(rs_type type); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation(rs_type type, rs_allocation_mipmap_control mipmap, uint32_t usages, void* ptr); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation(rs_type type, uint32_t usage); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_char4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_double4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_float4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_half4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_int4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_long4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_short4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uchar4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_uint4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ulong4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort2(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort2(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort2(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort3(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort3(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort3(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort4(uint32_t dimX); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort4(uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_allocation rsCreateAllocation_ushort4(uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
פרמטרים
סוג | סוג ההקצאה |
---|---|
שימוש | דגל השימוש להקצאה |
mipmap | |
שימושים | |
ptr | |
dimX | |
dimY | |
dimZ |
יצירת אובייקט rs_allocation מהסוג והשימוש שצוינו.
RS_ALLOCATION_USAGE_SCRIPT ו-RS_ALLOCATION_USAGE_GRAPHICS_TEXTURE הם דגלי השימוש היחידים שנתמכים להקצאות שנוצרות מתוך סקריפט של RenderScript.
אפשר גם להשתמש בפונקציות העטיפה של rsCreateAllocation_
לדוגמה, הפונקציה rsCreateAllocation_int4() מחזירה הקצאה מסוג נתונים int4 של מאפיינים שצוינו.
rsCreateElement : יצירת אובייקט rs_element מסוג הנתונים שצוין
rs_element rsCreateElement(int32_t data_type, int32_t data_kind, bool isNormalized, uint32_t vecSize); | נוספה ב-רמת API 24 |
rs_element rsCreateElement(rs_data_type data_type); | נוספה ב-רמת API 24 |
פרמטרים
data_type | סוג הנתונים של הרכיב |
---|---|
data_kind | |
isNormalized | |
vecSize |
יצירת אובייקט rs_element מסוג הנתונים שצוין. סוג הנתונים של האלמנט יוגדר כ-RS_KIND_USER ו-vector_width יוגדר כ-1, כדי לציין שהנתונים לא הם וקטוריים.
rsCreatePixelElement : יצירת אובייקט rs_element מסוג הנתונים וסוג הנתונים שצוינו
rs_element rsCreatePixelElement(rs_data_type data_type, rs_data_kind data_kind); | נוספה ב-רמת API 24 |
פרמטרים
data_type | סוג הנתונים של הרכיב |
---|---|
data_kind | סוג הנתונים של הרכיב |
יצירת אובייקט rs_element מסוג הנתונים וסוג הנתונים שצוינו. הערך של vector_width ברכיב יוגדר כ-1, כדי לציין שהוא לא וקטור.
rsCreateType : יצירת אובייקט rs_type עם מאפייני הרכיב והצורה שצוינו
rs_type rsCreateType(rs_element element, uint32_t dimX); | נוספה ב-רמת API 24 |
rs_type rsCreateType(rs_element element, uint32_t dimX, uint32_t dimY); | נוספה ב-רמת API 24 |
rs_type rsCreateType(rs_element element, uint32_t dimX, uint32_t dimY, uint32_t dimZ); | נוספה ב-רמת API 24 |
rs_type rsCreateType(rs_element element, uint32_t dimX, uint32_t dimY, uint32_t dimZ, bool mipmaps, bool faces, rs_yuv_format yuv_format); | נוספה ב-רמת API 24 |
פרמטרים
רכיב | האלמנט שרוצים לשייך לסוג |
---|---|
dimX | גודל לאורך המאפיין X |
dimY | גודל לאורך ציר Y |
dimZ | גודל לאורך המאפיין Z |
mipmaps | סימון שמציין אם לסוג יש שרשרת mipmap |
פנים | סימון שמציין אם הסוג הוא cubemap |
yuv_format | פריסת YUV של הסוג |
יצירת אובייקט rs_type עם מאפייני הרכיב והצורה שצוינו.
המאפיין dimX מציין את הגודל של המאפיין X.
אם הערך של dimY קיים ולא אפס, הוא מציין שהמאפיין Y קיים ומציין את הגודל שלו.
אם הערך של dimZ קיים ולא אפס, הוא מציין שהמידה Z קיימת ומציין את הגודל שלה.
מפות mip מצביעות על נוכחות של רמת פירוט (LOD).
הערך של faces מציין את נוכחות הפנים של מפת הקוביות.
השדה yuv_format מציין את פורמט ה-YUV המשויך (או RS_YUV_NONE).
rsCreateVectorElement : יצירת אובייקט rs_element מסוג הנתונים ורוחבו של הווקטור שצוינו
rs_element rsCreateVectorElement(rs_data_type data_type, uint32_t vector_width); | נוספה ב-רמת API 24 |
פרמטרים
data_type | סוג הנתונים של הרכיב |
---|---|
vector_width | רוחב הווקטור (2, 3 או 4) |
יצירת אובייקט rs_element מסוג הנתונים ורוחבו של הווקטור שצוינו. הערך של vector_width חייב להיות 2, 3 או 4. סוג הנתונים של הרכיב יוגדר כ-RS_KIND_USER.