pub struct ImageData<'a> { /* private fields */ }
Expand description
A parsed JPEG image, containing all data needed for on-GPU decoding.
Implementations§
source§impl<'a> ImageData<'a>
impl<'a> ImageData<'a>
sourcepub fn new(jpeg: impl Into<Cow<'a, [u8]>>) -> Result<Self, Error>
pub fn new(jpeg: impl Into<Cow<'a, [u8]>>) -> Result<Self, Error>
Reads ImageData
from an in-memory JPEG file.
If this returns an error, it either means that the JPEG file is malformed, or that it uses features this library does not support. In either case, the application should fall back to a more fully-featured software decoder.
sourcepub fn parallelism(&self) -> u32
pub fn parallelism(&self) -> u32
Returns the total parallelism this JPEG permits.
This number indicates how many parts of the image can be processed in parallel. It is crucial for performance that this number is as high as possible. If it is below 10000, it is likely faster to use a CPU-based decoder instead.
Auto Trait Implementations§
impl<'a> Freeze for ImageData<'a>
impl<'a> RefUnwindSafe for ImageData<'a>
impl<'a> Send for ImageData<'a>
impl<'a> Sync for ImageData<'a>
impl<'a> Unpin for ImageData<'a>
impl<'a> UnwindSafe for ImageData<'a>
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