Class GrayscaleTexture#

Inheritance Relationships#

Base Type#

Class Documentation#

class GrayscaleTexture : public Karana::Scene::Texture#

Texture specialization for grayscale values.

Public Functions

GrayscaleTexture(std::string_view name, const TextureData &data_in)#

Constructor for GrayscaleTexture.

Parameters:
  • name – The Texture’s name.

  • data_in – Input data to create the Texture.

~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.