Struct luminance::texture::Texture[][src]

pub struct Texture<B: ?Sized, D, P> where
    B: TextureBackend<D, P>,
    D: Dimensionable,
    P: Pixel
{ /* fields omitted */ }
Expand description

GPU textures.

Implementations

Create a new Texture.

size is the wished size of the Texture.

mipmaps is the number of extra mipmaps to allocate with the texture. 0 means that the texture will only be made of a base level.

sampler is a Sampler object that will be used when sampling the texture from inside a shader, for instance.

gen_mipmaps determines whether mipmaps should be generated automatically.

texels is a slice of raw texels to put into the texture store.

Notes

Feel free to have a look at the documentation of GraphicsContext::new_texture for a simpler interface.

Create a new Texture with raw texels.

size is the wished size of the Texture.

mipmaps is the number of extra mipmaps to allocate with the texture. 0 means that the texture will only be made of a base level.

sampler is a Sampler object that will be used when sampling the texture from inside a shader, for instance.

gen_mipmaps determines whether mipmaps should be generated automatically.

texels is a slice of raw texels to put into the texture store.

Notes

Feel free to have a look at the documentation of GraphicsContext::new_texture_raw for a simpler interface.

Return the number of mipmaps.

Return the size of the texture.

Resize the texture by providing a new size and texels by reusing its GPU resources.

This function works similarly to Texture::new but instead of creating a brand new texture, reuses the texture resources on the GPU.

Resize the texture by providing a new size and raw texels by reusing its GPU resources.

This function works similarly to Texture::new_raw but instead of creating a brand new texture, reuses the texture resources on the GPU.

Clear the texture with a single pixel value.

This function will assign the input pixel value to all the pixels in the rectangle described by size and offset in the texture.

Clear the texture with a single pixel value.

This function will assign the input pixel value to all the pixels in the texture.

Upload pixels to a region of the texture described by the rectangle made with size and offset.

Upload pixels to the whole texture.

Upload raw data to a region of the texture described by the rectangle made with size and offset.

Upload raw data to the whole texture.

Get a copy of all the pixels from the texture.

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.