pub struct Source<'a> { /* private fields */ }Expand description
A Pillow image’s tobytes() storage. Integer/float modes use native byte
order, 1 uses MSB-first bits with each row rounded up to a byte. Palette
entries are RGBA, permitting palette alpha and PA’s separate alpha band.
Implementations§
Source§impl<'a> Source<'a>
impl<'a> Source<'a>
Sourcepub fn new(
width: u32,
height: u32,
mode: &'a str,
bytes: &'a [u8],
palette: Option<&'a [[u8; 4]; 256]>,
) -> Result<Self, WriteError>
pub fn new( width: u32, height: u32, mode: &'a str, bytes: &'a [u8], palette: Option<&'a [[u8; 4]; 256]>, ) -> Result<Self, WriteError>
Validate the complete storage before any allocation or pixel access.
Sourcepub fn with_auxiliary(self, bytes: &'a [u8]) -> Result<Self, WriteError>
pub fn with_auxiliary(self, bytes: &'a [u8]) -> Result<Self, WriteError>
Preserve Pillow’s otherwise unexported fourth storage byte of RGB or
LAB. frombytes initializes it to 255; Image.new initializes it to
zero. Raw RGBA packing and ImageCms copy it. Other modes ignore it.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Source<'a>
impl<'a> Freeze for Source<'a>
impl<'a> Move for Source<'a>
impl<'a> RefUnwindSafe for Source<'a>
impl<'a> Send for Source<'a>
impl<'a> Sync for Source<'a>
impl<'a> Unpin for Source<'a>
impl<'a> UnsafeUnpin for Source<'a>
impl<'a> UnwindSafe for Source<'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