Class Texture
Defined in File Texture.hpp
Class Documentation
-
class Texture
This class represents a texture.
Public Functions
-
Texture()
Constructor.
-
Texture(int index, unsigned short int width, unsigned short int height, unsigned char numChannels, unsigned char numBytesPerChan, float texelSize, unsigned char *data = nullptr, std::string layer = "default")
Constructor.
-
virtual ~Texture()
Destructor.
-
void save(const std::string &file_name = "")
Writes the texture to an image file.
If no filename is provided, file will be called texture_<INDEX>.ppm
Public Members
-
unsigned short int m_width
The dimensions of the texture.
-
unsigned short int m_height
-
unsigned char *m_data
The texture data.
-
unsigned char m_numChannels
The number of color channels.
-
unsigned char m_numBytesPerChan
The number of bytes per channel.
-
float m_texelSize
The size of a texture pixel.
-
std::string m_layerName
The layer name of this texture.
-
Texture()