Macros | Typedefs | Functions
Basic Types

Macros

#define NULL   0
 NULL value for null pointers.
 

Typedefs

typedef char AtInt8
 8-bit signed integer
 
typedef short AtInt16
 16-bit signed integer
 
typedef int AtInt32
 32-bit signed integer
 
typedef signed long long AtInt64
 64-bit signed integer
 
typedef unsigned char AtByte
 8-bit unsigned integer (same as AtUInt8)
 
typedef unsigned char AtUInt8
 8-bit unsigned integer
 
typedef unsigned short AtUInt16
 16-bit unsigned integer
 
typedef unsigned int AtUInt32
 32-bit unsigned integer
 
typedef unsigned long long AtUInt64
 64-bit unsigned integer
 

Functions

template<typename T >
ABS (T a)
 Absolute value of 'a'.
 
template<typename T >
MIN (T a, T b)
 Minimum of 'a' and 'b'.
 
template<typename T >
MAX (T a, T b)
 Maximum of 'a' and 'b'.
 
template<typename T >
MIN3 (T a, T b, T c)
 Minimum of three values: a, b, c.
 
template<typename T >
MAX3 (T a, T b, T c)
 Maximum of three values: a, b, c.
 
template<typename T >
MIN4 (T a, T b, T c, T d)
 Minimum of four values: a, b, c, d.
 
template<typename T >
MAX4 (T a, T b, T c, T d)
 Maximum of four values: a, b, c, d.
 
template<typename T >
SQR (T a)
 Square of 'a'.
 
template<typename T >
AtInt64 FLOOR (T a)
 Largest integer that is smaller than or equal to 'a'.
 
template<typename T >
AtInt64 CEIL (T a)
 Smallest integer that is bigger than or equal to 'a'.
 
template<typename T >
AtInt64 ROUND (T a)
 Round 'a' to nearest int.
 
template<typename T >
int SGN (T a)
 Take binary sign of 'a' (either -1, or 1 if >= 0)
 
template<typename T >
void SWAP (T &a, T &b)
 Swap 'a' and 'b'.
 
template<typename T >
CLAMP (T v, T lo, T hi)
 Clamp the input to the specified range.
 
template<typename T >
ACOS (T x)
 Safe arc cosine of 'x' (acos() returns NaN if x>1)
 
template<typename T >
LERP (T t, T a, T b)
 Linear interpolation between 'a' and 'b' using 't' (0<=t<=1)
 
template<typename T >
HERP01 (T t)
 Hermite interpolation between 0 and 1 using 't' (0<=t<=1)
 
template<typename T >
HERP (T t, T a, T b)
 Hermite interpolation between 'a' and 'b' using 't' (0<=t<=1)
 
template<typename T >
BILERP (T s, T t, T c00, T c10, T c01, T c11)
 Bilinear interpolation between four float values using 's' and 't' (0<=st<=1)
 
template<typename T >
BIHERP (T s, T t, T c00, T c10, T c01, T c11)
 Bicubic Hermite interpolation between four float values using 's' and 't' (0<=st<=1)
 
template<typename T >
BIAS (T a, T b)
 Bias function.
 
template<typename T >
GAIN (T a, T g)
 Gain function.
 
template<typename T >
STEP (T x, T e)
 Step function.
 
template<typename T >
FILTERSTEP (T x, T e, T w)
 Filtered-step function.
 
template<typename T >
LINEARSTEP (T lo, T hi, T t)
 Linearly interpolated step from 'lo' to 'hi'. More...
 
template<typename T >
SMOOTHSTEP (T e0, T e1, T t)
 RenderMan's smoothstep() function. More...
 
AI_API bool AiIsFinite (float x)
 Test to see if the given floating point number is finite (not NaN and not infinite) as defined by the IEEE-754 standard. More...
 
AI_API float fast_exp (float x)
 Fast, approximate expf(). More...
 

Detailed Description

Portable definitions for common basic types (different sizes of integer, etc). Using these types ensures portability of client code across platforms.

Function Documentation

template<typename T >
T LINEARSTEP ( lo,
hi,
t 
)
inline

Linearly interpolated step from 'lo' to 'hi'.

Returns x where (0 <= x <= 1). Similar to FILTERSTEP() but slightly different mode of calling

template<typename T >
T SMOOTHSTEP ( e0,
e1,
t 
)
inline

RenderMan's smoothstep() function.

Returns 0 if (t < e0) or 1 if (t > e1) or a hermitian interpolation for (e0 < t < e1)

AI_API bool AiIsFinite ( float  x)

Test to see if the given floating point number is finite (not NaN and not infinite) as defined by the IEEE-754 standard.

Parameters
xfloating point value
Returns
true if the value is finite, false if NaN or infinite
AI_API float fast_exp ( float  x)

Fast, approximate expf().

Maximum error is 392 ulp for x between [-72,72], 372 ulp between [-8,8], and 209 ulp between [0,2].

Parameters
xfloating point value between [-72,72]
Returns
exp(x) accurate to within 372 ulp

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com