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;
222 static void getTextureRaw2D(
RE_Render *r,
int id,
231 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
242 int src_x,
int src_y,
int src_z,
243 int dst_x,
int dst_y,
int dst_z,
251 bool do_opencl_interop =
true)
const;
255 bool do_opencl_interop =
true);
273 void setMaxAnisotropy(
RE_Render *r,
int atf);
274 int getMaxAnisotropy()
const;
278 void setLodBias(
RE_Render *r,
float bias);
279 float getLodBias()
const;
286 bool getWrapS()
const;
287 bool getWrapT()
const;
288 bool getWrapR()
const;
336 bool removeResidentTexture(
RE_Render *r);
350 int level = 0)
const;
356 static void adjustPow2(
int &
w,
int &
h,
int &d);
362 void removeReference(
void *ref_obj);
369 void invalidateCache();
372 void print(std::ostream *os =
nullptr);
377 static void dumpTextureTable(std::ostream &os,
378 int64 min_tex_size = -1);
389 virtual int getGLType()
const = 0;
390 virtual int getGLProxy()
const = 0;
391 virtual int getGLTypeBinding()
const = 0;
395 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
397 bool createTextureID();
403 void * compressTexData(
const void *
src,
int &
w,
int &
h);
404 void determineCompressionInternal();
422 void buildFormatTable();
436 bool myMipMapAutoGenFlag;
437 bool myAutoCompressFlag;
461 return myTexDimension;
467 myTextureDataType =
type;
470 setFormat(myDataType, myVectorSize, myFormatExtra);
476 return myTextureDataType;
482 return myID != 0 && myValidFlag;
512 return myFormatExtra;
560 return myAutoCompressFlag;
584 return myMipMapAutoGenFlag;
614 return myCurrentFilterState.
getWrapS();
620 return myCurrentFilterState.
getWrapT();
626 return myCurrentFilterState.
getWrapR();
632 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