pub struct ImportedTextureNormalizer { /* private fields */ }Expand description
Caches the wgpu pipeline state for normalizing imported textures.
Create once and reuse across frames to avoid repeated shader compilation.
Implementations§
Source§impl ImportedTextureNormalizer
impl ImportedTextureNormalizer
pub fn new(device: &Device) -> Self
Sourcepub fn normalize(
&self,
device: &Device,
queue: &Queue,
source_texture: &Texture,
size: PhysicalSize<u32>,
) -> Texture
pub fn normalize( &self, device: &Device, queue: &Queue, source_texture: &Texture, size: PhysicalSize<u32>, ) -> Texture
Normalize source_texture into a new Rgba8Unorm texture with top-left origin.
The source texture is sampled with a Y-flip, so bottom-left-origin textures (common from GL/Metal) are corrected automatically.
Auto Trait Implementations§
impl Freeze for ImportedTextureNormalizer
impl !RefUnwindSafe for ImportedTextureNormalizer
impl Send for ImportedTextureNormalizer
impl Sync for ImportedTextureNormalizer
impl Unpin for ImportedTextureNormalizer
impl UnsafeUnpin for ImportedTextureNormalizer
impl !UnwindSafe for ImportedTextureNormalizer
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more