1.3.49
 
Loading...
Searching...
No Matches
helios::Texture Class Reference

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.
 

Detailed Description

Texture map data structure.

Definition at line 73 of file Context.h.

Constructor & Destructor Documentation

◆ Texture()

Texture::Texture ( const char *  texture_file)
explicit

Constructor - initialize with given texture file.

Parameters
[in]texture_filePath 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.

Member Function Documentation

◆ getImageResolution()

helios::int2 Texture::getImageResolution ( ) const

Get the size of the texture in pixels (horizontal x vertical)

Definition at line 143 of file Context.cpp.

◆ getSolidFraction()

float Texture::getSolidFraction ( const std::vector< vec2 > &  uvs)

Computes the solid fraction of the texture transparency channel within a given UV polygon.

Parameters
[in]uvsA vector of 2D UV coordinates defining the vertices of the polygon.
Returns
The fraction of the polygon that is considered solid, as a float between 0.0 and 1.0.

Definition at line 155 of file Context.cpp.

◆ getTextureFile()

std::string Texture::getTextureFile ( ) const

Get the name/path of the texture map file.

Definition at line 139 of file Context.cpp.

◆ getTransparencyData()

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.

◆ hasTransparencyChannel()

bool Texture::hasTransparencyChannel ( ) const

Check whether the texture has a transparency channel.

Definition at line 147 of file Context.cpp.


The documentation for this class was generated from the following files: