1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// A request for classifying an image.
///
///
/// This request will produce a collection of VNClassificationObservation objects which describe an image.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnclassifyimagerequest?language=objc)
#[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "VNRequest")]
pub struct VNClassifyImageRequest;
);
#[cfg(feature = "VNRequest")]
extern_conformance!(
unsafe impl NSCopying for VNClassifyImageRequest {}
);
#[cfg(feature = "VNRequest")]
unsafe impl CopyingHelper for VNClassifyImageRequest {
type Result = Self;
}
#[cfg(feature = "VNRequest")]
extern_conformance!(
unsafe impl NSObjectProtocol for VNClassifyImageRequest {}
);
#[cfg(feature = "VNRequest")]
impl VNClassifyImageRequest {
extern_methods!(
#[cfg(feature = "VNObservation")]
/// Obtain the collection of classifications currently recognized by the Vision framework.
///
///
/// Parameter `requestRevision`: The revision of the request for which classifications should be reported.
///
///
/// Parameter `error`: The address of the variable that will be populated with the error when the call fails.
///
///
/// Returns: the collection of classifications for the revision, or nil if an error was encountered.
#[deprecated]
#[unsafe(method(knownClassificationsForRevision:error:_))]
#[unsafe(method_family = none)]
pub unsafe fn knownClassificationsForRevision_error(
request_revision: NSUInteger,
) -> Result<Retained<NSArray<VNClassificationObservation>>, Retained<NSError>>;
/// Obtain the collection of identifiers supported by the target request.
///
/// This method will return the collection of all possible classification identifiers that are produced by the target request based on its current state of configuration at the time of the call.
///
///
/// Parameter `error`: The address of the variable that will be populated with the error if the call fails.
///
///
/// Returns: The collection of classification identifiers, or nil if a failure occurs.
#[unsafe(method(supportedIdentifiersAndReturnError:_))]
#[unsafe(method_family = none)]
pub unsafe fn supportedIdentifiersAndReturnError(
&self,
) -> Result<Retained<NSArray<NSString>>, Retained<NSError>>;
#[cfg(feature = "VNObservation")]
/// VNClassificationObservation results.
#[unsafe(method(results))]
#[unsafe(method_family = none)]
pub unsafe fn results(&self) -> Option<Retained<NSArray<VNClassificationObservation>>>;
);
}
/// Methods declared on superclass `VNRequest`.
#[cfg(feature = "VNRequest")]
impl VNClassifyImageRequest {
extern_methods!(
/// Creates a new VNRequest with no completion handler.
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "block2")]
/// Creates a new VNRequest with an optional completion handler.
///
///
/// Parameter `completionHandler`: The block to be invoked after the request has completed its processing. The completion handler gets executed on the same dispatch queue as the request being executed.
///
/// # Safety
///
/// `completion_handler` must be a valid pointer or null.
#[unsafe(method(initWithCompletionHandler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCompletionHandler(
this: Allocated<Self>,
completion_handler: VNRequestCompletionHandler,
) -> Retained<Self>;
);
}
/// Methods declared on superclass `NSObject`.
#[cfg(feature = "VNRequest")]
impl VNClassifyImageRequest {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
/// Classification with a taxonomy of 1,303 possible identifiers.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnclassifyimagerequestrevision1?language=objc)
pub static VNClassifyImageRequestRevision1: NSUInteger = 1;
/// The same taxonomy as `VNClassifyImageRequestRevision1` but with improved accuracy, reduced latency and memory utilization.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnclassifyimagerequestrevision2?language=objc)
pub static VNClassifyImageRequestRevision2: NSUInteger = 2;