RixTexture Class Reference

#include <RixInterfaces.h>

Inheritance diagram for RixTexture:
RixInterface

Classes

struct  TxParams
 
struct  TxProperties
 

Public Types

enum  ErrType {
  Ok = 0, FileNotFound, PartNotFound, InvalidFaceIndex,
  TextureAccessErr, InvalidDerivatives, InvalidFilter, InvalidFile
}
 

Public Member Functions

virtual int AcquireTexture (const char *filename, TxProperties &txProperties, bool persistentFilename=false)=0
 
virtual int AcquireTexturePart (int partIndex, TxProperties const &txProperties, TxProperties &partProperties)=0
 
virtual int ReleaseTexture (TxProperties const &txProperties)=0
 
virtual int Texture (TxProperties const &txProperties, TxParams const &txParams, RtInt nPoints, RtFloat2 const *st, RtFloat const *stRadius, RtFloat *result, int *runFlags=NULL)=0
 
virtual int TextureDerivatives (TxProperties const &txProperties, TxParams const &txParams, RtInt nPoints, RtFloat2 const *st, RtFloat const *dsdu, RtFloat const *dtdu, RtFloat const *dsdv, RtFloat const *dtdv, RtFloat *result, RtFloat *dresultds, RtFloat *dresultdt, int *runFlags=NULL)=0
 
virtual int Ptexture (TxProperties const &txProperties, TxParams const &txParams, RtInt nPoints, RtFloat2 const *uv, RtFloat const *uWidth, RtFloat const *vWidth, RtFloat *result, int *runFlags=NULL)=0
 
virtual int TextureData (TxProperties const &txProperties, TxParams const &txParams, int mipLevel, int cubeFace, void *result)=0
 
- Public Member Functions inherited from RixInterface
virtual int GetVersion () const
 

Protected Member Functions

 RixTexture ()
 constructor for internal use only
 
- Protected Member Functions inherited from RixInterface
 RixInterface (int version)
 Interfaces should not be constructed by users.
 
virtual ~RixInterface ()
 Interfaces should not be deleted by users.
 

Additional Inherited Members

- Protected Attributes inherited from RixInterface
int m_version
 Version number of this interface.
 

Detailed Description

RixTexture performs filtered texture map lookups using a texture coordinate and a region over which to filter. This interface is ideally suited for use with path tracing.

The data pointers for input and results (including derivative results) should be interleaved.

This interface also provides the ability to obtain the derivatives at a given texture lookup, which is useful for bump mapping.

NOTE: Currently only FilterType::Bilinear and FilterType::Bspline supports the derivative capability.

Member Function Documentation

virtual int RixTexture::AcquireTexture ( const char *  filename,
TxProperties txProperties,
bool  persistentFilename = false 
)
pure virtual

All texture access must acquire a texture first. A non-zero return code means the texture specified by filename could not be acquired. NOTE: The filename string storage must be persistent. If it is not, the call will create a persistent string. If the filename is persistent (e.g: from a GetToken() call), then true can be used to make this call more efficient.

virtual int RixTexture::AcquireTexturePart ( int  partIndex,
TxProperties const &  txProperties,
TxProperties partProperties 
)
pure virtual

Once a texture has been acquired, we can then acquire a part by part index, the partProperties will reflect the properties of the multi-part texture.

virtual int RixTexture::Ptexture ( TxProperties const &  txProperties,
TxParams const &  txParams,
RtInt  nPoints,
RtFloat2 const *  uv,
RtFloat const *  uWidth,
RtFloat const *  vWidth,
RtFloat *  result,
int *  runFlags = NULL 
)
pure virtual

Lookup filtered ptexture results over nPoints from a ptexture obtained with AcquireTexture(). The lookup point is provided by stIn. The radius of the texture filter at the lookup point is provided by uRadius and vRadius. The results are placed in result.

An optional runFlags array can be used to prevent lookups at a given point by setting the value of the flag at a given point to 0.

The call cannot be used to obtain texture results from ptexture, the Texture() or TextureDerivatives() call must be used instead.

The result buffer should be preinitialized in case the call can write no valid data to it. A non-zero return code, specified by ErrType, is returned on some errors but not others; in particular, if an invalid face index is provided, the result buffer will remain untouched, but no error will be generated.

virtual int RixTexture::ReleaseTexture ( TxProperties const &  txProperties)
pure virtual

All texture access should release a texture as soon as it is finished looking up values.

virtual int RixTexture::Texture ( TxProperties const &  txProperties,
TxParams const &  txParams,
RtInt  nPoints,
RtFloat2 const *  st,
RtFloat const *  stRadius,
RtFloat *  result,
int *  runFlags = NULL 
)
pure virtual

Lookup filtered texture results over nPoints from a texture obtained with AcquireTexture(). The lookup point is provided by stIn. The radius of the texture filter at the lookup point is provided by stRadius. The results are placed in result.

An optional runFlags array can be used to prevent lookups at a given point by setting the value of the flag at a given point to 0.

A non-zero return code, specified by ErrType is returned on error.

virtual int RixTexture::TextureData ( TxProperties const &  txProperties,
TxParams const &  txParams,
int  mipLevel,
int  cubeFace,
void *  result 
)
pure virtual

Read the whole texture into a buffer at a given MIP level. The user of the API must provide the appropriately allocated buffer to place the results into.

virtual int RixTexture::TextureDerivatives ( TxProperties const &  txProperties,
TxParams const &  txParams,
RtInt  nPoints,
RtFloat2 const *  st,
RtFloat const *  dsdu,
RtFloat const *  dtdu,
RtFloat const *  dsdv,
RtFloat const *  dtdv,
RtFloat *  result,
RtFloat *  dresultds,
RtFloat *  dresultdt,
int *  runFlags = NULL 
)
pure virtual

Lookup filtered texture results over nPoints from a texture obtained with AcquireTexture(). The lookup point is provided by stIn. The derivatives of the texture results can be obtained by passing non-NULL pointers for dresultds and dresultdt. The filter radius is computed from the bi-variate derivatives provided by the caller. (And then usually scaled by du/dv before being passed to this call).

An optional runFlags array can be used to prevent lookups at a given point by setting the value of the flag at a given point to 0.

A non-zero return code, specified by ErrType is returned on error.

NOTE: Currently only the Bspline and Bilinear filters provide support for derivatives results.


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