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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use objc2::__framework_prelude::*;
use objc2_foundation::*;
#[cfg(feature = "objc2-metal")]
use objc2_metal::*;

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIImageProcessorKernel;

    unsafe impl ClassType for CIImageProcessorKernel {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSObjectProtocol for CIImageProcessorKernel {}

extern_methods!(
    unsafe impl CIImageProcessorKernel {
        #[method(processWithInputs:arguments:output:error:_)]
        pub unsafe fn processWithInputs_arguments_output_error(
            inputs: Option<&NSArray<ProtocolObject<dyn CIImageProcessorInput>>>,
            arguments: Option<&NSDictionary<NSString, AnyObject>>,
            output: &ProtocolObject<dyn CIImageProcessorOutput>,
        ) -> Result<(), Retained<NSError>>;

        #[method(roiForInput:arguments:outputRect:)]
        pub unsafe fn roiForInput_arguments_outputRect(
            input: c_int,
            arguments: Option<&NSDictionary<NSString, AnyObject>>,
            output_rect: CGRect,
        ) -> CGRect;

        #[cfg(feature = "CIVector")]
        #[method_id(@__retain_semantics Other roiTileArrayForInput:arguments:outputRect:)]
        pub unsafe fn roiTileArrayForInput_arguments_outputRect(
            input: c_int,
            arguments: Option<&NSDictionary<NSString, AnyObject>>,
            output_rect: CGRect,
        ) -> Retained<NSArray<CIVector>>;

        #[cfg(feature = "CIImage")]
        #[method(formatForInputAtIndex:)]
        pub unsafe fn formatForInputAtIndex(input: c_int) -> CIFormat;

        #[cfg(feature = "CIImage")]
        #[method(outputFormat)]
        pub unsafe fn outputFormat() -> CIFormat;

        #[method(outputIsOpaque)]
        pub unsafe fn outputIsOpaque() -> bool;

        #[method(synchronizeInputs)]
        pub unsafe fn synchronizeInputs() -> bool;

        #[cfg(feature = "CIImage")]
        #[method_id(@__retain_semantics Other applyWithExtent:inputs:arguments:error:_)]
        pub unsafe fn applyWithExtent_inputs_arguments_error(
            extent: CGRect,
            inputs: Option<&NSArray<CIImage>>,
            args: Option<&NSDictionary<NSString, AnyObject>>,
        ) -> Result<Retained<CIImage>, Retained<NSError>>;
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl CIImageProcessorKernel {
        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new() -> Retained<Self>;
    }
);

extern_protocol!(
    pub unsafe trait CIImageProcessorInput {
        #[method(region)]
        unsafe fn region(&self) -> CGRect;

        #[method(bytesPerRow)]
        unsafe fn bytesPerRow(&self) -> usize;

        #[cfg(feature = "CIImage")]
        #[method(format)]
        unsafe fn format(&self) -> CIFormat;

        #[method(baseAddress)]
        unsafe fn baseAddress(&self) -> NonNull<c_void>;

        #[cfg(feature = "objc2-metal")]
        #[method_id(@__retain_semantics Other metalTexture)]
        unsafe fn metalTexture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;

        #[method(digest)]
        unsafe fn digest(&self) -> u64;

        #[method(roiTileIndex)]
        unsafe fn roiTileIndex(&self) -> NSUInteger;

        #[method(roiTileCount)]
        unsafe fn roiTileCount(&self) -> NSUInteger;
    }

    unsafe impl ProtocolType for dyn CIImageProcessorInput {}
);

extern_protocol!(
    pub unsafe trait CIImageProcessorOutput {
        #[method(region)]
        unsafe fn region(&self) -> CGRect;

        #[method(bytesPerRow)]
        unsafe fn bytesPerRow(&self) -> usize;

        #[cfg(feature = "CIImage")]
        #[method(format)]
        unsafe fn format(&self) -> CIFormat;

        #[method(baseAddress)]
        unsafe fn baseAddress(&self) -> NonNull<c_void>;

        #[cfg(feature = "objc2-metal")]
        #[method_id(@__retain_semantics Other metalTexture)]
        unsafe fn metalTexture(&self) -> Option<Retained<ProtocolObject<dyn MTLTexture>>>;

        #[cfg(feature = "objc2-metal")]
        #[method_id(@__retain_semantics Other metalCommandBuffer)]
        unsafe fn metalCommandBuffer(
            &self,
        ) -> Option<Retained<ProtocolObject<dyn MTLCommandBuffer>>>;

        #[method(digest)]
        unsafe fn digest(&self) -> u64;
    }

    unsafe impl ProtocolType for dyn CIImageProcessorOutput {}
);