Struct libktx_rs::texture::Texture[][src]

pub struct Texture<'a> { /* fields omitted */ }
Expand description

A KTX (1 or 2) texture.

This wraps both a sys::ktxTexture handle, and the TextureSource it was created from.

Implementations

Attempts to create a new texture, consuming the given TextureSource.

Returns the pointer to the (C-allocated) underlying sys::ktxTexture.

SAFETY: Pointers are harmless. Dereferencing them is not!

Returns the total size of image data, in bytes.

Returns a read-only view on the image data.

Returns a read-write view on the image data.

Returns the pitch (in bytes) of an image row at the specified image level.
This is rounded up to 1 if needed.

Returns the size (in bytes) of an element of the image.

Attempts to write the texture (in its native format, either KTX1 or KTX2) to sink.

If this Texture really is a KTX1, returns KTX1-specific functionalities for it.

If this Texture really is a KTX2, returns KTX2-specific functionalities for it.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.