#include <MTLComputeTexture.hpp>
|
void | swap (Texture &tex) noexcept |
| Swap the contents of two Textures.
|
|
std::vector< T > | flatten (std::vector< std::vector< T > > &v) const |
| Flatten a 2D vector into a 1D vector.
|
|
std::vector< std::vector< T > > | unflatten (std::vector< T > &v, int width, int height) const |
| Unflatten a 1D vector into a 2D vector.
|
|
|
MTL::Device * | gpu |
| The Metal device object.
|
|
MTL::Texture * | texture |
| The Metal texture object.
|
|
MTL::TextureDescriptor * | descriptor |
| The Metal texture descriptor object.
|
|
int | width = -1 |
| The width and height of the texture.
|
|
int | height = -1 |
| The width and height of the texture.
|
|
bool | freed = false |
| Whether the texture has been freed.
|
|
◆ Texture() [1/4]
Constructor for the Texture class.
Constructs a new texture object
- Parameters
-
gpu | The Metal device object |
width | The width of the texture |
height | The height of the texture |
tt | The texture type |
◆ Texture() [2/4]
Constructor for the Texture class.
Constructs a new texture object and tries to infer the texture type
- Parameters
-
gpu | The Metal device object |
width | The width of the texture |
height | The height of the texture |
◆ Texture() [3/4]
Copy constructor for the Texture class.
Constructs a new texture from an existing texture
- Parameters
-
◆ Texture() [4/4]
Default constructor for the Texture class.
Creates a new empty texture object
◆ ~Texture()
Destructor for the Texture class.
Calls autorelease on the texture and descriptor objects and sets the freed flag to true
◆ flatten()
template<typename T >
std::vector< T > MTLCompute::Texture< T >::flatten |
( |
std::vector< std::vector< T > > & | v | ) |
const |
|
inlineprivate |
Flatten a 2D vector into a 1D vector.
- Parameters
-
v | The 2D vector to flatten |
- Returns
- std::vector<T> The flattened vector
◆ getData()
Get the data from the texture as a vector.
- Returns
- std::vector<std::vector<T>> The data from the texture
◆ getDescriptor()
Get the texture descriptor.
- Returns
- MTL::TextureDescriptor* The texture descriptor
◆ getFreed()
Get whether the texture has been freed.
- Returns
- bool Whether the texture has been freed
◆ getGPU()
Get the GPU device.
- Returns
- MTL::Device* The GPU device
◆ getHeight()
Get the height of the texture.
- Returns
- int The height of the texture
◆ getTexture()
Get the MTL::Texture object.
- Returns
- MTL::Texture* The MTL::Texture object
◆ getWidth()
Get the width of the texture.
- Returns
- int The width of the texture
◆ operator=() [1/2]
Overload the = operator to set texture contents from another texture.
- Parameters
-
other | The texture to set the contents from |
◆ operator=() [2/2]
Overload the = operator to set texture contents from a vector.
- Parameters
-
data | The data to set the texture contents to |
◆ operator[]()
Overload the [] operator to get a row from the texture.
- Parameters
-
index | The index of the row to get |
- Returns
- std::vector<T> The row from the texture
◆ swap()
Swap the contents of two Textures.
- Parameters
-
buf | The texture to swap with |
◆ unflatten()
template<typename T >
std::vector< std::vector< T > > MTLCompute::Texture< T >::unflatten |
( |
std::vector< T > & | v, |
|
|
int | width, |
|
|
int | height ) const |
|
inlineprivate |
Unflatten a 1D vector into a 2D vector.
- Parameters
-
v | The 1D vector to unflatten |
width | The width of the 2D vector |
height | The height of the 2D vector |
- Returns
- std::vector<std::vector<T>> The unflattened vector
◆ descriptor
The Metal texture descriptor object.
◆ freed
Whether the texture has been freed.
◆ gpu
◆ height
The width and height of the texture.
◆ texture
The Metal texture object.
◆ width
The width and height of the texture.
The documentation for this class was generated from the following file: