HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_Texture2DMap.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: Render Library (C++)
7  *
8  * COMMENTS:
9  * Handle to a 2D texture map stored in the texture cache. This class is
10  * primarily responsible for fetching images from various 2D sources and
11  * creating the texture for them.
12  */
13 
14 #ifndef __RE_Texture2DMap_h__
15 #define __RE_Texture2DMap_h__
16 
17 #include "RE_API.h"
18 #include "RE_TextureMap.h"
19 #include <UT/UT_StringHolder.h>
20 #include <UT/UT_UniquePtr.h>
21 
22 class PXL_Raster;
23 
25 {
26 public:
28  ~RE_Texture2DMap() override;
29 
30  /// Returns the amount of main memory (NOT graphics memory!)
31  /// owned by this RE_Texture2DMap.
32  int64 getMemoryUsage(bool inclusive) const override;
33 
35  RE_TextureMap *clone() const override;
36 
37  int getSourceOpID() const override { return myOpID; }
38 
39  void setSourcePlane(const UT_StringRef &plane)
40  { mySourcePlane = plane; }
41 
42  // Public interface is in RE_TextureMap
43 
45  loadMap(IMG_File *file, int w=-1, int h=-1);
46 
47 private:
48  bool buildTexture(RE_Render *r, RE_Texture *tex,
49  void *data) override;
50  bool getNodeSource(const char *map, const char *rel,
51  void **mapptr,
52  RE_TextureDimension &textype,
53  RE_GPUType &datatype,
54  int &vectorsize,
55  int &w, int &h, int &d) override;
56  bool getFileSource(const char *map,
57  void **mapptr,
58  RE_TextureDimension &textype,
59  RE_GPUType &datatype,
60  int &vectorsize,
61  int &w, int &h, int &d,
62  bool preload) override;
63  void buildTextureName(UT_String &, const char *map,
64  const char *rel) override;
65 
66  void cachedTextureFound(RE_Texture *tex) override;
67 
68 
69  fpreal myOpTime;
70  size_t myOpVersion;
71  int myOpID;
72  TIL_Raster *myCopRaster;
73  UT_StringHolder mySourcePlane;
74 };
75 
76 #endif
virtual RE_TextureMap * clone() const =0
#define RE_API
Definition: RE_API.h:10
virtual bool getNodeSource(const char *map, const char *rel, void **mapptr, RE_TextureDimension &textype, RE_GPUType &datatype, int &vectorsize, int &w, int &h, int &d)
RE_TextureDimension
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
RE_GPUType
Definition: RE_Types.h:44
virtual void cachedTextureFound(RE_Texture *tex)
long long int64
Definition: SYS_Types.h:116
virtual void buildTextureName(UT_String &cachedname, const char *map, const char *rel)
virtual int64 getMemoryUsage(bool inclusive) const
int getSourceOpID() const override
RE_TextureDimension getMapType() override
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
virtual bool getFileSource(const char *map, void **mapptr, RE_TextureDimension &textype, RE_GPUType &datatype, int &vectorsize, int &w, int &h, int &d, bool preload_only)
fpreal64 fpreal
Definition: SYS_Types.h:277
void setSourcePlane(const UT_StringRef &plane)
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
GLboolean r
Definition: glcorearb.h:1222
virtual bool buildTexture(RE_Render *r, RE_Texture *tex, void *data)=0
Definition: format.h:895