Vis 2
Kinetic Visualization for 3D shape and structure
 All Classes Namespaces Functions Pages
Texture.h
1 //Author: Christian Hafner
2 #pragma once
3 
4 #include "include_opengl.h"
5 #include "lodepng.h"
6 #include <vector>
7 #include <string>
8 
12 class Texture
13 {
14 public:
15  Texture(GLuint textureHandle, GLuint width=0.f, GLuint height=0.f, bool hasMipmaps=false, bool isSingleChannel=false, float anisotropy=1.f);
16  ~Texture();
17 
18  bool hasMipmaps() const;
19  bool isSingleChannel() const;
20  float getAnisotropy() const;
21 
22  GLuint getTextureHandle() const;
23 
24  static Texture* createFromPNG(std::string& path, bool mipmaps=false, bool singleChannel=false, float anisotropy=1.0f);
25  static Texture* createFromPNG(const std::vector<std::string>& paths);
26 
27 
28  unsigned _width, _height;
29 
30 private:
31  Texture();
32 
33  static double evalScatteringIntegrand(double u, double xi);
34 
35  bool _hasMipmaps;
36  bool _isSingleChannel;
37  float _anisotropy;
38 
39  GLuint _textureHandle;
40 
41 
42 
43  static GLuint loadPNG(std::string& path, bool mipmaps, bool singleChannel, float anisotropy, unsigned* width=nullptr, unsigned* height=nullptr);
44 };
Definition: Texture.h:12