Data Structures | Functions
ai_array.h File Reference

Generic array data type and methods. More...

#include "ai_color.h"
#include "ai_math.h"
#include "ai_matrix.h"
#include "ai_string.h"
#include "ai_vector.h"
#include "ai_api.h"
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  POD_tempf2
 
struct  POD_tempf3
 
struct  POD_tempf4
 

Macros

AtArray Getters

The following getter functions return the i'th element in an array of the given type. In case of out-of-bounds access, an error message is generated with the source code location of the offending call.

Note that, for ease of use, these are actually macros, which are shorter to type than the full functions. The actual functions can be found in ai_array.h.

#define AiArrayGetBool(a, i)   AiArrayGetBoolFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetByte(a, i)   AiArrayGetByteFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetInt(a, i)   AiArrayGetIntFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetUInt(a, i)   AiArrayGetUIntFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetFlt(a, i)   AiArrayGetFltFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetRGB(a, i)   AiArrayGetRGBFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetRGBA(a, i)   AiArrayGetRGBAFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetVec2(a, i)   AiArrayGetVec2Func (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetVec(a, i)   AiArrayGetVecFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetMtx(a, i)   AiArrayGetMtxFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetStr(a, i)   AiArrayGetStrFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetPtr(a, i)   AiArrayGetPtrFunc (a,i,__AI_FILE__,__AI_LINE__)
 
#define AiArrayGetArray(a, i)   AiArrayGetArrayFunc(a,i,__AI_FILE__,__AI_LINE__)
 
AtArray Setters

The following functions write an element of a given type into the i'th position in an array. If the write was succesful, these functions will return true, otherwise a detailed error message will be logged and false will be returned.

#define AiArraySetBool(a, i, val)   AiArraySetBoolFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetByte(a, i, val)   AiArraySetByteFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetInt(a, i, val)   AiArraySetIntFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetUInt(a, i, val)   AiArraySetUIntFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetFlt(a, i, val)   AiArraySetFltFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetRGB(a, i, val)   AiArraySetRGBFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetRGBA(a, i, val)   AiArraySetRGBAFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetVec2(a, i, val)   AiArraySetVec2Func (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetVec(a, i, val)   AiArraySetVecFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetMtx(a, i, val)   AiArraySetMtxFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetStr(a, i, val)   AiArraySetStrFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetPtr(a, i, val)   AiArraySetPtrFunc (a,i,val,__AI_FILE__,__AI_LINE__)
 
#define AiArraySetArray(a, i, val)   AiArraySetArrayFunc(a,i,val,__AI_FILE__,__AI_LINE__)
 

Functions

AI_API AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type,...)
 Create an array and initialize it with supplied data. More...
 
AI_API AtArray * AiArrayAllocate (uint32_t nelements, uint8_t nkeys, uint8_t type)
 Create an empty (uninitialized) array of the specified type. More...
 
AI_API void AiArrayDestroy (AtArray *array)
 Deallocate an array object. More...
 
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. More...
 
AI_API void AiArrayResize (AtArray *array, uint32_t nelements, uint8_t nkeys)
 Resize an existing array contents in place. More...
 
AI_API AtArray * AiArrayCopy (const AtArray *array)
 Create a copy of an array. More...
 
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. More...
 
AI_API void * AiArrayMap (AtArray *array)
 Obtains a pointer to the internal array data for construction. More...
 
AI_API void * AiArrayMapKey (AtArray *array, uint8_t key)
 Obtains a pointer to a specific key in the internal array data for construction. More...
 
AI_API void AiArrayUnmap (AtArray *array)
 Notifies the array that construction is finished. More...
 
AI_API AI_PURE uint32_t AiArrayGetNumElements (const AtArray *array)
 Get the number of elements on each key of the array. More...
 
AI_API AI_PURE uint8_t AiArrayGetNumKeys (const AtArray *array)
 Get the number of keys. More...
 
AI_API AI_PURE uint8_t AiArrayGetType (const AtArray *array)
 Get the type of array elements. More...
 
AI_API AI_PURE size_t AiArrayGetDataSize (const AtArray *array)
 Get the total size in bytes of the data buffer for this array. More...
 
AI_API AI_PURE size_t AiArrayGetKeySize (const AtArray *array)
 Get the total size in bytes of the data for one key. More...
 
AI_API AI_PURE AtVector AiArrayInterpolateVec (const AtArray *array, float time, uint32_t idx)
 Interpolate a vector at a given time from an array. More...
 
AI_API AI_PURE AtRGB AiArrayInterpolateRGB (const AtArray *array, float time, uint32_t idx)
 Interpolate a color at a given time from an array. More...
 
AI_API AI_PURE AtRGBA AiArrayInterpolateRGBA (const AtArray *array, float time, uint32_t idx)
 Interpolate an AtRGBA at a given time from an array. More...
 
AI_API AI_PURE float AiArrayInterpolateFlt (const AtArray *array, float time, uint32_t idx)
 Interpolate a float at a given time from an array. More...
 
AI_API AI_PURE AtMatrix AiArrayInterpolateMtx (const AtArray *array, float time, uint32_t idx)
 Interpolate a matrix at a given time from an array. More...
 
AI_API AI_PURE bool AiArrayGetBoolFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE uint8_t AiArrayGetByteFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE int AiArrayGetIntFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE uint32_t AiArrayGetUIntFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE float AiArrayGetFltFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtRGB AiArrayGetRGBFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtRGBA AiArrayGetRGBAFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtVector2 AiArrayGetVec2Func (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtVector AiArrayGetVecFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtMatrix AiArrayGetMtxFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtString AiArrayGetStrFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE void * AiArrayGetPtrFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API AI_PURE AtArray * AiArrayGetArrayFunc (const AtArray *a, uint32_t i, const char *, int line)
 
AI_API bool AiArraySetBoolFunc (AtArray *a, uint32_t i, bool val, const char *, int line)
 
AI_API bool AiArraySetByteFunc (AtArray *a, uint32_t i, uint8_t val, const char *, int line)
 
AI_API bool AiArraySetIntFunc (AtArray *a, uint32_t i, int val, const char *, int line)
 
AI_API bool AiArraySetUIntFunc (AtArray *a, uint32_t i, uint32_t val, const char *, int line)
 
AI_API bool AiArraySetFltFunc (AtArray *a, uint32_t i, float val, const char *, int line)
 
AI_API bool AiArraySetRGBFunc (AtArray *a, uint32_t i, AtRGB val, const char *, int line)
 
AI_API bool AiArraySetRGBAFunc (AtArray *a, uint32_t i, AtRGBA val, const char *, int line)
 
AI_API bool AiArraySetVec2Func (AtArray *a, uint32_t i, AtVector2 val, const char *, int line)
 
AI_API bool AiArraySetVecFunc (AtArray *a, uint32_t i, AtVector val, const char *, int line)
 
AI_API bool AiArraySetMtxFunc (AtArray *a, uint32_t i, AtMatrix val, const char *, int line)
 
AI_API bool AiArraySetStrFunc (AtArray *a, uint32_t i, AtString val, const char *, int line)
 
AI_API bool AiArraySetPtrFunc (AtArray *a, uint32_t i, void *val, const char *, int line)
 
AI_API bool AiArraySetArrayFunc (AtArray *a, uint32_t i, AtArray *val, const char *, int line)
 
bool AiArraySetStrFunc (AtArray *a, uint32_t i, const char *val, const char *filename, int line)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector v1)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector v1, AtVector v2)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector v1, AtVector v2, AtVector v3)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector v1, AtVector v2, AtVector v3, AtVector v4)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector v1, AtVector v2, AtVector v3, AtVector v4, AtVector v5)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector2 v1)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector2 v1, AtVector2 v2)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector2 v1, AtVector2 v2, AtVector2 v3)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector2 v1, AtVector2 v2, AtVector2 v3, AtVector2 v4)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtVector2 v1, AtVector2 v2, AtVector2 v3, AtVector2 v4, AtVector2 v5)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGB v1)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGB v1, AtRGB v2)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGB v1, AtRGB v2, AtRGB v3)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGB v1, AtRGB v2, AtRGB v3, AtRGB v4)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGB v1, AtRGB v2, AtRGB v3, AtRGB v4, AtRGB v5)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGBA v1)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGBA v1, AtRGBA v2)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGBA v1, AtRGBA v2, AtRGBA v3)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGBA v1, AtRGBA v2, AtRGBA v3, AtRGBA v4)
 
AtArray * AiArray (uint32_t nelements, uint8_t nkeys, int type, AtRGBA v1, AtRGBA v2, AtRGBA v3, AtRGBA v4, AtRGBA v5)
 

Detailed Description

Generic array data type and methods.


© 2020 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com