HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_OGLTexture Class Referenceabstract

#include <RE_OGLTexture.h>

+ Inheritance diagram for RE_OGLTexture:

Public Member Functions

 ~RE_OGLTexture () override
 
int64 getMemoryUsage (bool inclusive) const override
 
virtual const char * className () const
 
RE_TextureDimension getTextureType () const
 
virtual bool hasTextureSupport (RE_Render *r)
 
virtual bool hasMipMapSupport (RE_Render *)
 
virtual int getMaxTextureSize (RE_Render *r)=0
 
virtual int getMaxTextureIndex (RE_Render *r)
 
bool hasAutoCompression (RE_Render *r)
 
virtual bool isValid () const
 
bool isMutable () const
 
RE_TextureID getID () const
 
virtual void free ()
 
RE_OGLTexturecopyAttributes () const
 
void setDataType (RE_TextureDataType type)
 
RE_TextureDataType getDataType () const
 
void setFormat (RE_GPUType data, int vectorsize, RE_TextureFormatExtra format_extra=RE_TEXTURE_FORMAT_EXTRA_NONE)
 
RE_GPUType getFormatType () const
 
int getFormatSize () const
 
RE_TextureFormatExtra getFormatExtra () const
 
int getInternalFormat () const
 
void setClientFormat (RE_GPUType data, int vectorsize)
 
void setCompression (RE_TextureCompress comp, bool auto_compress)
 
RE_TextureCompress getCompression () const
 
bool getAutoCompression () const
 
void setResolution (int w, int h=1, int depth=1, bool force_pow2=false)
 
int getWidth () const
 
int getHeight () const
 
int getDepth () const
 
int getGLWidth () const
 
int getGLHeight () const
 
int getGLDepth () const
 
float getTexS () const
 
float getTexT () const
 
float getTexR () const
 
virtual void setSamples (int samples)
 
int getSamples () const
 
void setMipMap (bool m, bool autogen=true)
 
bool getMipMap () const
 
bool getMipMapAutoGenerate () const
 
bool isMipMapped () const
 
bool queryTextureStats (RE_Render *r, int *width, int *height, int *depth, int *format)
 
void setLabel (RE_Render *r, const char *label)
 
virtual void setTexture (RE_Render *r, const void *data, int level=-1, int index=-1, bool proxy=false)=0
 
virtual int64 getSizeBytes () const
 
int64 getScanBytes () const
 
int64 getScanBytes (int sublen) const
 
int64 getBitsPerPixel () const
 
int64 getTextureSize () const
 
virtual void setSubTexture (RE_Render *r, const void *data, int level, int xoffset, int xsize, int yoffset=0, int ysize=1, int zoffset=0, int zsize=1)=0
 
virtual void getTexture (RE_Render *r, void *data, int level=0, int index=-1) const
 
virtual bool copyFromBuffer (RE_Render *r, int x, int y, int z=0, const UT_DimRect *bufferarea=nullptr, int level=0)=0
 
bool copyFromTexture (RE_Render *r, const RE_OGLTexture *src_texture, int src_x, int src_y, int src_z, int dst_x, int dst_y, int dst_z, int width=-1, int height=-1, int depth=-1, int mip_level=0)
 
bool generateMipMaps (RE_Render *r)
 
void setMinFilter (RE_Render *r, RE_TexFiltType t)
 
RE_TexFiltType getMinFilter () const
 
void setMagFilter (RE_Render *r, RE_TexFiltType t)
 
RE_TexFiltType getMagFilter () const
 
void setMaxAnisotropy (RE_Render *r, int atf)
 
int getMaxAnisotropy () const
 
void setLodBias (RE_Render *r, float bias)
 
float getLodBias () const
 
void setTextureWrap (RE_Render *r, RE_TexClampType clamp_s, RE_TexClampType clamp_t=RE_CLAMP_EDGE, RE_TexClampType clamp_r=RE_CLAMP_EDGE)
 
bool getWrapS () const
 
bool getWrapT () const
 
bool getWrapR () const
 
void setBorder (RE_Render *r, RE_TextureBorder border, const UT_Vector4F *color_alpha=nullptr)
 
UT_Vector4F getBorderColor () const
 
void setTextureFilter (RE_Render *r, const RE_TextureFilter &filter)
 
void setDepthCompareMode (RE_Render *r, bool enabled, RE_TextureCompare compare=RE_TEXTURE_COMPARE_LESS_EQUAL)
 
bool setTextureSwizzle (RE_Render *r, RE_TextureSwizzle red, RE_TextureSwizzle green, RE_TextureSwizzle blue, RE_TextureSwizzle alpha)
 
void setAlphaInfo (IMG_FileAlphaInfo a)
 
IMG_FileAlphaInfo getAlphaInfo () const
 
bool createTextureHandle (RE_Render *r)
 
uint64 getTextureHandle () const
 
bool makeResidentTexture (RE_Render *r)
 
bool removeResidentTexture (RE_Render *r)
 
bool writeToFile (RE_Render *r, const char *name, int level=0) const
 
RE_OGLTextureexpandMultisampleTexture (RE_Render *r) const
 
void addReference (void(*cb)(void *, RE_OGLTexture *), void *ref_obj)
 
void removeReference (void *ref_obj)
 
void setFileModTime (time_t time)
 
bool hasFileModTime () const
 
time_t getFileModTime () const
 
void invalidateCache ()
 
void print (std::ostream *os=nullptr)
 
- Public Member Functions inherited from RE_CachedObject
 RE_CachedObject ()
 
 ~RE_CachedObject () override
 
void setInUse (bool inc)
 
virtual bool inUse ()
 
int getUsage () const
 
void incRef ()
 
void decRef ()
 
int getRefCount () const
 
void setCached (bool cached, const char *mapname)
 
bool isCached () const
 
const char * getName () const
 
bool setRemovalCallback (bool(*relCB)(void *, void *), void *relObject)
 
bool clearRemovalCallback (void *relObject)
 
- Public Member Functions inherited from RE_CachedObjectBase
 RE_CachedObjectBase ()
 
virtual ~RE_CachedObjectBase ()
 
void setVersion (RE_CacheVersion v)
 
RE_CacheVersion getVersion () const
 
void setExtraData (RE_CachedExtraData *data)
 
const RE_CachedExtraDataHandlegetExtraData () const
 
void setCacheTag (RE_CacheTagHandle h)
 
void resetCacheTag ()
 
void setInCache (bool c)
 
bool isInCache () const
 

Static Public Member Functions

static RE_OGLTexturenewTexture (RE_TextureDimension t)
 
static void getTextureRaw2D (RE_Render *r, int id, int width, int height, RE_TextureDataType datatype, RE_GPUType format, int vectorsize, void *data)
 
static int getGLTextureType (RE_TextureDimension t)
 
static RE_TextureDimension getRETextureType (int gl_type)
 
static RE_OGLTexturefindTextureWithID (RE_TextureID id)
 
static void adjustPow2 (int &w, int &h, int &d)
 
static void dumpTextureTable (std::ostream &os, int64 min_tex_size=-1)
 

Protected Member Functions

 RE_OGLTexture (RE_TextureDimension d)
 
void deleteObject ()
 
void setupTextureParameters (RE_Render *r, bool force)
 
void validate ()
 
virtual int getGLType () const =0
 
virtual int getGLProxy () const =0
 
virtual int getGLTypeBinding () const =0
 
virtual int getGLCreateType () const
 
virtual bool buildMipMaps (RE_Render *r, const void *data)=0
 
bool createTextureID ()
 
RE_GPUType getClientType () const
 
voidcompressTexData (const void *src, int &w, int &h)
 
void determineCompressionInternal ()
 
void determineTextureSize (RE_Render *r)
 
void updateTextureWrap (RE_Render *r, bool force)
 
void updateFilters (RE_Render *r, bool force)
 

Protected Attributes

RE_TextureID myID
 
int myGLType
 
int myGLFormat
 
int myGLInternal
 
int myGLWidth
 
int myGLHeight
 
int myGLDepth
 
time_t myModTime
 
bool myCanMipMap
 
int mySamples
 

Friends

class RE_OGLRender
 
class RE_OGLFramebuffer
 
class RE_TextureMap
 

Additional Inherited Members

- Public Attributes inherited from RE_CachedObjectBase
RE_CacheVersion myVersion
 
RE_CacheTagHandle myCacheTagHandle
 
bool myCachedFlag
 
RE_CachedExtraDataHandle myExtraData
 

Detailed Description

Examples:
DM/DM_BackgroundHook.C, and DM/DM_LightBloomHook.C.

Definition at line 31 of file RE_OGLTexture.h.

Constructor & Destructor Documentation

RE_OGLTexture::~RE_OGLTexture ( )
override
RE_OGLTexture::RE_OGLTexture ( RE_TextureDimension  d)
protected

Member Function Documentation

void RE_OGLTexture::addReference ( void(*)(void *, RE_OGLTexture *)  cb,
void ref_obj 
)
static void RE_OGLTexture::adjustPow2 ( int w,
int h,
int d 
)
static
virtual bool RE_OGLTexture::buildMipMaps ( RE_Render r,
const void data 
)
protectedpure virtual
const char * RE_OGLTexture::className ( ) const
inlinevirtual

Definition at line 614 of file RE_OGLTexture.h.

void* RE_OGLTexture::compressTexData ( const void src,
int w,
int h 
)
protected
RE_OGLTexture* RE_OGLTexture::copyAttributes ( ) const
virtual bool RE_OGLTexture::copyFromBuffer ( RE_Render r,
int  x,
int  y,
int  z = 0,
const UT_DimRect bufferarea = nullptr,
int  level = 0 
)
pure virtual
bool RE_OGLTexture::copyFromTexture ( RE_Render r,
const RE_OGLTexture src_texture,
int  src_x,
int  src_y,
int  src_z,
int  dst_x,
int  dst_y,
int  dst_z,
int  width = -1,
int  height = -1,
int  depth = -1,
int  mip_level = 0 
)
bool RE_OGLTexture::createTextureHandle ( RE_Render r)
bool RE_OGLTexture::createTextureID ( )
protected
void RE_OGLTexture::deleteObject ( )
protected
void RE_OGLTexture::determineCompressionInternal ( )
protected
void RE_OGLTexture::determineTextureSize ( RE_Render r)
protected
static void RE_OGLTexture::dumpTextureTable ( std::ostream &  os,
int64  min_tex_size = -1 
)
static
RE_OGLTexture* RE_OGLTexture::expandMultisampleTexture ( RE_Render r) const
static RE_OGLTexture* RE_OGLTexture::findTextureWithID ( RE_TextureID  id)
static
virtual void RE_OGLTexture::free ( )
virtual
bool RE_OGLTexture::generateMipMaps ( RE_Render r)
IMG_FileAlphaInfo RE_OGLTexture::getAlphaInfo ( ) const
inline

Definition at line 301 of file RE_OGLTexture.h.

bool RE_OGLTexture::getAutoCompression ( ) const
inline

Definition at line 542 of file RE_OGLTexture.h.

int64 RE_OGLTexture::getBitsPerPixel ( ) const
UT_Vector4F RE_OGLTexture::getBorderColor ( ) const
RE_GPUType RE_OGLTexture::getClientType ( ) const
inlineprotected

Definition at line 482 of file RE_OGLTexture.h.

RE_TextureCompress RE_OGLTexture::getCompression ( ) const
inline

Definition at line 536 of file RE_OGLTexture.h.

RE_TextureDataType RE_OGLTexture::getDataType ( ) const
inline

Definition at line 458 of file RE_OGLTexture.h.

int RE_OGLTexture::getDepth ( ) const
inline

Definition at line 512 of file RE_OGLTexture.h.

time_t RE_OGLTexture::getFileModTime ( ) const
inline

Definition at line 350 of file RE_OGLTexture.h.

RE_TextureFormatExtra RE_OGLTexture::getFormatExtra ( ) const
inline

Definition at line 494 of file RE_OGLTexture.h.

int RE_OGLTexture::getFormatSize ( ) const
inline

Definition at line 488 of file RE_OGLTexture.h.

RE_GPUType RE_OGLTexture::getFormatType ( ) const
inline

Definition at line 476 of file RE_OGLTexture.h.

virtual int RE_OGLTexture::getGLCreateType ( ) const
inlineprotectedvirtual

Definition at line 376 of file RE_OGLTexture.h.

int RE_OGLTexture::getGLDepth ( ) const
inline

Definition at line 530 of file RE_OGLTexture.h.

int RE_OGLTexture::getGLHeight ( ) const
inline

Definition at line 524 of file RE_OGLTexture.h.

virtual int RE_OGLTexture::getGLProxy ( ) const
protectedpure virtual
static int RE_OGLTexture::getGLTextureType ( RE_TextureDimension  t)
static
virtual int RE_OGLTexture::getGLType ( ) const
protectedpure virtual
virtual int RE_OGLTexture::getGLTypeBinding ( ) const
protectedpure virtual
int RE_OGLTexture::getGLWidth ( ) const
inline

Definition at line 518 of file RE_OGLTexture.h.

int RE_OGLTexture::getHeight ( ) const
inline

Definition at line 506 of file RE_OGLTexture.h.

RE_TextureID RE_OGLTexture::getID ( ) const
inline

Definition at line 470 of file RE_OGLTexture.h.

int RE_OGLTexture::getInternalFormat ( ) const
inline

Definition at line 100 of file RE_OGLTexture.h.

float RE_OGLTexture::getLodBias ( ) const
inline

Definition at line 584 of file RE_OGLTexture.h.

RE_TexFiltType RE_OGLTexture::getMagFilter ( ) const
inline

Definition at line 578 of file RE_OGLTexture.h.

int RE_OGLTexture::getMaxAnisotropy ( ) const
inline

Definition at line 590 of file RE_OGLTexture.h.

int RE_OGLTexture::getMaxTextureIndex ( RE_Render r)
inlinevirtual

Definition at line 632 of file RE_OGLTexture.h.

virtual int RE_OGLTexture::getMaxTextureSize ( RE_Render r)
pure virtual
int64 RE_OGLTexture::getMemoryUsage ( bool  inclusive) const
overridevirtual

Returns the amount of main memory (NOT graphics memory!) owned by this RE_OGLTexture.

Reimplemented from RE_CachedObject.

RE_TexFiltType RE_OGLTexture::getMinFilter ( ) const
inline

Definition at line 572 of file RE_OGLTexture.h.

bool RE_OGLTexture::getMipMap ( ) const
inline

Definition at line 554 of file RE_OGLTexture.h.

bool RE_OGLTexture::getMipMapAutoGenerate ( ) const
inline

Definition at line 566 of file RE_OGLTexture.h.

static RE_TextureDimension RE_OGLTexture::getRETextureType ( int  gl_type)
static
int RE_OGLTexture::getSamples ( ) const
int64 RE_OGLTexture::getScanBytes ( ) const
inline

Definition at line 662 of file RE_OGLTexture.h.

int64 RE_OGLTexture::getScanBytes ( int  sublen) const
virtual int64 RE_OGLTexture::getSizeBytes ( ) const
virtual
float RE_OGLTexture::getTexR ( ) const
inline

Definition at line 650 of file RE_OGLTexture.h.

float RE_OGLTexture::getTexS ( ) const
inline

Definition at line 638 of file RE_OGLTexture.h.

float RE_OGLTexture::getTexT ( ) const
inline

Definition at line 644 of file RE_OGLTexture.h.

virtual void RE_OGLTexture::getTexture ( RE_Render r,
void data,
int  level = 0,
int  index = -1 
) const
virtual
uint64 RE_OGLTexture::getTextureHandle ( ) const
inline

Definition at line 313 of file RE_OGLTexture.h.

static void RE_OGLTexture::getTextureRaw2D ( RE_Render r,
int  id,
int  width,
int  height,
RE_TextureDataType  datatype,
RE_GPUType  format,
int  vectorsize,
void data 
)
static
int64 RE_OGLTexture::getTextureSize ( ) const
inline

Definition at line 656 of file RE_OGLTexture.h.

RE_TextureDimension RE_OGLTexture::getTextureType ( ) const
inline

Definition at line 443 of file RE_OGLTexture.h.

int RE_OGLTexture::getWidth ( ) const
inline

Definition at line 500 of file RE_OGLTexture.h.

bool RE_OGLTexture::getWrapR ( ) const
inline

Definition at line 608 of file RE_OGLTexture.h.

bool RE_OGLTexture::getWrapS ( ) const
inline

Definition at line 596 of file RE_OGLTexture.h.

bool RE_OGLTexture::getWrapT ( ) const
inline

Definition at line 602 of file RE_OGLTexture.h.

bool RE_OGLTexture::hasAutoCompression ( RE_Render r)
bool RE_OGLTexture::hasFileModTime ( ) const
inline

Definition at line 349 of file RE_OGLTexture.h.

bool RE_OGLTexture::hasMipMapSupport ( RE_Render )
inlinevirtual

Definition at line 548 of file RE_OGLTexture.h.

bool RE_OGLTexture::hasTextureSupport ( RE_Render r)
inlinevirtual

Definition at line 620 of file RE_OGLTexture.h.

void RE_OGLTexture::invalidateCache ( )
bool RE_OGLTexture::isMipMapped ( ) const
inline

Definition at line 560 of file RE_OGLTexture.h.

bool RE_OGLTexture::isMutable ( ) const
inline

Definition at line 64 of file RE_OGLTexture.h.

bool RE_OGLTexture::isValid ( ) const
inlinevirtual

Definition at line 464 of file RE_OGLTexture.h.

bool RE_OGLTexture::makeResidentTexture ( RE_Render r)
static RE_OGLTexture* RE_OGLTexture::newTexture ( RE_TextureDimension  t)
static
void RE_OGLTexture::print ( std::ostream *  os = nullptr)
bool RE_OGLTexture::queryTextureStats ( RE_Render r,
int width,
int height,
int depth,
int format 
)
void RE_OGLTexture::removeReference ( void ref_obj)
bool RE_OGLTexture::removeResidentTexture ( RE_Render r)
void RE_OGLTexture::setAlphaInfo ( IMG_FileAlphaInfo  a)
inline

Definition at line 300 of file RE_OGLTexture.h.

void RE_OGLTexture::setBorder ( RE_Render r,
RE_TextureBorder  border,
const UT_Vector4F color_alpha = nullptr 
)
void RE_OGLTexture::setClientFormat ( RE_GPUType  data,
int  vectorsize 
)
void RE_OGLTexture::setCompression ( RE_TextureCompress  comp,
bool  auto_compress 
)
void RE_OGLTexture::setDataType ( RE_TextureDataType  type)
inline

Definition at line 449 of file RE_OGLTexture.h.

void RE_OGLTexture::setDepthCompareMode ( RE_Render r,
bool  enabled,
RE_TextureCompare  compare = RE_TEXTURE_COMPARE_LESS_EQUAL 
)
void RE_OGLTexture::setFileModTime ( time_t  time)
inline

Definition at line 348 of file RE_OGLTexture.h.

void RE_OGLTexture::setFormat ( RE_GPUType  data,
int  vectorsize,
RE_TextureFormatExtra  format_extra = RE_TEXTURE_FORMAT_EXTRA_NONE 
)
void RE_OGLTexture::setLabel ( RE_Render r,
const char *  label 
)
void RE_OGLTexture::setLodBias ( RE_Render r,
float  bias 
)
void RE_OGLTexture::setMagFilter ( RE_Render r,
RE_TexFiltType  t 
)
void RE_OGLTexture::setMaxAnisotropy ( RE_Render r,
int  atf 
)
void RE_OGLTexture::setMinFilter ( RE_Render r,
RE_TexFiltType  t 
)
void RE_OGLTexture::setMipMap ( bool  m,
bool  autogen = true 
)
void RE_OGLTexture::setResolution ( int  w,
int  h = 1,
int  depth = 1,
bool  force_pow2 = false 
)
virtual void RE_OGLTexture::setSamples ( int  samples)
virtual
virtual void RE_OGLTexture::setSubTexture ( RE_Render r,
const void data,
int  level,
int  xoffset,
int  xsize,
int  yoffset = 0,
int  ysize = 1,
int  zoffset = 0,
int  zsize = 1 
)
pure virtual
virtual void RE_OGLTexture::setTexture ( RE_Render r,
const void data,
int  level = -1,
int  index = -1,
bool  proxy = false 
)
pure virtual
void RE_OGLTexture::setTextureFilter ( RE_Render r,
const RE_TextureFilter filter 
)
bool RE_OGLTexture::setTextureSwizzle ( RE_Render r,
RE_TextureSwizzle  red,
RE_TextureSwizzle  green,
RE_TextureSwizzle  blue,
RE_TextureSwizzle  alpha 
)
void RE_OGLTexture::setTextureWrap ( RE_Render r,
RE_TexClampType  clamp_s,
RE_TexClampType  clamp_t = RE_CLAMP_EDGE,
RE_TexClampType  clamp_r = RE_CLAMP_EDGE 
)
void RE_OGLTexture::setupTextureParameters ( RE_Render r,
bool  force 
)
protected
void RE_OGLTexture::updateFilters ( RE_Render r,
bool  force 
)
protected
void RE_OGLTexture::updateTextureWrap ( RE_Render r,
bool  force 
)
protected
void RE_OGLTexture::validate ( )
inlineprotected

Definition at line 626 of file RE_OGLTexture.h.

bool RE_OGLTexture::writeToFile ( RE_Render r,
const char *  name,
int  level = 0 
) const

Friends And Related Function Documentation

friend class RE_OGLFramebuffer
friend

Definition at line 438 of file RE_OGLTexture.h.

friend class RE_OGLRender
friend

Definition at line 437 of file RE_OGLTexture.h.

friend class RE_TextureMap
friend

Definition at line 439 of file RE_OGLTexture.h.

Member Data Documentation

bool RE_OGLTexture::myCanMipMap
protected

Definition at line 400 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLDepth
protected

Definition at line 398 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLFormat
protected

Definition at line 394 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLHeight
protected

Definition at line 397 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLInternal
protected

Definition at line 395 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLType
protected

Definition at line 393 of file RE_OGLTexture.h.

int RE_OGLTexture::myGLWidth
protected

Definition at line 396 of file RE_OGLTexture.h.

RE_TextureID RE_OGLTexture::myID
protected

Definition at line 392 of file RE_OGLTexture.h.

time_t RE_OGLTexture::myModTime
protected

Definition at line 399 of file RE_OGLTexture.h.

int RE_OGLTexture::mySamples
protected

Definition at line 436 of file RE_OGLTexture.h.


The documentation for this class was generated from the following file: