13 #ifndef RE_OGLTexture_h
14 #define RE_OGLTexture_h
40 virtual const char *className()
const;
49 virtual bool hasMipMapSupport(
RE_Render *);
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;
213 static void getTextureRaw2D(
RE_Render *r,
int id,
222 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
233 int src_x,
int src_y,
int src_z,
234 int dst_x,
int dst_y,
int dst_z,
257 void setMaxAnisotropy(
RE_Render *r,
int atf);
258 int getMaxAnisotropy()
const;
262 void setLodBias(
RE_Render *r,
float bias);
263 float getLodBias()
const;
270 bool getWrapS()
const;
271 bool getWrapT()
const;
272 bool getWrapR()
const;
320 bool removeResidentTexture(
RE_Render *r);
334 int level = 0)
const;
340 static void adjustPow2(
int &
w,
int &
h,
int &d);
346 void removeReference(
void *ref_obj);
353 void invalidateCache();
356 void print(std::ostream *os =
nullptr);
361 static void dumpTextureTable(std::ostream &os,
362 int64 min_tex_size = -1);
373 virtual int getGLType()
const = 0;
374 virtual int getGLProxy()
const = 0;
375 virtual int getGLTypeBinding()
const = 0;
379 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
381 bool createTextureID();
387 void * compressTexData(
const void *
src,
int &
w,
int &
h);
388 void determineCompressionInternal();
406 void buildFormatTable();
420 bool myMipMapAutoGenFlag;
421 bool myAutoCompressFlag;
445 return myTexDimension;
451 myTextureDataType =
type;
454 setFormat(myDataType, myVectorSize, myFormatExtra);
460 return myTextureDataType;
466 return myID != 0 && myValidFlag;
496 return myFormatExtra;
544 return myAutoCompressFlag;
568 return myMipMapAutoGenFlag;
598 return myCurrentFilterState.
getWrapS();
604 return myCurrentFilterState.
getWrapT();
610 return myCurrentFilterState.
getWrapR();
616 return "RE_OGLTexture";
void setFileModTime(time_t time)
virtual int getMaxTextureIndex(RE_Render *r)
GLint GLint GLint yoffset
bool getMipMapAutoGenerate() const
RE_GPUType getClientType() const
GLuint GLsizei const GLchar * label
virtual const char * className() const
int64 getMemoryUsage(bool inclusive) const override
int64 getTextureSize() const
GT_API const UT_StringHolder time
RE_TextureFormatExtra getFormatExtra() const
GLdouble GLdouble GLdouble z
RE_TexFiltType getMagFilter() const
GLboolean GLboolean GLboolean GLboolean a
GLenum GLenum GLsizei const GLuint GLboolean enabled
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
bool hasFileModTime() const
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, ROI roi={}, int nthreads=0)
GLint GLsizei GLsizei height
IMATH_NAMESPACE::V2f float
RE_TextureID getID() const
RE_TextureCompress myCompression
unsigned int RE_TextureID
time_t getFileModTime() const
GLint GLint GLsizei GLint GLenum format
int getFormatSize() const
virtual bool hasTextureSupport(RE_Render *r)
GLfloat GLfloat GLfloat alpha
RE_TextureCompress getCompression() const
int64 getScanBytes() const
GLuint const GLchar * name
int getMaxAnisotropy() const
RE_TexFiltType getMinFilter() const
GR_API int getMaxTextureSize(RE_RenderContext rc)
GLint GLint GLsizei GLsizei GLsizei depth
uint64 getTextureHandle() const
GLfloat GLfloat GLfloat GLfloat h
virtual bool isValid() const
Cached object implementation for RE_TextureCache.
GLint GLint GLsizei GLint border
SIM_API const UT_StringHolder force
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)
GLubyte GLubyte GLubyte GLubyte w
RE_TexClampType getWrapT() const
FMT_INLINE void print(format_string< T...> fmt, T &&...args)
png_structrp int png_fixed_point red
GLint GLint GLint GLint zoffset
void setFormat(RE_GPUType data, int vectorsize, RE_TextureFormatExtra format_extra=RE_TEXTURE_FORMAT_EXTRA_NONE)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter