Skip to main content

PdfInlineImage

Struct PdfInlineImage 

Source
pub struct PdfInlineImage {
    pub data: Vec<u8>,
    pub width: u32,
    pub height: u32,
    pub color_space: ColorSpace,
    pub bits_per_component: u8,
    pub filter: InlineImageFilter,
    pub image_mask: bool,
    pub source_page_index: u32,
    pub source_page_obj: ObjectId,
}
Expand description

One inline image surfaced by DocumentReader::inline_images.

All fields except data come from the inline-image dictionary between BI and ID. data is the raw byte payload between ID and EI with any wrapping ASCII filters (/A85, /AHx) and /Fl / /RL already peeled off — only the terminal codec filter (/DCT, /JPX, /JBIG2, /CCF, if any) is left in place for a downstream decoder.

source_page_index is the 1-based page number the inline image was painted on; source_page_obj is the page leaf’s ObjectId so callers can disambiguate when pages have duplicate indices (rare but the round-29 marked-text path already exposes both for the same reason).

Fields§

§data: Vec<u8>

Inline-image payload — after wrapping non-codec filters are peeled, terminal codec filter (if any) left in place.

§width: u32

/W (or /Width) — pixel width.

§height: u32

/H (or /Height) — pixel height.

§color_space: ColorSpace

/CS (or /ColorSpace) mapped to a ColorSpace tag. The inline-image abbreviated forms /G /RGB /CMYK /I from Table 93 map to DeviceGray / DeviceRGB / DeviceCMYK / Indexed respectively.

§bits_per_component: u8

/BPC (or /BitsPerComponent) — bits per component (1, 2, 4, 8, or 16). Defaults to 8 when the dict is silent or the payload’s terminal filter is /JPX (/JPXDecode defines its own bit-depth per codestream).

§filter: InlineImageFilter

Terminal codec filter (if any) — see InlineImageFilter.

§image_mask: bool

/IM true flag (image mask): a 1-bit-per-pixel stencil where the source colour comes from the current fill colour rather than from the payload. The payload is still the 1-bit stencil; the renderer combines it with Tj’s active colour.

§source_page_index: u32

1-based index of the page this inline image was painted on.

§source_page_obj: ObjectId

ObjectId of the page leaf — useful when two pages share an index (the round-29 marked-text path already pairs both).

Trait Implementations§

Source§

impl Clone for PdfInlineImage

Source§

fn clone(&self) -> PdfInlineImage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PdfInlineImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for PdfInlineImage

Source§

impl PartialEq for PdfInlineImage

Source§

fn eq(&self, other: &PdfInlineImage) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PdfInlineImage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V