[−][src]Struct glium_graphics::Texture
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]
F: Facade,
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]
factory: &mut F,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Self, String> where
F: Facade,
P: AsRef<Path>,
Creates a texture from path.
pub fn from_image<F>(
factory: &mut F,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureCreationError> where
F: Facade, [src]
factory: &mut F,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, TextureCreationError> where
F: Facade,
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]
factory: &mut F,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Self, TextureCreationError> where
F: Facade,
Creates texture from memory alpha.
pub fn update<F>(
&mut self,
factory: &mut F,
img: &RgbaImage
) -> Result<(), TextureCreationError> where
F: Facade, [src]
&mut self,
factory: &mut F,
img: &RgbaImage
) -> Result<(), TextureCreationError> where
F: Facade,
Updates texture with an image.
Trait Implementations
impl ImageSize for Texture[src]
fn get_size(&self) -> (u32, u32)[src]
fn get_width(&self) -> u32
Gets the image width.
fn get_height(&self) -> u32
Gets the image height.
impl<F> UpdateTexture<F> for Texture where
F: Facade, [src]
F: Facade,
fn update<O: Into<[u32; 2]>, S: Into<[u32; 2]>>(
&mut self,
factory: &mut F,
_format: Format,
memory: &[u8],
offset: O,
size: S
) -> Result<(), Self::Error>[src]
&mut self,
factory: &mut F,
_format: Format,
memory: &[u8],
offset: O,
size: S
) -> Result<(), Self::Error>
impl<F> CreateTexture<F> for Texture where
F: Facade, [src]
F: Facade,
fn create<S: Into<[u32; 2]>>(
factory: &mut F,
_format: Format,
memory: &[u8],
size: S,
_settings: &TextureSettings
) -> Result<Self, Self::Error>[src]
factory: &mut F,
_format: Format,
memory: &[u8],
size: S,
_settings: &TextureSettings
) -> Result<Self, Self::Error>
impl<F> TextureOp<F> for Texture[src]
type Error = TextureCreationError
The error when performing an operation.
Auto Trait Implementations
impl !Sync for Texture
impl !Send for Texture
impl Unpin for Texture
impl !RefUnwindSafe for Texture
impl !UnwindSafe for Texture
Blanket Implementations
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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>,
T: Parameter<Self>,
Sets value as a parameter of self.