[−][src]Struct nannou::wgpu::TextureBuilder
A type aimed at simplifying the construction of a Texture.
The builder assumes a set of defaults describing a 128x128, non-multisampled, single-layer, non-linear sRGBA-8 texture. A suite of builder methods may be used to specify the exact properties desired.
Methods
impl TextureBuilder
[src]
pub const REQUIRED_IMAGE_TEXTURE_USAGE: TextureUsage
[src]
The minimum required texture usage when loading from an image.
pub fn from_image_view<T>(image_view: &T) -> Self where
T: GenericImageView,
T::Pixel: Pixel,
[src]
T: GenericImageView,
T::Pixel: Pixel,
Produce a texture descriptor from an image.
Specifically, this supports any image type implementing image::GenericImageView
whose
Pixel
type implements Pixel
.
By default, the produced builder will have the wgpu::TextureUsage
returned by
wgpu::TextureBuilder::default_image_texture_usage()
. This is a general-purpose usage that
should allow for copying to and from the texture, sampling the texture and rendering to the
texture. Specifying only the texture usage required may result in better performance. It
may be necessary to manually specify the the usage if STORAGE
is required.
pub fn default_image_texture_usage() -> TextureUsage
[src]
The default texture usage for the case where a user has loaded a texture from an image.
impl Builder
[src]
pub const DEFAULT_SIDE: u32
[src]
pub const DEFAULT_DEPTH: u32
[src]
pub const DEFAULT_SIZE: Extent3d
[src]
pub const DEFAULT_ARRAY_LAYER_COUNT: u32
[src]
pub const DEFAULT_MIP_LEVEL_COUNT: u32
[src]
pub const DEFAULT_SAMPLE_COUNT: u32
[src]
pub const DEFAULT_DIMENSION: TextureDimension
[src]
pub const DEFAULT_FORMAT: TextureFormat
[src]
pub const DEFAULT_USAGE: TextureUsage
[src]
pub const DEFAULT_DESCRIPTOR: TextureDescriptor
[src]
pub fn new() -> Self
[src]
Creates a new Default
builder
pub fn size(self, [width, height]: [u32; 2]) -> Self
[src]
Specify the width and height of the texture.
Note: On calls to size
, depth
and extent
the Builder
will attempt to infer the
wgpu::TextureDimension
of its inner wgpu::TextureDescriptor
by examining its size
field.
pub fn depth(self, depth: u32) -> Self
[src]
Specify the depth of the texture.
Note: On calls to size
, depth
and extent
the Builder
will attempt to infer the
wgpu::TextureDimension
of its inner wgpu::TextureDescriptor
by examining its size
field.
pub fn extent(self, extent: Extent3d) -> Self
[src]
Specify the width, height and depth of the texture.
Note: On calls to size
, depth
and extent
the Builder
will attempt to infer the
wgpu::TextureDimension
of its inner wgpu::TextureDescriptor
by examining its size
field.
pub fn array_layer_count(self, count: u32) -> Self
[src]
pub fn mip_level_count(self, count: u32) -> Self
[src]
pub fn sample_count(self, count: u32) -> Self
[src]
Specify the number of samples per pixel in the case that the texture is multisampled.
pub fn format(self, format: TextureFormat) -> Self
[src]
Specify the texture format.
pub fn usage(self, usage: TextureUsage) -> Self
[src]
Describes to the implementation how the texture is to be used.
It is important that the set of usage bits reflects the
pub fn build(self, device: &Device) -> Texture
[src]
Build the texture resulting from the specified parameters with the given device.
pub fn into_descriptor(self) -> TextureDescriptor
[src]
Consumes the builder and returns the resulting wgpu::TextureDescriptor
.
Trait Implementations
impl Debug for Builder
[src]
impl Default for Builder
[src]
impl From<TextureDescriptor> for Builder
[src]
fn from(descriptor: TextureDescriptor) -> Self
[src]
impl Into<TextureDescriptor> for Builder
[src]
fn into(self) -> TextureDescriptor
[src]
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
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,
fn adapt_into_using<M>(self, method: M) -> D where
M: TransformMatrix<Swp, Dwp, T>,
[src]
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into(self) -> D
[src]
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, U> ConvertInto<U> for T where
U: ConvertFrom<T>,
[src]
U: ConvertFrom<T>,
fn convert_into(self) -> U
[src]
fn convert_unclamped_into(self) -> U
[src]
fn try_convert_into(self) -> Result<U, OutOfBounds<U>>
[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> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,