[−][src]Struct gfx_texture::Texture
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.
Methods
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>,
fn create<S: Into<[u32; 2]>>(
context: &mut TextureContext<F, R, C>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Self, Self::Error>
[src]
context: &mut TextureContext<F, R, C>,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Self, Self::Error>
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> where
<R as Resources>::Buffer: Send + Sync,
<R as Resources>::Mapping: Send,
<R as Resources>::Sampler: Send + Sync,
<R as Resources>::ShaderResourceView: Send + Sync,
<R as Resources>::Texture: Send + Sync,
<R as Resources>::Buffer: Send + Sync,
<R as Resources>::Mapping: Send,
<R as Resources>::Sampler: Send + Sync,
<R as Resources>::ShaderResourceView: Send + Sync,
<R as Resources>::Texture: Send + Sync,
impl<R> Sync for Texture<R> where
<R as Resources>::Buffer: Send + Sync,
<R as Resources>::Mapping: Send,
<R as Resources>::Sampler: Send + Sync,
<R as Resources>::ShaderResourceView: Send + Sync,
<R as Resources>::Texture: Send + Sync,
<R as Resources>::Buffer: Send + Sync,
<R as Resources>::Mapping: Send,
<R as Resources>::Sampler: Send + Sync,
<R as Resources>::ShaderResourceView: Send + Sync,
<R as Resources>::Texture: Send + Sync,
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,
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> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
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.
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>,