Struct luminance::texture::Texture
[−]
[src]
pub struct Texture<C, L, D, P> where C: HasTexture, L: Layerable, D: Dimensionable, P: Pixel { pub repr: C::ATexture, pub size: D::Size, pub mipmaps: usize, // some fields omitted }
Texture.
L
refers to the layering type; D
refers to the dimension; P
is the pixel format for the
texels.
Fields
repr: C::ATexture
size: D::Size
mipmaps: usize
Methods
impl<C, L, D, P> Texture<C, L, D, P> where C: HasTexture, L: Layerable, D: Dimensionable, D::Size: Copy, P: Pixel
[src]
fn new(size: D::Size, mipmaps: usize, sampler: &Sampler) -> Self
fn from_raw(texture: C::ATexture, size: D::Size, mipmaps: usize) -> Self
Create a texture from its backend representation.
fn clear_part(&self, gen_mipmaps: bool, offset: D::Offset, size: D::Size, pixel: P::Encoding) where D::Offset: Copy, D::Size: Copy, P::Encoding: Copy
Clear a part of a texture.
The part being cleared is defined by a rectangle in which the offset
represents the
left-upper corner and the size
gives the dimension of the rectangle. All the covered texels
by this rectangle will be cleared to the pixel
value.
fn clear(&self, gen_mipmaps: bool, pixel: P::Encoding) where D::Offset: Copy, D::Size: Copy, P::Encoding: Copy
Clear a whole texture with a pixel
value.
fn upload_part(&self, gen_mipmaps: bool, offset: D::Offset, size: D::Size, texels: &[P::Encoding]) where D::Offset: Copy, D::Size: Copy
Upload texels to a part of a texture.
The part being updated is defined by a rectangle in which the offset
represents the
left-upper corner and the size
gives the dimension of the rectangle. All the covered texels
by this rectangle will be updated by the texels
slice.
fn upload(&self, gen_mipmaps: bool, texels: &[P::Encoding]) where D::Offset: Copy, D::Size: Copy
Upload texels
to the whole texture.
fn upload_part_raw(&self, gen_mipmaps: bool, offset: D::Offset, size: D::Size, texels: &[P::RawEncoding]) where D::Offset: Copy, D::Size: Copy
Upload raw texels
to a part of a texture.
This function is similar to upload_part
but it works on P::RawEncoding
instead of
P::Encoding
. This useful when the texels are represented as a contiguous array of raw
components of the texels.
fn upload_raw(&self, gen_mipmaps: bool, texels: &[P::RawEncoding]) where D::Offset: Copy, D::Size: Copy
Upload raw texels
to the whole texture.
fn get_raw_texels(&self) -> Vec<P::RawEncoding> where P: Pixel, P::RawEncoding: Copy
Get the raw texels associated with this texture.
Trait Implementations
impl<C, L, D, P> ColorSlot<C, L, D> for Texture<C, L, D, P> where C: HasFramebuffer + HasTexture, L: Layerable, D: Dimensionable, D::Size: Copy, P: ColorPixel + RenderablePixel
[src]
fn color_formats() -> Vec<PixelFormat>
Turn a color slot into a list of pixel formats.
fn reify_textures(size: D::Size, mipmaps: usize, textures: &mut Vec<C::ATexture>) -> Self
Reify a list of raw textures into a color slot.
impl<C, L, D, P> DepthSlot<C, L, D> for Texture<C, L, D, P> where C: HasFramebuffer + HasTexture, L: Layerable, D: Dimensionable, D::Size: Copy, P: DepthPixel
[src]
fn depth_format() -> Option<PixelFormat>
Turn a depth slot into a pixel format.
fn reify_texture(size: D::Size, mipmaps: usize, texture: Option<C::ATexture>) -> Self
Reify a raw textures into a depth slot.