[][src]Struct glium_graphics::Texture

pub struct Texture(pub SrgbTexture2d);

Wrapper for 2D texture.

Methods

impl Texture[src]

pub fn new(texture: SrgbTexture2d) -> Texture[src]

Creates a new Texture.

pub fn empty<F>(factory: &mut F) -> Result<Self, TextureCreationError> where
    F: Facade
[src]

Returns empty texture.

pub fn from_path<F, P>(
    factory: &mut F,
    path: P,
    flip: Flip,
    settings: &TextureSettings
) -> Result<Self, String> where
    F: Facade,
    P: AsRef<Path>, 
[src]

Creates a texture from path.

pub fn from_image<F>(
    factory: &mut F,
    img: &RgbaImage,
    settings: &TextureSettings
) -> Result<Self, TextureCreationError> where
    F: Facade
[src]

Creates a texture from image.

pub fn from_memory_alpha<F>(
    factory: &mut F,
    buffer: &[u8],
    width: u32,
    height: u32,
    settings: &TextureSettings
) -> Result<Self, TextureCreationError> where
    F: Facade
[src]

Creates texture from memory alpha.

pub fn update<F>(
    &mut self,
    factory: &mut F,
    img: &RgbaImage
) -> Result<(), TextureCreationError> where
    F: Facade
[src]

Updates texture with an image.

Trait Implementations

impl ImageSize for Texture[src]

fn get_width(&self) -> u32

Gets the image width.

fn get_height(&self) -> u32

Gets the image height.

impl<F> CreateTexture<F> for Texture where
    F: Facade
[src]

type Error = TextureCreationError

The error when creating texture.

impl<F> UpdateTexture<F> for Texture where
    F: Facade
[src]

type Error = TextureCreationError

The error when updating texture.

Auto Trait Implementations

impl !Send for Texture

impl !Sync for Texture

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.