Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Vision/VNObservation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,11 +628,11 @@ unsafe impl VNRequestRevisionProviding for VNRecognizedText {}
extern_methods!(
unsafe impl VNRecognizedText {
#[method_id(@__retain_semantics Other string)]
pub unsafe fn string(&self) -> Retained<NSString>;
pub fn string(&self) -> Retained<NSString>;

#[cfg(feature = "VNTypes")]
#[method(confidence)]
pub unsafe fn confidence(&self) -> VNConfidence;
pub fn confidence(&self) -> VNConfidence;

#[method_id(@__retain_semantics Other boundingBoxForRange:error:_)]
pub unsafe fn boundingBoxForRange_error(
Expand Down Expand Up @@ -683,7 +683,7 @@ unsafe impl VNRequestRevisionProviding for VNRecognizedTextObservation {}
extern_methods!(
unsafe impl VNRecognizedTextObservation {
#[method_id(@__retain_semantics Other topCandidates:)]
pub unsafe fn topCandidates(
pub fn topCandidates(
&self,
max_candidate_count: NSUInteger,
) -> Retained<NSArray<VNRecognizedText>>;
Expand Down
34 changes: 21 additions & 13 deletions Vision/VNRecognizeTextRequest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,41 +66,41 @@ extern_methods!(
pub unsafe fn recognitionLanguages(&self) -> Retained<NSArray<NSString>>;

#[method(setRecognitionLanguages:)]
pub unsafe fn setRecognitionLanguages(&self, recognition_languages: &NSArray<NSString>);
pub fn setRecognitionLanguages(&self, recognition_languages: &NSArray<NSString>);

#[method_id(@__retain_semantics Other customWords)]
pub unsafe fn customWords(&self) -> Retained<NSArray<NSString>>;
pub fn customWords(&self) -> Retained<NSArray<NSString>>;

#[method(setCustomWords:)]
pub unsafe fn setCustomWords(&self, custom_words: &NSArray<NSString>);
pub fn setCustomWords(&self, custom_words: &NSArray<NSString>);

#[method(recognitionLevel)]
pub unsafe fn recognitionLevel(&self) -> VNRequestTextRecognitionLevel;
pub fn recognitionLevel(&self) -> VNRequestTextRecognitionLevel;

#[method(setRecognitionLevel:)]
pub unsafe fn setRecognitionLevel(&self, recognition_level: VNRequestTextRecognitionLevel);
pub fn setRecognitionLevel(&self, recognition_level: VNRequestTextRecognitionLevel);

#[method(usesLanguageCorrection)]
pub unsafe fn usesLanguageCorrection(&self) -> bool;
pub fn usesLanguageCorrection(&self) -> bool;

#[method(setUsesLanguageCorrection:)]
pub unsafe fn setUsesLanguageCorrection(&self, uses_language_correction: bool);
pub fn setUsesLanguageCorrection(&self, uses_language_correction: bool);

#[method(automaticallyDetectsLanguage)]
pub unsafe fn automaticallyDetectsLanguage(&self) -> bool;
pub fn automaticallyDetectsLanguage(&self) -> bool;

#[method(setAutomaticallyDetectsLanguage:)]
pub unsafe fn setAutomaticallyDetectsLanguage(&self, automatically_detects_language: bool);
pub fn setAutomaticallyDetectsLanguage(&self, automatically_detects_language: bool);

#[method(minimumTextHeight)]
pub unsafe fn minimumTextHeight(&self) -> c_float;
pub fn minimumTextHeight(&self) -> c_float;

#[method(setMinimumTextHeight:)]
pub unsafe fn setMinimumTextHeight(&self, minimum_text_height: c_float);
pub fn setMinimumTextHeight(&self, minimum_text_height: c_float);

#[cfg(feature = "VNObservation")]
#[method_id(@__retain_semantics Other results)]
pub unsafe fn results(&self) -> Option<Retained<NSArray<VNRecognizedTextObservation>>>;
pub fn results(&self) -> Option<Retained<NSArray<VNRecognizedTextObservation>>>;
}
);

Expand All @@ -125,10 +125,18 @@ extern_methods!(
#[cfg(feature = "VNRequest")]
unsafe impl VNRecognizeTextRequest {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
pub fn new() -> Retained<Self>;
}
);

#[cfg(feature = "VNRequest")]
impl DefaultRetained for VNRecognizeTextRequest {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}

/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizetextrequestrevision1?language=objc)
pub static VNRecognizeTextRequestRevision1: NSUInteger = 1;

Expand Down
4 changes: 2 additions & 2 deletions Vision/VNRequestHandler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@ extern_methods!(
) -> Retained<Self>;

#[method_id(@__retain_semantics Init initWithData:options:)]
pub unsafe fn initWithData_options(
pub fn initWithData_options(
this: Allocated<Self>,
image_data: &NSData,
options: &NSDictionary<VNImageOption, AnyObject>,
) -> Retained<Self>;

#[cfg(feature = "VNRequest")]
#[method(performRequests:error:_)]
pub unsafe fn performRequests_error(
pub fn performRequests_error(
&self,
requests: &NSArray<VNRequest>,
) -> Result<(), Retained<NSError>>;
Expand Down