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 
21 class PXL_Raster;
22 
24 {
25 public:
27  ~RE_Texture2DMap() override;
28 
29  /// Returns the amount of main memory (NOT graphics memory!)
30  /// owned by this RE_Texture2DMap.
31  int64 getMemoryUsage(bool inclusive) const override;
32 
34  RE_TextureMap *clone() const override;
35 
36  int getSourceOpID() const override { return myOpID; }
37 
38  void setSourcePlane(const UT_StringRef &plane)
39  { mySourcePlane = plane; }
40 
41  // Public interface is in RE_TextureMap
42 
43  static PXL_Raster *loadMap(IMG_File *file, int w=-1, int h=-1);
44 
45 private:
46  bool buildTexture(RE_Render *r, RE_Texture *tex,
47  void *data) override;
48  bool getNodeSource(const char *map, const char *rel,
49  void **mapptr,
50  RE_TextureDimension &textype,
51  RE_GPUType &datatype,
52  int &vectorsize,
53  int &w, int &h, int &d) override;
54  bool getFileSource(const char *map,
55  void **mapptr,
56  RE_TextureDimension &textype,
57  RE_GPUType &datatype,
58  int &vectorsize,
59  int &w, int &h, int &d,
60  bool preload) override;
61  void buildTextureName(UT_String &, const char *map,
62  const char *rel) override;
63 
64  void cachedTextureFound(RE_Texture *tex) override;
65 
66 
67  fpreal myOpTime;
68  size_t myOpVersion;
69  int myOpID;
70  TIL_Raster *myCopRaster;
71  UT_StringHolder mySourcePlane;
72 };
73 
74 #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
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
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
Generic interface for reading and writing image files. This class handles the reading and writing of ...
Definition: IMG_File.h:56
RE_TextureDimension getMapType() override
GLboolean * data
Definition: glcorearb.h:130
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2001
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)
GLboolean r
Definition: glcorearb.h:1221
virtual bool buildTexture(RE_Render *r, RE_Texture *tex, void *data)=0