#include <Texture2D.h>
|
PLATFORM_API | Texture2D (const Type type, const std::string &filename, const uint8_t channels, const uint8_t depth, const uint32_t width, const uint32_t height) |
|
size_t | getSizeInBytes () const |
|
void | setMipLevels (const uint8_t mips) |
|
uint8_t | getMipLevels () const |
|
template<typename T > |
const T * | getRawData (const uint8_t face=0, const uint8_t mip=0) const |
|
void | setRawData (unsigned char *data, const size_t size, const uint8_t face=0, const uint8_t mip=0) |
|
void | setRawData (std::vector< unsigned char > &&rawData, const uint8_t face=0, const uint8_t mip=0) |
|
uint8_t | getPossibleMipMapsLevels () const |
|
bool | isCubeMap () const |
|
bool | isNormalMap () const |
|
uint8_t | getNumFaces () const |
|
void | setWrapMode (const TextureWrapMode mode) |
|
TextureWrapMode | getWrapMode () const |
|
Definition at line 37 of file Texture2D.h.
◆ Type
Enum defining the types of textures.
Enumerator |
---|
default_ | |
cubemap | |
normal_roughness | |
aoe | |
Definition at line 43 of file Texture2D.h.
◆ Texture2D()
core::Texture2D::Texture2D |
( |
const Type |
type, |
|
|
const std::string & |
filename, |
|
|
const uint8_t |
channels, |
|
|
const uint8_t |
depth, |
|
|
const uint32_t |
width, |
|
|
const uint32_t |
height |
|
) |
| |
Constructor for Texture2D class.
- Parameters
-
type | Type of texture. |
filename | File name of the texture. |
channels | Number of channels in the texture. |
depth | Depth of the texture. |
width | Width of the texture. |
height | Height of the texture. |
Definition at line 25 of file Texture2D.cpp.
◆ getMipLevels()
uint8_t core::Texture2D::getMipLevels |
( |
| ) |
const |
|
inline |
- Returns
- The number of mip levels.
Definition at line 79 of file Texture2D.h.
◆ getNumFaces()
uint8_t core::Texture2D::getNumFaces |
( |
| ) |
const |
|
inline |
- Returns
- The number of faces of the texture.
Definition at line 131 of file Texture2D.h.
◆ getPossibleMipMapsLevels()
uint8_t core::Texture2D::getPossibleMipMapsLevels |
( |
| ) |
const |
- Returns
- The possible number of mip maps levels.
Definition at line 58 of file Texture2D.cpp.
◆ getRawData()
template<typename T >
const T* core::Texture2D::getRawData |
( |
const uint8_t |
face = 0 , |
|
|
const uint8_t |
mip = 0 |
|
) |
| const |
|
inline |
Get the raw data of the texture.
- Parameters
-
face | Face of the texture. |
mip | Mip level of the texture. |
- Returns
- The raw data of the texture.
Definition at line 89 of file Texture2D.h.
◆ getSizeInBytes()
size_t core::Texture2D::getSizeInBytes |
( |
| ) |
const |
|
inline |
- Returns
- The size in bytes of the texture.
Definition at line 67 of file Texture2D.h.
◆ getWrapMode()
- Returns
- The wrap mode of the texture.
Definition at line 143 of file Texture2D.h.
◆ isCubeMap()
bool core::Texture2D::isCubeMap |
( |
| ) |
const |
|
inline |
- Returns
- True if the texture is a cubemap.
Definition at line 121 of file Texture2D.h.
◆ isNormalMap()
bool core::Texture2D::isNormalMap |
( |
| ) |
const |
|
inline |
- Returns
- True if the texture is a normal map.
Definition at line 126 of file Texture2D.h.
◆ setMipLevels()
void core::Texture2D::setMipLevels |
( |
const uint8_t |
mips | ) |
|
Set the number of mip levels for the texture.
- Parameters
-
mips | Number of mip levels to set. |
Definition at line 38 of file Texture2D.cpp.
◆ setRawData() [1/2]
void core::Texture2D::setRawData |
( |
std::vector< unsigned char > && |
rawData, |
|
|
const uint8_t |
face = 0 , |
|
|
const uint8_t |
mip = 0 |
|
) |
| |
Set the raw data of the texture.
- Parameters
-
rawData | Raw data of the texture. |
face | Face of the texture. |
mip | Mip level of the texture. |
Definition at line 53 of file Texture2D.cpp.
◆ setRawData() [2/2]
void core::Texture2D::setRawData |
( |
unsigned char * |
data, |
|
|
const size_t |
size, |
|
|
const uint8_t |
face = 0 , |
|
|
const uint8_t |
mip = 0 |
|
) |
| |
Set the raw data of the texture.
- Parameters
-
data | Raw data of the texture. |
size | Size of the raw data. |
face | Face of the texture. |
mip | Mip level of the texture. |
Definition at line 47 of file Texture2D.cpp.
◆ setWrapMode()
Set the wrap mode of the texture.
- Parameters
-
Definition at line 138 of file Texture2D.h.
◆ channels
const uint8_t core::Texture2D::channels |
Number of channels in the texture.
Definition at line 152 of file Texture2D.h.
◆ depth
const uint8_t core::Texture2D::depth |
◆ filename
const std::string core::Texture2D::filename |
◆ height
const uint32_t core::Texture2D::height |
◆ type
const Type core::Texture2D::type |
◆ width
const uint32_t core::Texture2D::width |
The documentation for this class was generated from the following files: