pub struct Composite { /* private fields */ }Expand description
An open merged image. Reading it doesn’t hold the file in memory.
Implementations§
Source§impl Composite
impl Composite
Sourcepub fn open(path: &Path) -> Result<Self, PsdError>
pub fn open(path: &Path) -> Result<Self, PsdError>
Reads the structure of the file at path, checking every length
against the file’s size; pixels are read when asked for, so a huge
header on a small file is refused here.
Sourcepub fn read_rects(
&mut self,
rects: &[[u32; 4]],
) -> Result<Vec<RgbaImage>, PsdError>
pub fn read_rects( &mut self, rects: &[[u32; 4]], ) -> Result<Vec<RgbaImage>, PsdError>
The rectangles [x0, y0, x1, y1] of the upright picture at full
resolution as straight-alpha RGBA. Every row of the file is decoded
once however many rectangles it crosses; memory is the rectangles’
pixels at 4 bytes each, plus what the module notes describe.
Sourcepub fn read_scaled(
&mut self,
rect: [u32; 4],
long: u32,
) -> Result<RgbaImage, PsdError>
pub fn read_scaled( &mut self, rect: [u32; 4], long: u32, ) -> Result<RgbaImage, PsdError>
The rectangle [x0, y0, x1, y1] of the upright picture, box-filtered
down so its long side is at most long pixels; never enlarged. The
memory beyond the module notes’ is 40 bytes per pixel of one row of
the result, and 4 per pixel of the result. Reduced six times or more,
rows are skipped so a huge file stays quick, leaving at least three
rows averaged into each row of the result.
Auto Trait Implementations§
impl Freeze for Composite
impl RefUnwindSafe for Composite
impl Send for Composite
impl Sync for Composite
impl Unpin for Composite
impl UnsafeUnpin for Composite
impl UnwindSafe for Composite
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more