pub struct LiveTextInteraction { /* private fields */ }Expand description
Wraps the VisionKit image analysis overlay view counterpart.
Implementations§
Source§impl LiveTextInteraction
impl LiveTextInteraction
Sourcepub fn new() -> Result<Self, VisionKitError>
pub fn new() -> Result<Self, VisionKitError>
Creates the VisionKit LiveTextInteraction wrapper.
Sourcepub fn with_delegate(
delegate: &LiveTextInteractionDelegate,
) -> Result<Self, VisionKitError>
pub fn with_delegate( delegate: &LiveTextInteractionDelegate, ) -> Result<Self, VisionKitError>
Creates the VisionKit live text interaction wrapper with the provided delegate.
Sourcepub fn set_analysis(
&self,
analysis: &ImageAnalysis,
) -> Result<(), VisionKitError>
pub fn set_analysis( &self, analysis: &ImageAnalysis, ) -> Result<(), VisionKitError>
Sets the VisionKit analysis value.
Sourcepub fn track_image_at_path<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), VisionKitError>
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.
Sourcepub fn delegate(
&self,
) -> Result<Option<LiveTextInteractionDelegate>, VisionKitError>
pub fn delegate( &self, ) -> Result<Option<LiveTextInteractionDelegate>, VisionKitError>
Returns the VisionKit delegate value.
Sourcepub fn set_delegate(
&self,
delegate: Option<&LiveTextInteractionDelegate>,
) -> Result<(), VisionKitError>
pub fn set_delegate( &self, delegate: Option<&LiveTextInteractionDelegate>, ) -> Result<(), VisionKitError>
Sets the VisionKit delegate value.
Sourcepub fn preferred_interaction_types(
&self,
) -> Result<LiveTextInteractionTypes, VisionKitError>
pub fn preferred_interaction_types( &self, ) -> Result<LiveTextInteractionTypes, VisionKitError>
Returns the VisionKit preferred interaction types value.
Sourcepub fn set_preferred_interaction_types(
&self,
interaction_types: LiveTextInteractionTypes,
) -> Result<(), VisionKitError>
pub fn set_preferred_interaction_types( &self, interaction_types: LiveTextInteractionTypes, ) -> Result<(), VisionKitError>
Sets the VisionKit preferred interaction types value.
Sourcepub fn active_interaction_types(
&self,
) -> Result<LiveTextInteractionTypes, VisionKitError>
pub fn active_interaction_types( &self, ) -> Result<LiveTextInteractionTypes, VisionKitError>
Returns the VisionKit active interaction types value.
Sourcepub fn selectable_items_highlighted(&self) -> Result<bool, VisionKitError>
pub fn selectable_items_highlighted(&self) -> Result<bool, VisionKitError>
Returns the VisionKit selectable items highlighted value.
Sourcepub fn set_selectable_items_highlighted(
&self,
value: bool,
) -> Result<(), VisionKitError>
pub fn set_selectable_items_highlighted( &self, value: bool, ) -> Result<(), VisionKitError>
Sets the VisionKit selectable items highlighted value.
Sourcepub fn tracking_image_view(
&self,
) -> Result<Option<LiveTextTrackingImageView>, VisionKitError>
pub fn tracking_image_view( &self, ) -> Result<Option<LiveTextTrackingImageView>, VisionKitError>
Returns the VisionKit tracking image view value.
Sourcepub fn set_tracking_image_view(
&self,
view: Option<&LiveTextTrackingImageView>,
) -> Result<(), VisionKitError>
pub fn set_tracking_image_view( &self, view: Option<&LiveTextTrackingImageView>, ) -> Result<(), VisionKitError>
Sets the VisionKit tracking image view value.
Sourcepub fn has_active_text_selection(&self) -> Result<bool, VisionKitError>
pub fn has_active_text_selection(&self) -> Result<bool, VisionKitError>
Returns whether VisionKit reports active text selection.
Sourcepub fn reset_selection(&self) -> Result<(), VisionKitError>
pub fn reset_selection(&self) -> Result<(), VisionKitError>
Resets the VisionKit selection state.
Sourcepub fn text(&self) -> Result<String, VisionKitError>
pub fn text(&self) -> Result<String, VisionKitError>
Returns the VisionKit text value.
Sourcepub fn selected_text(&self) -> Result<String, VisionKitError>
pub fn selected_text(&self) -> Result<String, VisionKitError>
Returns the VisionKit selected text value.
Sourcepub fn selected_attributed_text(
&self,
) -> Result<LiveTextAttributedText, VisionKitError>
pub fn selected_attributed_text( &self, ) -> Result<LiveTextAttributedText, VisionKitError>
Returns the VisionKit selected attributed text value.
Sourcepub fn selected_ranges(&self) -> Result<Vec<LiveTextTextRange>, VisionKitError>
pub fn selected_ranges(&self) -> Result<Vec<LiveTextTextRange>, VisionKitError>
Returns the VisionKit selected ranges value.
Sourcepub fn set_selected_ranges(
&self,
ranges: &[LiveTextTextRange],
) -> Result<(), VisionKitError>
pub fn set_selected_ranges( &self, ranges: &[LiveTextTextRange], ) -> Result<(), VisionKitError>
Sets the VisionKit selected ranges value.
Sourcepub fn contents_rect(&self) -> Result<Rect, VisionKitError>
pub fn contents_rect(&self) -> Result<Rect, VisionKitError>
Returns the VisionKit contents rect value.
Sourcepub fn set_contents_rect_needs_update(&self) -> Result<(), VisionKitError>
pub fn set_contents_rect_needs_update(&self) -> Result<(), VisionKitError>
Marks the VisionKit contents rectangle as needing an update.
Sourcepub fn has_interactive_item_at_point(
&self,
x: f64,
y: f64,
) -> Result<bool, VisionKitError>
pub fn has_interactive_item_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>
Returns whether VisionKit reports interactive item at point.
Sourcepub fn has_text_at_point(&self, x: f64, y: f64) -> Result<bool, VisionKitError>
pub fn has_text_at_point(&self, x: f64, y: f64) -> Result<bool, VisionKitError>
Returns whether VisionKit reports text at point.
Sourcepub fn has_data_detector_at_point(
&self,
x: f64,
y: f64,
) -> Result<bool, VisionKitError>
pub fn has_data_detector_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>
Returns whether VisionKit reports data detector at point.
Sourcepub fn has_supplementary_interface_at_point(
&self,
x: f64,
y: f64,
) -> Result<bool, VisionKitError>
pub fn has_supplementary_interface_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>
Returns whether VisionKit reports supplementary interface at point.
Sourcepub fn analysis_has_text_at_point(
&self,
x: f64,
y: f64,
) -> Result<bool, VisionKitError>
pub fn analysis_has_text_at_point( &self, x: f64, y: f64, ) -> Result<bool, VisionKitError>
Returns the VisionKit analysis has text at point value.
Returns the VisionKit live text button visible value.
Returns whether VisionKit reports supplementary interface hidden.
Sets the VisionKit supplementary interface hidden value.
Sourcepub fn supplementary_interface_content_insets(
&self,
) -> Result<EdgeInsets, VisionKitError>
pub fn supplementary_interface_content_insets( &self, ) -> Result<EdgeInsets, VisionKitError>
Returns the VisionKit supplementary interface content insets value.
Sourcepub fn set_supplementary_interface_content_insets(
&self,
insets: EdgeInsets,
) -> Result<(), VisionKitError>
pub fn set_supplementary_interface_content_insets( &self, insets: EdgeInsets, ) -> Result<(), VisionKitError>
Sets the VisionKit supplementary interface content insets value.
Sourcepub fn supplementary_interface_font(
&self,
) -> Result<Option<LiveTextFont>, VisionKitError>
pub fn supplementary_interface_font( &self, ) -> Result<Option<LiveTextFont>, VisionKitError>
Returns the VisionKit supplementary interface font value.
Sourcepub fn set_supplementary_interface_font(
&self,
font: Option<&LiveTextFont>,
) -> Result<(), VisionKitError>
pub fn set_supplementary_interface_font( &self, font: Option<&LiveTextFont>, ) -> Result<(), VisionKitError>
Sets the VisionKit supplementary interface font value.
Sourcepub fn begin_subject_analysis_if_necessary(&self) -> Result<(), VisionKitError>
pub fn begin_subject_analysis_if_necessary(&self) -> Result<(), VisionKitError>
Begins VisionKit subject analysis when the overlay requires it.
Sourcepub fn subjects(&self) -> Result<Vec<LiveTextSubject>, VisionKitError>
pub fn subjects(&self) -> Result<Vec<LiveTextSubject>, VisionKitError>
Returns the VisionKit subjects value.
Sourcepub fn highlighted_subjects(
&self,
) -> Result<Vec<LiveTextSubject>, VisionKitError>
pub fn highlighted_subjects( &self, ) -> Result<Vec<LiveTextSubject>, VisionKitError>
Returns the VisionKit highlighted subjects value.
Sourcepub fn set_highlighted_subjects(
&self,
subjects: &[LiveTextSubject],
) -> Result<(), VisionKitError>
pub fn set_highlighted_subjects( &self, subjects: &[LiveTextSubject], ) -> Result<(), VisionKitError>
Sets the VisionKit highlighted subjects value.
Sourcepub fn subject_at_point(
&self,
x: f64,
y: f64,
) -> Result<Option<LiveTextSubject>, VisionKitError>
pub fn subject_at_point( &self, x: f64, y: f64, ) -> Result<Option<LiveTextSubject>, VisionKitError>
Returns the VisionKit subject at point value.
Sourcepub fn image_for_subjects(
&self,
subjects: &[LiveTextSubject],
) -> Result<LiveTextImageData, VisionKitError>
pub fn image_for_subjects( &self, subjects: &[LiveTextSubject], ) -> Result<LiveTextImageData, VisionKitError>
Returns the VisionKit image extracted for the provided subjects.