26 #ifndef _TIL_TextureMap_h_
27 #define _TIL_TextureMap_h_
45 class IMG_TTFilterInfo;
51 class TIL_TextureRaster;
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);
252 static void clearCache(
int only_out_of_date=0);
262 static int getAutoFlush();
263 static void setAutoFlush(
int onOff);
268 static void imageDataDied(
void *imagedata);
272 static void setNonRATError(
bool on);
273 static bool getNonRATError();
289 bool isPtex()
const {
return myPtex !=
nullptr; }
290 bool isOIIO()
const {
return myOIIO !=
nullptr; }
292 const til_Lookup *
lookup()
const {
return myLookup; }
293 const til_PtexData *
ptexData()
const {
return myPtex.get(); }
294 const til_OIIOData *
oiioData()
const {
return myOIIO.get(); }
301 const til_Lookup *myLookup;
315 bool isValid()
const {
return myMipMapRes.size() > 0; }
316 bool mipMapped()
const {
return myMipMapRes.size() > 1; }
317 int mipCount()
const {
return myMipMapRes.size(); }
334 const char *relativeTo =
nullptr,
375 const char *relativeTo,
377 bool always_resolve =
true,
378 bool force_disk_cache =
false);
386 { getResolution(getLookupHandle(), x, y); }
387 int getNChannels()
const;
394 void setFaceIndex(
int index);
400 void setPtexChannel(
int index);
410 void setFilterWidths(
float xwidth,
float ywidth);
411 void setFilterBlurs(
float xblur,
float yblur);
412 void setMipInterpolate(
int onoff);
416 void setBeerLambert(
bool beerlambert);
419 void setZSkew(
float zskew);
423 myIESNormalization =
mode;
435 bool needalpha =
true)
437 myInterpRequired = interp;
438 myAlphaRequired = needalpha;
443 myInterpRequired = interp;
453 bool isDefault()
const;
478 template <
typename T>
482 colorLookup(h, u, v, clr);
484 template <
typename T>
489 colorLookup(h, u, v, clr);
492 float farvalue=1E6)
const
495 return depthLookup(h, u, v, farvalue);
497 template <
typename T>
502 bumpLookup(h, u, v, du, dv);
505 template <
typename T>
510 envLookup(h, R, angle, clr);
513 template <
typename T>
519 envLookup(h, r00, r10, r11, r01, clr);
530 const float u[4],
const float v[4],
533 const float u[4],
const float v[4],
537 float farvalue=1E6)
const;
572 float quality,
int maxsamples);
578 float quality,
int maxsamples);
603 bool textureInfo(TextureInfo &info)
const;
606 bool loadMipRaster(
int mip_level,
612 bool isVolatileTexture()
const;
616 bool hasTextureChanged(
const TIL_Raster **newraster = 0);
625 const TIL_Cdf2D *getCDF(
int maxres=512);
631 void resolveHandles();
635 float quality,
int maxsamples)
const;
641 float quality,
int maxsamples)
const;
643 void updateHandles();
648 if (myOIIO || myPtex)
651 void doUpdateFilter();
665 int myIESNormalization;
666 float myIESAngleScale;
667 bool myInterpRequired;
668 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