13 #ifndef RE_OGLTexture_h
14 #define RE_OGLTexture_h
43 virtual const char *className()
const;
52 virtual bool hasMipMapSupport(
RE_Render *);
58 virtual int getMaxTextureIndex(
RE_Render *r);
64 virtual bool isValid()
const;
99 int getFormatSize()
const;
116 bool getAutoCompression()
const;
120 void setResolution(
int w,
int h = 1,
int depth = 1,
121 bool force_pow2 =
false);
122 int getWidth()
const;
123 int getHeight()
const;
124 int getDepth()
const;
128 int getGLWidth()
const;
129 int getGLHeight()
const;
130 int getGLDepth()
const;
134 float getTexS()
const;
135 float getTexT()
const;
136 float getTexR()
const;
139 virtual void setSamples(
int samples);
140 int getSamples()
const;
146 void setMipMap(
bool m,
bool autogen =
true);
147 bool getMipMap()
const;
148 bool getMipMapAutoGenerate()
const;
152 bool isMipMapped()
const;
184 bool proxy=
false) = 0;
187 virtual int64 getSizeBytes()
const;
191 int64 getScanBytes()
const;
192 int64 getScanBytes(
int sublen)
const;
195 int64 getBitsPerPixel()
const;
198 int64 getTextureSize()
const;
208 int zoffset=0,
int zsize=1) = 0;
216 static void getTextureRaw2D(
RE_Render *r,
int id,
225 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
236 int src_x,
int src_y,
int src_z,
237 int dst_x,
int dst_y,
int dst_z,
245 bool do_opencl_interop =
true)
const;
249 bool do_opencl_interop =
true);
267 void setMaxAnisotropy(
RE_Render *r,
int atf);
268 int getMaxAnisotropy()
const;
272 void setLodBias(
RE_Render *r,
float bias);
273 float getLodBias()
const;
280 bool getWrapS()
const;
281 bool getWrapT()
const;
282 bool getWrapR()
const;
330 bool removeResidentTexture(
RE_Render *r);
344 int level = 0)
const;
350 static void adjustPow2(
int &
w,
int &
h,
int &d);
356 void removeReference(
void *ref_obj);
363 void invalidateCache();
366 void print(std::ostream *os =
nullptr);
371 static void dumpTextureTable(std::ostream &os,
372 int64 min_tex_size = -1);
383 virtual int getGLType()
const = 0;
384 virtual int getGLProxy()
const = 0;
385 virtual int getGLTypeBinding()
const = 0;
389 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
391 bool createTextureID();
397 void * compressTexData(
const void *
src,
int &
w,
int &
h);
398 void determineCompressionInternal();
416 void buildFormatTable();
430 bool myMipMapAutoGenFlag;
431 bool myAutoCompressFlag;
455 return myTexDimension;
461 myTextureDataType =
type;
464 setFormat(myDataType, myVectorSize, myFormatExtra);
470 return myTextureDataType;
476 return myID != 0 && myValidFlag;
506 return myFormatExtra;
554 return myAutoCompressFlag;
578 return myMipMapAutoGenFlag;
608 return myCurrentFilterState.
getWrapS();
614 return myCurrentFilterState.
getWrapT();
620 return myCurrentFilterState.
getWrapR();
626 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
CompareResults OIIO_API compare(const ImageBuf &A, const ImageBuf &B, float failthresh, float warnthresh, float failrelative, float warnrelative, ROI roi={}, int nthreads=0)
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
Temporary container for either a RV_Render and an RE_Render.
virtual bool hasMipMapSupport(RE_Render *)
RE_TexFiltType getMagFilter() const
int getInternalFormat() const
GLenum GLuint GLint GLint layer
RE_TextureDimension getTextureType() const
bool hasFileModTime() const
GLint GLsizei GLsizei height
GLint GLint GLsizei GLint GLenum GLenum type
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
IMATH_NAMESPACE::V2f IMATH_NAMESPACE::Box2i std::string this attribute is obsolete as of OpenEXR v3 float
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