pub struct FrameFormat { /* private fields */ }Expand description
The format defining all images in a SER file.
Only one format per SER file is supported. All images must have the same width, height, bytes per pixel, etc.
Once a format is defined, SER frames may be converted to/from image::DynamicImages. Furthermore, a FrameFormat may be computed from an existing DynamicImage using TryFrom.
Implementations§
Source§impl FrameFormat
impl FrameFormat
Source§impl FrameFormat
impl FrameFormat
pub fn set_color(&mut self, val: ColorId) -> &mut Self
pub fn set_depth(&mut self, val: PixelDepth) -> &mut Self
pub fn set_endian(&mut self, val: PixelEndian) -> &mut Self
pub fn set_width(&mut self, val: u32) -> &mut Self
pub fn set_height(&mut self, val: u32) -> &mut Self
Source§impl FrameFormat
impl FrameFormat
pub fn new( color: ColorId, depth: PixelDepth, endian: PixelEndian, width: u32, height: u32, ) -> Self
pub fn raw_len(&self) -> usize
Sourcepub fn try_into_frame(&self, img: DynamicImage) -> Result<Frame, &'static str>
pub fn try_into_frame(&self, img: DynamicImage) -> Result<Frame, &'static str>
Attempt to convert a DynamicImage into a Frame that is compatible with this FrameFormat.
Trait Implementations§
Source§impl Clone for FrameFormat
impl Clone for FrameFormat
Source§fn clone(&self) -> FrameFormat
fn clone(&self) -> FrameFormat
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl From<FrameFormat> for Ser
impl From<FrameFormat> for Ser
Source§fn from(value: FrameFormat) -> Self
fn from(value: FrameFormat) -> Self
Converts to this type from the input type.
Source§impl PartialEq<Frame> for FrameFormat
impl PartialEq<Frame> for FrameFormat
Source§impl TryFrom<&DynamicImage> for FrameFormat
impl TryFrom<&DynamicImage> for FrameFormat
Auto Trait Implementations§
impl Freeze for FrameFormat
impl RefUnwindSafe for FrameFormat
impl Send for FrameFormat
impl Sync for FrameFormat
impl Unpin for FrameFormat
impl UnsafeUnpin for FrameFormat
impl UnwindSafe for FrameFormat
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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