rendy_texture

Struct TextureBuilder

Source
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>

Source

pub fn new() -> Self

New empty TextureBuilder

Source

pub fn set_premultiplied_alpha(&mut self, premultiplied: bool) -> &mut Self

Set whether the image has premultiplied alpha

Source

pub fn with_premultiplied_alpha(self, premultiplied: bool) -> Self

Set whether the image has premultiplied alpha

Source

pub fn with_data<P: AsPixel>(self, data: impl Into<Cow<'a, [P]>>) -> Self

Set pixel data.

Source

pub fn set_data<P: AsPixel>( &mut self, data: impl Into<Cow<'a, [P]>>, ) -> &mut Self

Set pixel data.

Source

pub fn with_raw_data( self, data: impl Into<Cow<'a, [u8]>>, format: Format, ) -> Self

Set pixel data with manual format definition.

Source

pub fn set_raw_data( &mut self, data: impl Into<Cow<'a, [u8]>>, format: Format, ) -> &mut Self

Set pixel data with manual format definition.

Source

pub fn with_data_width(self, data_width: u32) -> Self

Set pixel data width.

Source

pub fn set_data_width(&mut self, data_width: u32) -> &mut Self

Set pixel data width.

Source

pub fn with_data_height(self, data_height: u32) -> Self

Set pixel data height.

Source

pub fn set_data_height(&mut self, data_height: u32) -> &mut Self

Set pixel data height.

Source

pub fn with_mip_levels(self, mip_levels: MipLevels) -> Self

Set number of generated or raw mip levels

Source

pub fn set_mip_levels(&mut self, mip_levels: MipLevels) -> &mut Self

Set number of generated or raw mip levels

Source

pub fn with_kind(self, kind: Kind) -> Self

Set image extent.

Source

pub fn set_kind(&mut self, kind: Kind) -> &mut Self

Set image kind.

Source

pub fn with_view_kind(self, view_kind: ViewKind) -> Self

With image view kind.

Source

pub fn set_view_kind(&mut self, view_kind: ViewKind) -> &mut Self

Set image view kind.

Source

pub fn with_sampler_info(self, sampler_info: SamplerDesc) -> Self

With image sampler info.

Source

pub fn set_sampler_info(&mut self, sampler_info: SamplerDesc) -> &mut Self

Set image sampler info.

Source

pub fn with_swizzle(self, swizzle: Swizzle) -> Self

With swizzle.

Source

pub fn set_swizzle(&mut self, swizzle: Swizzle) -> &mut Self

Set swizzle.

Source

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>

Source§

fn clone(&self) -> TextureBuilder<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for TextureBuilder<'a>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.