pub(crate) fn new_from_image(
        renderer: &WGPURenderer<Device>,
        img: image::Image,
        mag_filter: FilterMode,
        min_filter: FilterMode,
    ) -> Result<Self> {
        let texture = renderer.wgpu_device().with_device_info(|info| {
            Ok(WGPUTexture::from_image(
                info.device,
                info.queue,
                img,
                mag_filter,
                min_filter,
                TextureType::Plain,
            )?)
        })?;
        Self::from_texture(renderer, &texture)
    }
/// Construct a new sprite from an image. The image contents are copied to a texture
/// in RGBA8 format. The entire image will be used
Construct a new sprite from an image. The image contents are copied to a texture
in RGBA8 format. The entire image will be used
Construct a new sprite from an image . The image contents are copied to a texture in RGBA8 format . The entire image will be used
pub(crate) fn new_from_image(
        renderer: &WGPURenderer<Device>,
        img: image::Image,
        mag_filter: FilterMode,
        min_filter: FilterMode,
    ) -> Result<Self> {
        let texture = renderer.wgpu_device().with_device_info(|info| {
            Ok(WGPUTexture::from_image(
                info.device,
                info.queue,
                img,
                mag_filter,
                min_filter,
                TextureType::Plain,
            )?)
        })?;
        Self::from_texture(renderer, &texture)
    }
pub ( crate ) fn new_from_image ( renderer : & WGPURenderer < Device > , img : image :: Image , mag_filter : FilterMode , min_filter : FilterMode , ) -> Result < Self > { let texture = renderer . wgpu_device ( ) . with_device_info ( | info | { Ok ( WGPUTexture :: from_image ( info . device , info . queue , img , mag_filter , min_filter , TextureType :: Plain , ) ? ) } ) ? ; Self :: from_texture ( renderer , & texture ) }
Construct a new sprite from an image.
Construct a new sprite from an image .
renderer
&WGPURenderer<Device>
img
image::Image
mag_filter
FilterMode
min_filter
FilterMode
renderer
&WGPURenderer<Device>
img
image::Image
mag_filter
FilterMode
min_filter
FilterMode