[−][src]Struct amethyst_rendy::rendy::texture::TextureBuilder
Generics-free texture builder.
Struct for staging data in preparation of building a Texture
Methods
impl<'a> TextureBuilder<'a>
[src][−]
pub fn new() -> TextureBuilder<'a>
[src][−]
New empty TextureBuilder
pub fn set_premultiplied_alpha(
&mut self,
premultiplied: bool
) -> &mut TextureBuilder<'a>
[src][−]
&mut self,
premultiplied: bool
) -> &mut TextureBuilder<'a>
Set whether the image has premultiplied alpha
pub fn with_premultiplied_alpha(self, premultiplied: bool) -> TextureBuilder<'a>
[src][−]
Set whether the image has premultiplied alpha
pub fn with_data<P, impl Into>>(
self,
data: impl Into>
) -> TextureBuilder<'a> where
P: AsPixel,
impl Into>: Into<Cow<'a, [P]>>,
[src][−]
self,
data: impl Into
) -> TextureBuilder<'a> where
P: AsPixel,
impl Into
Set pixel data.
pub fn set_data<P, impl Into>>(
&mut self,
data: impl Into>
) -> &mut TextureBuilder<'a> where
P: AsPixel,
impl Into>: Into<Cow<'a, [P]>>,
[src][−]
&mut self,
data: impl Into
) -> &mut TextureBuilder<'a> where
P: AsPixel,
impl Into
Set pixel data.
pub fn with_raw_data<impl Into>>(
self,
data: impl Into>,
format: Format
) -> TextureBuilder<'a> where
impl Into>: Into<Cow<'a, [u8]>>,
[src][−]
self,
data: impl Into
format: Format
) -> TextureBuilder<'a> where
impl Into
Set pixel data with manual format definition.
pub fn set_raw_data<impl Into>>(
&mut self,
data: impl Into>,
format: Format
) -> &mut TextureBuilder<'a> where
impl Into>: Into<Cow<'a, [u8]>>,
[src][−]
&mut self,
data: impl Into
format: Format
) -> &mut TextureBuilder<'a> where
impl Into
Set pixel data with manual format definition.
pub fn with_data_width(self, data_width: u32) -> TextureBuilder<'a>
[src][−]
Set pixel data width.
pub fn set_data_width(&mut self, data_width: u32) -> &mut TextureBuilder<'a>
[src][−]
Set pixel data width.
pub fn with_data_height(self, data_height: u32) -> TextureBuilder<'a>
[src][−]
Set pixel data height.
pub fn set_data_height(&mut self, data_height: u32) -> &mut TextureBuilder<'a>
[src][−]
Set pixel data height.
pub fn with_mip_levels(self, mip_levels: MipLevels) -> TextureBuilder<'a>
[src][−]
Set number of generated or raw mip levels
pub fn set_mip_levels(
&mut self,
mip_levels: MipLevels
) -> &mut TextureBuilder<'a>
[src][−]
&mut self,
mip_levels: MipLevels
) -> &mut TextureBuilder<'a>
Set number of generated or raw mip levels
pub fn with_kind(self, kind: Kind) -> TextureBuilder<'a>
[src][−]
Set image extent.
pub fn set_kind(&mut self, kind: Kind) -> &mut TextureBuilder<'a>
[src][−]
Set image kind.
pub fn with_view_kind(self, view_kind: ViewKind) -> TextureBuilder<'a>
[src][−]
With image view kind.
pub fn set_view_kind(&mut self, view_kind: ViewKind) -> &mut TextureBuilder<'a>
[src][−]
Set image view kind.
pub fn with_sampler_info(self, sampler_info: SamplerInfo) -> TextureBuilder<'a>
[src][−]
With image sampler info.
pub fn set_sampler_info(
&mut self,
sampler_info: SamplerInfo
) -> &mut TextureBuilder<'a>
[src][−]
&mut self,
sampler_info: SamplerInfo
) -> &mut TextureBuilder<'a>
Set image sampler info.
pub fn with_swizzle(self, swizzle: Swizzle) -> TextureBuilder<'a>
[src][−]
With swizzle.
pub fn set_swizzle(&mut self, swizzle: Swizzle) -> &mut TextureBuilder<'a>
[src][−]
Set swizzle.
pub fn build<B>(
&self,
next_state: ImageState,
factory: &'a mut Factory<B>
) -> Result<Texture<B>, Error> where
B: Backend,
[src][−]
&self,
next_state: ImageState,
factory: &'a mut Factory<B>
) -> Result<Texture<B>, Error> where
B: Backend,
Build texture.
Parameters
next_state
: The next state that this texture will be used in. It will get transitioned to this state after uploading.factory
: Factory to use to build the texture
Trait Implementations
impl<'de, 'a> Deserialize<'de> for TextureBuilder<'a>
[src][+]
impl<'a> Debug for TextureBuilder<'a>
[src][+]
impl<'a> Clone for TextureBuilder<'a>
[src][+]
impl<'a> Serialize for TextureBuilder<'a>
[src][+]
impl From<TextureBuilder<'static>> for TextureData
[src][+]
Auto Trait Implementations
impl<'a> Unpin for TextureBuilder<'a>
impl<'a> Sync for TextureBuilder<'a>
impl<'a> Send for TextureBuilder<'a>
impl<'a> UnwindSafe for TextureBuilder<'a>
impl<'a> RefUnwindSafe for TextureBuilder<'a>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
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>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,
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> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
[src][+]
D: AdaptFrom<S, Swp, Dwp, T>,
Dwp: WhitePoint,
Swp: WhitePoint,
T: Component + Float,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> SetParameter for T
[src][+]
impl<T> Supports<T> for T
[src]
impl<T> Erased for T
[src]
impl<T> Serialize for T where
T: Serialize + ?Sized,
[src][+]
T: Serialize + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src][+]
SS: SubsetOf<SP>,
impl<T> Resource for T where
T: Any + Send + Sync,
[src]
T: Any + Send + Sync,
impl<T> Any for T where
T: Any,
[src][+]
T: Any,
impl<T> Event for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> Clone for T where
T: Clone,
[src][+]
T: Clone,