Struct gfx_graphics::Texture [−][src]
pub struct Texture<R> where
R: Resources, { pub surface: Texture<R, R8_G8_B8_A8>, pub sampler: Sampler<R>, pub view: ShaderResourceView<R, [f32; 4]>, }
Represents a texture.
Fields
surface: Texture<R, R8_G8_B8_A8>
Pixel storage for texture.
sampler: Sampler<R>
Sampler for texture.
view: ShaderResourceView<R, [f32; 4]>
View used by shader.
Implementations
impl<R> Texture<R> where
R: Resources,
[src]
R: Resources,
pub fn empty<F, C>(
context: &mut TextureContext<F, R, C>
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
[src]
context: &mut TextureContext<F, R, C>
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
Returns empty texture.
pub fn from_path<F, C, P>(
context: &mut TextureContext<F, R, C>,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Texture<R>, String> where
C: Buffer<R>,
F: Factory<R>,
P: AsRef<Path>,
[src]
context: &mut TextureContext<F, R, C>,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Texture<R>, String> where
C: Buffer<R>,
F: Factory<R>,
P: AsRef<Path>,
Creates a texture from path.
pub fn from_image<F, C>(
context: &mut TextureContext<F, R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8, Global>>,
settings: &TextureSettings
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
[src]
context: &mut TextureContext<F, R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8, Global>>,
settings: &TextureSettings
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
Creates a texture from image.
pub fn from_memory_alpha<F, C>(
context: &mut TextureContext<F, R, C>,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
[src]
context: &mut TextureContext<F, R, C>,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Texture<R>, Error> where
C: Buffer<R>,
F: Factory<R>,
Creates texture from memory alpha.
pub fn update<F, C>(
&mut self,
context: &mut TextureContext<F, R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8, Global>>
) -> Result<(), Error> where
C: Buffer<R>,
F: Factory<R>,
[src]
&mut self,
context: &mut TextureContext<F, R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8, Global>>
) -> Result<(), Error> where
C: Buffer<R>,
F: Factory<R>,
Updates the texture with an image.
Trait Implementations
impl<R> Clone for Texture<R> where
R: Clone + Resources,
[src]
R: Clone + Resources,
impl<F, R, C> CreateTexture<TextureContext<F, R, C>> for Texture<R> where
C: Buffer<R>,
F: Factory<R>,
R: Resources,
[src]
C: Buffer<R>,
F: Factory<R>,
R: Resources,
pub fn create<S>(
context: &mut TextureContext<F, R, C>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Texture<R>, <Texture<R> as TextureOp<TextureContext<F, R, C>>>::Error> where
S: Into<[u32; 2]>,
[src]
context: &mut TextureContext<F, R, C>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Texture<R>, <Texture<R> as TextureOp<TextureContext<F, R, C>>>::Error> where
S: Into<[u32; 2]>,
impl<R> Debug for Texture<R> where
R: Debug + Resources,
[src]
R: Debug + Resources,
impl<R> ImageSize for Texture<R> where
R: Resources,
[src]
R: Resources,
pub fn get_size(&self) -> (u32, u32)
[src]
pub fn get_width(&self) -> u32
[src]
pub fn get_height(&self) -> u32
[src]
impl<R> PartialEq<Texture<R>> for Texture<R> where
R: PartialEq<R> + Resources,
[src]
R: PartialEq<R> + Resources,
impl<R> StructuralPartialEq for Texture<R> where
R: Resources,
[src]
R: Resources,
impl<F, R> TextureOp<F> for Texture<R> where
R: Resources,
[src]
R: Resources,
impl<F, R, C> UpdateTexture<TextureContext<F, R, C>> for Texture<R> where
C: Buffer<R>,
F: Factory<R>,
R: Resources,
[src]
C: Buffer<R>,
F: Factory<R>,
R: Resources,
Auto Trait Implementations
impl<R> !RefUnwindSafe for Texture<R>
impl<R> Send for Texture<R>
impl<R> Sync for Texture<R>
impl<R> Unpin for Texture<R>
impl<R> !UnwindSafe for Texture<R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,