pub struct OpenRasterDecoder<'a, R>{ /* private fields */ }Implementations§
Source§impl<'a, R> OpenRasterDecoder<'a, R>
impl<'a, R> OpenRasterDecoder<'a, R>
Sourcepub fn with_limits(
r: R,
limits: Limits,
) -> Result<OpenRasterDecoder<'a, R>, ImageError>
pub fn with_limits( r: R, limits: Limits, ) -> Result<OpenRasterDecoder<'a, R>, ImageError>
Create a new OpenRasterDecoder with the provided limits.
(Limits need to be specified in advance, because determining the minimum information needed for the ImageDecoder trait (image size and color type) may require reading through and remembering image-dependent amount of data.)
Warning: While decoding limits apply to the header parsing and decoding of the merged imaged component (a PNG file inside the ZIP archive that forms an OpenRaster file), memory constraints on the ZIP file decoding process have not yet been implemented; input ZIP files with very many entries may require significant amounts of memory to read.
Trait Implementations§
Source§impl<'a, R: Read + Seek + 'a> ImageDecoder for OpenRasterDecoder<'a, R>
impl<'a, R: Read + Seek + 'a> ImageDecoder for OpenRasterDecoder<'a, R>
Source§fn dimensions(&self) -> (u32, u32)
fn dimensions(&self) -> (u32, u32)
Returns a tuple containing the width and height of the image
Source§fn color_type(&self) -> ColorType
fn color_type(&self) -> ColorType
Returns the color type of the image data produced by this decoder
Source§fn original_color_type(&self) -> ExtendedColorType
fn original_color_type(&self) -> ExtendedColorType
Returns the color type of the image file before decoding
Source§fn set_limits(&mut self, limits: Limits) -> ImageResult<()>
fn set_limits(&mut self, limits: Limits) -> ImageResult<()>
Source§fn icc_profile(&mut self) -> ImageResult<Option<Vec<u8>>>
fn icc_profile(&mut self) -> ImageResult<Option<Vec<u8>>>
Returns the ICC color profile embedded in the image, or
Ok(None) if the image does not have one. Read moreSource§fn exif_metadata(&mut self) -> ImageResult<Option<Vec<u8>>>
fn exif_metadata(&mut self) -> ImageResult<Option<Vec<u8>>>
Returns the raw Exif chunk, if it is present.
A third-party crate such as
kamadak-exif is required to actually parse it. Read moreSource§fn orientation(&mut self) -> ImageResult<Orientation>
fn orientation(&mut self) -> ImageResult<Orientation>
Returns the orientation of the image. Read more
Source§fn read_image(self, buf: &mut [u8]) -> ImageResult<()>
fn read_image(self, buf: &mut [u8]) -> ImageResult<()>
Returns all the bytes in the image. Read more
Source§fn read_image_boxed(self: Box<Self>, buf: &mut [u8]) -> ImageResult<()>
fn read_image_boxed(self: Box<Self>, buf: &mut [u8]) -> ImageResult<()>
Use
read_image instead; this method is an implementation detail needed so the trait can
be object safe. 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 total_bytes(&self) -> u64
fn total_bytes(&self) -> u64
Returns the total number of bytes in the decoded image. Read more