Texture.hpp
Go to the documentation of this file.
1 
28 /*
29  * Texture.hpp
30  *
31  * @date 19.07.2017
32  * @author Jan Philipp Vogtherr (jvogtherr@uos.de)
33  * @author Kristin Schmidt (krschmidt@uos.de)
34  */
35 
36 #ifndef LVR2_TEXTURE_TEXTURE_HPP_
37 #define LVR2_TEXTURE_TEXTURE_HPP_
38 
39 #include <cstring>
40 #include <math.h>
41 #include <cstdio>
43 #include "lvr2/io/PPMIO.hpp"
44 
45 namespace lvr2
46 {
47 
48 class GlTexture;
49 
54 class Texture {
55 public:
56 
60  Texture( );
61 
65  Texture(
66  int index,
67  unsigned short int width,
68  unsigned short int height,
69  unsigned char numChannels,
70  unsigned char numBytesPerChan,
71  float texelSize,
72  unsigned char* data = nullptr
73  );
74 
78  Texture(
79  int index,
80  GlTexture* oldTexture
81  );
82 
86  Texture(Texture&& other);
87 
91  Texture(const Texture& other);
92 
93  Texture & operator=(const Texture &other);
94 
98  virtual ~Texture();
99 
105  void save();
106 
108  int m_index;
109 
111  unsigned short int m_width, m_height;
112 
114  unsigned char* m_data;
115 
117  unsigned char m_numChannels;
118 
120  unsigned char m_numBytesPerChan;
121 
123  float m_texelSize;
124 
125 };
126 
127 } // namespace lvr2
128 
129 #endif /* LVR2_TEXTURE_TEXTURE_HPP_ */
lvr2::Texture::m_data
unsigned char * m_data
The texture data.
Definition: Texture.hpp:114
lvr2::GlTexture
Definition: GlTexture.hpp:56
lvr2::Texture::m_numChannels
unsigned char m_numChannels
The number of color channels.
Definition: Texture.hpp:117
lvr2::Texture::~Texture
virtual ~Texture()
Destructor.
Definition: Texture.cpp:186
lvr2::Texture::Texture
Texture()
Constructor.
Definition: Texture.cpp:43
lvr2::Texture::m_height
unsigned short int m_height
Definition: Texture.hpp:111
PPMIO.hpp
lvr2::Texture::m_texelSize
float m_texelSize
The size of a texture pixel.
Definition: Texture.hpp:123
lvr2::Texture::save
void save()
Writes the texture to an image file.
Definition: Texture.cpp:175
lvr2::Texture::operator=
Texture & operator=(const Texture &other)
Definition: Texture.cpp:130
lvr2
Definition: BaseBufferManipulators.hpp:39
lvr2::Texture
This class represents a texture.
Definition: Texture.hpp:54
lvr2::Texture::m_width
unsigned short int m_width
The dimensions of the texture.
Definition: Texture.hpp:111
lvr2::Texture::m_index
int m_index
Texture index.
Definition: Texture.hpp:108
BoundingRectangle.hpp
lvr2::Texture::m_numBytesPerChan
unsigned char m_numBytesPerChan
The number of bytes per channel.
Definition: Texture.hpp:120


lvr2
Author(s): Thomas Wiemann , Sebastian Pütz , Alexander Mock , Lars Kiesow , Lukas Kalbertodt , Tristan Igelbrink , Johan M. von Behren , Dominik Feldschnieders , Alexander Löhr
autogenerated on Wed Mar 2 2022 00:37:25