13 #ifndef RE_OGLTexture_h
14 #define RE_OGLTexture_h
39 virtual const char *className()
const;
48 virtual bool hasMipMapSupport(
RE_Render *);
51 virtual int getMaxTextureSize(
RE_Render *r) = 0;
54 virtual int getMaxTextureIndex(
RE_Render *r);
60 virtual bool isValid()
const;
95 int getFormatSize()
const;
112 bool getAutoCompression()
const;
116 void setResolution(
int w,
int h = 1,
int depth = 1,
117 bool force_pow2 =
false);
118 int getWidth()
const;
119 int getHeight()
const;
120 int getDepth()
const;
124 int getGLWidth()
const;
125 int getGLHeight()
const;
126 int getGLDepth()
const;
130 float getTexS()
const;
131 float getTexT()
const;
132 float getTexR()
const;
135 virtual void setSamples(
int samples);
136 int getSamples()
const;
142 void setMipMap(
bool m,
bool autogen =
true);
143 bool getMipMap()
const;
144 bool getMipMapAutoGenerate()
const;
148 bool isMipMapped()
const;
180 bool proxy=
false) = 0;
183 virtual int64 getSizeBytes()
const;
187 int64 getScanBytes()
const;
188 int64 getScanBytes(
int sublen)
const;
191 int64 getBitsPerPixel()
const;
194 int64 getTextureSize()
const;
204 int zoffset=0,
int zsize=1) = 0;
216 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
227 int src_x,
int src_y,
int src_z,
228 int dst_x,
int dst_y,
int dst_z,
251 void setMaxAnisotropy(
RE_Render *r,
int atf);
252 int getMaxAnisotropy()
const;
257 float getLodBias()
const;
264 bool getWrapS()
const;
265 bool getWrapT()
const;
266 bool getWrapR()
const;
314 bool removeResidentTexture(
RE_Render *r);
328 int level = 0)
const;
334 static void adjustPow2(
int &
w,
int &
h,
int &d);
340 void removeReference(
void *ref_obj);
347 void invalidateCache();
350 void print(std::ostream *os =
nullptr);
355 static void dumpTextureTable(std::ostream &os,
356 int64 min_tex_size = -1);
362 void setupTextureParameters(
RE_Render *r,
bool force);
367 virtual int getGLType()
const = 0;
368 virtual int getGLProxy()
const = 0;
369 virtual int getGLTypeBinding()
const = 0;
373 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
375 bool createTextureID();
381 void * compressTexData(
const void *
src,
int &
w,
int &
h);
382 void determineCompressionInternal();
396 void updateTextureWrap(
RE_Render *r,
bool force);
397 void updateFilters(
RE_Render *r,
bool force);
400 void buildFormatTable();
414 bool myMipMapAutoGenFlag;
415 bool myAutoCompressFlag;
439 return myTexDimension;
445 myTextureDataType =
type;
448 setFormat(myDataType, myVectorSize, myFormatExtra);
454 return myTextureDataType;
460 return myID != 0 && myValidFlag;
490 return myFormatExtra;
538 return myAutoCompressFlag;
562 return myMipMapAutoGenFlag;
592 return myCurrentFilterState.
getWrapS();
598 return myCurrentFilterState.
getWrapT();
604 return myCurrentFilterState.
getWrapR();
610 return "RE_OGLTexture";
634 return float(myWidth) / float(
myGLWidth);
646 return float(myDepth) / float(
myGLDepth);
virtual int getMaxTextureIndex(RE_Render *r)
GLint GLint GLint yoffset
bool getMipMapAutoGenerate() const
GLint GLint GLsizei GLint border
RE_GPUType getClientType() const
virtual const char * className() const
int64 getMemoryUsage(bool inclusive) const override
int64 getTextureSize() const
GT_API const UT_StringHolder time
RE_TextureFormatExtra getFormatExtra() const
RE_TexFiltType getMagFilter() const
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLuint const GLchar * name
bool getAutoCompression() const
unsigned long long uint64
int getMaxAnisotropy() const
virtual int getGLCreateType() const
virtual bool hasMipMapSupport(RE_Render *)
RE_TexFiltType getMagFilter() const
int getInternalFormat() const
RE_TextureDimension getTextureType() const
GLubyte GLubyte GLubyte GLubyte w
GLint GLint GLsizei GLsizei GLsizei depth
bool hasFileModTime() const
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
GLint GLint GLsizei GLint GLenum GLenum type
RE_TextureID getID() const
void print(std::FILE *f, const S &format_str, Args &&...args)
RE_TextureCompress myCompression
unsigned int RE_TextureID
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei const GLchar * label
int getFormatSize() const
int getFileModTime() const
GLdouble GLdouble GLdouble z
virtual bool hasTextureSupport(RE_Render *r)
RE_TextureCompress getCompression() const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
int64 getScanBytes() const
void setFileModTime(int time)
int getMaxAnisotropy() const
GLint GLsizei GLsizei height
RE_TexFiltType getMinFilter() const
uint64 getTextureHandle() const
GLint GLint GLsizei GLint GLenum format
GLfloat GLfloat GLfloat GLfloat h
virtual bool isValid() const
Cached object implementation for RE_TextureCache.
RE_TexClampType getWrapR() const
RE_TexClampType getWrapS() const
RE_TextureDataType getDataType() const
RE_GPUType getFormatType() const
RE_TexFiltType getMinFilter() const
void setAlphaInfo(IMG_FileAlphaInfo a)
IMG_FileAlphaInfo getAlphaInfo() const
void setDataType(RE_TextureDataType type)
RE_TexClampType getWrapT() const
GLfloat GLfloat GLfloat alpha
GLint GLint GLint GLint zoffset
void setFormat(RE_GPUType data, int vectorsize, RE_TextureFormatExtra format_extra=RE_TEXTURE_FORMAT_EXTRA_NONE)