13 #ifndef RE_OGLTexture_h
14 #define RE_OGLTexture_h
40 virtual const char *className()
const;
49 virtual bool hasMipMapSupport(
RE_Render *);
52 virtual int getMaxTextureSize(
RE_Render *r) = 0;
55 virtual int getMaxTextureIndex(
RE_Render *r);
61 virtual bool isValid()
const;
96 int getFormatSize()
const;
113 bool getAutoCompression()
const;
117 void setResolution(
int w,
int h = 1,
int depth = 1,
118 bool force_pow2 =
false);
119 int getWidth()
const;
120 int getHeight()
const;
121 int getDepth()
const;
125 int getGLWidth()
const;
126 int getGLHeight()
const;
127 int getGLDepth()
const;
131 float getTexS()
const;
132 float getTexT()
const;
133 float getTexR()
const;
136 virtual void setSamples(
int samples);
137 int getSamples()
const;
143 void setMipMap(
bool m,
bool autogen =
true);
144 bool getMipMap()
const;
145 bool getMipMapAutoGenerate()
const;
149 bool isMipMapped()
const;
181 bool proxy=
false) = 0;
184 virtual int64 getSizeBytes()
const;
188 int64 getScanBytes()
const;
189 int64 getScanBytes(
int sublen)
const;
192 int64 getBitsPerPixel()
const;
195 int64 getTextureSize()
const;
205 int zoffset=0,
int zsize=1) = 0;
217 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
228 int src_x,
int src_y,
int src_z,
229 int dst_x,
int dst_y,
int dst_z,
252 void setMaxAnisotropy(
RE_Render *r,
int atf);
253 int getMaxAnisotropy()
const;
258 float getLodBias()
const;
265 bool getWrapS()
const;
266 bool getWrapT()
const;
267 bool getWrapR()
const;
315 bool removeResidentTexture(
RE_Render *r);
329 int level = 0)
const;
335 static void adjustPow2(
int &
w,
int &
h,
int &d);
341 void removeReference(
void *ref_obj);
348 void invalidateCache();
351 void print(std::ostream *os =
nullptr);
356 static void dumpTextureTable(std::ostream &os,
357 int64 min_tex_size = -1);
363 void setupTextureParameters(
RE_Render *r,
bool force);
368 virtual int getGLType()
const = 0;
369 virtual int getGLProxy()
const = 0;
370 virtual int getGLTypeBinding()
const = 0;
374 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
376 bool createTextureID();
382 void * compressTexData(
const void *
src,
int &
w,
int &
h);
383 void determineCompressionInternal();
397 void updateTextureWrap(
RE_Render *r,
bool force);
398 void updateFilters(
RE_Render *r,
bool force);
401 void buildFormatTable();
415 bool myMipMapAutoGenFlag;
416 bool myAutoCompressFlag;
440 return myTexDimension;
446 myTextureDataType =
type;
449 setFormat(myDataType, myVectorSize, myFormatExtra);
455 return myTextureDataType;
461 return myID != 0 && myValidFlag;
491 return myFormatExtra;
539 return myAutoCompressFlag;
563 return myMipMapAutoGenFlag;
593 return myCurrentFilterState.
getWrapS();
599 return myCurrentFilterState.
getWrapT();
605 return myCurrentFilterState.
getWrapR();
611 return "RE_OGLTexture";
void setFileModTime(time_t time)
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)
RE_TextureID getID() const
RE_TextureCompress myCompression
unsigned int RE_TextureID
time_t getFileModTime() const
GLboolean GLboolean GLboolean GLboolean a
GLuint GLsizei const GLchar * label
int getFormatSize() 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
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
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
GLint GLint GLint GLint zoffset
void setFormat(RE_GPUType data, int vectorsize, RE_TextureFormatExtra format_extra=RE_TEXTURE_FORMAT_EXTRA_NONE)