objc2_core_ml/generated/
MLImageConstraint.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
9extern_class!(
10    /// MLImageConstraint
11    ///
12    /// Constraint on image properties.
13    ///
14    /// See also [Apple's documentation](https://developer.apple.com/documentation/coreml/mlimageconstraint?language=objc)
15    #[unsafe(super(NSObject))]
16    #[derive(Debug, PartialEq, Eq, Hash)]
17    pub struct MLImageConstraint;
18);
19
20extern_conformance!(
21    unsafe impl NSCoding for MLImageConstraint {}
22);
23
24extern_conformance!(
25    unsafe impl NSObjectProtocol for MLImageConstraint {}
26);
27
28extern_conformance!(
29    unsafe impl NSSecureCoding for MLImageConstraint {}
30);
31
32impl MLImageConstraint {
33    extern_methods!(
34        /// The required or default height of the image
35        #[unsafe(method(pixelsHigh))]
36        #[unsafe(method_family = none)]
37        pub unsafe fn pixelsHigh(&self) -> NSInteger;
38
39        /// The required or default width of the image
40        #[unsafe(method(pixelsWide))]
41        #[unsafe(method_family = none)]
42        pub unsafe fn pixelsWide(&self) -> NSInteger;
43
44        /// The accepted kCVPixelFormatType for the image.
45        #[unsafe(method(pixelFormatType))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn pixelFormatType(&self) -> OSType;
48
49        #[cfg(feature = "MLImageSizeConstraint")]
50        /// Detailed image size constraint
51        #[unsafe(method(sizeConstraint))]
52        #[unsafe(method_family = none)]
53        pub unsafe fn sizeConstraint(&self) -> Retained<MLImageSizeConstraint>;
54
55        #[unsafe(method(init))]
56        #[unsafe(method_family = init)]
57        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
58    );
59}
60
61/// Methods declared on superclass `NSObject`.
62impl MLImageConstraint {
63    extern_methods!(
64        #[unsafe(method(new))]
65        #[unsafe(method_family = new)]
66        pub unsafe fn new() -> Retained<Self>;
67    );
68}