HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE_TextureCubeMap.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 cube 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_TextureCubeMap_h__
15 #define __RE_TextureCubeMap_h__
16 
17 #include "RE_API.h"
18 #include "RE_TextureMap.h"
19 
20 class IMG_File;
21 class PXL_Raster;
22 
24 {
25 public:
27  ~RE_TextureCubeMap() override;
28 
29  /// Returns the amount of main memory (NOT graphics memory!)
30  /// owned by this RE_TextureCubeMap.
31  int64 getMemoryUsage(bool inclusive) const override;
32 
34  RE_TextureMap *clone() const override;
35 
36  // Public interface is in RE_TextureMap
37 private:
38  bool buildTexture(RE_Render *r, RE_Texture *tex,
39  void *data) override;
40  bool getNodeSource(const char *map, const char *rel,
41  void **mapptr,
42  RE_TextureDimension &textype,
43  RE_GPUType &datatype,
44  int &vectorsize,
45  int &w, int &h, int &d) override;
46  bool getFileSource(const char *map,
47  void **mapptr,
48  RE_TextureDimension &textype,
49  RE_GPUType &datatype,
50  int &vectorsize,
51  int &w, int &h, int &d,
52  bool preload) override;
53  void buildTextureName(UT_String &, const char *map,
54  const char *rel) override;
55 
56  bool loadCubeMap(IMG_File *fp, int w, int h,
57  RE_GPUType dt, int vs, void **mapptr);
58  bool loadSphereMap(IMG_File *fp,int w, int h, int sw, int sh,
59  RE_GPUType dt, int vs, void **mapptr);
60  void generateMipMaps(RE_Render *r, RE_Texture *tex);
61  void scalePolarFromRaster(PXL_Raster *dest,
62  const PXL_Raster *src,
63  bool wrap_y);
64 
65  float myOpTime;
66 
67  PXL_Raster *myPolarMap;
68  enum PolarType
69  {
70  LatLongStyle, // aspect 2:1
71  MatCapStyle // aspect 1:1
72  };
73  PolarType myPolarType;
74 };
75 
76 #endif
virtual RE_TextureMap * clone() const =0
#define RE_API
Definition: RE_API.h:10
RE_TextureDimension getMapType() override
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
GLenum src
Definition: glcorearb.h:1792
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:856
RE_GPUType
Definition: RE_Types.h:44
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
Generic interface for reading and writing image files. This class handles the reading and writing of ...
Definition: IMG_File.h:56
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)
GLboolean r
Definition: glcorearb.h:1221
virtual bool buildTexture(RE_Render *r, RE_Texture *tex, void *data)=0