[−][src]Struct piston_window::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> Texture<R> where
R: Resources,
[src]
R: Resources,
pub fn empty<F>(factory: &mut F) -> Result<Texture<R>, CombinedError> where
F: Factory<R>,
[src]
F: Factory<R>,
Returns empty texture.
pub fn from_path<F, P>(
factory: &mut F,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Texture<R>, String> where
F: Factory<R>,
P: AsRef<Path>,
[src]
factory: &mut F,
path: P,
flip: Flip,
settings: &TextureSettings
) -> Result<Texture<R>, String> where
F: Factory<R>,
P: AsRef<Path>,
Creates a texture from path.
pub fn from_image<F>(
factory: &mut F,
img: &ImageBuffer<Rgba<u8>, Vec<u8>>,
settings: &TextureSettings
) -> Result<Texture<R>, CombinedError> where
F: Factory<R>,
[src]
factory: &mut F,
img: &ImageBuffer<Rgba<u8>, Vec<u8>>,
settings: &TextureSettings
) -> Result<Texture<R>, CombinedError> where
F: Factory<R>,
Creates a texture from image.
pub fn from_memory_alpha<F>(
factory: &mut F,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Texture<R>, CombinedError> where
F: Factory<R>,
[src]
factory: &mut F,
buffer: &[u8],
width: u32,
height: u32,
settings: &TextureSettings
) -> Result<Texture<R>, CombinedError> where
F: Factory<R>,
Creates texture from memory alpha.
pub fn update<C>(
&mut self,
encoder: &mut Encoder<R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8>>
) -> Result<(), UpdateError<[u16; 3]>> where
C: Buffer<R>,
[src]
&mut self,
encoder: &mut Encoder<R, C>,
img: &ImageBuffer<Rgba<u8>, Vec<u8>>
) -> Result<(), UpdateError<[u16; 3]>> where
C: Buffer<R>,
Updates the texture with an image.
Trait Implementations
impl<R> PartialEq<Texture<R>> for Texture<R> where
R: PartialEq<R> + Resources,
[src]
R: PartialEq<R> + Resources,
impl<R, C> UpdateTexture<Encoder<R, C>> for Texture<R> where
C: Buffer<R>,
R: Resources,
[src]
C: Buffer<R>,
R: Resources,
type Error = UpdateError<[u16; 3]>
The error when updating texture.
fn update<O, S>(
&mut self,
encoder: &mut Encoder<R, C>,
format: Format,
memory: &[u8],
offset: O,
size: S
) -> Result<(), <Texture<R> as UpdateTexture<Encoder<R, C>>>::Error> where
O: Into<[u32; 2]>,
S: Into<[u32; 2]>,
[src]
&mut self,
encoder: &mut Encoder<R, C>,
format: Format,
memory: &[u8],
offset: O,
size: S
) -> Result<(), <Texture<R> as UpdateTexture<Encoder<R, C>>>::Error> where
O: Into<[u32; 2]>,
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,
fn get_size(&self) -> (u32, u32)
[src]
fn get_width(&self) -> u32
[src]
Gets the image width.
fn get_height(&self) -> u32
[src]
Gets the image height.
impl<F, R> CreateTexture<F> for Texture<R> where
F: Factory<R>,
R: Resources,
[src]
F: Factory<R>,
R: Resources,
type Error = CombinedError
The error when creating texture.
fn create<S>(
factory: &mut F,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Texture<R>, <Texture<R> as CreateTexture<F>>::Error> where
S: Into<[u32; 2]>,
[src]
factory: &mut F,
_format: Format,
memory: &[u8],
size: S,
settings: &TextureSettings
) -> Result<Texture<R>, <Texture<R> as CreateTexture<F>>::Error> where
S: Into<[u32; 2]>,
impl<R> Clone for Texture<R> where
R: Clone + Resources,
[src]
R: Clone + Resources,
Auto Trait Implementations
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,
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> SetParameter for T
[src]
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
[src]
T: Parameter<Self>,
Sets value
as a parameter of self
.