14 #ifndef __RE_TextureMap_h__
15 #define __RE_TextureMap_h__
23 class RE_TextureCache;
24 class re_AutoTextureSource;
37 myTexture->setInUse(
true);
40 : myTexture(src.myTexture)
43 myTexture->setInUse(
true);
48 myTexture->setInUse(
false);
51 bool isValid()
const {
return myTexture != NULL; }
58 myTexture->setInUse(
false);
65 *
this = tex.myTexture;
72 myTexture->setInUse(
false);
78 {
return myTexture == tex; }
80 {
return myTexture != tex; }
82 {
return myTexture == tex.myTexture; }
84 {
return myTexture != tex.myTexture; }
87 {
return myTexture ? myTexture->getUsage() : 0; }
101 virtual int64 getMemoryUsage(
bool inclusive)
const;
103 virtual const char *className()
const;
119 const char *relativeTo);
127 const char *relativeTo,
130 void *releaseObject);
153 void setSourceModifyCallback(
const char *opname,
161 void clearStoredTexture();
192 void clear(
const char *clear_name = NULL);
196 bool isSourceValid();
199 void getResolution(
int &
w,
int &
h,
int &d);
208 float getAspectRatio();
210 float getAspectRatioXZ();
227 void sizeTo(
int w,
int h,
int d=1);
236 void maxSize(
int w,
int h,
int d);
240 void maxMemSize(
int mem_limit_mb);
244 void makePow2(
bool pow2);
250 void setMipMap(
bool mip);
255 { myFormatOption = opt; }
260 { myTextureComponent = SYSclamp(texcomp, -1, 3); }
265 { myTextureRGBMono = fill_rgb_mono; }
269 { myOpaqueAlpha = opaque_alpha; }
281 static void textureReferenceDeleted(
void *,
RE_Texture *t);
284 static void setTextureCacheSize(
int64 size_in_mb);
285 static int64 getTextureCacheSize();
287 static int64 getTextureCacheUsage();
288 static int64 get2DTextureUsage();
289 static int64 get3DTextureUsage();
290 static int64 getMipMapUsage();
291 static int64 get3DTextureFP32Size();
292 static int64 get3DTextureFP16Size();
293 static int64 get2DTextureFP32Size();
294 static int64 get2DTextureFP16Size();
295 static int64 getOrig3DTextureFP32Size();
296 static int64 getOrig3DTextureFP16Size();
297 static int64 getOrig2DTextureFP32Size();
298 static int64 getOrig2DTextureFP16Size();
300 static void pruneTextureCache();
301 static void clearTextureCache();
302 static void debugDumpCache();
307 static void recordTextureMapUsage(
bool enable);
308 static bool recordingTextureUsage();
312 static int getNumUsedTextureMaps();
313 static int64 getUsedTextureMemory();
320 virtual void buildSourceName(
UT_String &cachedname,
321 const char *map,
const char *rel);
322 virtual void buildTextureName(
UT_String &cachedname,
323 const char *map,
const char *rel);
324 re_AutoTextureSource getTextureSource(
const char *map,
const char *relto,
329 void getDesiredResolution(
RE_GPUType type,
int vsize,
330 int *
w,
int *
h,
int *d);
343 virtual bool getNodeSource(
const char *map,
const char *rel,
348 int &
w,
int &
h,
int &d);
349 virtual bool getFileSource(
const char *map,
354 int &
w,
int &
h,
int &d);
372 {
return myFormatOption; }
375 const char *filename,
395 static bool cachedMapReleased(
void *tex,
void *map);
405 int myTextureComponent;
406 bool myTextureRGBMono;
412 void *myModifyCallbackData;
416 RE_TextureCache *myCache;
420 void *myReleaseObject;
427 return "RE_TextureMap";
RE_TextureFormatExtra getTextureFormatOption() const
bool operator==(const RE_TextureHolder &tex) const
const RE_TextureFilter & filter() const
virtual const char * className() const
void checkAlphaDetails(bool check)
void operator=(RE_Texture *tex)
bool getOpaqueAlpha() const
GLint GLint GLsizei GLint GLenum GLenum const void * pixels
void setTextureFormatOption(RE_TextureFormatExtra opt)
RE_TextureCompress getCompression() const
const char * getRelativePath() const
RE_TextureFilter & filter()
RE_TextureFormatExtra option
bool operator!=(const RE_TextureHolder &tex) const
RE_Texture * operator->() const
void setTextureComponent(int texcomp)
virtual void cachedTextureFound(RE_Texture *tex)
RE_TextureCompress myCompression
RE_CacheVersion getVersion() const
void operator=(const RE_TextureHolder &tex)
IMG_FileAlphaInfo myAlphaInfo
bool operator!=(const RE_Texture *tex) const
RE_Texture * operator*() const
void fillRGBFromSingle(bool fill_rgb_mono)
RE_TextureHolder(const RE_TextureHolder &src)
RE_TextureHolder(RE_Texture *tex)
GLfloat GLfloat GLfloat GLfloat h
void setOpaqueAlpha(bool opaque_alpha)
IMG_FileAlphaInfo getAlphaDetails() const
File options for manipulating image data on load or save. This class allows you to modify the incomin...
bool operator==(const RE_Texture *tex) const
GLint GLint GLsizei GLint GLenum GLenum type
void setVersion(RE_CacheVersion v)
GLubyte GLubyte GLubyte GLubyte w
Simple class for a mutli-integer cache tag.
const char * getMapName() const
bool hasTaggedTexture() const