HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TIL_TextureMap.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT library (C++)
7  *
8  * COMMENTS: There are two classes defined here. If you're using one,
9  * you'll use the other:
10  * TIL_TextureMap - a texture map. It knows how to lookup
11  * it's raster for you.
12  * TIL_TextureCache - The cache control specifies parameters
13  * used in the internal cache for
14  * texture maps
15  * This class is simply a verb class which
16  * accesses an internal class.
17  *
18  * The only way to get at the texture cache is through a
19  * TIL_TextureMap. This allows the cache to keep a good
20  * record of references. The rasters are loaded on demand
21  * which means that unless you look up a color, you don't
22  * load the raster.
23  *
24  */
25 
26 #ifndef _TIL_TextureMap_h_
27 #define _TIL_TextureMap_h_
28 
29 #include "TIL_API.h"
30 #include <IMG/IMG_FileTypes.h>
31 #include <IMG/IMG_TextureFilter.h>
32 #include <UT/UT_Array.h>
33 #include <UT/UT_FilterType.h>
34 #include <UT/UT_NonCopyable.h>
35 #include <UT/UT_Rect.h>
36 #include <UT/UT_Set.h>
37 #include <UT/UT_SharedPtr.h>
38 #include <UT/UT_String.h>
39 #include <UT/UT_StringHolder.h>
40 #include <UT/UT_UniquePtr.h>
41 #include <UT/UT_Vector2.h>
42 #include <UT/UT_Vector3.h>
43 #include <UT/UT_Vector4.h>
44 
45 class TIL_Raster;
46 class TIL_TextureMap;
47 class TIL_Cdf2D;
48 class IMG_TTFilterInfo;
49 class IMG_File;
50 class IMG_FileTTMap;
51 class UT_Options;
52 class til_Map; // Internal structure
53 class til_Lookup; // Internal structure
54 class TIL_TextureRaster; // Not exposed through HDK
55 class UT_Filter;
56 class UT_OpCaller;
57 
58 //
59 // An enum for bump map computation type
60 //
61 
63 {
70 };
71 
73 {
74  TIL_PTEX_COMPLEMENT_S = 0x01, // Complement the S coordinate
75  TIL_PTEX_COMPLEMENT_T = 0x02, // Complement the T coordinate
76  TIL_PTEX_SWAP_ST = 0x04, // Swap S/T coordinates
77 
78  // Orientation matching http://ptex.us
80 
81  // The following are based on experimental evidence and may not be correct
82  // Mudbox has the t coordinate flipped and the ST coordinats swapped
84 };
85 
87 {
88 public:
89  /// Callback for missing texture
91  virtual ~TIL_MissingTexture();
93 
94  /// Callback invoked when a texture can't be found. It's possible @c
95  /// filename may be a @c nullptr.
96  virtual void missingTexture(const char *filename) const {};
97 
98  /// Callback invoked when a texture is converted internally to a .rat
99  virtual void convertToRat(const char *filename, bool ies) const {};
100 };
101 
103 public:
104  const char *myFilename; // Filename for the raster
105  int myXres, myYres; // Resolution
107  int myImageCount; // Image count...
109  int myOwnership; // If it's a COP, this will be 0
110 };
111 
113 public:
115  : myOptions(NULL)
116  , myShared()
117  { }
119  : myOptions(options)
120  , myShared()
121  { }
124  : myOptions(options)
125  , myShared(shared)
126  { }
128  : myOptions(opts.myOptions)
129  , myShared(opts.myShared)
130  { }
132 
134  {
135  if (&src != this)
136  {
137  myShared = src.myShared;
138  myOptions = src.myOptions;
139  }
140  return *this;
141  }
142 
143  const UT_Options *get() const { return myOptions; }
144 
145 private:
146  const UT_Options *myOptions;
147  UT_SharedPtr<UT_Options> myShared;
148 };
149 
150 //
151 // The texture cache control class
152 //
154 {
155 public:
156 //
157 // Limit the raster size of a texture map to the size specified
158  static int getMaxWidth();
159  static int getMaxHeight();
160  static void setMaxSize(int w=256, int h=256);
161 
162 //
163 // Limit the maximum number of maps in core at once
164  static int getCacheSize();
165  static void setCacheSize(int size=100);
166 
167 // Limit the maps to max amount of memory (in Mb)
168  static int64 getCacheMemSize();
169  static void setCacheMemSize(int64 sizeinmb);
170 
171 //
172 // Query methods for the cache.
173  static void getImageStat(UT_Array<TIL_TextureMapStat> &stats);
174 
175  // Simple method to get memory usage
176  static int64 getMemoryUsage();
177 
178  static void getConversionStats(exint &num_conversions,
179  exint &current_memory,
180  exint &peak_memory);
181 
182  static void storeTexture(const UT_StringHolder &name,
184  static void eraseTexture(const UT_StringHolder &name);
185 
187  {
189 
190  int max_open_files = 0;
191  float max_memory_MB = 0;
192  int autotile = 0;
193  int autoscanline = 0;
194  int automip = 0;
195  int forcefloat = 0;
196  int accept_untiled = 0;
197  int accept_unmipped = 0;
198  int deduplicate = 0;
199  int unassociatedalpha = 0;
200  int failure_retries = 0;
201  int max_errors_per_file = 0;
202  int trust_file_extensions = 0;
203  int max_mip_res = 0;
204 
205  // Read-only options
206  int64 cache_memory_used = 0;
207  int tiles_created = 0;
208  int tiles_current = 0;
209  int tiles_peak = 0;
210  int open_files_created = 0;
211  int open_files_current = 0;
212  int open_files_peak = 0;
213 
214  int64 image_size = 0; // total size
215  int64 file_size = 0; // total size on disk
216  int64 bytes_read = 0; // bytes read
217  int unique_files = 0;
218  float fileio_time = 0;
219  float fileopen_time = 0;
220  };
221  static bool getOIIOStats(OIIOStats &stats);
222 
223  static UT_StringHolder getOIIOStats(int level=1);
224 
226  {
234  };
235  static void getPtexStats(PtexStats &stats);
236 
237  // List of all invalid textures since the cache was last cleared
239  : public UT_NonCopyable
240  {
241  ErrorFiles();
242  ~ErrorFiles();
243 
245  };
246  static ErrorFiles getErrorFiles();
247 
248 //
249 // The version of the cache updates everytime something in it changes
250 // or is removed. This way we can clear display lists, etc.
251  static int getVersion();
252 
253  static void bumpVersion();
254 
255  /// Close all file descriptors, without flushing the cache
256  static void closeAllFiles();
257 
258 //
259 // Flush all maps out of core.
260  static void clearCache(int only_out_of_date=0);
261 
262 //
263 // Flush a map by name.
264  static void clearCache(const UT_StringRef &mapname);
265 
266 //
267 // Set auto-flushing of the cache. That is, as soon as the map is
268 // dereferenced completely, flush it from the cache. This can slow
269 // some applications down.
270  static int getAutoFlush();
271  static void setAutoFlush(int onOff);
272 
273 //
274 // Inform the cache of any deleted rasters that it may be referencing
275  static void rasterDied(TIL_Raster *raster);
276  static void imageDataDied(void *imagedata); // for COPs 1.
277 
278 //
279 // If a texture map is not a .rat file, exit with an error on load.
280  static void setNonRATError(bool on);
281  static bool getNonRATError();
282 };
283 
284 class til_PtexData;
285 class til_OIIOData;
286 
288 {
289 public:
291  : myLookup(0)
292  {
293  }
294 
295  const til_Lookup *lookup() const { return myLookup.get(); }
296 
297 private:
299 
300  UT_SharedPtr<til_Lookup> myLookup;
301  friend class TIL_TextureMap;
302 };
303 
305 {
306 public:
307  // Information about a texture
308  struct TextureInfo
309  {
310  void dump() const;
311 
312  bool isValid() const { return myMipMapRes.size() > 0; }
313  bool mipMapped() const { return myMipMapRes.size() > 1; }
314  int mipCount() const { return myMipMapRes.size(); }
315 
317  PXL_DataFormat myDataFormat = PXL_INT8;
318  int myChannelCount = 0;
319  int myMipOffset = 0;
320  };
321 
323  {
324  forceDiskCache(bool enable=true)
325  : myEnable(enable)
326  {
327  }
328  bool myEnable;
329  };
330 
332  const char *relativeTo = nullptr,
333  TIL_Raster *rp = nullptr);
334 
335  TIL_TextureMap(const UT_StringHolder &mapname, const forceDiskCache &);
336 
337  virtual ~TIL_TextureMap();
338 
340 
341  /// Returns whether a filename has UDIM formatting characters
342  static bool hasUDIM(const char *format);
343 
344  /// Expand a file containing %(UDIM)d, %(U)d or %(V)d formatting characters
345  /// The @c iu and @c iv parameters passed in are the zero-based coordinates
346  /// (i.e. UDIM == (1000 + iu+1+ 10*iv) and U == iu+1).
347  ///
348  /// For example: expandUDIM("%s/%s_%(UDIM)%d_%(U)02d_%(V)d.rat", 3, 7)
349  /// will return "%s/%s_1074_04_8.rat"
350  static UT_StringHolder expandUDIM(const char *format, int iu, int iv);
351 
352  /// Set the callback for missing textures. This returns the previous
353  /// callback.
354  static const TIL_MissingTexture *setMissingTexture(
355  const TIL_MissingTexture *m);
356 
357  /// Access the missing texture callback without having to set it
358  static const TIL_MissingTexture *getMissingTexture();
359 
360  /// Check existence of a texture map.
361  static bool mapExists(const UT_StringRef &name);
362 
363  /// Check existence of a UDIM directory. The path passed in should be the
364  /// expanded UDIM texture path. This allows you to check for paths where
365  /// the <UDIM> token is in the directory name (rather than the filename).
366  ///
367  /// If the directory is missing, this will print a warning and notify the
368  /// missing texture callback.
369  static bool validUDIMDirectory(const UT_StringRef &udim_name);
370 
371  void setOpCaller(UT_OpCaller *c) { myCaller = c; }
372  void setMap(const UT_StringHolder &name,
373  const char *relativeTo,
374  TIL_Raster *rp = nullptr,
375  bool always_resolve = true,
376  bool force_disk_cache = false);
377  const UT_StringHolder &getMap() const;
378 
379  void clearRaster();
380  void forceReload();
381  const TIL_Raster *getOGLRaster();
382  TIL_TextureOptions getTextureOptions() const;
383  void getResolution(int &x, int &y)
384  { getResolution(getLookupHandle(), x, y); }
385  int getNChannels() const;
386 
387  // The color channel name may be NULL representing the default channel
388  void setColorChannelName(const UT_StringHolder &n);
389  const UT_StringHolder &getColorChannelName() const;
390 
391  // Set the face index
392  void setFaceIndex(int index);
393  int getFaceIndex() const { return myFaceIndex; }
394  // Set the subimage for OIIO lookup
395  void setSubimage(int i) { mySubimage = i; }
396  int getSubimage() const { return mySubimage; }
397  // Set the channel offset (offset into the tuple data)
398  void setPtexChannel(int index);
399  int getPtexChannel() const { return myPtexChannel; }
400 
401  // ptexture orientation
402  TIL_PtexOrient ptexOrient() const { return myPtexOrient; }
403  void setPtexOrient(TIL_PtexOrient o) { myPtexOrient = o; }
404 
405  void setFilter(UT_FilterType filter, float xw, float yw);
406  void setXFilter(UT_FilterType filter);
407  void setYFilter(UT_FilterType filter);
408  void setFilterWidths(float xwidth, float ywidth);
409  void setFilterBlurs(float xblur, float yblur);
410  void setMipInterpolate(int onoff);
411  void setWrapMode(UT_FilterWrap uwrap, UT_FilterWrap vwrap,
412  const UT_Vector4 &border);
413  void setDeepInterp(IMG_DeepInterp interp);
414  void setBeerLambert(bool beerlambert);
415  void setSourceColorSpace(IMG_ColorSpace convert);
416  void setFilterMode(IMG_TextureFilter::FilterMode m);
417  void setZSkew(float zskew);
418  // IES normalization- 0: none 1: max value (default) 2: preserve energy
420  {
421  myIESNormalization = mode;
422  }
423  int iesNormalization() const { return myIESNormalization; }
424  void setIESAngleScale(float scale) { myIESAngleScale = scale; }
425  float iesAngleScale() const { return myIESAngleScale; }
426 
427  const UT_Filter *getXFilter() const { return myFilter.getXFilter(); };
428  const UT_Filter *getYFilter() const { return myFilter.getYFilter(); };
429  float getXFilterWidth() const { return myFilter.getXWidth(); }
430  float getYFilterWidth() const { return myFilter.getYWidth(); }
431 
432 //
433 // Functions used to set the color lookup behaviour of the map
434  void setColorLookup(bool interp = true,
435  bool needalpha = true)
436  {
437  myInterpRequired = interp;
438  myAlphaRequired = needalpha;
439  }
440  void setBumpLookup(bool interp = false,
442  {
443  myInterpRequired = interp;
444  myBumpType = type;
445  }
446 
447  UT_FilterWrap getUWrap() const { return myFilter.getXWrap(); }
448  UT_FilterWrap getVWrap() const { return myFilter.getYWrap(); }
449  const UT_Vector4 &getBorder() const { return myFilter.getBorder(); }
450 
451  // If the texture failed to load, this method will tell us whether it
452  // is using the default lookup functionality.
453  bool isDefault() const;
454  int isTTMap() const;
455  int isDSM() const;
456  bool isPtex() const;
457  bool isOIIO() const;
458  int isIES() const;
459 
460 //
461 // Lookup a single sample of the image, interpreting the map as a color
462 // When specifying four corners of the map, the order of the coordinates
463 // is very important:
464 //
465 // BAD GOOD GOOD
466 // 2--3 3--2 2--3
467 // \/ | | | |
468 // /\ | | | |
469 // 0--1 0--1 1--0
470 
471  /// When performing multiple texture evaluations, this allows the texture
472  /// class to pre-compute some common values rather than performing the
473  /// computation on every lookup.
474  TIL_TextureHandle getLookupHandle() const;
475 
476  /// @{
477  /// Evaluate using an automatic lookup handle
478  template <typename T>
479  inline void colorLookup(float u, float v, UT_Vector4T<T> &clr) const
480  {
481  TIL_TextureHandle h = getLookupHandle();
482  colorLookup(h, u, v, clr);
483  }
484  template <typename T>
485  inline void colorLookup(const float u[4], const float v[4],
486  UT_Vector4T<T> &clr) const
487  {
488  TIL_TextureHandle h = getLookupHandle();
489  colorLookup(h, u, v, clr);
490  }
491  fpreal depthLookup(float u, float v,
492  float farvalue=1E6) const
493  {
494  TIL_TextureHandle h = getLookupHandle();
495  return depthLookup(h, u, v, farvalue);
496  }
497  template <typename T>
498  void bumpLookup(float u, float v,
499  T &du, T &dv) const
500  {
501  TIL_TextureHandle h = getLookupHandle();
502  bumpLookup(h, u, v, du, dv);
503  }
504 
505  template <typename T>
506  inline void envLookup(const UT_Vector3T<T> &R, fpreal angle,
507  UT_Vector4T<T> &clr) const
508  {
509  TIL_TextureHandle h = getLookupHandle();
510  envLookup(h, R, angle, clr);
511  }
512 
513  template <typename T>
514  inline void envLookup(const UT_Vector3T<T> &r00, const UT_Vector3T<T> &r10,
515  const UT_Vector3T<T> &r11, const UT_Vector3T<T> &r01,
516  UT_Vector4T<T> &clr) const
517  {
518  TIL_TextureHandle h = getLookupHandle();
519  envLookup(h, r00, r10, r11, r01, clr);
520  }
521  /// @}
522 
523  /// @{
524  /// Get the min/max color values in a texture file
526  { getMinMax(getLookupHandle(), min, max); }
528  { getMinMax(getLookupHandle(), min, max); }
529  void getMinMax(const TIL_TextureHandle &h,
530  UT_Vector4F &min, UT_Vector4F &max) const;
531  void getMinMax(const TIL_TextureHandle &h,
532  UT_Vector4D &min, UT_Vector4D &max) const;
533 
534  /// Get a checksum for the texture. If the texture is a MIP mapped texture
535  /// and @c compute_for_mips is true, the checksum will be computed from the
536  /// 128x128 MIP map.
537  const UT_StringHolder &getTextureChecksum(const TIL_TextureHandle &h) const;
539  { return getTextureChecksum(getLookupHandle()); }
540  /// @}
541 
542  /// @{
543  /// Evaluate using a lookup handle
544  void colorLookup(TIL_TextureHandle &h,
545  float u, float v, UT_Vector4F &clr) const;
546  void colorLookup(TIL_TextureHandle &h,
547  float u, float v, UT_Vector4D &clr) const;
548  void colorLookup(TIL_TextureHandle &h,
549  const float u[4], const float v[4],
550  UT_Vector4F &clr) const;
551  void colorLookup(TIL_TextureHandle &h,
552  const float u[4], const float v[4],
553  UT_Vector4D &clr) const;
554  float depthLookup(TIL_TextureHandle &h,
555  float u, float v,
556  float farvalue=1E6) const;
557  void bumpLookup(TIL_TextureHandle &h,
558  float u, float v,
559  fpreal32 &du, fpreal32 &dv) const;
560  void bumpLookup(TIL_TextureHandle &h,
561  float u, float v,
562  fpreal64 &du, fpreal64 &dv) const;
563 
564  void envLookup(TIL_TextureHandle &h,
565  const UT_Vector3F &R, fpreal angle,
566  UT_Vector4F &clr) const;
567  void envLookup(TIL_TextureHandle &h,
568  const UT_Vector3D &R, fpreal angle,
569  UT_Vector4D &clr) const;
570 
571  void envLookup(TIL_TextureHandle &h,
572  const UT_Vector3F &r00, const UT_Vector3F &r10,
573  const UT_Vector3F &r11, const UT_Vector3F &r01,
574  UT_Vector4 &clr) const;
575  void envLookup(TIL_TextureHandle &h,
576  const UT_Vector3D &r00, const UT_Vector3D &r10,
577  const UT_Vector3D &r11, const UT_Vector3D &r01,
578  UT_Vector4D &clr) const;
579  void getResolution(const TIL_TextureHandle &h,
580  int &x, int &y);
581  /// @}
582 
583  /// @{
584  /// Deep shadow lookup will fall back to regular depth map lookups
585  /// if this map is not a deep shadow map.
586  void deepLookup(TIL_TextureHandle &h,
587  UT_Vector3F &clr,
588  const UT_Vector3F &p,
589  const UT_Vector3F &du,
590  const UT_Vector3F &dv,
591  float quality, int maxsamples);
592  void deepLookup(TIL_TextureHandle &h,
593  UT_Vector3D &clr,
594  const UT_Vector3D &p,
595  const UT_Vector3D &du,
596  const UT_Vector3D &dv,
597  float quality, int maxsamples);
598  /// @}
599 
600  /// Query filter information
601  const IMG_TextureFilter &getFilter() const { return myFilter; }
602  IMG_TextureFilter &getFilter() { return myFilter; }
603 
604  // Adjust scales should only be called internally.
606  {
607  return myBumpType;
608  }
609 
610  bool getInterpRequired() const { return myInterpRequired; }
611  bool getAlphaRequired() const { return myAlphaRequired; }
612 
613  /// Get the OCIO color space associated with the file
614  const UT_StringHolder &ocioColorSpace() const;
615 
616  /// Lookup the wrap mode in metadata on the image. Returns false if
617  /// there's no metadata.
618  void wrapMode(UT_StringHolder &swrap,
619  UT_StringHolder &twrap) const;
620 
621  /// Load information about texture and MIP levels
622  bool textureInfo(TextureInfo &info) const;
623 
624  /// Load the raster for a given MIP level, possibly converting the data
625  bool loadMipRaster(const TIL_TextureHandle &h,
626  int mip_level,
627  const TextureInfo &tinfo,
628  const UT_DimRect &region,
629  void *data) const;
630  bool loadMipRaster(int mip_level,
631  const TextureInfo &tinfo,
632  const UT_DimRect &region,
633  void *data) const
634  {
635  return loadMipRaster(getLookupHandle(),
636  mip_level, tinfo, region, data);
637  }
638 
639  // Returns true if the texture is volatile (ie, sourced from a COP). It
640  // needs to be checked every time it's accessed to se if it's been updated.
641  bool isVolatileTexture() const;
642 
643  // Returns true if a volatile texture has changed, and optionally returns
644  // the new raster in the newraster parm.
645  bool hasTextureChanged(const TIL_Raster **newraster = 0);
646 
647  // Return the IMG File used (for TT maps). This may contain filters.
648  IMG_File *getFile();
649 
650  // Returns the unfiltered TT map.
651  IMG_FileTTMap *getTTMap();
652 
653  /// Return a 2d CDF for sampling
654  const TIL_Cdf2D *getCDF(int maxres=512);
655 
656  // Look up the color channel index
657  int getColorChannelIndex(IMG_FileTTMap *map) const;
658 
659 private:
660  void resolveHandles();
661  float shadowLookup(const UT_Vector3 &p,
662  const UT_Vector3 &du,
663  const UT_Vector3 &dv,
664  float quality, int maxsamples) const;
665 
666  // This version of the shadow lookup is used when there are no
667  // derivatives available (for non-shading contexts)
668  float shadowLookup(const UT_Vector3 &Ps,
669  float du, float dv,
670  float quality, int maxsamples) const;
671 
672  void updateHandles();
673 
674 private:
675  void updateFilter()
676  {
677  if (myOIIO || myPtex)
678  doUpdateFilter();
679  }
680  void doUpdateFilter();
681 
682  til_Map *myMap;
685  UT_SharedPtr<til_Lookup> myMapLookup;
686  UT_OpCaller *myCaller;
687  IMG_TextureFilter myFilter;
688  UT_StringHolder myColorChannel;
689 
690  int myFaceIndex;
691  int mySubimage;
692  int myPtexChannel;
693  TIL_BUMP_COMPUTE_TYPE myBumpType;
694  TIL_PtexOrient myPtexOrient;
695  int myIESNormalization;
696  float myIESAngleScale;
697  bool myInterpRequired;
698  bool myAlphaRequired;
699 };
700 
701 #endif
type
Definition: core.h:556
TIL_TextureOptions(const UT_Options *options)
int getVersion(int version)
Definition: ImfVersion.h:99
GT_API const UT_StringHolder filename
bool isDefault(const cgltf_texture_view &tv)
UT_FilterWrap getVWrap() const
const UT_Set< UT_StringHolder > * myFileList
TIL_BUMP_COMPUTE_TYPE getBumpCompute() const
SIM_API const UT_StringHolder angle
const UT_Filter * getYFilter() const
const GLdouble * v
Definition: glcorearb.h:837
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
void getMinMax(UT_Vector4D &min, UT_Vector4D &max) const
forceDiskCache(bool enable=true)
TIL_PtexOrient ptexOrient() const
const UT_StringHolder & getTextureChecksum() const
int64 exint
Definition: SYS_Types.h:125
GLint level
Definition: glcorearb.h:108
TIL_MissingTexture()
Callback for missing texture.
UT_FilterWrap
Definition: UT_FilterType.h:42
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
int getFaceIndex() const
int getPtexChannel() const
GLint y
Definition: glcorearb.h:103
Tto convert(const Tfrom &source)
3D Vector class.
UT_FilterType
Definition: UT_FilterType.h:16
float iesAngleScale() const
float fpreal32
Definition: SYS_Types.h:200
UT_Array< UT_Vector2i > myMipMapRes
fpreal depthLookup(float u, float v, float farvalue=1E6) const
void setPtexOrient(TIL_PtexOrient o)
int getSubimage() const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
double fpreal64
Definition: SYS_Types.h:201
const IMG_TextureFilter & getFilter() const
Query filter information.
IMG_DeepInterp
GA_API const UT_StringHolder scale
GLdouble n
Definition: glcorearb.h:2008
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:108
IMG_TextureFilter & getFilter()
float getYFilterWidth() const
void setIESNormalization(int mode)
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
Definition: UT_SharedPtr.h:36
TIL_BUMP_COMPUTE_TYPE
OIIO_UTIL_API uint64_t file_size(string_view path) noexcept
TIL_TextureOptions(const TIL_TextureOptions &opts)
GLint GLint GLsizei GLint GLenum format
Definition: glcorearb.h:108
TIL_TextureOptions(const UT_Options *options, UT_SharedPtr< UT_Options > shared)
TIL_PtexOrient
#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()
long long int64
Definition: SYS_Types.h:116
const TIL_TextureOptions & operator=(const TIL_TextureOptions &src)
bool loadMipRaster(int mip_level, const TextureInfo &tinfo, const UT_DimRect &region, void *data) const
GLuint const GLchar * name
Definition: glcorearb.h:786
UT_FilterWrap getUWrap() const
const char * myFilename
PXL_DataFormat
Definition: PXL_Common.h:20
void setSubimage(int i)
void getResolution(int &x, int &y)
GLint GLenum GLint x
Definition: glcorearb.h:409
Modes for filtering.
virtual void convertToRat(const char *filename, bool ies) const
Callback invoked when a texture is converted internally to a .rat.
GLenum mode
Definition: glcorearb.h:99
GLsizeiptr size
Definition: glcorearb.h:664
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
A map of string to various well defined value types.
Definition: UT_Options.h:87
GLint GLint GLsizei GLint border
Definition: glcorearb.h:108
bool getInterpRequired() const
void getMinMax(UT_Vector4F &min, UT_Vector4F &max) const
const UT_Filter * getXFilter() const
fpreal64 fpreal
Definition: SYS_Types.h:283
GLuint index
Definition: glcorearb.h:786
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
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
void envLookup(const UT_Vector3T< T > &R, fpreal angle, UT_Vector4T< T > &clr) const
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
OutGridT XformOp bool bool shared
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
int iesNormalization() const
#define TIL_API
Definition: TIL_API.h:10
void setBumpLookup(bool interp=false, TIL_BUMP_COMPUTE_TYPE type=TIL_BUMP_PRECOMPUTE)
bool getAlphaRequired() const
void setIESAngleScale(float scale)
Definition: format.h:1821
const til_Lookup * lookup() const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297
GLenum src
Definition: glcorearb.h:1793