Struct gfx_texture::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: Resources> Texture<R>
[src][−]
pub fn empty<F, C>(context: &mut TextureContext<F, R, C>) -> Result<Self, Error> where
F: Factory<R>,
C: CommandBuffer<R>,
[src][−]
F: Factory<R>,
C: CommandBuffer<R>,
Returns empty texture.
pub fn from_path<F, C, P>(
context: &mut TextureContext<F, R, C>,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Self, String> where
F: Factory<R>,
C: CommandBuffer<R>,
P: AsRef<Path>,
[src][−]
context: &mut TextureContext<F, R, C>,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Self, String> where
F: Factory<R>,
C: CommandBuffer<R>,
P: AsRef<Path>,
Creates a texture from path.
pub fn from_image<F, C>(
context: &mut TextureContext<F, R, C>,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, Error> where
F: Factory<R>,
C: CommandBuffer<R>,
[src][−]
context: &mut TextureContext<F, R, C>,
img: &RgbaImage,
settings: &TextureSettings
) -> Result<Self, Error> where
F: Factory<R>,
C: CommandBuffer<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<Self, Error> where
F: Factory<R>,
C: CommandBuffer<R>,
[src][−]
context: &mut TextureContext<F, R, C>,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Self, Error> where
F: Factory<R>,
C: CommandBuffer<R>,
Creates texture from memory alpha.
pub fn update<F, C>(
&mut self,
context: &mut TextureContext<F, R, C>,
img: &RgbaImage
) -> Result<(), Error> where
F: Factory<R>,
C: CommandBuffer<R>,
[src][−]
&mut self,
context: &mut TextureContext<F, R, C>,
img: &RgbaImage
) -> Result<(), Error> where
F: Factory<R>,
C: CommandBuffer<R>,
Updates the texture with an image.
Trait Implementations
impl<R: Clone> Clone for Texture<R> where
R: Resources,
[src][+]
R: Resources,
impl<F, R, C> CreateTexture<TextureContext<F, R, C>> for Texture<R> where
F: Factory<R>,
R: Resources,
C: CommandBuffer<R>,
[src][+]
F: Factory<R>,
R: Resources,
C: CommandBuffer<R>,
impl<R: Debug> Debug for Texture<R> where
R: Resources,
[src][+]
R: Resources,
impl<R> ImageSize for Texture<R> where
R: Resources,
[src][+]
R: Resources,
impl<R: PartialEq> PartialEq<Texture<R>> for Texture<R> where
R: Resources,
[src][+]
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
F: Factory<R>,
R: Resources,
C: CommandBuffer<R>,
[src][+]
F: Factory<R>,
R: Resources,
C: CommandBuffer<R>,
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,
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][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,