pub(crate) struct OcrLayer {
pub(crate) area: DrawingArea,
state: Rc<RefCell<OcrState>>,
}Expand description
Non-interactive drawing area over the picture stack; it scrolls and zooms with the photo.
Fields§
§area: DrawingArea§state: Rc<RefCell<OcrState>>Implementations§
Source§impl OcrLayer
impl OcrLayer
pub(crate) fn new() -> Self
Sourcepub(super) fn set_boxes(&self, boxes: Vec<OcrBox>, image: (f64, f64))
pub(super) fn set_boxes(&self, boxes: Vec<OcrBox>, image: (f64, f64))
Replaces the boxes and clears the selection; image is the displayed texture’s size.
pub(crate) fn clear(&self)
pub(super) fn has_boxes(&self) -> bool
Sourcepub(super) fn box_at(&self, p: (f64, f64)) -> Option<usize>
pub(super) fn box_at(&self, p: (f64, f64)) -> Option<usize>
Box under p, given in this area’s coordinates.
Sourcepub(super) fn set_hovered(&self, idx: Option<usize>) -> bool
pub(super) fn set_hovered(&self, idx: Option<usize>) -> bool
Returns whether the hovered box changed.
Sourcepub(super) fn press(&self, idx: usize, shift: bool, ctrl: bool) -> bool
pub(super) fn press(&self, idx: usize, shift: bool, ctrl: bool) -> bool
Mouse press on a box; returns whether dragging should extend the selection.
pub(super) fn click(&self, idx: usize, extend: bool)
pub(super) fn extend_to(&self, idx: usize)
pub(super) fn has_selection(&self) -> bool
pub(super) fn all_text(&self) -> Option<String>
pub(super) fn select_all(&self)
pub(super) fn clear_selection(&self)
pub(super) fn selected_text(&self) -> Option<String>
pub(super) fn text_at(&self, idx: usize) -> Option<String>
Auto Trait Implementations§
impl !RefUnwindSafe for OcrLayer
impl !Send for OcrLayer
impl !Sync for OcrLayer
impl !UnwindSafe for OcrLayer
impl Freeze for OcrLayer
impl Unpin for OcrLayer
impl UnsafeUnpin for OcrLayer
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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