#[non_exhaustive]pub struct DecodeOptions {
pub cmyk_jpeg_polarity: CmykJpegPolarity,
pub limits: DecodeLimits,
}Expand description
Per-decode options for crate::decode_image_view_with.
§Examples
use pdfcer_image_codec::peak::DecodeLimits;
use pdfcer_image_codec::{CmykJpegPolarity, DecodeOptions};
let options = DecodeOptions::default()
.with_cmyk_jpeg_polarity(CmykJpegPolarity::InvertOnApp14)
.with_limits(DecodeLimits::new(64 << 20).with_max_pixels(Some(1_000_000)));
assert_eq!(options.limits.memory_budget, 64 << 20);Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cmyk_jpeg_polarity: CmykJpegPolarityThe DCT-A1 polarity rule (R169).
limits: DecodeLimitsThe memory budget and pixel cap the image is checked against.
Implementations§
Source§impl DecodeOptions
impl DecodeOptions
Sourcepub const fn with_cmyk_jpeg_polarity(self, polarity: CmykJpegPolarity) -> Self
pub const fn with_cmyk_jpeg_polarity(self, polarity: CmykJpegPolarity) -> Self
Sets the DCT-A1 polarity rule.
Sourcepub const fn with_limits(self, limits: DecodeLimits) -> Self
pub const fn with_limits(self, limits: DecodeLimits) -> Self
Sets the limits.
Trait Implementations§
Source§impl Clone for DecodeOptions
impl Clone for DecodeOptions
impl Copy for DecodeOptions
Source§impl Debug for DecodeOptions
impl Debug for DecodeOptions
Source§impl Default for DecodeOptions
impl Default for DecodeOptions
impl Eq for DecodeOptions
Source§impl PartialEq for DecodeOptions
impl PartialEq for DecodeOptions
impl StructuralPartialEq for DecodeOptions
Auto Trait Implementations§
impl Forget for DecodeOptions
impl Freeze for DecodeOptions
impl Move for DecodeOptions
impl RefUnwindSafe for DecodeOptions
impl Send for DecodeOptions
impl Sync for DecodeOptions
impl Unpin for DecodeOptions
impl UnsafeUnpin for DecodeOptions
impl UnwindSafe for DecodeOptions
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, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
impl<T, Ctx> BundleDefault<Ctx> for Twhere
T: Default,
Source§fn default_with_context(_: Ctx) -> T
fn default_with_context(_: Ctx) -> T
Creates a default value with the given context.