Rhino C++ API  8.5
Classes | Public Member Functions | Protected Member Functions | List of all members
IRhRdkTextureEvaluator Class Referenceabstract

#include <IRhRdkTextureEvaluator.h>

Inheritance diagram for IRhRdkTextureEvaluator:
CRhRdkTextureEvaluator CRhRdkOneColorEvaluator CRhRdkTwoColorEvaluator

Classes

class  CEvalFlags
 
class  IChildCallback
 

Public Member Functions

virtual const IChildCallbackChildCallback (void) const =0
 
virtual void DeleteThis (void)=0
 
virtual void * EVF (const wchar_t *, void *)=0
 
virtual bool GetColor (const ON_3dPoint &uvw, const ON_3dVector &duvwdx, const ON_3dVector &duvwdy, CRhRdkColor &colOut, void *pvData=NULL) const =0
 
virtual bool Initialize (void)=0
 
virtual bool RegisterChildCallback (IChildCallback *pChildCallback, const CRhRdkTexture &texture, void *pvData)=0
 
bool WriteByteArray (const ON_2iSize &size, unsigned char *buffer) const
 
bool WriteFloatArray (const ON_2iSize &size, float *buffer) const
 

Protected Member Functions

virtual ~IRhRdkTextureEvaluator ()
 

Detailed Description

This is the interface to a lightweight object capable of evaluating texture color throughout uvw space.

Constructor & Destructor Documentation

◆ ~IRhRdkTextureEvaluator()

virtual IRhRdkTextureEvaluator::~IRhRdkTextureEvaluator ( )
inlineprotectedvirtual

Member Function Documentation

◆ ChildCallback()

virtual const IChildCallback* IRhRdkTextureEvaluator::ChildCallback ( void  ) const
pure virtual
Returns
A pointer to the child callback object or NULL if not registered.

Implemented in CRhRdkTextureEvaluator.

◆ DeleteThis()

virtual void IRhRdkTextureEvaluator::DeleteThis ( void  )
pure virtual

You must implement this method as

delete this;

Implemented in CRhRdkOneColorEvaluator.

◆ EVF()

virtual void* IRhRdkTextureEvaluator::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Emergency virtual function for future expansion.

Implemented in CRhRdkTextureEvaluator, and CRhRdkOneColorEvaluator.

◆ GetColor()

virtual bool IRhRdkTextureEvaluator::GetColor ( const ON_3dPoint uvw,
const ON_3dVector duvwdx,
const ON_3dVector duvwdy,
CRhRdkColor colOut,
void *  pvData = NULL 
) const
pure virtual

Get the color of the texture at a particular point in uvw space. May be called from within a rendering shade pipeline.

Parameters
uvwis the point for which to evaluate the texture.
duvwdxis a ray differential.
duvwdyis a ray differential.
colOutreceives the texture color.
Note
For ray differentials see Pharr Humphreys, "Physically Based Rendering", chapter 11.
Returns
true if the color was retrieved successfully, else false. It is important to only return false if the function fails catastrophically. A black value outside some threshold is not a failure case. If the first call returns false, the entire evaluation will fail. If you return false you must leave colOut untouched.

Implemented in CRhRdkOneColorEvaluator.

◆ Initialize()

virtual bool IRhRdkTextureEvaluator::Initialize ( void  )
pure virtual

Call this function before calling GetColor for the first time. Ideally, this should be on the main thread, but you can also call it on a worker thread as long as you are sure that Initialize() or GetColor() cannot be called at the same time on another thread.

Implemented in CRhRdkTextureEvaluator.

◆ RegisterChildCallback()

virtual bool IRhRdkTextureEvaluator::RegisterChildCallback ( IChildCallback pChildCallback,
const CRhRdkTexture texture,
void *  pvData 
)
pure virtual

◆ WriteByteArray()

bool IRhRdkTextureEvaluator::WriteByteArray ( const ON_2iSize size,
unsigned char *  buffer 
) const

◆ WriteFloatArray()

bool IRhRdkTextureEvaluator::WriteFloatArray ( const ON_2iSize size,
float *  buffer 
) const