DD::Image::VArray Class Reference

Public Member Functions

 VArray (const ChannelSetInit c)
 
 VArray (const ChannelSet &c)
 
 VArray (Channel c)
 
 VArray (const VArray &b)
 
float & operator[] (Channel z)
 
const float & operator[] (Channel z) const
 
float * array ()
 
VArrayoperator= (const VArray &v)
 
Vector4P () const
 
float x () const
 
float y () const
 
float z () const
 
float w () const
 
Vector3PL () const
 
Vector3PW () const
 
Vector3MB () const
 
Vector4UV () const
 
Vector3N () const
 
Vector4Cf () const
 
float r () const
 
float g () const
 
float b () const
 
float a () const
 
Vector3VEL () const
 
void lerp (const VArray &b, float t)
 
void offset (const VArray &b, const VArray &delta, float t)
 
void scale (float s)
 
void offset (const VArray &b, const VArray &dx, float x, const VArray &dy, float y)
 
void midpoint (const VArray &a, const VArray &b)
 
void w_normalize ()
 Divide all the channels by w, and put 1/w into w. More...
 

Public Attributes

ChannelSet channels
 
float chan [VARRAY_CHANS]
 

Detailed Description

Array of floating point numbers that are interpolated across a primitive. A VertexContext contains 4 of these: the current value, the derivatives horizontally and vertically, and the value at X=0.

Member Function Documentation

void DD::Image::VArray::lerp ( const VArray b,
float  t 
)
inline

Destructive linear interpolate between this and VArray b by t.

void DD::Image::VArray::offset ( const VArray b,
const VArray delta,
float  t 
)
inline

Sets it to b+delta*t

void DD::Image::VArray::scale ( float  s)
inline

Scale the VArray.

void DD::Image::VArray::offset ( const VArray b,
const VArray dx,
float  x,
const VArray dy,
float  y 
)
inline

Sets it to b+dx*x+dy*y

void DD::Image::VArray::midpoint ( const VArray a,
const VArray b 
)
inline

Sets it to the midpoint between a and b ((a+b)/2).

void VArray::w_normalize ( )

Divide all the channels by w, and put 1/w into w.

Divide all the channels by w, and put 1/w into w. The resulting values can then be linearly interpolated in screen space. Don't forget to divide by w to get the original values back, unless the divided value is useful (which is only true for xyz).

Referenced by DD::Image::rPoint::add_to_render().



©2020 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.thefoundry.co.uk