41AI_API AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type, ...);
42AI_API AtArray*
AiArrayAllocate(uint32_t nelements, uint8_t nkeys, uint8_t type);
44AI_API AtArray*
AiArrayConvert(uint32_t nelements, uint8_t nkeys, uint8_t type,
const void* data);
45AI_API
void AiArrayResize(AtArray* array, uint32_t nelements, uint8_t nkeys);
47AI_API
bool AiArraySetKey(AtArray* array, uint8_t key,
const void* data);
70AI_API AI_PURE
bool AiArrayGetBool (
const AtArray* a, uint32_t i);
71AI_API AI_PURE uint8_t AiArrayGetByte (
const AtArray* a, uint32_t i);
72AI_API AI_PURE
int AiArrayGetInt (
const AtArray* a, uint32_t i);
73AI_API AI_PURE uint32_t AiArrayGetUInt (
const AtArray* a, uint32_t i);
74AI_API AI_PURE
float AiArrayGetFlt (
const AtArray* a, uint32_t i);
75AI_API AI_PURE
AtRGB AiArrayGetRGB (
const AtArray* a, uint32_t i);
76AI_API AI_PURE
AtRGBA AiArrayGetRGBA (
const AtArray* a, uint32_t i);
77AI_API AI_PURE
AtVector2 AiArrayGetVec2 (
const AtArray* a, uint32_t i);
78AI_API AI_PURE
AtVector AiArrayGetVec (
const AtArray* a, uint32_t i);
79AI_API AI_PURE
AtMatrix AiArrayGetMtx (
const AtArray* a, uint32_t i);
80AI_API AI_PURE
AtString AiArrayGetStr (
const AtArray* a, uint32_t i);
81AI_API AI_PURE
void* AiArrayGetPtr (
const AtArray* a, uint32_t i);
82AI_API AI_PURE AtArray* AiArrayGetArray(
const AtArray* a, uint32_t i);
94AI_API
bool AiArraySetBool (AtArray* a, uint32_t i,
bool val);
95AI_API
bool AiArraySetByte (AtArray* a, uint32_t i, uint8_t val);
96AI_API
bool AiArraySetInt (AtArray* a, uint32_t i,
int val);
97AI_API
bool AiArraySetUInt (AtArray* a, uint32_t i, uint32_t val);
98AI_API
bool AiArraySetFlt (AtArray* a, uint32_t i,
float val);
99AI_API
bool AiArraySetRGB (AtArray* a, uint32_t i,
AtRGB val);
100AI_API
bool AiArraySetRGBA (AtArray* a, uint32_t i,
AtRGBA val);
101AI_API
bool AiArraySetVec2 (AtArray* a, uint32_t i,
AtVector2 val);
102AI_API
bool AiArraySetVec (AtArray* a, uint32_t i,
AtVector val);
103AI_API
bool AiArraySetMtx (AtArray* a, uint32_t i,
AtMatrix val);
104AI_API
bool AiArraySetStr (AtArray* a, uint32_t i,
AtString val);
105AI_API
bool AiArraySetPtr (AtArray* a, uint32_t i,
void* val);
106AI_API
bool AiArraySetArray(AtArray* a, uint32_t i, AtArray* val);
111#ifdef AI_CPU_COMPILER
113inline bool AiArraySetStr(AtArray* a, uint32_t i,
const char* val)
115 return AiArraySetStr(a, i,
AtString(val));
127inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtVector v1) {
128 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1));
131 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2));
134 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3));
137 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3), reinterpret_type<POD_tempf3>(v4));
140 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3), reinterpret_type<POD_tempf3>(v4), reinterpret_type<POD_tempf3>(v5));
143inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtVector2 v1) {
144 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf2>(v1));
147 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf2>(v1), reinterpret_type<POD_tempf2>(v2));
150 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf2>(v1), reinterpret_type<POD_tempf2>(v2), reinterpret_type<POD_tempf2>(v3));
153 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf2>(v1), reinterpret_type<POD_tempf2>(v2), reinterpret_type<POD_tempf2>(v3), reinterpret_type<POD_tempf2>(v4));
156 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf2>(v1), reinterpret_type<POD_tempf2>(v2), reinterpret_type<POD_tempf2>(v3), reinterpret_type<POD_tempf2>(v4), reinterpret_type<POD_tempf2>(v5));
159inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtRGB v1) {
160 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1));
162inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtRGB v1,
AtRGB v2) {
163 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2));
166 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3));
169 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3), reinterpret_type<POD_tempf3>(v4));
172 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf3>(v1), reinterpret_type<POD_tempf3>(v2), reinterpret_type<POD_tempf3>(v3), reinterpret_type<POD_tempf3>(v4), reinterpret_type<POD_tempf3>(v5));
175inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtRGBA v1) {
176 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf4>(v1));
178inline AtArray*
AiArray(uint32_t nelements, uint8_t nkeys,
int type,
AtRGBA v1,
AtRGBA v2) {
179 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf4>(v1), reinterpret_type<POD_tempf4>(v2));
182 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf4>(v1), reinterpret_type<POD_tempf4>(v2), reinterpret_type<POD_tempf4>(v3));
185 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf4>(v1), reinterpret_type<POD_tempf4>(v2), reinterpret_type<POD_tempf4>(v3), reinterpret_type<POD_tempf4>(v4));
188 return AiArray(nelements, nkeys, type, reinterpret_type<POD_tempf4>(v1), reinterpret_type<POD_tempf4>(v2), reinterpret_type<POD_tempf4>(v3), reinterpret_type<POD_tempf4>(v4), reinterpret_type<POD_tempf4>(v5));
DLL export prefix for API functions (necessary for multi-platform development)
Color types and utilities.
Matrix math type and methods.
AtString class for fast comparisons.
Vector math types, operators and utilities.
Arnold String allows for fast string comparisons.
Definition: ai_string.h:46
AI_API AI_PURE AtRGBA AiArrayInterpolateRGBA(const AtArray *array, float time, uint32_t idx)
Interpolate an AtRGBA at a given time from an array.
Definition: ai_array.cpp:369
AI_API AtArray * AiArrayCopy(const AtArray *array)
Create a copy of an array.
Definition: ai_array.cpp:146
AI_API AtArray * AiArrayConvert(uint32_t nelements, uint8_t nkeys, uint8_t type, const void *data)
Create an array and initialize it from an existing data buffer.
Definition: ai_array.cpp:115
AI_API AI_PURE size_t AiArrayGetKeySize(const AtArray *array)
Get the total size in bytes of the data for one key.
Definition: ai_array.cpp:304
AI_API AtArray * AiArray(uint32_t nelements, uint8_t nkeys, int type,...)
Create an array and initialize it with supplied data.
Definition: ai_array.cpp:71
AI_API AI_PURE uint8_t AiArrayGetNumKeys(const AtArray *array)
Get the number of keys.
Definition: ai_array.cpp:271
AI_API void AiArrayDestroy(AtArray *array)
Deallocate an array object.
Definition: ai_array.cpp:38
AI_API AI_PURE uint32_t AiArrayGetNumElements(const AtArray *array)
Get the number of elements on each key of the array.
Definition: ai_array.cpp:260
AI_API AI_PURE AtMatrix AiArrayInterpolateMtx(const AtArray *array, float time, uint32_t idx)
Interpolate a matrix at a given time from an array.
Definition: ai_array.cpp:343
AI_API void * AiArrayMap(AtArray *array)
Obtains a pointer to the internal array data for construction.
Definition: ai_array.cpp:215
AI_API AtArray * AiArrayAllocate(uint32_t nelements, uint8_t nkeys, uint8_t type)
Create an empty (uninitialized) array of the specified type.
Definition: ai_array.cpp:28
AI_API AI_PURE float AiArrayInterpolateFlt(const AtArray *array, float time, uint32_t idx)
Interpolate a float at a given time from an array.
Definition: ai_array.cpp:330
AI_API AI_PURE AtRGB AiArrayInterpolateRGB(const AtArray *array, float time, uint32_t idx)
Interpolate a color at a given time from an array.
Definition: ai_array.cpp:356
AI_API AI_PURE AtVector AiArrayInterpolateVec(const AtArray *array, float time, uint32_t idx)
Interpolate a vector at a given time from an array.
Definition: ai_array.cpp:317
AI_API bool AiArraySetKey(AtArray *array, uint8_t key, const void *data)
Initializes data for all the elements in a specific key of an array.
Definition: ai_array.cpp:182
AI_API AI_PURE uint8_t AiArrayGetType(const AtArray *array)
Get the type of array elements.
Definition: ai_array.cpp:282
AI_API void * AiArrayMapKey(AtArray *array, uint8_t key)
Obtains a pointer to a specific key in the internal array data for construction.
Definition: ai_array.cpp:233
AI_API void AiArrayUnmap(AtArray *array)
Notifies the array that construction is finished.
Definition: ai_array.cpp:248
AI_API AI_PURE size_t AiArrayGetDataSize(const AtArray *array)
Get the total size in bytes of the data buffer for this array.
Definition: ai_array.cpp:293
AI_API void AiArrayResize(AtArray *array, uint32_t nelements, uint8_t nkeys)
Resize an existing array contents in place.
Definition: ai_array.cpp:130
Definition: ai_matrix.h:30
RGB color + alpha.
Definition: ai_color.h:267
RGB color.
Definition: ai_color.h:32
2D point
Definition: ai_vector.h:255
3D point (single precision)
Definition: ai_vector.h:30
Definition: ai_array.h:123
Definition: ai_array.h:124
Definition: ai_array.h:125