Struct luminance::texture::Texture
[−]
[src]
pub struct Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel, { /* fields omitted */ }
Texture.
L
refers to the layering type; D
refers to the dimension; P
is the pixel format for the
texels.
Methods
impl<L, D, P> Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: Pixel,
[src]
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: Pixel,
fn new(size: D::Size, mipmaps: usize, sampler: &Sampler) -> Result<Self>
unsafe fn from_raw(raw: RawTexture, size: D::Size, mipmaps: usize) -> Self
Create a texture from its backend representation.
fn to_raw(self) -> RawTexture
Convert a texture to its raw 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,
&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,
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,
&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,
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,
&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,
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,
P: Pixel,
P::RawEncoding: Copy,
Get the raw texels associated with this texture.
fn size(&self) -> D::Size
Methods from Deref<Target = RawTexture>
Trait Implementations
impl<L, D, P> ColorSlot<L, D> for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: ColorPixel + RenderablePixel,
[src]
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: ColorPixel + RenderablePixel,
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<GLuint>
) -> Self
size: D::Size,
mipmaps: usize,
textures: &mut Vec<GLuint>
) -> Self
Reify a list of raw textures into a color slot.
impl<L, D, P> DepthSlot<L, D> for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: DepthPixel,
[src]
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: DepthPixel,
fn depth_format() -> Option<PixelFormat>
Turn a depth slot into a pixel format.
fn reify_texture<T>(size: D::Size, mipmaps: usize, texture: T) -> Self where
T: Into<Option<GLuint>>,
T: Into<Option<GLuint>>,
Reify a raw textures into a depth slot.
impl<L: Debug, D: Debug, P: Debug> Debug for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
D::Size: Debug,
[src]
L: Layerable,
D: Dimensionable,
P: Pixel,
D::Size: Debug,
impl<L, D, P> Deref for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
L: Layerable,
D: Dimensionable,
P: Pixel,
type Target = RawTexture
The resulting type after dereferencing
fn deref(&self) -> &Self::Target
The method called to dereference a value
impl<L, D, P> DerefMut for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
L: Layerable,
D: Dimensionable,
P: Pixel,
impl<L, D, P> Drop for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
L: Layerable,
D: Dimensionable,
P: Pixel,