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: InlineImageFilterTerminal 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: u321-based index of the page this inline image was painted on.
source_page_obj: ObjectIdObjectId 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
impl Clone for PdfInlineImage
Source§fn clone(&self) -> PdfInlineImage
fn clone(&self) -> PdfInlineImage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PdfInlineImage
impl Debug for PdfInlineImage
impl Eq for PdfInlineImage
Source§impl PartialEq for PdfInlineImage
impl PartialEq for PdfInlineImage
Source§fn eq(&self, other: &PdfInlineImage) -> bool
fn eq(&self, other: &PdfInlineImage) -> bool
self and other values to be equal, and is used by ==.