pub struct RasterCandidate {
pub id: u32,
pub page: u32,
pub gray: Vec<u8>,
pub width: u32,
pub height: u32,
pub hash: String,
pub image_bbox: BoundingBox,
pub image_index: Option<u32>,
pub text_chunks: Vec<TextChunk>,
pub kind: RasterCandidateKind,
/* private fields */
}Expand description
Prepared OCR candidate for the two-phase (plan → OCR → finish) path.
Emitted when OCR can change the output (table-like or pattern-painted Image XObject). Missing OCR words at finish time degrades to PDF-text cells when a bordered grid is already known (tables only).
Fields§
§id: u32Stable id within a session (0-based).
page: u321-based PDF page number.
gray: Vec<u8>Grayscale pixels (row-major).
width: u32Pixel width.
height: u32Pixel height.
hash: StringFNV-1a hash of gray pixels (hex), for OCR result caching.
image_bbox: BoundingBoxImage placement in PDF user space.
image_index: Option<u32>1-based Image XObject index (matches ImageChunk::index).
text_chunks: Vec<TextChunk>Overlapping native text (PDF fallback when OCR is absent).
kind: RasterCandidateKindHow OCR words should be assembled.
Implementations§
Source§impl RasterCandidate
impl RasterCandidate
Sourcepub fn meta(&self) -> RasterCandidateMeta
pub fn meta(&self) -> RasterCandidateMeta
Metadata for JS without copying gray pixels.
Trait Implementations§
Source§impl Clone for RasterCandidate
impl Clone for RasterCandidate
Auto Trait Implementations§
impl Freeze for RasterCandidate
impl RefUnwindSafe for RasterCandidate
impl Send for RasterCandidate
impl Sync for RasterCandidate
impl Unpin for RasterCandidate
impl UnsafeUnpin for RasterCandidate
impl UnwindSafe for RasterCandidate
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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