HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_TextureMap Class Reference

#include <TIL_TextureMap.h>

Classes

struct  forceDiskCache
 
struct  TextureInfo
 

Public Member Functions

 TIL_TextureMap (const UT_StringHolder &mapname=UT_StringHolder(), const char *relativeTo=nullptr, TIL_Raster *rp=nullptr)
 
 TIL_TextureMap (const UT_StringHolder &mapname, const forceDiskCache &)
 
virtual ~TIL_TextureMap ()
 
void setOpCaller (UT_OpCaller *c)
 
void setMap (const UT_StringHolder &name, const char *relativeTo, TIL_Raster *rp=nullptr, bool always_resolve=true, bool force_disk_cache=false)
 
const UT_StringHoldergetMap () const
 
void clearRaster ()
 
void forceReload ()
 
const TIL_RastergetOGLRaster ()
 
TIL_TextureOptions getTextureOptions () const
 
void getResolution (int &x, int &y)
 
int getNChannels () const
 
void setColorChannelName (const UT_StringHolder &n)
 
const UT_StringHoldergetColorChannelName () const
 
void setFaceIndex (int index)
 
int getFaceIndex () const
 
void setSubimage (int i)
 
int getSubimage () const
 
void setPtexChannel (int index)
 
int getPtexChannel () const
 
TIL_PtexOrient ptexOrient () const
 
void setPtexOrient (TIL_PtexOrient o)
 
void setFilter (UT_FilterType filter, float xw, float yw)
 
void setXFilter (UT_FilterType filter)
 
void setYFilter (UT_FilterType filter)
 
void setFilterWidths (float xwidth, float ywidth)
 
void setFilterBlurs (float xblur, float yblur)
 
void setMipInterpolate (int onoff)
 
void setWrapMode (UT_FilterWrap uwrap, UT_FilterWrap vwrap, const UT_Vector4 &border)
 
void setDeepInterp (IMG_DeepInterp interp)
 
void setBeerLambert (bool beerlambert)
 
void setSourceColorSpace (IMG_ColorSpace convert)
 
void setFilterMode (IMG_TextureFilter::FilterMode m)
 
void setZSkew (float zskew)
 
void setIESNormalization (int mode)
 
void setIESAngleScale (float scale)
 
const UT_FiltergetXFilter () const
 
const UT_FiltergetYFilter () const
 
float getXFilterWidth () const
 
float getYFilterWidth () const
 
void setColorLookup (bool interp=true, bool needalpha=true)
 
void setBumpLookup (bool interp=false, TIL_BUMP_COMPUTE_TYPE type=TIL_BUMP_PRECOMPUTE)
 
UT_FilterWrap getUWrap () const
 
UT_FilterWrap getVWrap () const
 
const UT_Vector4getBorder () const
 
bool isDefault () const
 
int isTTMap () const
 
int isDSM () const
 
bool isPtex () const
 
bool isOIIO () const
 
int isIES () const
 
TIL_TextureHandle getLookupHandle () const
 
const IMG_TextureFiltergetFilter () const
 Query filter information. More...
 
IMG_TextureFiltergetFilter ()
 
TIL_BUMP_COMPUTE_TYPE getBumpCompute () const
 
bool getInterpRequired () const
 
bool getAlphaRequired () const
 
const UT_StringHolderocioColorSpace () const
 Get the OCIO color space associated with the file. More...
 
void wrapMode (UT_StringHolder &swrap, UT_StringHolder &twrap) const
 
bool textureInfo (TextureInfo &info) const
 Load information about texture and MIP levels. More...
 
bool loadMipRaster (int mip_level, const UT_DimRect &region, void *data)
 Load the raster for a given MIP level, possibly converting the data. More...
 
bool isVolatileTexture () const
 
bool hasTextureChanged (const TIL_Raster **newraster=0)
 
IMG_File * getFile ()
 
IMG_FileTTMapgetTTMap ()
 
const TIL_Cdf2D * getCDF (int maxres=512)
 Return a 2d CDF for sampling. More...
 
int getColorChannelIndex (IMG_FileTTMap *map) const
 
template<typename T >
void colorLookup (float u, float v, UT_Vector4T< T > &clr) const
 
template<typename T >
void colorLookup (const float u[4], const float v[4], UT_Vector4T< T > &clr) const
 
fpreal depthLookup (float u, float v, float farvalue=1E6) const
 
template<typename T >
void bumpLookup (float u, float v, T &du, T &dv) const
 
template<typename T >
void envLookup (const UT_Vector3T< T > &R, fpreal angle, UT_Vector4T< T > &clr) const
 
template<typename T >
void envLookup (const UT_Vector3T< T > &r00, const UT_Vector3T< T > &r10, const UT_Vector3T< T > &r11, const UT_Vector3T< T > &r01, UT_Vector4T< T > &clr) const
 
void colorLookup (TIL_TextureHandle &h, float u, float v, UT_Vector4F &clr) const
 
void colorLookup (TIL_TextureHandle &h, float u, float v, UT_Vector4D &clr) const
 
void colorLookup (TIL_TextureHandle &h, const float u[4], const float v[4], UT_Vector4F &clr) const
 
void colorLookup (TIL_TextureHandle &h, const float u[4], const float v[4], UT_Vector4D &clr) const
 
float depthLookup (TIL_TextureHandle &h, float u, float v, float farvalue=1E6) const
 
void bumpLookup (TIL_TextureHandle &h, float u, float v, fpreal32 &du, fpreal32 &dv) const
 
void bumpLookup (TIL_TextureHandle &h, float u, float v, fpreal64 &du, fpreal64 &dv) const
 
void envLookup (TIL_TextureHandle &h, const UT_Vector3F &R, fpreal angle, UT_Vector4F &clr) const
 
void envLookup (TIL_TextureHandle &h, const UT_Vector3D &R, fpreal angle, UT_Vector4D &clr) const
 
void envLookup (TIL_TextureHandle &h, const UT_Vector3F &r00, const UT_Vector3F &r10, const UT_Vector3F &r11, const UT_Vector3F &r01, UT_Vector4 &clr) const
 
void envLookup (TIL_TextureHandle &h, const UT_Vector3D &r00, const UT_Vector3D &r10, const UT_Vector3D &r11, const UT_Vector3D &r01, UT_Vector4D &clr) const
 
void getResolution (const TIL_TextureHandle &h, int &x, int &y)
 
void deepLookup (TIL_TextureHandle &h, UT_Vector3F &clr, const UT_Vector3F &p, const UT_Vector3F &du, const UT_Vector3F &dv, float quality, int maxsamples)
 
void deepLookup (TIL_TextureHandle &h, UT_Vector3D &clr, const UT_Vector3D &p, const UT_Vector3D &du, const UT_Vector3D &dv, float quality, int maxsamples)
 

Static Public Member Functions

static bool hasUDIM (const char *format)
 Returns whether a filename has UDIM formatting characters. More...
 
static UT_StringHolder expandUDIM (const char *format, int iu, int iv)
 
static const TIL_MissingTexturesetMissingTexture (const TIL_MissingTexture *m)
 
static const TIL_MissingTexturegetMissingTexture ()
 Access the missing texture callback without having to set it. More...
 
static bool mapExists (const UT_StringRef &name)
 Check existence of a texture map. More...
 
static bool validUDIMDirectory (const UT_StringRef &udim_name)
 

Detailed Description

Definition at line 309 of file TIL_TextureMap.h.

Constructor & Destructor Documentation

TIL_TextureMap::TIL_TextureMap ( const UT_StringHolder mapname = UT_StringHolder(),
const char *  relativeTo = nullptr,
TIL_Raster rp = nullptr 
)
TIL_TextureMap::TIL_TextureMap ( const UT_StringHolder mapname,
const forceDiskCache  
)
virtual TIL_TextureMap::~TIL_TextureMap ( )
virtual

Member Function Documentation

template<typename T >
void TIL_TextureMap::bumpLookup ( float  u,
float  v,
T du,
T dv 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 500 of file TIL_TextureMap.h.

void TIL_TextureMap::bumpLookup ( TIL_TextureHandle h,
float  u,
float  v,
fpreal32 du,
fpreal32 dv 
) const

Evaluate using a lookup handle

void TIL_TextureMap::bumpLookup ( TIL_TextureHandle h,
float  u,
float  v,
fpreal64 du,
fpreal64 dv 
) const

Evaluate using a lookup handle

void TIL_TextureMap::clearRaster ( )
template<typename T >
void TIL_TextureMap::colorLookup ( float  u,
float  v,
UT_Vector4T< T > &  clr 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 481 of file TIL_TextureMap.h.

template<typename T >
void TIL_TextureMap::colorLookup ( const float  u[4],
const float  v[4],
UT_Vector4T< T > &  clr 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 487 of file TIL_TextureMap.h.

void TIL_TextureMap::colorLookup ( TIL_TextureHandle h,
float  u,
float  v,
UT_Vector4F clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::colorLookup ( TIL_TextureHandle h,
float  u,
float  v,
UT_Vector4D clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::colorLookup ( TIL_TextureHandle h,
const float  u[4],
const float  v[4],
UT_Vector4F clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::colorLookup ( TIL_TextureHandle h,
const float  u[4],
const float  v[4],
UT_Vector4D clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::deepLookup ( TIL_TextureHandle h,
UT_Vector3F clr,
const UT_Vector3F p,
const UT_Vector3F du,
const UT_Vector3F dv,
float  quality,
int  maxsamples 
)

Deep shadow lookup will fall back to regular depth map lookups if this map is not a deep shadow map.

void TIL_TextureMap::deepLookup ( TIL_TextureHandle h,
UT_Vector3D clr,
const UT_Vector3D p,
const UT_Vector3D du,
const UT_Vector3D dv,
float  quality,
int  maxsamples 
)

Deep shadow lookup will fall back to regular depth map lookups if this map is not a deep shadow map.

fpreal TIL_TextureMap::depthLookup ( float  u,
float  v,
float  farvalue = 1E6 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 493 of file TIL_TextureMap.h.

float TIL_TextureMap::depthLookup ( TIL_TextureHandle h,
float  u,
float  v,
float  farvalue = 1E6 
) const

Evaluate using a lookup handle

template<typename T >
void TIL_TextureMap::envLookup ( const UT_Vector3T< T > &  R,
fpreal  angle,
UT_Vector4T< T > &  clr 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 508 of file TIL_TextureMap.h.

template<typename T >
void TIL_TextureMap::envLookup ( const UT_Vector3T< T > &  r00,
const UT_Vector3T< T > &  r10,
const UT_Vector3T< T > &  r11,
const UT_Vector3T< T > &  r01,
UT_Vector4T< T > &  clr 
) const
inline

Evaluate using an automatic lookup handle

Definition at line 516 of file TIL_TextureMap.h.

void TIL_TextureMap::envLookup ( TIL_TextureHandle h,
const UT_Vector3F R,
fpreal  angle,
UT_Vector4F clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::envLookup ( TIL_TextureHandle h,
const UT_Vector3D R,
fpreal  angle,
UT_Vector4D clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::envLookup ( TIL_TextureHandle h,
const UT_Vector3F r00,
const UT_Vector3F r10,
const UT_Vector3F r11,
const UT_Vector3F r01,
UT_Vector4 clr 
) const

Evaluate using a lookup handle

void TIL_TextureMap::envLookup ( TIL_TextureHandle h,
const UT_Vector3D r00,
const UT_Vector3D r10,
const UT_Vector3D r11,
const UT_Vector3D r01,
UT_Vector4D clr 
) const

Evaluate using a lookup handle

static UT_StringHolder TIL_TextureMap::expandUDIM ( const char *  format,
int  iu,
int  iv 
)
static

Expand a file containing %(UDIM)d, %(U)d or %(V)d formatting characters The iu and iv parameters passed in are the zero-based coordinates (i.e. UDIM == (1000 + iu+1+ 10*iv) and U == iu+1).

For example: expandUDIM("%s/%s_%(UDIM)%d_%(U)02d_%(V)d.rat", 3, 7) will return "%s/%s_1074_04_8.rat"

void TIL_TextureMap::forceReload ( )
bool TIL_TextureMap::getAlphaRequired ( ) const
inline

Definition at line 594 of file TIL_TextureMap.h.

const UT_Vector4& TIL_TextureMap::getBorder ( ) const
inline

Definition at line 451 of file TIL_TextureMap.h.

TIL_BUMP_COMPUTE_TYPE TIL_TextureMap::getBumpCompute ( ) const
inline

Definition at line 588 of file TIL_TextureMap.h.

const TIL_Cdf2D* TIL_TextureMap::getCDF ( int  maxres = 512)

Return a 2d CDF for sampling.

int TIL_TextureMap::getColorChannelIndex ( IMG_FileTTMap map) const
const UT_StringHolder& TIL_TextureMap::getColorChannelName ( ) const
int TIL_TextureMap::getFaceIndex ( ) const
inline

Definition at line 397 of file TIL_TextureMap.h.

IMG_File* TIL_TextureMap::getFile ( )
const IMG_TextureFilter& TIL_TextureMap::getFilter ( ) const
inline

Query filter information.

Definition at line 584 of file TIL_TextureMap.h.

IMG_TextureFilter& TIL_TextureMap::getFilter ( )
inline

Definition at line 585 of file TIL_TextureMap.h.

bool TIL_TextureMap::getInterpRequired ( ) const
inline

Definition at line 593 of file TIL_TextureMap.h.

TIL_TextureHandle TIL_TextureMap::getLookupHandle ( ) const

When performing multiple texture evaluations, this allows the texture class to pre-compute some common values rather than performing the computation on every lookup.

const UT_StringHolder& TIL_TextureMap::getMap ( ) const
static const TIL_MissingTexture* TIL_TextureMap::getMissingTexture ( )
static

Access the missing texture callback without having to set it.

int TIL_TextureMap::getNChannels ( ) const
const TIL_Raster* TIL_TextureMap::getOGLRaster ( )
int TIL_TextureMap::getPtexChannel ( ) const
inline

Definition at line 403 of file TIL_TextureMap.h.

void TIL_TextureMap::getResolution ( int x,
int y 
)
inline

Definition at line 387 of file TIL_TextureMap.h.

void TIL_TextureMap::getResolution ( const TIL_TextureHandle h,
int x,
int y 
)

Evaluate using a lookup handle

int TIL_TextureMap::getSubimage ( ) const
inline

Definition at line 400 of file TIL_TextureMap.h.

TIL_TextureOptions TIL_TextureMap::getTextureOptions ( ) const
IMG_FileTTMap* TIL_TextureMap::getTTMap ( )
UT_FilterWrap TIL_TextureMap::getUWrap ( ) const
inline

Definition at line 449 of file TIL_TextureMap.h.

UT_FilterWrap TIL_TextureMap::getVWrap ( ) const
inline

Definition at line 450 of file TIL_TextureMap.h.

const UT_Filter* TIL_TextureMap::getXFilter ( ) const
inline

Definition at line 429 of file TIL_TextureMap.h.

float TIL_TextureMap::getXFilterWidth ( ) const
inline

Definition at line 431 of file TIL_TextureMap.h.

const UT_Filter* TIL_TextureMap::getYFilter ( ) const
inline

Definition at line 430 of file TIL_TextureMap.h.

float TIL_TextureMap::getYFilterWidth ( ) const
inline

Definition at line 432 of file TIL_TextureMap.h.

bool TIL_TextureMap::hasTextureChanged ( const TIL_Raster **  newraster = 0)
static bool TIL_TextureMap::hasUDIM ( const char *  format)
static

Returns whether a filename has UDIM formatting characters.

bool TIL_TextureMap::isDefault ( ) const
int TIL_TextureMap::isDSM ( ) const
int TIL_TextureMap::isIES ( ) const
bool TIL_TextureMap::isOIIO ( ) const
bool TIL_TextureMap::isPtex ( ) const
int TIL_TextureMap::isTTMap ( ) const
bool TIL_TextureMap::isVolatileTexture ( ) const
bool TIL_TextureMap::loadMipRaster ( int  mip_level,
const UT_DimRect region,
void data 
)

Load the raster for a given MIP level, possibly converting the data.

static bool TIL_TextureMap::mapExists ( const UT_StringRef name)
static

Check existence of a texture map.

const UT_StringHolder& TIL_TextureMap::ocioColorSpace ( ) const

Get the OCIO color space associated with the file.

TIL_PtexOrient TIL_TextureMap::ptexOrient ( ) const
inline

Definition at line 406 of file TIL_TextureMap.h.

void TIL_TextureMap::setBeerLambert ( bool  beerlambert)
void TIL_TextureMap::setBumpLookup ( bool  interp = false,
TIL_BUMP_COMPUTE_TYPE  type = TIL_BUMP_PRECOMPUTE 
)
inline

Definition at line 442 of file TIL_TextureMap.h.

void TIL_TextureMap::setColorChannelName ( const UT_StringHolder n)
void TIL_TextureMap::setColorLookup ( bool  interp = true,
bool  needalpha = true 
)
inline

Definition at line 436 of file TIL_TextureMap.h.

void TIL_TextureMap::setDeepInterp ( IMG_DeepInterp  interp)
void TIL_TextureMap::setFaceIndex ( int  index)
void TIL_TextureMap::setFilter ( UT_FilterType  filter,
float  xw,
float  yw 
)
void TIL_TextureMap::setFilterBlurs ( float  xblur,
float  yblur 
)
void TIL_TextureMap::setFilterMode ( IMG_TextureFilter::FilterMode  m)
void TIL_TextureMap::setFilterWidths ( float  xwidth,
float  ywidth 
)
void TIL_TextureMap::setIESAngleScale ( float  scale)
inline

Definition at line 427 of file TIL_TextureMap.h.

void TIL_TextureMap::setIESNormalization ( int  mode)
inline

Definition at line 423 of file TIL_TextureMap.h.

void TIL_TextureMap::setMap ( const UT_StringHolder name,
const char *  relativeTo,
TIL_Raster rp = nullptr,
bool  always_resolve = true,
bool  force_disk_cache = false 
)
void TIL_TextureMap::setMipInterpolate ( int  onoff)
static const TIL_MissingTexture* TIL_TextureMap::setMissingTexture ( const TIL_MissingTexture m)
static

Set the callback for missing textures. This returns the previous callback.

void TIL_TextureMap::setOpCaller ( UT_OpCaller c)
inline

Definition at line 375 of file TIL_TextureMap.h.

void TIL_TextureMap::setPtexChannel ( int  index)
void TIL_TextureMap::setPtexOrient ( TIL_PtexOrient  o)
inline

Definition at line 407 of file TIL_TextureMap.h.

void TIL_TextureMap::setSourceColorSpace ( IMG_ColorSpace  convert)
void TIL_TextureMap::setSubimage ( int  i)
inline

Definition at line 399 of file TIL_TextureMap.h.

void TIL_TextureMap::setWrapMode ( UT_FilterWrap  uwrap,
UT_FilterWrap  vwrap,
const UT_Vector4 border 
)
void TIL_TextureMap::setXFilter ( UT_FilterType  filter)
void TIL_TextureMap::setYFilter ( UT_FilterType  filter)
void TIL_TextureMap::setZSkew ( float  zskew)
bool TIL_TextureMap::textureInfo ( TextureInfo info) const

Load information about texture and MIP levels.

static bool TIL_TextureMap::validUDIMDirectory ( const UT_StringRef udim_name)
static

Check existence of a UDIM directory. The path passed in should be the expanded UDIM texture path. This allows you to check for paths where the <UDIM> token is in the directory name (rather than the filename).

If the directory is missing, this will print a warning and notify the missing texture callback.

void TIL_TextureMap::wrapMode ( UT_StringHolder swrap,
UT_StringHolder twrap 
) const

Lookup the wrap mode in metadata on the image. Returns false if there's no metadata.


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