pub struct CodecRegistry;Expand description
Registry that handles decoding and encoding images.
Implementations§
Source§impl CodecRegistry
impl CodecRegistry
Sourcepub fn decode(path: &Path) -> Result<DynamicImage>
pub fn decode(path: &Path) -> Result<DynamicImage>
Decode an image from a file path with default options.
Sourcepub fn decode_with_options(
path: &Path,
options: &DecodeOptions,
) -> Result<DynamicImage>
pub fn decode_with_options( path: &Path, options: &DecodeOptions, ) -> Result<DynamicImage>
Decode an image from a file path with custom options.
Sourcepub fn encode(
img: &DynamicImage,
path: &Path,
options: &EncodeOptions,
) -> Result<()>
pub fn encode( img: &DynamicImage, path: &Path, options: &EncodeOptions, ) -> Result<()>
Encode an image and write to a file path.
Auto Trait Implementations§
impl Freeze for CodecRegistry
impl RefUnwindSafe for CodecRegistry
impl Send for CodecRegistry
impl Sync for CodecRegistry
impl Unpin for CodecRegistry
impl UnsafeUnpin for CodecRegistry
impl UnwindSafe for CodecRegistry
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> 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