Trait luminance::texture::HasTexture
[−]
[src]
pub trait HasTexture { type ATexture; fn new_texture<L, D, P>(size: D::Size,
mipmaps: usize,
sampler: &Sampler)
-> Self::ATexture where L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel; fn free(tex: &mut Self::ATexture); fn clear_part<L, D, P>(tex: &Self::ATexture,
gen_mimpmaps: bool,
offset: D::Offset,
size: D::Size,
pixel: P::Encoding) where L: Layerable, D: Dimensionable, D::Offset: Copy, D::Size: Copy, P: Pixel, P::Encoding: Copy; fn upload_part<L, D, P>(tex: &Self::ATexture,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::Encoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel; fn upload_part_raw<L, D, P>(tex: &Self::ATexture,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::RawEncoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel; fn get_raw_texels<P>(tex: &Self::ATexture) -> Vec<P::RawEncoding> where P: Pixel, P::RawEncoding: Copy; }
Trait to implement to provide texture features.
Associated Types
type ATexture
Required Methods
fn new_texture<L, D, P>(size: D::Size,
mipmaps: usize,
sampler: &Sampler)
-> Self::ATexture where L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel
mipmaps: usize,
sampler: &Sampler)
-> Self::ATexture where L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel
Create a new texture.
size
is a value used to specify the dimension of the texture. mipmaps
is the number of
extra mipmaps you want to have. If you set this value to 0
, you end up with only one level
(the base level) of texture storage.
fn free(tex: &mut Self::ATexture)
Destroy a texture.
fn clear_part<L, D, P>(tex: &Self::ATexture,
gen_mimpmaps: bool,
offset: D::Offset,
size: D::Size,
pixel: P::Encoding) where L: Layerable, D: Dimensionable, D::Offset: Copy, D::Size: Copy, P: Pixel, P::Encoding: Copy
gen_mimpmaps: bool,
offset: D::Offset,
size: D::Size,
pixel: P::Encoding) where L: Layerable, D: Dimensionable, D::Offset: Copy, D::Size: Copy, P: Pixel, P::Encoding: Copy
Clear the texture’s texels by setting them all to the same value.
fn upload_part<L, D, P>(tex: &Self::ATexture,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::Encoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::Encoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel
Upload texels to the texture’s memory.
fn upload_part_raw<L, D, P>(tex: &Self::ATexture,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::RawEncoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::RawEncoding]) where L: Layerable, D::Offset: Copy, D::Size: Copy, D: Dimensionable, P: Pixel
Upload raw texels to the texture’s memory.
fn get_raw_texels<P>(tex: &Self::ATexture) -> Vec<P::RawEncoding> where P: Pixel, P::RawEncoding: Copy
Retrieve the texels as a collection of P::RawEncoding.