pub struct TextureBuilder<'a> { /* private fields */ }
Expand description
Generics-free texture builder.
Struct for staging data in preparation of building a Texture
Implementations§
Source§impl<'a> TextureBuilder<'a>
impl<'a> TextureBuilder<'a>
Sourcepub fn set_premultiplied_alpha(&mut self, premultiplied: bool) -> &mut Self
pub fn set_premultiplied_alpha(&mut self, premultiplied: bool) -> &mut Self
Set whether the image has premultiplied alpha
Sourcepub fn with_premultiplied_alpha(self, premultiplied: bool) -> Self
pub fn with_premultiplied_alpha(self, premultiplied: bool) -> Self
Set whether the image has premultiplied alpha
Sourcepub fn set_data<P: AsPixel>(
&mut self,
data: impl Into<Cow<'a, [P]>>,
) -> &mut Self
pub fn set_data<P: AsPixel>( &mut self, data: impl Into<Cow<'a, [P]>>, ) -> &mut Self
Set pixel data.
Sourcepub fn with_raw_data(
self,
data: impl Into<Cow<'a, [u8]>>,
format: Format,
) -> Self
pub fn with_raw_data( self, data: impl Into<Cow<'a, [u8]>>, format: Format, ) -> Self
Set pixel data with manual format definition.
Sourcepub fn set_raw_data(
&mut self,
data: impl Into<Cow<'a, [u8]>>,
format: Format,
) -> &mut Self
pub fn set_raw_data( &mut self, data: impl Into<Cow<'a, [u8]>>, format: Format, ) -> &mut Self
Set pixel data with manual format definition.
Sourcepub fn with_data_width(self, data_width: u32) -> Self
pub fn with_data_width(self, data_width: u32) -> Self
Set pixel data width.
Sourcepub fn set_data_width(&mut self, data_width: u32) -> &mut Self
pub fn set_data_width(&mut self, data_width: u32) -> &mut Self
Set pixel data width.
Sourcepub fn with_data_height(self, data_height: u32) -> Self
pub fn with_data_height(self, data_height: u32) -> Self
Set pixel data height.
Sourcepub fn set_data_height(&mut self, data_height: u32) -> &mut Self
pub fn set_data_height(&mut self, data_height: u32) -> &mut Self
Set pixel data height.
Sourcepub fn with_mip_levels(self, mip_levels: MipLevels) -> Self
pub fn with_mip_levels(self, mip_levels: MipLevels) -> Self
Set number of generated or raw mip levels
Sourcepub fn set_mip_levels(&mut self, mip_levels: MipLevels) -> &mut Self
pub fn set_mip_levels(&mut self, mip_levels: MipLevels) -> &mut Self
Set number of generated or raw mip levels
Sourcepub fn with_view_kind(self, view_kind: ViewKind) -> Self
pub fn with_view_kind(self, view_kind: ViewKind) -> Self
With image view kind.
Sourcepub fn set_view_kind(&mut self, view_kind: ViewKind) -> &mut Self
pub fn set_view_kind(&mut self, view_kind: ViewKind) -> &mut Self
Set image view kind.
Sourcepub fn with_sampler_info(self, sampler_info: SamplerDesc) -> Self
pub fn with_sampler_info(self, sampler_info: SamplerDesc) -> Self
With image sampler info.
Sourcepub fn set_sampler_info(&mut self, sampler_info: SamplerDesc) -> &mut Self
pub fn set_sampler_info(&mut self, sampler_info: SamplerDesc) -> &mut Self
Set image sampler info.
Sourcepub fn with_swizzle(self, swizzle: Swizzle) -> Self
pub fn with_swizzle(self, swizzle: Swizzle) -> Self
With swizzle.
Sourcepub fn set_swizzle(&mut self, swizzle: Swizzle) -> &mut Self
pub fn set_swizzle(&mut self, swizzle: Swizzle) -> &mut Self
Set swizzle.
Sourcepub fn build<B>(
&self,
next_state: ImageState,
factory: &'a mut Factory<B>,
) -> Result<Texture<B>, BuildError>where
B: Backend,
pub fn build<B>(
&self,
next_state: ImageState,
factory: &'a mut Factory<B>,
) -> Result<Texture<B>, BuildError>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§
Source§impl<'a> Clone for TextureBuilder<'a>
impl<'a> Clone for TextureBuilder<'a>
Source§fn clone(&self) -> TextureBuilder<'a>
fn clone(&self) -> TextureBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for TextureBuilder<'a>
impl<'a> RefUnwindSafe for TextureBuilder<'a>
impl<'a> Send for TextureBuilder<'a>
impl<'a> Sync for TextureBuilder<'a>
impl<'a> Unpin for TextureBuilder<'a>
impl<'a> UnwindSafe for TextureBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)