objc2_vision/generated/VNRecognizeAnimalsRequest.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6
7use crate::*;
8
9/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnanimalidentifier?language=objc)
10// NS_TYPED_ENUM
11pub type VNAnimalIdentifier = NSString;
12
13extern "C" {
14 /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnanimalidentifierdog?language=objc)
15 pub static VNAnimalIdentifierDog: &'static VNAnimalIdentifier;
16}
17
18extern "C" {
19 /// [Apple's documentation](https://developer.apple.com/documentation/vision/vnanimalidentifiercat?language=objc)
20 pub static VNAnimalIdentifierCat: &'static VNAnimalIdentifier;
21}
22
23extern_class!(
24 /// A request that will recognize various animals in an image. The list of animals supported by the recognition algorithm can be queried by -supportedIdentifiersAndReturnError:
25 ///
26 ///
27 /// This request will generate VNRecognizedObjectObservation objects with a defined boundingBox, label and confidence level.
28 ///
29 /// See also [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequest?language=objc)
30 #[unsafe(super(VNImageBasedRequest, VNRequest, NSObject))]
31 #[derive(Debug, PartialEq, Eq, Hash)]
32 #[cfg(feature = "VNRequest")]
33 pub struct VNRecognizeAnimalsRequest;
34);
35
36#[cfg(feature = "VNRequest")]
37extern_conformance!(
38 unsafe impl NSCopying for VNRecognizeAnimalsRequest {}
39);
40
41#[cfg(feature = "VNRequest")]
42unsafe impl CopyingHelper for VNRecognizeAnimalsRequest {
43 type Result = Self;
44}
45
46#[cfg(feature = "VNRequest")]
47extern_conformance!(
48 unsafe impl NSObjectProtocol for VNRecognizeAnimalsRequest {}
49);
50
51#[cfg(feature = "VNRequest")]
52impl VNRecognizeAnimalsRequest {
53 extern_methods!(
54 /// This class method returns a list of all animals supported by the recognition algorithm
55 ///
56 ///
57 /// This request will generate a collection of names for supported animals by current recognition algorithm.
58 #[deprecated]
59 #[unsafe(method(knownAnimalIdentifiersForRevision:error:_))]
60 #[unsafe(method_family = none)]
61 pub unsafe fn knownAnimalIdentifiersForRevision_error(
62 request_revision: NSUInteger,
63 ) -> Result<Retained<NSArray<VNAnimalIdentifier>>, Retained<NSError>>;
64
65 /// Obtain the collection of identifiers supported by the target request.
66 ///
67 /// 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.
68 ///
69 ///
70 /// Parameter `error`: The address of the variable that will be populated with the error if the call fails.
71 ///
72 ///
73 /// Returns: The collection of classification identifiers, or nil if a failure occurs.
74 #[unsafe(method(supportedIdentifiersAndReturnError:_))]
75 #[unsafe(method_family = none)]
76 pub unsafe fn supportedIdentifiersAndReturnError(
77 &self,
78 ) -> Result<Retained<NSArray<VNAnimalIdentifier>>, Retained<NSError>>;
79
80 #[cfg(feature = "VNObservation")]
81 /// VNRecognizedObjectObservation results.
82 #[unsafe(method(results))]
83 #[unsafe(method_family = none)]
84 pub unsafe fn results(&self) -> Option<Retained<NSArray<VNRecognizedObjectObservation>>>;
85 );
86}
87
88/// Methods declared on superclass `VNRequest`.
89#[cfg(feature = "VNRequest")]
90impl VNRecognizeAnimalsRequest {
91 extern_methods!(
92 /// Creates a new VNRequest with no completion handler.
93 #[unsafe(method(init))]
94 #[unsafe(method_family = init)]
95 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
96
97 #[cfg(feature = "block2")]
98 /// Creates a new VNRequest with an optional completion handler.
99 ///
100 ///
101 /// 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.
102 #[unsafe(method(initWithCompletionHandler:))]
103 #[unsafe(method_family = init)]
104 pub unsafe fn initWithCompletionHandler(
105 this: Allocated<Self>,
106 completion_handler: VNRequestCompletionHandler,
107 ) -> Retained<Self>;
108 );
109}
110
111/// Methods declared on superclass `NSObject`.
112#[cfg(feature = "VNRequest")]
113impl VNRecognizeAnimalsRequest {
114 extern_methods!(
115 #[unsafe(method(new))]
116 #[unsafe(method_family = new)]
117 pub unsafe fn new() -> Retained<Self>;
118 );
119}
120
121/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequestrevision1?language=objc)
122pub static VNRecognizeAnimalsRequestRevision1: NSUInteger = 1;
123
124/// [Apple's documentation](https://developer.apple.com/documentation/vision/vnrecognizeanimalsrequestrevision2?language=objc)
125pub static VNRecognizeAnimalsRequestRevision2: NSUInteger = 2;