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;
120 bool getAutoCompression()
const;
124 void setResolution(
int w,
int h = 1,
int depth = 1,
125 bool force_pow2 =
false);
126 int getWidth()
const;
127 int getHeight()
const;
128 int getDepth()
const;
132 int getGLWidth()
const;
133 int getGLHeight()
const;
134 int getGLDepth()
const;
138 float getTexS()
const;
139 float getTexT()
const;
140 float getTexR()
const;
143 virtual void setSamples(
int samples);
144 int getSamples()
const;
150 void setMipMap(
bool m,
bool autogen =
true);
151 bool getMipMap()
const;
152 bool getMipMapAutoGenerate()
const;
156 bool isMipMapped()
const;
188 bool proxy=
false) = 0;
191 virtual int64 getSizeBytes()
const;
195 int64 getScanBytes()
const;
196 int64 getScanBytes(
int sublen)
const;
199 int64 getBitsPerPixel()
const;
202 int64 getTextureSize()
const;
212 int zoffset=0,
int zsize=1) = 0;
226 static void getTextureRaw2D(
RE_Render *r,
int id,
235 virtual bool copyFromBuffer(
RE_Render *r,
int x,
int y,
int z = 0,
246 int src_x,
int src_y,
int src_z,
247 int dst_x,
int dst_y,
int dst_z,
255 bool do_opencl_interop =
true)
const;
259 bool do_opencl_interop =
true);
277 void setMaxAnisotropy(
RE_Render *r,
int atf);
278 int getMaxAnisotropy()
const;
282 void setLodBias(
RE_Render *r,
float bias);
283 float getLodBias()
const;
290 bool getWrapS()
const;
291 bool getWrapT()
const;
292 bool getWrapR()
const;
340 bool removeResidentTexture(
RE_Render *r);
354 int level = 0)
const;
360 static void adjustPow2(
int &
w,
int &
h,
int &d);
366 void removeReference(
void *ref_obj);
373 void invalidateCache();
376 void print(std::ostream *os =
nullptr);
381 static void dumpTextureTable(std::ostream &os,
382 int64 min_tex_size = -1);
386 virtual int getGLType()
const = 0;
398 virtual int getGLProxy()
const = 0;
399 virtual int getGLTypeBinding()
const = 0;
403 virtual bool buildMipMaps(
RE_Render *r,
const void *
data) = 0;
405 bool createTextureID();
411 void * compressTexData(
const void *
src,
int &
w,
int &
h);
412 void determineCompressionInternal();
430 void buildFormatTable();
444 bool myMipMapAutoGenFlag;
445 bool myAutoCompressFlag;
469 return myTexDimension;
475 myTextureDataType =
type;
478 setFormat(myDataType, myVectorSize, myFormatExtra);
484 return myTextureDataType;
490 return myID != 0 && myValidFlag;
520 return myFormatExtra;
568 return myAutoCompressFlag;
592 return myMipMapAutoGenFlag;
622 return myCurrentFilterState.
getWrapS();
628 return myCurrentFilterState.
getWrapT();
634 return myCurrentFilterState.
getWrapR();
640 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