pub struct IcnsDecoder<R> { /* private fields */ }Expand description
ICNS decoder
Implementations§
Source§impl<R> IcnsDecoder<R>
impl<R> IcnsDecoder<R>
Sourcepub fn new(reader: R) -> Result<IcnsDecoder<R>, ImageError>
pub fn new(reader: R) -> Result<IcnsDecoder<R>, ImageError>
Create a new IcnsDecoder and seek around the input file to locate
the “best” image. (“best” here means largest, breaking ties to prefer
higher total bit depth; if still tied the earliest image is chosen.)
The resulting decoder does not support decoding Jpeg2000 image entries. Use [IcnsDecoder::new_with_decode_funcs] if you’d like to supply your own function for that.
Sourcepub fn new_with_decode_func(
reader: R,
jp2: SubformatDecodeFn,
) -> Result<IcnsDecoder<R>, ImageError>
pub fn new_with_decode_func( reader: R, jp2: SubformatDecodeFn, ) -> Result<IcnsDecoder<R>, ImageError>
Create a new IcnsDecoder and seek around the input file to locate
the “best” image. (“best” here means largest, breaking ties to prefer
higher total bit depth; if still tied the earliest image is chosen.)
The ICNS format can nest PNG and JP2 images; this function accepts a function that can be used to decode the JP2 images. See for example unsupported_jpeg2000, and decode_jpeg2000_using_hook.
Trait Implementations§
Source§impl<R: Read + Seek> ImageDecoder for IcnsDecoder<R>
impl<R: Read + Seek> ImageDecoder for IcnsDecoder<R>
Source§fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
Source§fn color_type(&self) -> ColorType
fn color_type(&self) -> ColorType
Source§fn set_limits(&mut self, limits: Limits) -> ImageResult<()>
fn set_limits(&mut self, limits: Limits) -> ImageResult<()>
Source§fn read_image(self, buf: &mut [u8]) -> ImageResult<()>
fn read_image(self, buf: &mut [u8]) -> ImageResult<()>
Source§fn read_image_boxed(self: Box<Self>, buf: &mut [u8]) -> ImageResult<()>
fn read_image_boxed(self: Box<Self>, buf: &mut [u8]) -> ImageResult<()>
read_image instead; this method is an implementation detail needed so the trait can
be object safe. Read moreSource§fn original_color_type(&self) -> ExtendedColorType
fn original_color_type(&self) -> ExtendedColorType
Source§fn icc_profile(&mut self) -> Result<Option<Vec<u8>>, ImageError>
fn icc_profile(&mut self) -> Result<Option<Vec<u8>>, ImageError>
Ok(None) if the image does not have one. Read moreSource§fn exif_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
fn exif_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
kamadak-exif is required to actually parse it. Read moreSource§fn xmp_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
fn xmp_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
Source§fn iptc_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
fn iptc_metadata(&mut self) -> Result<Option<Vec<u8>>, ImageError>
Source§fn orientation(&mut self) -> Result<Orientation, ImageError>
fn orientation(&mut self) -> Result<Orientation, ImageError>
Source§fn total_bytes(&self) -> u64
fn total_bytes(&self) -> u64
Auto Trait Implementations§
impl<R> Freeze for IcnsDecoder<R>where
R: Freeze,
impl<R> !RefUnwindSafe for IcnsDecoder<R>
impl<R> !Send for IcnsDecoder<R>
impl<R> !Sync for IcnsDecoder<R>
impl<R> Unpin for IcnsDecoder<R>where
R: Unpin,
impl<R> UnsafeUnpin for IcnsDecoder<R>where
R: UnsafeUnpin,
impl<R> !UnwindSafe for IcnsDecoder<R>
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
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