Data Structures | Functions | Variables | Friends
AtRGB API

Creation and operation with Arnold color types. More...

Data Structures

struct  AtRGB
 RGB color. More...
 
struct  AtRGBA
 RGB color + alpha. More...
 

Functions

AI_DEVICE constexpr AtRGB::AtRGB (float c)
 
AI_DEVICE constexpr AtRGB::AtRGB (float r, float g, float b)
 
AI_DEVICE constexpr AtRGB::AtRGB (const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGB AtRGB::operator+ (const AtRGB &rgb) const
 
AI_DEVICE AtRGBAtRGB::operator+= (const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB AtRGB::operator+ (float f) const
 
AI_DEVICE AtRGBAtRGB::operator+= (float f)
 
AI_DEVICE constexpr AtRGB AtRGB::operator- (const AtRGB &rgb) const
 
AI_DEVICE AtRGBAtRGB::operator-= (const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB AtRGB::operator- (float f) const
 
AI_DEVICE AtRGBAtRGB::operator-= (float f)
 
AI_DEVICE constexpr AtRGB AtRGB::operator- () const
 
AI_DEVICE constexpr AtRGB AtRGB::operator* (const AtRGB &rgb) const
 
AI_DEVICE AtRGB AtRGB::operator*= (const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB AtRGB::operator* (float f) const
 
AI_DEVICE AtRGB AtRGB::operator*= (float f)
 
AI_DEVICE constexpr AtRGB AtRGB::operator/ (const AtRGB &rgb) const
 
AI_DEVICE AtRGB AtRGB::operator/= (const AtRGB &rgb)
 
AI_DEVICE AtRGB AtRGB::operator/ (float f) const
 
AI_DEVICE AtRGB AtRGB::operator/= (float f)
 
AI_DEVICE constexpr bool AtRGB::operator== (const AtRGB &rgb) const
 
AI_DEVICE constexpr bool AtRGB::operator!= (const AtRGB &rgb) const
 
AI_DEVICE AtRGBAtRGB::operator= (float f)
 
AI_DEVICE float & AtRGB::operator[] (unsigned int i)
 
AI_DEVICE constexpr const float & AtRGB::operator[] (unsigned int i) const
 
AI_DEVICE constexpr AtRGB operator* (float f, const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB operator+ (float f, const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB operator- (float f, const AtRGB &rgb)
 
AI_DEVICE constexpr AtRGB operator/ (float f, const AtRGB &rgb)
 
AI_DEVICE AtBooleanMask< 3 > operator< (const AtRGB &lhs, const AtRGB &rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator<= (const AtRGB &lhs, const AtRGB &rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator> (const AtRGB &lhs, const AtRGB &rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator>= (const AtRGB &lhs, const AtRGB &rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator< (const AtRGB &lhs, float rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator<= (const AtRGB &lhs, float rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator> (const AtRGB &lhs, float rhs)
 
AI_DEVICE AtBooleanMask< 3 > operator>= (const AtRGB &lhs, float rhs)
 
AI_DEVICE constexpr AtRGBA::AtRGBA (float r, float g, float b, float a)
 
AI_DEVICE constexpr AtRGBA::AtRGBA (const AtRGB &rgb, float a=1)
 
AI_DEVICE AtRGBAtRGBA::rgb ()
 
AI_DEVICE const AtRGBAtRGBA::rgb () const
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator+ (const AtRGBA &rgba) const
 
AI_DEVICE AtRGBAAtRGBA::operator+= (const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator+ (float f) const
 
AI_DEVICE AtRGBAAtRGBA::operator+= (float f)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator- (const AtRGBA &rgba) const
 
AI_DEVICE AtRGBAAtRGBA::operator-= (const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator- (float f) const
 
AI_DEVICE AtRGBAAtRGBA::operator-= (float f)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator- () const
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator* (const AtRGBA &rgba) const
 
AI_DEVICE AtRGBA AtRGBA::operator*= (const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator* (float f) const
 
AI_DEVICE AtRGBA AtRGBA::operator*= (float f)
 
AI_DEVICE constexpr AtRGBA AtRGBA::operator/ (const AtRGBA &rgba) const
 
AI_DEVICE AtRGBA AtRGBA::operator/= (const AtRGBA &rgba)
 
AI_DEVICE AtRGBA AtRGBA::operator/ (float f) const
 
AI_DEVICE AtRGBA AtRGBA::operator/= (float f)
 
AI_DEVICE constexpr bool AtRGBA::operator== (const AtRGBA &rgba) const
 
AI_DEVICE constexpr bool AtRGBA::operator!= (const AtRGBA &rgba) const
 
AI_DEVICE AtRGBAAtRGBA::operator= (float f)
 
AI_DEVICE float & AtRGBA::operator[] (unsigned int i)
 
AI_DEVICE constexpr const float & AtRGBA::operator[] (unsigned int i) const
 
AI_DEVICE constexpr AtRGBA operator* (float f, const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGBA operator+ (float f, const AtRGBA &rgba)
 
AI_DEVICE constexpr AtRGBA operator- (float f, const AtRGBA &rgba)
 
AtBooleanMask< 4 > operator< (const AtRGBA &lhs, const AtRGBA &rhs)
 
AtBooleanMask< 4 > operator<= (const AtRGBA &lhs, const AtRGBA &rhs)
 
AtBooleanMask< 4 > operator> (const AtRGBA &lhs, const AtRGBA &rhs)
 
AtBooleanMask< 4 > operator>= (const AtRGBA &lhs, const AtRGBA &rhs)
 
AtBooleanMask< 4 > operator< (const AtRGBA &lhs, float rhs)
 
AtBooleanMask< 4 > operator<= (const AtRGBA &lhs, float rhs)
 
AtBooleanMask< 4 > operator> (const AtRGBA &lhs, float rhs)
 
AtBooleanMask< 4 > operator>= (const AtRGBA &lhs, float rhs)
 

Variables

float AtRGB::r
 
float AtRGB::g
 
float AtRGB::b
 
float AtRGBA::r
 
float AtRGBA::g
 
float AtRGBA::b
 
float AtRGBA::a
 

Friends

AI_DEVICE friend constexpr AtRGB AtRGB::operator* (float f, const AtRGB &rgb)
 
AI_DEVICE friend constexpr AtRGB AtRGB::operator+ (float f, const AtRGB &rgb)
 
AI_DEVICE friend constexpr AtRGB AtRGB::operator- (float f, const AtRGB &rgb)
 
AI_DEVICE friend constexpr AtRGBA AtRGBA::operator* (float f, const AtRGBA &rgba)
 
AI_DEVICE friend constexpr AtRGBA AtRGBA::operator+ (float f, const AtRGBA &rgba)
 
AI_DEVICE friend constexpr AtRGBA AtRGBA::operator- (float f, const AtRGBA &rgba)
 

Other Color Operations

AI_DEVICE constexpr AtRGB AiRGBClamp (const AtRGB &c, float lo, float hi)
 Clamp the RGB color vector to the specified range.
 
AI_DEVICE constexpr AtRGBA AiRGBAClamp (const AtRGBA &c, float lo, float hi)
 Clamp the RGBA color vector to the specified range.
 
AI_DEVICE void AiColorClipToZero (AtRGB &c)
 Clip negative values.
 
AI_DEVICE bool AiColorIsSmall (const AtRGB &c, float epsilon=AI_EPSILON)
 Check for almost black.
 
AI_DEVICE AtRGB AiColorABS (const AtRGB &c)
 Absolute value of color.
 
AI_DEVICE AtRGBA AiColorABS (const AtRGBA &c)
 Absolute value of color, RGBA version.
 
AI_DEVICE constexpr float AiColorMaxRGB (const AtRGB &c)
 Max RGB component of color.
 
AI_DEVICE constexpr float AiColorMaxRGB (const AtRGBA &c)
 Max RGB component of color, RGBA version (ignores alpha)
 
bool AiColorThreshold (const AtRGB &c1, const AtRGB &c2, float t)
 Check to see if two colors differ by more than a threhsold.
 
AI_DEVICE constexpr float AiColorToGrey (const AtRGB &c)
 Convert a RGB color to grey scale (take average of R, G, B)
 
AI_DEVICE constexpr float AiColorToGrey (const AtRGBA &rgba)
 Convert a RGBA color to grey scale (take average of R, G, B - ignore alpha)
 
AI_API AI_PURE bool AiRGBIsFinite (const AtRGB &rgba)
 Check to see if an RGB color has any corrupted components (nan or infinite). More...
 
AI_API AI_PURE bool AiRGBAIsFinite (const AtRGBA &rgba)
 Check to see if an RGBA color has any corrupted components (nan or infinite).
 
AtRGB AiBerpRGB (float a, float b, const AtRGB &c0, const AtRGB &c1, const AtRGB &c2)
 Barycentric interpolation of triangle vertex colors.
 
AI_API AI_DEVICE AI_PURE AtRGB AiColorHeatMap (const AtRGB *map_colors, const float *map_values, unsigned int map_length, float lookup)
 Interpolate a value according to a heat map (piecewise linear color map). More...
 

Detailed Description

Creation and operation with Arnold color types.

Function Documentation

◆ AiRGBIsFinite()

AI_API AI_PURE bool AiRGBIsFinite ( const AtRGB rgb)

Check to see if an RGB color has any corrupted components (nan or infinite).

Check to see if an RGB color has any corrupted components (nan or infinite).

◆ AiColorHeatMap()

AI_API AI_DEVICE AI_PURE AtRGB AiColorHeatMap ( const AtRGB map_colors,
const float *  map_values,
unsigned int  map_length,
float  lookup 
)

Interpolate a value according to a heat map (piecewise linear color map).

Parameters
map_colorsthe set of input colors
map_valuesthe floating point values assigned to each color
map_lengththe number of points in the map
lookupthe function evaluation position
Returns
the piecewise-linear interpolated color f(lookup).

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