objc2_core_ml/generated/
MLFeatureValue_MLImageConversion.rs1use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5#[cfg(feature = "objc2-core-graphics")]
6use objc2_core_graphics::*;
7use objc2_foundation::*;
8#[cfg(feature = "objc2-image-io")]
9use objc2_image_io::*;
10
11use crate::*;
12
13pub type MLFeatureValueImageOption = NSString;
18
19extern "C" {
20 pub static MLFeatureValueImageOptionCropRect: &'static MLFeatureValueImageOption;
24}
25
26extern "C" {
27 pub static MLFeatureValueImageOptionCropAndScale: &'static MLFeatureValueImageOption;
31}
32
33#[cfg(feature = "MLFeatureValue")]
35impl MLFeatureValue {
36 extern_methods!(
37 #[unsafe(method(featureValueWithImageAtURL:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
43 #[unsafe(method_family = none)]
44 pub unsafe fn featureValueWithImageAtURL_pixelsWide_pixelsHigh_pixelFormatType_options_error(
45 url: &NSURL,
46 pixels_wide: NSInteger,
47 pixels_high: NSInteger,
48 pixel_format_type: OSType,
49 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
50 ) -> Result<Retained<Self>, Retained<NSError>>;
51
52 #[cfg(feature = "MLImageConstraint")]
53 #[unsafe(method(featureValueWithImageAtURL:constraint:options:error:_))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn featureValueWithImageAtURL_constraint_options_error(
61 url: &NSURL,
62 constraint: &MLImageConstraint,
63 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
64 ) -> Result<Retained<Self>, Retained<NSError>>;
65
66 #[cfg(feature = "objc2-core-graphics")]
67 #[unsafe(method(featureValueWithCGImage:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
73 #[unsafe(method_family = none)]
74 pub unsafe fn featureValueWithCGImage_pixelsWide_pixelsHigh_pixelFormatType_options_error(
75 cg_image: &CGImage,
76 pixels_wide: NSInteger,
77 pixels_high: NSInteger,
78 pixel_format_type: OSType,
79 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
80 ) -> Result<Retained<Self>, Retained<NSError>>;
81
82 #[cfg(all(feature = "MLImageConstraint", feature = "objc2-core-graphics"))]
83 #[unsafe(method(featureValueWithCGImage:constraint:options:error:_))]
89 #[unsafe(method_family = none)]
90 pub unsafe fn featureValueWithCGImage_constraint_options_error(
91 cg_image: &CGImage,
92 constraint: &MLImageConstraint,
93 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
94 ) -> Result<Retained<Self>, Retained<NSError>>;
95
96 #[cfg(feature = "objc2-image-io")]
97 #[unsafe(method(featureValueWithImageAtURL:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn featureValueWithImageAtURL_orientation_pixelsWide_pixelsHigh_pixelFormatType_options_error(
105 url: &NSURL,
106 orientation: CGImagePropertyOrientation,
107 pixels_wide: NSInteger,
108 pixels_high: NSInteger,
109 pixel_format_type: OSType,
110 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
111 ) -> Result<Retained<Self>, Retained<NSError>>;
112
113 #[cfg(all(feature = "MLImageConstraint", feature = "objc2-image-io"))]
114 #[unsafe(method(featureValueWithImageAtURL:orientation:constraint:options:error:_))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn featureValueWithImageAtURL_orientation_constraint_options_error(
122 url: &NSURL,
123 orientation: CGImagePropertyOrientation,
124 constraint: &MLImageConstraint,
125 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
126 ) -> Result<Retained<Self>, Retained<NSError>>;
127
128 #[cfg(all(feature = "objc2-core-graphics", feature = "objc2-image-io"))]
129 #[unsafe(method(featureValueWithCGImage:orientation:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
135 #[unsafe(method_family = none)]
136 pub unsafe fn featureValueWithCGImage_orientation_pixelsWide_pixelsHigh_pixelFormatType_options_error(
137 cg_image: &CGImage,
138 orientation: CGImagePropertyOrientation,
139 pixels_wide: NSInteger,
140 pixels_high: NSInteger,
141 pixel_format_type: OSType,
142 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
143 ) -> Result<Retained<Self>, Retained<NSError>>;
144
145 #[cfg(all(
146 feature = "MLImageConstraint",
147 feature = "objc2-core-graphics",
148 feature = "objc2-image-io"
149 ))]
150 #[unsafe(method(featureValueWithCGImage:orientation:constraint:options:error:_))]
156 #[unsafe(method_family = none)]
157 pub unsafe fn featureValueWithCGImage_orientation_constraint_options_error(
158 cg_image: &CGImage,
159 orientation: CGImagePropertyOrientation,
160 constraint: &MLImageConstraint,
161 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
162 ) -> Result<Retained<Self>, Retained<NSError>>;
163 );
164}