Texture map data structure. More...
#include <Context.h>
Public Member Functions | |
Texture ()=default | |
Default constructor. | |
Texture (const char *texture_file) | |
Constructor - initialize with given texture file. | |
std::string | getTextureFile () const |
Get the name/path of the texture map file. | |
int2 | getImageResolution () const |
Get the size of the texture in pixels (horizontal x vertical) | |
bool | hasTransparencyChannel () const |
Check whether the texture has a transparency channel. | |
const std::vector< std::vector< bool > > * | getTransparencyData () const |
Get the data in the texture transparency channel (if it exists) | |
float | getSolidFraction (const std::vector< vec2 > &uvs) |
Computes the solid fraction of the texture transparency channel within a given UV polygon. | |
|
explicit |
Constructor - initialize with given texture file.
[in] | texture_file | Path to texture file. Note that file paths can be absolute, or relative to the directory in which the program is being run. |
Definition at line 96 of file Context.cpp.
helios::int2 Texture::getImageResolution | ( | ) | const |
Get the size of the texture in pixels (horizontal x vertical)
Definition at line 143 of file Context.cpp.
float Texture::getSolidFraction | ( | const std::vector< vec2 > & | uvs | ) |
Computes the solid fraction of the texture transparency channel within a given UV polygon.
[in] | uvs | A vector of 2D UV coordinates defining the vertices of the polygon. |
Definition at line 155 of file Context.cpp.
std::string Texture::getTextureFile | ( | ) | const |
Get the name/path of the texture map file.
Definition at line 139 of file Context.cpp.
const std::vector< std::vector< bool > > * Texture::getTransparencyData | ( | ) | const |
Get the data in the texture transparency channel (if it exists)
Definition at line 151 of file Context.cpp.
bool Texture::hasTransparencyChannel | ( | ) | const |
Check whether the texture has a transparency channel.
Definition at line 147 of file Context.cpp.