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
9use crate::*;
10
11pub type MLFeatureValueImageOption = NSString;
16
17extern "C" {
18 pub static MLFeatureValueImageOptionCropRect: &'static MLFeatureValueImageOption;
22}
23
24extern "C" {
25 pub static MLFeatureValueImageOptionCropAndScale: &'static MLFeatureValueImageOption;
29}
30
31#[cfg(feature = "MLFeatureValue")]
33impl MLFeatureValue {
34 extern_methods!(
35 #[unsafe(method(featureValueWithImageAtURL:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
37 #[unsafe(method_family = none)]
38 pub unsafe fn featureValueWithImageAtURL_pixelsWide_pixelsHigh_pixelFormatType_options_error(
39 url: &NSURL,
40 pixels_wide: NSInteger,
41 pixels_high: NSInteger,
42 pixel_format_type: OSType,
43 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
44 ) -> Result<Retained<Self>, Retained<NSError>>;
45
46 #[cfg(feature = "MLImageConstraint")]
47 #[unsafe(method(featureValueWithImageAtURL:constraint:options:error:_))]
49 #[unsafe(method_family = none)]
50 pub unsafe fn featureValueWithImageAtURL_constraint_options_error(
51 url: &NSURL,
52 constraint: &MLImageConstraint,
53 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
54 ) -> Result<Retained<Self>, Retained<NSError>>;
55
56 #[cfg(feature = "objc2-core-graphics")]
57 #[unsafe(method(featureValueWithCGImage:pixelsWide:pixelsHigh:pixelFormatType:options:error:_))]
59 #[unsafe(method_family = none)]
60 pub unsafe fn featureValueWithCGImage_pixelsWide_pixelsHigh_pixelFormatType_options_error(
61 cg_image: &CGImage,
62 pixels_wide: NSInteger,
63 pixels_high: NSInteger,
64 pixel_format_type: OSType,
65 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
66 ) -> Result<Retained<Self>, Retained<NSError>>;
67
68 #[cfg(all(feature = "MLImageConstraint", feature = "objc2-core-graphics"))]
69 #[unsafe(method(featureValueWithCGImage:constraint:options:error:_))]
71 #[unsafe(method_family = none)]
72 pub unsafe fn featureValueWithCGImage_constraint_options_error(
73 cg_image: &CGImage,
74 constraint: &MLImageConstraint,
75 options: Option<&NSDictionary<MLFeatureValueImageOption, AnyObject>>,
76 ) -> Result<Retained<Self>, Retained<NSError>>;
77 );
78}