RixShadingParam Class Reference

RixShadingParam Class Reference

#include <RixShadingParam.h>

Public Member Functions

bool IsValid () const
 
void InitEvalF (RixShadingContext const *sctx, int pid, RtFloat *dflt, bool promote=false)
 
void InitEvalV (RixShadingContext const *sctx, int pid, RtFloat3 *dflt, bool promote=false)
 
void InitEvalC (RixShadingContext const *sctx, int pid, RtColorRGB *dflt, bool promote=false)
 
void InitEvalI (RixShadingContext const *sctx, int pid, RtInt *dflt, bool promote=false)
 
void InitEmptyF (RtFloat const *dflt=NULL)
 InitEmpty: initialize to invalid or valid-but-uniform-default state.
 
void InitEmptyI (RtInt const *dflt=NULL)
 
void InitEmptyV (RtFloat3 *dflt=NULL)
 
void InitEmptyC (RtColorRGB const *dflt=NULL)
 
void InitReserveF (RixShadingContext::Allocator &pool, int npts, RtFloat dflt)
 
void InitReserveI (RixShadingContext::Allocator &pool, int npts, RtInt dflt)
 
void InitReserveC (RixShadingContext::Allocator &pool, int npts, RtColorRGB const &dflt)
 
void InitReserveV (RixShadingContext::Allocator &pool, int npts)
 
RtInt GetValueI () const
 
RtInt GetValueI (int i) const
 
RtFloat GetValueF () const
 
RtFloat GetValueF (int i) const
 
RtFloat3 const & GetValueV () const
 
RtFloat3 const & GetValueV (int i) const
 
RtColorRGB const & GetValueC () const
 
RtColorRGB const & GetValueC (int i) const
 
void SetValue (int i, RtFloat v)
 SetValue.
 
void Bind (RixPattern::OutputSpec &o, int pid)
 
void PromoteToVarying (int npts)
 

Public Attributes

union {
   RtInt *   i1
 
   RtFloat *   f1
 
   RtFloat3 *   f3
 
   RtColorRGB *   rgb
 
data
 publicly visible member variables ..... (we're struct-like)
 
RixSCDetail detail
 
RixSCType type
 

Detailed Description

RixShadingParam is a convenience class to encapsulate the type, detail and value(s) associated with an individual POD parameter of a RixShadingPlugin. Client is expected to know/define the types of its paramters and can use this class to initialize and invoke EvalParam on them.

Usage –

InitEval: initialize a parameter by invoking Eval. Optionally promote to varying, to simplify coding logic.

InitEmpty: initialize to invalid or valid-but-uniform-default state.

InitReserve: reserve space for varying parameter but start as uniform in an attempt to express minimum computational requirements. Usually called to initialize an output or target parameter.

Bind: exposes our internal state as standard RixPattern output.

GetValue: retrieves the value of the parameter at shading point i.Bxdf clients: #define RIX_SHADING_PARAM_MEMCATEGORY RixShadingContext::k_BxdfMem Pattern clients: #define RIX_SHADING_PARAM_MEMCATEGORY RixShadingContext::k_PatternMem

Member Function Documentation

void RixShadingParam::Bind ( RixPattern::OutputSpec o,
int  pid 
)
inline

Bind: exposes our internal state as standard RixPattern output

RtInt RixShadingParam::GetValueI ( ) const
inline

GetValue: return value handling detail

void RixShadingParam::InitEvalC ( RixShadingContext const *  sctx,
int  pid,
RtColorRGB *  dflt,
bool  promote = false 
)
inline

returned detail is that of real connection

void RixShadingParam::InitEvalF ( RixShadingContext const *  sctx,
int  pid,
RtFloat *  dflt,
bool  promote = false 
)
inline

InitEval: initialize a parmeter by invoking Eval. We don't promote to varying to preserve the detail of the upstream data.

returned detail is that of real connection

void RixShadingParam::InitEvalI ( RixShadingContext const *  sctx,
int  pid,
RtInt *  dflt,
bool  promote = false 
)
inline

returned detail is that of real connection

void RixShadingParam::InitReserveF ( RixShadingContext::Allocator pool,
int  npts,
RtFloat  dflt 
)
inline

InitReserve: reserve space for varying parameter but start as uniform in an attempt to express minimum computational requirements. Usually called to initialize an output or target parameter.

void RixShadingParam::PromoteToVarying ( int  npts)
inline

PromoteToVarying: convert uniform to varying. NB: this assumes that data has been allocated for worse-case (via InitReserve). Tread carefully.

"smear" our uniform result into all elements.


The documentation for this class was generated from the following file: