26 #ifndef _TIL_TextureMap_h_
27 #define _TIL_TextureMap_h_
41 class IMG_TTFilterInfo;
119 : myOptions(opts.myOptions)
120 , myShared(opts.myShared)
128 myShared = src.myShared;
129 myOptions = src.myOptions;
149 static int getMaxWidth();
150 static int getMaxHeight();
151 static void setMaxSize(
int w=256,
int h=256);
155 static int getCacheSize();
156 static void setCacheSize(
int size=100);
159 static int64 getCacheMemSize();
160 static void setCacheMemSize(
int64 sizeinmb);
167 static int64 getMemoryUsage();
169 static void getConversionStats(
exint &num_conversions,
170 exint ¤t_memory,
182 static void clearCache(
int only_out_of_date=0);
186 static void clearCache(
const char *mapname);
192 static int getAutoFlush();
193 static void setAutoFlush(
int onOff);
198 static void imageDataDied(
void *imagedata);
202 static void setNonRATError(
bool on);
203 static bool getNonRATError();
220 bool isPtex()
const {
return myPtex.get() !=
nullptr; }
221 bool isOIIO()
const {
return myOIIO.get() !=
nullptr; }
223 const til_Lookup *
lookup()
const {
return myLookup; }
224 const til_PtexData *
ptexData()
const {
return myPtex.get(); }
225 const til_OIIOData *
oiioData()
const {
return myOIIO.get(); }
232 til_Lookup *myLookup;
241 TIL_TextureMap(
const char *mapname = 0,
const char *relativeTo = 0,
247 static bool hasUDIM(
const char *
format);
263 void setMap(
const char *
name,
const char *relativeTo,
264 TIL_Raster *rp = 0,
bool always_resolve =
true);
268 const char *getMap()
const;
272 { getResolution(getLookupHandle(), x, y); }
273 int getNChannels()
const;
276 void setColorChannelName(
const char *
name);
277 const char *getColorChannelName()
const;
280 void setFaceIndex(
int index);
286 void setPtexChannel(
int index);
296 void setFilterWidths(
float xwidth,
float ywidth);
297 void setFilterBlurs(
float xblur,
float yblur);
298 void setMipInterpolate(
int onoff);
302 void setBeerLambert(
bool beerlambert);
305 void setZSkew(
float zskew);
316 bool needalpha =
true)
318 myInterpRequired =
interp;
319 myAlphaRequired = needalpha;
324 myInterpRequired =
interp;
334 bool isDefault()
const;
359 template <
typename T>
363 colorLookup(h, u, v, clr);
365 template <
typename T>
370 colorLookup(h, u, v, clr);
373 float farvalue=1E6)
const
376 return depthLookup(h, u, v, farvalue);
378 template <
typename T>
383 bumpLookup(h, u, v, du, dv);
386 template <
typename T>
391 envLookup(h, R, angle, clr);
394 template <
typename T>
400 envLookup(h, r00, r10, r11, r01, clr);
411 const float u[4],
const float v[4],
414 const float u[4],
const float v[4],
418 float farvalue=1E6)
const;
453 float quality,
int maxsamples);
459 float quality,
int maxsamples);
477 bool isVolatileTexture()
const;
481 bool hasTextureChanged(
const TIL_Raster **newraster = 0);
490 const TIL_Cdf2D *getCDF(
int maxres=512);
499 float quality,
int maxsamples)
const;
505 float quality,
int maxsamples)
const;
522 bool myInterpRequired;
523 bool myAlphaRequired;
TIL_TextureOptions(const UT_Options *options)
int getVersion(int version)
GT_API const UT_StringHolder filename
GLuint const GLchar * name
UT_FilterWrap getVWrap() const
virtual void convertToRat(const char *filename) const
Callback invoked when a texture is converted internally to a .rat.
TIL_BUMP_COMPUTE_TYPE getBumpCompute() const
const til_PtexData * ptexData() const
const UT_Filter * getYFilter() const
void colorLookup(float u, float v, UT_Vector4T< T > &clr) const
void colorLookup(const float u[4], const float v[4], UT_Vector4T< T > &clr) const
float getXFilterWidth() const
TIL_PtexOrient ptexOrient() const
TIL_MissingTexture()
Callback for missing texture.
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
int getPtexChannel() const
Tto convert(const Tfrom &source)
fpreal depthLookup(float u, float v, float farvalue=1E6) const
void setPtexOrient(TIL_PtexOrient o)
const IMG_TextureFilter & getFilter() const
Query filter information.
void setOpCaller(UT_OpCaller *c)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
IMG_TextureFilter & getFilter()
float getYFilterWidth() const
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
GLint GLint GLsizei GLsizei GLsizei GLint border
TIL_TextureOptions(const TIL_TextureOptions &opts)
GLubyte GLubyte GLubyte GLubyte w
TIL_TextureOptions(const UT_Options *options, UT_SharedPtr< UT_Options > shared)
void setColorLookup(bool interp=true, bool needalpha=true)
const UT_Vector4 & getBorder() const
const TIL_TextureOptions & operator=(const TIL_TextureOptions &src)
Generic interface for reading and writing image files. This class handles the reading and writing of ...
GLfloat GLfloat GLfloat GLfloat h
UT_FilterWrap getUWrap() const
void getResolution(int &x, int &y)
GLuint GLuint GLsizei GLenum type
A map of string to various well defined value types.
bool getInterpRequired() const
const UT_Filter * getXFilter() const
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
const til_OIIOData * oiioData() const
virtual void missingTexture(const char *filename) const
void envLookup(const UT_Vector3T< T > &R, fpreal angle, UT_Vector4T< T > &clr) const
IMG_ColorSpace
Modes for how to translate colors in images for texture lookups.
void bumpLookup(float u, float v, T &du, T &dv) const
void setBumpLookup(bool interp=false, TIL_BUMP_COMPUTE_TYPE type=TIL_BUMP_PRECOMPUTE)
bool getAlphaRequired() const
const til_Lookup * lookup() const