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,
P: Pixel,
[src]
impl<L, D, P> Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
pub fn new<C>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
sampler: &Sampler
) -> Result<Self, TextureError> where
C: GraphicsContext,
[src]
pub fn new<C>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
sampler: &Sampler
) -> Result<Self, TextureError> where
C: GraphicsContext,
pub fn to_raw(self) -> RawTexture
[src]
pub fn to_raw(self) -> RawTexture
Convert a texture to its raw representation.
pub fn mipmaps(&self) -> usize
[src]
pub fn mipmaps(&self) -> usize
Number of mipmaps in the texture.
pub fn clear_part(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
pixel: P::Encoding
) where
P::Encoding: Copy,
[src]
pub fn clear_part(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
pixel: P::Encoding
) where
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.
pub fn clear(&self, gen_mipmaps: bool, pixel: P::Encoding) where
P::Encoding: Copy,
[src]
pub fn clear(&self, gen_mipmaps: bool, pixel: P::Encoding) where
P::Encoding: Copy,
Clear a whole texture with a pixel
value.
pub fn upload_part(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::Encoding]
)
[src]
pub fn upload_part(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::Encoding]
)
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.
pub fn upload(&self, gen_mipmaps: bool, texels: &[P::Encoding])
[src]
pub fn upload(&self, gen_mipmaps: bool, texels: &[P::Encoding])
Upload texels
to the whole texture.
pub fn upload_part_raw(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::RawEncoding]
)
[src]
pub fn upload_part_raw(
&self,
gen_mipmaps: bool,
offset: D::Offset,
size: D::Size,
texels: &[P::RawEncoding]
)
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.
pub fn upload_raw(&self, gen_mipmaps: bool, texels: &[P::RawEncoding])
[src]
pub fn upload_raw(&self, gen_mipmaps: bool, texels: &[P::RawEncoding])
Upload raw texels
to the whole texture.
pub fn get_raw_texels(&self) -> Vec<P::RawEncoding> where
P: Pixel,
P::RawEncoding: Copy,
[src]
pub fn get_raw_texels(&self) -> Vec<P::RawEncoding> where
P: Pixel,
P::RawEncoding: Copy,
Get the raw texels associated with this texture.
pub fn size(&self) -> D::Size
[src]
pub fn size(&self) -> D::Size
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]
impl<L, D, P> ColorSlot<L, D> for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: ColorPixel + RenderablePixel,
fn color_formats() -> Vec<PixelFormat>
[src]
fn color_formats() -> Vec<PixelFormat>
Turn a color slot into a list of pixel formats.
fn reify_textures<C, I>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
textures: &mut I
) -> Self where
C: GraphicsContext,
I: Iterator<Item = GLuint>,
[src]
fn reify_textures<C, I>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
textures: &mut I
) -> Self where
C: GraphicsContext,
I: Iterator<Item = GLuint>,
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]
impl<L, D, P> DepthSlot<L, D> for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
D::Size: Copy,
P: DepthPixel,
fn depth_format() -> Option<PixelFormat>
[src]
fn depth_format() -> Option<PixelFormat>
Turn a depth slot into a pixel format.
fn reify_texture<C, T>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
texture: T
) -> Self where
C: GraphicsContext,
T: Into<Option<GLuint>>,
[src]
fn reify_texture<C, T>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
texture: T
) -> Self where
C: GraphicsContext,
T: Into<Option<GLuint>>,
Reify a raw textures into a depth slot.
impl<L, D, P> Deref for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
impl<L, D, P> Deref for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
type Target = RawTexture
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl<L, D, P> DerefMut for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
impl<L, D, P> DerefMut for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
impl<L, D, P> Drop for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,
[src]
impl<L, D, P> Drop for Texture<L, D, P> where
L: Layerable,
D: Dimensionable,
P: Pixel,