Class GrayscaleTexture#
Defined in File Texture.h
Inheritance Relationships#
Base Type#
public Karana::Scene::Texture(Class Texture)
Class Documentation#
-
class GrayscaleTexture : public Karana::Scene::Texture#
Texture specialization for grayscale values.
See Scene layer for more discussion on the scene layer.
Public Functions
-
GrayscaleTexture(std::string_view name, const TextureData &data_in)#
GrayscaleTexture constructor. The constructor is not meant to be called directly. Please use the create(…) method instead to create an instance.
-
~GrayscaleTexture()#
Destructor for GrayscaleTexture.
-
virtual void setData(const TextureData &data_in) final#
Set the texture data associated with the Texture.
- Parameters:
data_in – The data to set the Texture data to.
-
virtual void setData(TextureData &&data)#
Set the texture data associated with the Texture.
- Parameters:
data – The data to set the Texture data to.
Public Static Functions
-
static kc::ks_ptr<GrayscaleTexture> create(std::string_view name, const TextureData &data)#
Create a GrayscaleTexture instance.
- Parameters:
name – The Texture’s name.
data – The data for the texture.
- Returns:
A ks_ptr to the GrayscaleTexture.
-
static kc::ks_ptr<GrayscaleTexture> create(std::string_view name, unsigned char *buffer, int len)#
Create a GrayscaleTexture instance.
- Parameters:
name – The Texture’s name.
buffer – A buffer holding a compressed image format.
len – The length of the buffer.
- Returns:
A ks_ptr to the GrayscaleTexture.
-
static kc::ks_ptr<GrayscaleTexture> lookupOrCreateGrayscaleTexture(const std::filesystem::path &filename)#
Create a texture from a file name. This caches the texture so that future versions created with the same file name just return a pointer to the same texture.
- Parameters:
filename – The name of the file.
- Returns:
A ks_ptr to the GrayscaleTexture.
-
GrayscaleTexture(std::string_view name, const TextureData &data_in)#