Skip to main content

LiveTextInteraction

Struct LiveTextInteraction 

Source
pub struct LiveTextInteraction { /* private fields */ }
Expand description

Wraps the VisionKit image analysis overlay view counterpart.

Implementations§

Source§

impl LiveTextInteraction

Source

pub fn new() -> Result<Self, VisionKitError>

Creates the VisionKit LiveTextInteraction wrapper.

Source

pub fn with_delegate( delegate: &LiveTextInteractionDelegate, ) -> Result<Self, VisionKitError>

Creates the VisionKit live text interaction wrapper with the provided delegate.

Source

pub fn set_analysis( &self, analysis: &ImageAnalysis, ) -> Result<(), VisionKitError>

Sets the VisionKit analysis value.

Source

pub fn track_image_at_path<P: AsRef<Path>>( &self, path: P, ) -> Result<(), VisionKitError>

Tracks the image at path for the VisionKit live text interaction.

Source

pub fn delegate( &self, ) -> Result<Option<LiveTextInteractionDelegate>, VisionKitError>

Returns the VisionKit delegate value.

Source

pub fn set_delegate( &self, delegate: Option<&LiveTextInteractionDelegate>, ) -> Result<(), VisionKitError>

Sets the VisionKit delegate value.

Source

pub fn preferred_interaction_types( &self, ) -> Result<LiveTextInteractionTypes, VisionKitError>

Returns the VisionKit preferred interaction types value.

Source

pub fn set_preferred_interaction_types( &self, interaction_types: LiveTextInteractionTypes, ) -> Result<(), VisionKitError>

Sets the VisionKit preferred interaction types value.

Source

pub fn active_interaction_types( &self, ) -> Result<LiveTextInteractionTypes, VisionKitError>

Returns the VisionKit active interaction types value.

Source

pub fn selectable_items_highlighted(&self) -> Result<bool, VisionKitError>

Returns the VisionKit selectable items highlighted value.

Source

pub fn set_selectable_items_highlighted( &self, value: bool, ) -> Result<(), VisionKitError>

Sets the VisionKit selectable items highlighted value.

Source

pub fn tracking_image_view( &self, ) -> Result<Option<LiveTextTrackingImageView>, VisionKitError>

Returns the VisionKit tracking image view value.

Source

pub fn set_tracking_image_view( &self, view: Option<&LiveTextTrackingImageView>, ) -> Result<(), VisionKitError>

Sets the VisionKit tracking image view value.

Source

pub fn has_active_text_selection(&self) -> Result<bool, VisionKitError>

Returns whether VisionKit reports active text selection.

Source

pub fn reset_selection(&self) -> Result<(), VisionKitError>

Resets the VisionKit selection state.

Source

pub fn text(&self) -> Result<String, VisionKitError>

Returns the VisionKit text value.

Source

pub fn selected_text(&self) -> Result<String, VisionKitError>

Returns the VisionKit selected text value.

Source

pub fn selected_attributed_text( &self, ) -> Result<LiveTextAttributedText, VisionKitError>

Returns the VisionKit selected attributed text value.

Source

pub fn selected_ranges(&self) -> Result<Vec<LiveTextTextRange>, VisionKitError>

Returns the VisionKit selected ranges value.

Source

pub fn set_selected_ranges( &self, ranges: &[LiveTextTextRange], ) -> Result<(), VisionKitError>

Sets the VisionKit selected ranges value.

Source

pub fn contents_rect(&self) -> Result<Rect, VisionKitError>

Returns the VisionKit contents rect value.

Source

pub fn set_contents_rect_needs_update(&self) -> Result<(), VisionKitError>

Marks the VisionKit contents rectangle as needing an update.

Source

pub fn has_interactive_item_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>

Returns whether VisionKit reports interactive item at point.

Source

pub fn has_text_at_point(&self, x: f64, y: f64) -> Result<bool, VisionKitError>

Returns whether VisionKit reports text at point.

Source

pub fn has_data_detector_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>

Returns whether VisionKit reports data detector at point.

Source

pub fn has_supplementary_interface_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>

Returns whether VisionKit reports supplementary interface at point.

Source

pub fn analysis_has_text_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>

Returns the VisionKit analysis has text at point value.

Source

pub fn live_text_button_visible(&self) -> Result<bool, VisionKitError>

Returns the VisionKit live text button visible value.

Source

pub fn is_supplementary_interface_hidden(&self) -> Result<bool, VisionKitError>

Returns whether VisionKit reports supplementary interface hidden.

Source

pub fn set_supplementary_interface_hidden( &self, hidden: bool, animated: bool, ) -> Result<(), VisionKitError>

Sets the VisionKit supplementary interface hidden value.

Source

pub fn supplementary_interface_content_insets( &self, ) -> Result<EdgeInsets, VisionKitError>

Returns the VisionKit supplementary interface content insets value.

Source

pub fn set_supplementary_interface_content_insets( &self, insets: EdgeInsets, ) -> Result<(), VisionKitError>

Sets the VisionKit supplementary interface content insets value.

Source

pub fn supplementary_interface_font( &self, ) -> Result<Option<LiveTextFont>, VisionKitError>

Returns the VisionKit supplementary interface font value.

Source

pub fn set_supplementary_interface_font( &self, font: Option<&LiveTextFont>, ) -> Result<(), VisionKitError>

Sets the VisionKit supplementary interface font value.

Source

pub fn begin_subject_analysis_if_necessary(&self) -> Result<(), VisionKitError>

Begins VisionKit subject analysis when the overlay requires it.

Source

pub fn subjects(&self) -> Result<Vec<LiveTextSubject>, VisionKitError>

Returns the VisionKit subjects value.

Source

pub fn highlighted_subjects( &self, ) -> Result<Vec<LiveTextSubject>, VisionKitError>

Returns the VisionKit highlighted subjects value.

Source

pub fn set_highlighted_subjects( &self, subjects: &[LiveTextSubject], ) -> Result<(), VisionKitError>

Sets the VisionKit highlighted subjects value.

Source

pub fn subject_at_point( &self, x: f64, y: f64, ) -> Result<Option<LiveTextSubject>, VisionKitError>

Returns the VisionKit subject at point value.

Source

pub fn image_for_subjects( &self, subjects: &[LiveTextSubject], ) -> Result<LiveTextImageData, VisionKitError>

Returns the VisionKit image extracted for the provided subjects.

Trait Implementations§

Source§

impl Drop for LiveTextInteraction

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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<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, 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.