26 #ifndef _TIL_TextureMap_h_
27 #define _TIL_TextureMap_h_
45 class IMG_TTFilterInfo;
51 class TIL_TextureRaster;
93 virtual
void missingTexture(const
char *
filename)
const {};
125 : myOptions(opts.myOptions)
126 , myShared(opts.myShared)
134 myShared = src.myShared;
135 myOptions = src.myOptions;
155 static int getMaxWidth();
156 static int getMaxHeight();
157 static void setMaxSize(
int w=256,
int h=256);
161 static int getCacheSize();
162 static void setCacheSize(
int size=100);
165 static int64 getCacheMemSize();
166 static void setCacheMemSize(
int64 sizeinmb);
173 static int64 getMemoryUsage();
175 static void getConversionStats(
exint &num_conversions,
176 exint ¤t_memory,
188 float max_memory_MB = 0;
190 int autoscanline = 0;
193 int accept_untiled = 0;
194 int accept_unmipped = 0;
196 int unassociatedalpha = 0;
197 int failure_retries = 0;
198 int max_errors_per_file = 0;
199 int trust_file_extensions = 0;
204 int tiles_created = 0;
205 int tiles_current = 0;
207 int open_files_created = 0;
208 int open_files_current = 0;
209 int open_files_peak = 0;
214 int unique_files = 0;
215 float fileio_time = 0;
216 float fileopen_time = 0;
218 static bool getOIIOStats(
OIIOStats &stats);
232 static void getPtexStats(
PtexStats &stats);
250 static void bumpVersion();
254 static void clearCache(
int only_out_of_date=0);
264 static int getAutoFlush();
265 static void setAutoFlush(
int onOff);
270 static void imageDataDied(
void *imagedata);
274 static void setNonRATError(
bool on);
275 static bool getNonRATError();
291 bool isPtex()
const {
return myPtex !=
nullptr; }
292 bool isOIIO()
const {
return myOIIO !=
nullptr; }
294 const til_Lookup *
lookup()
const {
return myLookup.get(); }
295 const til_PtexData *
ptexData()
const {
return myPtex.get(); }
296 const til_OIIOData *
oiioData()
const {
return myOIIO.get(); }
317 bool isValid()
const {
return myMipMapRes.size() > 0; }
318 bool mipMapped()
const {
return myMipMapRes.size() > 1; }
319 int mipCount()
const {
return myMipMapRes.size(); }
336 const char *relativeTo =
nullptr,
346 static
bool hasUDIM(const
char *
format);
373 static
bool validUDIMDirectory(const
UT_StringRef &udim_name);
377 const char *relativeTo,
379 bool always_resolve =
true,
380 bool force_disk_cache =
false);
388 { getResolution(getLookupHandle(), x, y); }
389 int getNChannels()
const;
396 void setFaceIndex(
int index);
402 void setPtexChannel(
int index);
412 void setFilterWidths(
float xwidth,
float ywidth);
413 void setFilterBlurs(
float xblur,
float yblur);
414 void setMipInterpolate(
int onoff);
418 void setBeerLambert(
bool beerlambert);
421 void setZSkew(
float zskew);
425 myIESNormalization =
mode;
437 bool needalpha =
true)
439 myInterpRequired = interp;
440 myAlphaRequired = needalpha;
445 myInterpRequired = interp;
455 bool isDefault()
const;
480 template <
typename T>
484 colorLookup(h, u, v, clr);
486 template <
typename T>
491 colorLookup(h, u, v, clr);
494 float farvalue=1E6)
const
497 return depthLookup(h, u, v, farvalue);
499 template <
typename T>
504 bumpLookup(h, u, v, du, dv);
507 template <
typename T>
512 envLookup(h, R, angle, clr);
515 template <
typename T>
521 envLookup(h, r00, r10, r11, r01, clr);
532 const float u[4],
const float v[4],
535 const float u[4],
const float v[4],
539 float farvalue=1E6)
const;
574 float quality,
int maxsamples);
580 float quality,
int maxsamples);
605 bool textureInfo(TextureInfo &info)
const;
608 bool loadMipRaster(
int mip_level,
614 bool isVolatileTexture()
const;
618 bool hasTextureChanged(
const TIL_Raster **newraster = 0);
627 const TIL_Cdf2D *getCDF(
int maxres=512);
633 void resolveHandles();
637 float quality,
int maxsamples)
const;
643 float quality,
int maxsamples)
const;
645 void updateHandles();
650 if (myOIIO || myPtex)
653 void doUpdateFilter();
667 int myIESNormalization;
668 float myIESAngleScale;
669 bool myInterpRequired;
670 bool myAlphaRequired;
TIL_TextureOptions(const UT_Options *options)
int getVersion(int version)
GT_API const UT_StringHolder filename
UT_FilterWrap getVWrap() const
virtual void convertToRat(const char *filename) const
Callback invoked when a texture is converted internally to a .rat.
const UT_Set< UT_StringHolder > * myFileList
TIL_BUMP_COMPUTE_TYPE getBumpCompute() const
const til_PtexData * ptexData() const
SIM_API const UT_StringHolder angle
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
forceDiskCache(bool enable=true)
TIL_PtexOrient ptexOrient() const
UT_StringHolder searchpath
TIL_MissingTexture()
Callback for missing texture.
int getPtexChannel() const
Tto convert(const Tfrom &source)
UT_Array< UT_Vector2i > myMipMapRes
fpreal depthLookup(float u, float v, float farvalue=1E6) const
void setPtexOrient(TIL_PtexOrient o)
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
const IMG_TextureFilter & getFilter() const
Query filter information.
GA_API const UT_StringHolder scale
IMG_TextureFilter & getFilter()
float getYFilterWidth() const
void setIESNormalization(int mode)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
OIIO_UTIL_API uint64_t file_size(string_view path) noexcept
TIL_TextureOptions(const TIL_TextureOptions &opts)
GLint GLint GLsizei GLint GLenum format
TIL_TextureOptions(const UT_Options *options, UT_SharedPtr< UT_Options > shared)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void setColorLookup(bool interp=true, bool needalpha=true)
const UT_Vector4 & getBorder() const
HUSD_API const char * raster()
const TIL_TextureOptions & operator=(const TIL_TextureOptions &src)
GLuint const GLchar * name
UT_FilterWrap getUWrap() const
void getResolution(int &x, int &y)
GLfloat GLfloat GLfloat GLfloat h
A map of string to various well defined value types.
GLint GLint GLsizei GLint border
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
PXL_DataFormat myDataFormat
void envLookup(const UT_Vector3T< T > &R, fpreal angle, UT_Vector4T< T > &clr) const
GLubyte GLubyte GLubyte GLubyte w
IMG_ColorSpace
Modes for how to translate colors in images for texture lookups.
OIIO_API size_t max_open_files()
Get the maximum number of open file handles allowed on this system.
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
void setIESAngleScale(float scale)
const til_Lookup * lookup() const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter