pub struct Decoder { /* private fields */ }
Expand description
A GPU JPEG decode context.
Holds all on-GPU buffers and textures needed for JPEG decoding.
Implementations§
source§impl Decoder
impl Decoder
pub fn with_texture_usages(gpu: Arc<Gpu>, usage: TextureUsages) -> Self
pub fn texture(&self) -> &Texture
sourcepub fn into_texture(self) -> Texture
pub fn into_texture(self) -> Texture
pub fn enqueue( &mut self, data: &ImageData<'_>, enc: &mut CommandEncoder ) -> bool
sourcepub fn start_decode(&mut self, data: &ImageData<'_>) -> DecodeOp<'_>
pub fn start_decode(&mut self, data: &ImageData<'_>) -> DecodeOp<'_>
Preprocesses and uploads a JPEG image, and dispatches the decoding operation on the GPU.
Returns a DecodeOp
with information about the decode operation.
sourcepub fn decode_blocking(&mut self, data: &ImageData<'_>) -> DecodeOp<'_>
pub fn decode_blocking(&mut self, data: &ImageData<'_>) -> DecodeOp<'_>
Performs a blocking decode operation.
This method works identically to Decoder::start_decode
, but will wait until the
operation on the GPU is finished.
Note that it is not typically necessary to use this method, since wgpu
will
automatically insert barriers before the target texture is accessed.
Auto Trait Implementations§
impl !Freeze for Decoder
impl !RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl !UnwindSafe for Decoder
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