[][src]Struct nannou::wgpu::TextureBuilder

pub struct TextureBuilder { /* fields omitted */ }

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]

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]

impl Into<TextureDescriptor> for Builder[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]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T, U> ConvertInto<U> for T where
    U: ConvertFrom<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> SetParameter for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,