pub struct DecodeTarget {
pub width: usize,
pub height: usize,
pub data: Vec<u8>,
pub channels: usize,
}Expand description
Pixel storage backing a PixelData during decode, tracking bit depth so the
channel codecs can write at the correct stride.
Upstream uses Uint8ClampedArray / Uint16Array / Float32Array views.
Here we keep a Vec<u8> of RGBA8 always (PixelData is RGBA8 in this port);
16/32-bit source samples are down-converted to 8-bit on store so the public
PixelData stays RGBA8 (matching how this crate models pixels).
Fields§
§width: usize§height: usize§data: Vec<u8>RGBA8 (or channels-wide) byte buffer.
channels: usizeImplementations§
Source§impl DecodeTarget
impl DecodeTarget
pub fn rgba(width: usize, height: usize) -> DecodeTarget
pub fn wide(width: usize, height: usize, channels: usize) -> DecodeTarget
pub fn into_pixel_data(self) -> PixelData
Auto Trait Implementations§
impl Freeze for DecodeTarget
impl RefUnwindSafe for DecodeTarget
impl Send for DecodeTarget
impl Sync for DecodeTarget
impl Unpin for DecodeTarget
impl UnsafeUnpin for DecodeTarget
impl UnwindSafe for DecodeTarget
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