PxUiOcrEditorSession Class

final class PxUiOcrEditorSession

Observable session that delivers live updates to the OCR editor screen.

Initializers

NameSummary
init(result:image:languageSummary:seedText:)Creates a session seeding the editor with a scan result and image.

Instance Properties

NameSummary
imageThe source image shown in the preview pane.
isRescanningTrue while the host is re-running OCR; drives the screen’s re-scan indicator.
languageSummaryThe language summary shown in the toolbar (e.g. “eng, deu”).
resultThe finished result the editor renders. Replace it (with a fresh image) after a re-scan to swap the editor’s text + preview.
scanProgressRe-scan progress, 0…100. Setting isRescanning shows the determinate indicator.
seedTextOptional pre-edited attributed text to seed the editor with, INSTEAD of rebuilding the coloured text from result. Adopters that let the user edit, dismiss, and re-open pass the previously-edited attributed text (the one the editor reported on dismiss) here so BOTH the edit and the confidence colours survive — the editor must not re-derive from result (whose per-word ranges no longer match an edited string). When nil, the editor builds coloured text from result as usual. result is still used for tap-to-highlight geometry in both cases.

Instance Methods

NameSummary
beginRescan()Convenience for the host re-scan flow: mark rescanning and reset progress.
finishRescan(result:image:)Convenience: push a fresh result + image and clear the indicator.

Relationships

Conforms To

  • Combine.ObservableObject
Top