Struct gfx_texture::Texture [] [src]

pub struct Texture<R> where R: Resources {
    // some fields omitted
}

Represents a texture.

Methods

impl<R: Resources> Texture<R>

fn handle(&self) -> Texture<R>

Gets a handle to the Gfx texture.

fn empty<F>(factory: &mut F) -> Result<Self, TextureError> where F: Factory<R>

Returns empty texture.

fn from_path<F, P>(factory: &mut F, path: P, settings: &Settings) -> Result<Self, String> where F: Factory<R>, P: AsRef<Path>

Creates a texture from path.

fn from_image<F>(factory: &mut F, image: &RgbaImage, convert_gamma: bool, _compress: bool, generate_mipmap: bool) -> Self where F: Factory<R>

Creates a texture from image.

fn from_memory_alpha<F>(factory: &mut F, buffer: &[u8], width: u32, height: u32) -> Self where F: Factory<R>

Creates texture from memory alpha.

fn update<F>(&mut self, factory: &mut F, image: &RgbaImage) where F: Factory<R>

Updates the texture with an image.

Trait Implementations

impl<R> ImageSize for Texture<R> where R: Resources

fn get_size(&self) -> (u32, u32)

fn get_width(&self) -> u32

fn get_height(&self) -> u32

Derived Implementations

impl<R: PartialEq> PartialEq for Texture<R> where R: Resources, R: PartialEq

fn eq(&self, __arg_0: &Texture<R>) -> bool

fn ne(&self, __arg_0: &Texture<R>) -> bool

impl<R: Debug> Debug for Texture<R> where R: Resources, R: Debug

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<R: Clone> Clone for Texture<R> where R: Resources, R: Clone

fn clone(&self) -> Texture<R>

fn clone_from(&mut self, source: &Self)