objc2_metal_performance_shaders/generated/MPSNeuralNetwork/
MPSNNReduce.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7use objc2_metal::*;
8
9use crate::*;
10
11extern_class!(
12    /// The MPSNNReduce performs a reduction operation
13    /// The reduction operations supported are:
14    /// - Reduce row min
15    /// - Reduce column min
16    /// - Reduce feature channels min
17    /// - Reduce row max
18    /// - Reduce column max
19    /// - Reduce feature channels max
20    /// - Reduce row mean
21    /// - Reduce column mean
22    /// - Reduce feature channels mean
23    /// - Reduce row sum
24    /// - Reduce column sum
25    /// - Reduce feature channels sum
26    ///
27    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreduceunary?language=objc)
28    #[unsafe(super(MPSCNNKernel, MPSKernel, NSObject))]
29    #[derive(Debug, PartialEq, Eq, Hash)]
30    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
31    pub struct MPSNNReduceUnary;
32);
33
34#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
35extern_conformance!(
36    unsafe impl NSCoding for MPSNNReduceUnary {}
37);
38
39#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
40extern_conformance!(
41    unsafe impl NSCopying for MPSNNReduceUnary {}
42);
43
44#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
45unsafe impl CopyingHelper for MPSNNReduceUnary {
46    type Result = Self;
47}
48
49#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
50extern_conformance!(
51    unsafe impl NSObjectProtocol for MPSNNReduceUnary {}
52);
53
54#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
55extern_conformance!(
56    unsafe impl NSSecureCoding for MPSNNReduceUnary {}
57);
58
59#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
60impl MPSNNReduceUnary {
61    extern_methods!(
62        /// The source rectangle to use when reading data.
63        ///
64        /// A MTLRegion that indicates which part of the source to read. If the clipRectSource does not lie
65        /// completely within the source image, the intersection of the image bounds and clipRectSource will
66        /// be used. The clipRectSource replaces the MPSCNNKernel offset parameter for this filter.
67        /// The latter is ignored.   Default: MPSRectNoClip, use the entire source texture.
68        #[unsafe(method(clipRectSource))]
69        #[unsafe(method_family = none)]
70        pub unsafe fn clipRectSource(&self) -> MTLRegion;
71
72        /// Setter for [`clipRectSource`][Self::clipRectSource].
73        #[unsafe(method(setClipRectSource:))]
74        #[unsafe(method_family = none)]
75        pub unsafe fn setClipRectSource(&self, clip_rect_source: MTLRegion);
76
77        #[cfg(feature = "MPSCoreTypes")]
78        /// Since the clipRectSource replaces the MPSCNNKernel offset parameter for this filter,
79        /// this property is deprecated..
80        #[deprecated]
81        #[unsafe(method(offset))]
82        #[unsafe(method_family = none)]
83        pub unsafe fn offset(&self) -> MPSOffset;
84
85        #[cfg(feature = "MPSCoreTypes")]
86        /// Setter for [`offset`][Self::offset].
87        #[deprecated]
88        #[unsafe(method(setOffset:))]
89        #[unsafe(method_family = none)]
90        pub unsafe fn setOffset(&self, offset: MPSOffset);
91
92        #[unsafe(method(initWithDevice:))]
93        #[unsafe(method_family = init)]
94        pub unsafe fn initWithDevice(
95            this: Allocated<Self>,
96            device: &ProtocolObject<dyn MTLDevice>,
97        ) -> Retained<Self>;
98    );
99}
100
101/// Methods declared on superclass `MPSCNNKernel`.
102#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
103impl MPSNNReduceUnary {
104    extern_methods!(
105        /// NSSecureCoding compatability
106        ///
107        /// While the standard NSSecureCoding/NSCoding method
108        /// -initWithCoder: should work, since the file can't
109        /// know which device your data is allocated on, we
110        /// have to guess and may guess incorrectly.  To avoid
111        /// that problem, use initWithCoder:device instead.
112        ///
113        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
114        ///
115        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
116        ///
117        /// Returns: A new MPSKernel object, or nil if failure.
118        ///
119        /// # Safety
120        ///
121        /// `a_decoder` possibly has further requirements.
122        #[unsafe(method(initWithCoder:device:))]
123        #[unsafe(method_family = init)]
124        pub unsafe fn initWithCoder_device(
125            this: Allocated<Self>,
126            a_decoder: &NSCoder,
127            device: &ProtocolObject<dyn MTLDevice>,
128        ) -> Option<Retained<Self>>;
129    );
130}
131
132/// Methods declared on superclass `MPSKernel`.
133#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
134impl MPSNNReduceUnary {
135    extern_methods!(
136        /// Called by NSCoder to decode MPSKernels
137        ///
138        /// This isn't the right interface to decode a MPSKernel, but
139        /// it is the one that NSCoder uses. To enable your NSCoder
140        /// (e.g. NSKeyedUnarchiver) to set which device to use
141        /// extend the object to adopt the MPSDeviceProvider
142        /// protocol. Otherwise, the Metal system default device
143        /// will be used.
144        ///
145        /// # Safety
146        ///
147        /// `a_decoder` possibly has further requirements.
148        #[unsafe(method(initWithCoder:))]
149        #[unsafe(method_family = init)]
150        pub unsafe fn initWithCoder(
151            this: Allocated<Self>,
152            a_decoder: &NSCoder,
153        ) -> Option<Retained<Self>>;
154    );
155}
156
157/// Methods declared on superclass `NSObject`.
158#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
159impl MPSNNReduceUnary {
160    extern_methods!(
161        #[unsafe(method(init))]
162        #[unsafe(method_family = init)]
163        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
164
165        #[unsafe(method(new))]
166        #[unsafe(method_family = new)]
167        pub unsafe fn new() -> Retained<Self>;
168    );
169}
170
171extern_class!(
172    /// The MPSNNReduceRowMin performs a reduction operation returning the mininmum value for each row of an image
173    ///
174    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmin?language=objc)
175    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
176    #[derive(Debug, PartialEq, Eq, Hash)]
177    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
178    pub struct MPSNNReduceRowMin;
179);
180
181#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
182extern_conformance!(
183    unsafe impl NSCoding for MPSNNReduceRowMin {}
184);
185
186#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
187extern_conformance!(
188    unsafe impl NSCopying for MPSNNReduceRowMin {}
189);
190
191#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
192unsafe impl CopyingHelper for MPSNNReduceRowMin {
193    type Result = Self;
194}
195
196#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
197extern_conformance!(
198    unsafe impl NSObjectProtocol for MPSNNReduceRowMin {}
199);
200
201#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
202extern_conformance!(
203    unsafe impl NSSecureCoding for MPSNNReduceRowMin {}
204);
205
206#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
207impl MPSNNReduceRowMin {
208    extern_methods!(
209        /// Specifies information to apply the reduction operation on an image.
210        ///
211        /// Parameter `device`: The device the filter will run on
212        ///
213        /// Returns: A valid MPSNNReduceRowMin object or nil, if failure.
214        #[unsafe(method(initWithDevice:))]
215        #[unsafe(method_family = init)]
216        pub unsafe fn initWithDevice(
217            this: Allocated<Self>,
218            device: &ProtocolObject<dyn MTLDevice>,
219        ) -> Retained<Self>;
220
221        /// NSSecureCoding compatability
222        ///
223        /// See
224        /// MPSKernel#initWithCoder.
225        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
226        ///
227        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
228        ///
229        /// Returns: A new MPSNNReduceRowMin object, or nil if failure.
230        ///
231        /// # Safety
232        ///
233        /// `a_decoder` possibly has further requirements.
234        #[unsafe(method(initWithCoder:device:))]
235        #[unsafe(method_family = init)]
236        pub unsafe fn initWithCoder_device(
237            this: Allocated<Self>,
238            a_decoder: &NSCoder,
239            device: &ProtocolObject<dyn MTLDevice>,
240        ) -> Option<Retained<Self>>;
241    );
242}
243
244/// Methods declared on superclass `MPSKernel`.
245#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
246impl MPSNNReduceRowMin {
247    extern_methods!(
248        /// Called by NSCoder to decode MPSKernels
249        ///
250        /// This isn't the right interface to decode a MPSKernel, but
251        /// it is the one that NSCoder uses. To enable your NSCoder
252        /// (e.g. NSKeyedUnarchiver) to set which device to use
253        /// extend the object to adopt the MPSDeviceProvider
254        /// protocol. Otherwise, the Metal system default device
255        /// will be used.
256        ///
257        /// # Safety
258        ///
259        /// `a_decoder` possibly has further requirements.
260        #[unsafe(method(initWithCoder:))]
261        #[unsafe(method_family = init)]
262        pub unsafe fn initWithCoder(
263            this: Allocated<Self>,
264            a_decoder: &NSCoder,
265        ) -> Option<Retained<Self>>;
266    );
267}
268
269/// Methods declared on superclass `NSObject`.
270#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
271impl MPSNNReduceRowMin {
272    extern_methods!(
273        #[unsafe(method(init))]
274        #[unsafe(method_family = init)]
275        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
276
277        #[unsafe(method(new))]
278        #[unsafe(method_family = new)]
279        pub unsafe fn new() -> Retained<Self>;
280    );
281}
282
283extern_class!(
284    /// The MPSNNReduceColumnMin performs a reduction operation returning the mininmum value for each column of an image
285    ///
286    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmin?language=objc)
287    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
288    #[derive(Debug, PartialEq, Eq, Hash)]
289    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
290    pub struct MPSNNReduceColumnMin;
291);
292
293#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
294extern_conformance!(
295    unsafe impl NSCoding for MPSNNReduceColumnMin {}
296);
297
298#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
299extern_conformance!(
300    unsafe impl NSCopying for MPSNNReduceColumnMin {}
301);
302
303#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
304unsafe impl CopyingHelper for MPSNNReduceColumnMin {
305    type Result = Self;
306}
307
308#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
309extern_conformance!(
310    unsafe impl NSObjectProtocol for MPSNNReduceColumnMin {}
311);
312
313#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
314extern_conformance!(
315    unsafe impl NSSecureCoding for MPSNNReduceColumnMin {}
316);
317
318#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
319impl MPSNNReduceColumnMin {
320    extern_methods!(
321        /// Specifies information to apply the reduction operation on an image.
322        ///
323        /// Parameter `device`: The device the filter will run on
324        ///
325        /// Returns: A valid MPSNNReduceColumnMin object or nil, if failure.
326        #[unsafe(method(initWithDevice:))]
327        #[unsafe(method_family = init)]
328        pub unsafe fn initWithDevice(
329            this: Allocated<Self>,
330            device: &ProtocolObject<dyn MTLDevice>,
331        ) -> Retained<Self>;
332
333        /// NSSecureCoding compatability
334        ///
335        /// See
336        /// MPSKernel#initWithCoder.
337        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
338        ///
339        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
340        ///
341        /// Returns: A new MPSNNReduceColumnMin object, or nil if failure.
342        ///
343        /// # Safety
344        ///
345        /// `a_decoder` possibly has further requirements.
346        #[unsafe(method(initWithCoder:device:))]
347        #[unsafe(method_family = init)]
348        pub unsafe fn initWithCoder_device(
349            this: Allocated<Self>,
350            a_decoder: &NSCoder,
351            device: &ProtocolObject<dyn MTLDevice>,
352        ) -> Option<Retained<Self>>;
353    );
354}
355
356/// Methods declared on superclass `MPSKernel`.
357#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
358impl MPSNNReduceColumnMin {
359    extern_methods!(
360        /// Called by NSCoder to decode MPSKernels
361        ///
362        /// This isn't the right interface to decode a MPSKernel, but
363        /// it is the one that NSCoder uses. To enable your NSCoder
364        /// (e.g. NSKeyedUnarchiver) to set which device to use
365        /// extend the object to adopt the MPSDeviceProvider
366        /// protocol. Otherwise, the Metal system default device
367        /// will be used.
368        ///
369        /// # Safety
370        ///
371        /// `a_decoder` possibly has further requirements.
372        #[unsafe(method(initWithCoder:))]
373        #[unsafe(method_family = init)]
374        pub unsafe fn initWithCoder(
375            this: Allocated<Self>,
376            a_decoder: &NSCoder,
377        ) -> Option<Retained<Self>>;
378    );
379}
380
381/// Methods declared on superclass `NSObject`.
382#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
383impl MPSNNReduceColumnMin {
384    extern_methods!(
385        #[unsafe(method(init))]
386        #[unsafe(method_family = init)]
387        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
388
389        #[unsafe(method(new))]
390        #[unsafe(method_family = new)]
391        pub unsafe fn new() -> Retained<Self>;
392    );
393}
394
395extern_class!(
396    /// The MPSNNReduceFeatureChannelsMin performs a reduction operation returning the mininmum value for feature channels of an image
397    ///
398    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmin?language=objc)
399    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
400    #[derive(Debug, PartialEq, Eq, Hash)]
401    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
402    pub struct MPSNNReduceFeatureChannelsMin;
403);
404
405#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
406extern_conformance!(
407    unsafe impl NSCoding for MPSNNReduceFeatureChannelsMin {}
408);
409
410#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
411extern_conformance!(
412    unsafe impl NSCopying for MPSNNReduceFeatureChannelsMin {}
413);
414
415#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
416unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsMin {
417    type Result = Self;
418}
419
420#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
421extern_conformance!(
422    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsMin {}
423);
424
425#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
426extern_conformance!(
427    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsMin {}
428);
429
430#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
431impl MPSNNReduceFeatureChannelsMin {
432    extern_methods!(
433        /// Specifies information to apply the reduction operation on an image.
434        ///
435        /// Parameter `device`: The device the filter will run on
436        ///
437        /// Returns: A valid MPSNNReduceFeatureChannelsMin object or nil, if failure.
438        #[unsafe(method(initWithDevice:))]
439        #[unsafe(method_family = init)]
440        pub unsafe fn initWithDevice(
441            this: Allocated<Self>,
442            device: &ProtocolObject<dyn MTLDevice>,
443        ) -> Retained<Self>;
444
445        /// NSSecureCoding compatability
446        ///
447        /// See
448        /// MPSKernel#initWithCoder.
449        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
450        ///
451        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
452        ///
453        /// Returns: A new MPSNNReduceFeatureChannelsMin object, or nil if failure.
454        ///
455        /// # Safety
456        ///
457        /// `a_decoder` possibly has further requirements.
458        #[unsafe(method(initWithCoder:device:))]
459        #[unsafe(method_family = init)]
460        pub unsafe fn initWithCoder_device(
461            this: Allocated<Self>,
462            a_decoder: &NSCoder,
463            device: &ProtocolObject<dyn MTLDevice>,
464        ) -> Option<Retained<Self>>;
465    );
466}
467
468/// Methods declared on superclass `MPSKernel`.
469#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
470impl MPSNNReduceFeatureChannelsMin {
471    extern_methods!(
472        /// Called by NSCoder to decode MPSKernels
473        ///
474        /// This isn't the right interface to decode a MPSKernel, but
475        /// it is the one that NSCoder uses. To enable your NSCoder
476        /// (e.g. NSKeyedUnarchiver) to set which device to use
477        /// extend the object to adopt the MPSDeviceProvider
478        /// protocol. Otherwise, the Metal system default device
479        /// will be used.
480        ///
481        /// # Safety
482        ///
483        /// `a_decoder` possibly has further requirements.
484        #[unsafe(method(initWithCoder:))]
485        #[unsafe(method_family = init)]
486        pub unsafe fn initWithCoder(
487            this: Allocated<Self>,
488            a_decoder: &NSCoder,
489        ) -> Option<Retained<Self>>;
490    );
491}
492
493/// Methods declared on superclass `NSObject`.
494#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
495impl MPSNNReduceFeatureChannelsMin {
496    extern_methods!(
497        #[unsafe(method(init))]
498        #[unsafe(method_family = init)]
499        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
500
501        #[unsafe(method(new))]
502        #[unsafe(method_family = new)]
503        pub unsafe fn new() -> Retained<Self>;
504    );
505}
506
507extern_class!(
508    /// The MPSNNReduceFeatureChannelsArgumentMin returns the argument index that is the
509    /// location of the minimum value for feature channels of an image
510    ///
511    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmin?language=objc)
512    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
513    #[derive(Debug, PartialEq, Eq, Hash)]
514    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
515    pub struct MPSNNReduceFeatureChannelsArgumentMin;
516);
517
518#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
519extern_conformance!(
520    unsafe impl NSCoding for MPSNNReduceFeatureChannelsArgumentMin {}
521);
522
523#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
524extern_conformance!(
525    unsafe impl NSCopying for MPSNNReduceFeatureChannelsArgumentMin {}
526);
527
528#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
529unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsArgumentMin {
530    type Result = Self;
531}
532
533#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
534extern_conformance!(
535    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsArgumentMin {}
536);
537
538#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
539extern_conformance!(
540    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsArgumentMin {}
541);
542
543#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
544impl MPSNNReduceFeatureChannelsArgumentMin {
545    extern_methods!(
546        /// Specifies information to apply the reduction operation on an image.
547        ///
548        /// Parameter `device`: The device the filter will run on
549        ///
550        /// Returns: A valid MPSNNReduceFeatureChannelsArgumentMin object or nil, if failure.
551        #[unsafe(method(initWithDevice:))]
552        #[unsafe(method_family = init)]
553        pub unsafe fn initWithDevice(
554            this: Allocated<Self>,
555            device: &ProtocolObject<dyn MTLDevice>,
556        ) -> Retained<Self>;
557
558        /// NSSecureCoding compatability
559        ///
560        /// See
561        /// MPSKernel#initWithCoder.
562        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
563        ///
564        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
565        ///
566        /// Returns: A new MPSNNReduceFeatureChannelsArgumentMin object, or nil if failure.
567        ///
568        /// # Safety
569        ///
570        /// `a_decoder` possibly has further requirements.
571        #[unsafe(method(initWithCoder:device:))]
572        #[unsafe(method_family = init)]
573        pub unsafe fn initWithCoder_device(
574            this: Allocated<Self>,
575            a_decoder: &NSCoder,
576            device: &ProtocolObject<dyn MTLDevice>,
577        ) -> Option<Retained<Self>>;
578    );
579}
580
581/// Methods declared on superclass `MPSKernel`.
582#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
583impl MPSNNReduceFeatureChannelsArgumentMin {
584    extern_methods!(
585        /// Called by NSCoder to decode MPSKernels
586        ///
587        /// This isn't the right interface to decode a MPSKernel, but
588        /// it is the one that NSCoder uses. To enable your NSCoder
589        /// (e.g. NSKeyedUnarchiver) to set which device to use
590        /// extend the object to adopt the MPSDeviceProvider
591        /// protocol. Otherwise, the Metal system default device
592        /// will be used.
593        ///
594        /// # Safety
595        ///
596        /// `a_decoder` possibly has further requirements.
597        #[unsafe(method(initWithCoder:))]
598        #[unsafe(method_family = init)]
599        pub unsafe fn initWithCoder(
600            this: Allocated<Self>,
601            a_decoder: &NSCoder,
602        ) -> Option<Retained<Self>>;
603    );
604}
605
606/// Methods declared on superclass `NSObject`.
607#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
608impl MPSNNReduceFeatureChannelsArgumentMin {
609    extern_methods!(
610        #[unsafe(method(init))]
611        #[unsafe(method_family = init)]
612        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
613
614        #[unsafe(method(new))]
615        #[unsafe(method_family = new)]
616        pub unsafe fn new() -> Retained<Self>;
617    );
618}
619
620extern_class!(
621    /// The MPSNNReduceRowMax performs a reduction operation returning the maximum value for each row of an image
622    ///
623    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmax?language=objc)
624    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
625    #[derive(Debug, PartialEq, Eq, Hash)]
626    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
627    pub struct MPSNNReduceRowMax;
628);
629
630#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
631extern_conformance!(
632    unsafe impl NSCoding for MPSNNReduceRowMax {}
633);
634
635#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
636extern_conformance!(
637    unsafe impl NSCopying for MPSNNReduceRowMax {}
638);
639
640#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
641unsafe impl CopyingHelper for MPSNNReduceRowMax {
642    type Result = Self;
643}
644
645#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
646extern_conformance!(
647    unsafe impl NSObjectProtocol for MPSNNReduceRowMax {}
648);
649
650#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
651extern_conformance!(
652    unsafe impl NSSecureCoding for MPSNNReduceRowMax {}
653);
654
655#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
656impl MPSNNReduceRowMax {
657    extern_methods!(
658        /// Specifies information to apply the reduction operation on an image.
659        ///
660        /// Parameter `device`: The device the filter will run on
661        ///
662        /// Returns: A valid MPSNNReduceRowMax object or nil, if failure.
663        #[unsafe(method(initWithDevice:))]
664        #[unsafe(method_family = init)]
665        pub unsafe fn initWithDevice(
666            this: Allocated<Self>,
667            device: &ProtocolObject<dyn MTLDevice>,
668        ) -> Retained<Self>;
669
670        /// NSSecureCoding compatability
671        ///
672        /// See
673        /// MPSKernel#initWithCoder.
674        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
675        ///
676        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
677        ///
678        /// Returns: A new MPSNNReduceRowMax object, or nil if failure.
679        ///
680        /// # Safety
681        ///
682        /// `a_decoder` possibly has further requirements.
683        #[unsafe(method(initWithCoder:device:))]
684        #[unsafe(method_family = init)]
685        pub unsafe fn initWithCoder_device(
686            this: Allocated<Self>,
687            a_decoder: &NSCoder,
688            device: &ProtocolObject<dyn MTLDevice>,
689        ) -> Option<Retained<Self>>;
690    );
691}
692
693/// Methods declared on superclass `MPSKernel`.
694#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
695impl MPSNNReduceRowMax {
696    extern_methods!(
697        /// Called by NSCoder to decode MPSKernels
698        ///
699        /// This isn't the right interface to decode a MPSKernel, but
700        /// it is the one that NSCoder uses. To enable your NSCoder
701        /// (e.g. NSKeyedUnarchiver) to set which device to use
702        /// extend the object to adopt the MPSDeviceProvider
703        /// protocol. Otherwise, the Metal system default device
704        /// will be used.
705        ///
706        /// # Safety
707        ///
708        /// `a_decoder` possibly has further requirements.
709        #[unsafe(method(initWithCoder:))]
710        #[unsafe(method_family = init)]
711        pub unsafe fn initWithCoder(
712            this: Allocated<Self>,
713            a_decoder: &NSCoder,
714        ) -> Option<Retained<Self>>;
715    );
716}
717
718/// Methods declared on superclass `NSObject`.
719#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
720impl MPSNNReduceRowMax {
721    extern_methods!(
722        #[unsafe(method(init))]
723        #[unsafe(method_family = init)]
724        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
725
726        #[unsafe(method(new))]
727        #[unsafe(method_family = new)]
728        pub unsafe fn new() -> Retained<Self>;
729    );
730}
731
732extern_class!(
733    /// The MPSNNReduceColumnMax performs a reduction operation returning the maximum value for each column of an image
734    ///
735    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmax?language=objc)
736    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
737    #[derive(Debug, PartialEq, Eq, Hash)]
738    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
739    pub struct MPSNNReduceColumnMax;
740);
741
742#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
743extern_conformance!(
744    unsafe impl NSCoding for MPSNNReduceColumnMax {}
745);
746
747#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
748extern_conformance!(
749    unsafe impl NSCopying for MPSNNReduceColumnMax {}
750);
751
752#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
753unsafe impl CopyingHelper for MPSNNReduceColumnMax {
754    type Result = Self;
755}
756
757#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
758extern_conformance!(
759    unsafe impl NSObjectProtocol for MPSNNReduceColumnMax {}
760);
761
762#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
763extern_conformance!(
764    unsafe impl NSSecureCoding for MPSNNReduceColumnMax {}
765);
766
767#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
768impl MPSNNReduceColumnMax {
769    extern_methods!(
770        /// Specifies information to apply the reduction operation on an image.
771        ///
772        /// Parameter `device`: The device the filter will run on
773        ///
774        /// Returns: A valid MPSNNReduceColumnMax object or nil, if failure.
775        #[unsafe(method(initWithDevice:))]
776        #[unsafe(method_family = init)]
777        pub unsafe fn initWithDevice(
778            this: Allocated<Self>,
779            device: &ProtocolObject<dyn MTLDevice>,
780        ) -> Retained<Self>;
781
782        /// NSSecureCoding compatability
783        ///
784        /// See
785        /// MPSKernel#initWithCoder.
786        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
787        ///
788        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
789        ///
790        /// Returns: A new MPSNNReduceColumnMax object, or nil if failure.
791        ///
792        /// # Safety
793        ///
794        /// `a_decoder` possibly has further requirements.
795        #[unsafe(method(initWithCoder:device:))]
796        #[unsafe(method_family = init)]
797        pub unsafe fn initWithCoder_device(
798            this: Allocated<Self>,
799            a_decoder: &NSCoder,
800            device: &ProtocolObject<dyn MTLDevice>,
801        ) -> Option<Retained<Self>>;
802    );
803}
804
805/// Methods declared on superclass `MPSKernel`.
806#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
807impl MPSNNReduceColumnMax {
808    extern_methods!(
809        /// Called by NSCoder to decode MPSKernels
810        ///
811        /// This isn't the right interface to decode a MPSKernel, but
812        /// it is the one that NSCoder uses. To enable your NSCoder
813        /// (e.g. NSKeyedUnarchiver) to set which device to use
814        /// extend the object to adopt the MPSDeviceProvider
815        /// protocol. Otherwise, the Metal system default device
816        /// will be used.
817        ///
818        /// # Safety
819        ///
820        /// `a_decoder` possibly has further requirements.
821        #[unsafe(method(initWithCoder:))]
822        #[unsafe(method_family = init)]
823        pub unsafe fn initWithCoder(
824            this: Allocated<Self>,
825            a_decoder: &NSCoder,
826        ) -> Option<Retained<Self>>;
827    );
828}
829
830/// Methods declared on superclass `NSObject`.
831#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
832impl MPSNNReduceColumnMax {
833    extern_methods!(
834        #[unsafe(method(init))]
835        #[unsafe(method_family = init)]
836        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
837
838        #[unsafe(method(new))]
839        #[unsafe(method_family = new)]
840        pub unsafe fn new() -> Retained<Self>;
841    );
842}
843
844extern_class!(
845    /// The MPSNNReduceFeatureChannelsMax performs a reduction operation returning the maximum value for feature channels of an image
846    ///
847    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmax?language=objc)
848    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
849    #[derive(Debug, PartialEq, Eq, Hash)]
850    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
851    pub struct MPSNNReduceFeatureChannelsMax;
852);
853
854#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
855extern_conformance!(
856    unsafe impl NSCoding for MPSNNReduceFeatureChannelsMax {}
857);
858
859#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
860extern_conformance!(
861    unsafe impl NSCopying for MPSNNReduceFeatureChannelsMax {}
862);
863
864#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
865unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsMax {
866    type Result = Self;
867}
868
869#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
870extern_conformance!(
871    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsMax {}
872);
873
874#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
875extern_conformance!(
876    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsMax {}
877);
878
879#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
880impl MPSNNReduceFeatureChannelsMax {
881    extern_methods!(
882        /// Specifies information to apply the reduction operation on an image.
883        ///
884        /// Parameter `device`: The device the filter will run on
885        ///
886        /// Returns: A valid MPSNNReduceFeatureChannelsMax object or nil, if failure.
887        #[unsafe(method(initWithDevice:))]
888        #[unsafe(method_family = init)]
889        pub unsafe fn initWithDevice(
890            this: Allocated<Self>,
891            device: &ProtocolObject<dyn MTLDevice>,
892        ) -> Retained<Self>;
893
894        /// NSSecureCoding compatability
895        ///
896        /// See
897        /// MPSKernel#initWithCoder.
898        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
899        ///
900        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
901        ///
902        /// Returns: A new MPSNNReduceFeatureChannelsMax object, or nil if failure.
903        ///
904        /// # Safety
905        ///
906        /// `a_decoder` possibly has further requirements.
907        #[unsafe(method(initWithCoder:device:))]
908        #[unsafe(method_family = init)]
909        pub unsafe fn initWithCoder_device(
910            this: Allocated<Self>,
911            a_decoder: &NSCoder,
912            device: &ProtocolObject<dyn MTLDevice>,
913        ) -> Option<Retained<Self>>;
914    );
915}
916
917/// Methods declared on superclass `MPSKernel`.
918#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
919impl MPSNNReduceFeatureChannelsMax {
920    extern_methods!(
921        /// Called by NSCoder to decode MPSKernels
922        ///
923        /// This isn't the right interface to decode a MPSKernel, but
924        /// it is the one that NSCoder uses. To enable your NSCoder
925        /// (e.g. NSKeyedUnarchiver) to set which device to use
926        /// extend the object to adopt the MPSDeviceProvider
927        /// protocol. Otherwise, the Metal system default device
928        /// will be used.
929        ///
930        /// # Safety
931        ///
932        /// `a_decoder` possibly has further requirements.
933        #[unsafe(method(initWithCoder:))]
934        #[unsafe(method_family = init)]
935        pub unsafe fn initWithCoder(
936            this: Allocated<Self>,
937            a_decoder: &NSCoder,
938        ) -> Option<Retained<Self>>;
939    );
940}
941
942/// Methods declared on superclass `NSObject`.
943#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
944impl MPSNNReduceFeatureChannelsMax {
945    extern_methods!(
946        #[unsafe(method(init))]
947        #[unsafe(method_family = init)]
948        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
949
950        #[unsafe(method(new))]
951        #[unsafe(method_family = new)]
952        pub unsafe fn new() -> Retained<Self>;
953    );
954}
955
956extern_class!(
957    /// The MPSNNReduceFeatureChannelsArgumentMax performs returns the argument index that is the
958    /// location of the maximum value for feature channels of an image
959    ///
960    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsargumentmax?language=objc)
961    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
962    #[derive(Debug, PartialEq, Eq, Hash)]
963    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
964    pub struct MPSNNReduceFeatureChannelsArgumentMax;
965);
966
967#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
968extern_conformance!(
969    unsafe impl NSCoding for MPSNNReduceFeatureChannelsArgumentMax {}
970);
971
972#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
973extern_conformance!(
974    unsafe impl NSCopying for MPSNNReduceFeatureChannelsArgumentMax {}
975);
976
977#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
978unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsArgumentMax {
979    type Result = Self;
980}
981
982#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
983extern_conformance!(
984    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsArgumentMax {}
985);
986
987#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
988extern_conformance!(
989    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsArgumentMax {}
990);
991
992#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
993impl MPSNNReduceFeatureChannelsArgumentMax {
994    extern_methods!(
995        /// Specifies information to apply the reduction operation on an image.
996        ///
997        /// Parameter `device`: The device the filter will run on
998        ///
999        /// Returns: A valid MPSNNReduceFeatureChannelsArgumentMax object or nil, if failure.
1000        #[unsafe(method(initWithDevice:))]
1001        #[unsafe(method_family = init)]
1002        pub unsafe fn initWithDevice(
1003            this: Allocated<Self>,
1004            device: &ProtocolObject<dyn MTLDevice>,
1005        ) -> Retained<Self>;
1006
1007        /// NSSecureCoding compatability
1008        ///
1009        /// See
1010        /// MPSKernel#initWithCoder.
1011        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1012        ///
1013        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1014        ///
1015        /// Returns: A new MPSNNReduceFeatureChannelsArgumentMax object, or nil if failure.
1016        ///
1017        /// # Safety
1018        ///
1019        /// `a_decoder` possibly has further requirements.
1020        #[unsafe(method(initWithCoder:device:))]
1021        #[unsafe(method_family = init)]
1022        pub unsafe fn initWithCoder_device(
1023            this: Allocated<Self>,
1024            a_decoder: &NSCoder,
1025            device: &ProtocolObject<dyn MTLDevice>,
1026        ) -> Option<Retained<Self>>;
1027    );
1028}
1029
1030/// Methods declared on superclass `MPSKernel`.
1031#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1032impl MPSNNReduceFeatureChannelsArgumentMax {
1033    extern_methods!(
1034        /// Called by NSCoder to decode MPSKernels
1035        ///
1036        /// This isn't the right interface to decode a MPSKernel, but
1037        /// it is the one that NSCoder uses. To enable your NSCoder
1038        /// (e.g. NSKeyedUnarchiver) to set which device to use
1039        /// extend the object to adopt the MPSDeviceProvider
1040        /// protocol. Otherwise, the Metal system default device
1041        /// will be used.
1042        ///
1043        /// # Safety
1044        ///
1045        /// `a_decoder` possibly has further requirements.
1046        #[unsafe(method(initWithCoder:))]
1047        #[unsafe(method_family = init)]
1048        pub unsafe fn initWithCoder(
1049            this: Allocated<Self>,
1050            a_decoder: &NSCoder,
1051        ) -> Option<Retained<Self>>;
1052    );
1053}
1054
1055/// Methods declared on superclass `NSObject`.
1056#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1057impl MPSNNReduceFeatureChannelsArgumentMax {
1058    extern_methods!(
1059        #[unsafe(method(init))]
1060        #[unsafe(method_family = init)]
1061        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1062
1063        #[unsafe(method(new))]
1064        #[unsafe(method_family = new)]
1065        pub unsafe fn new() -> Retained<Self>;
1066    );
1067}
1068
1069extern_class!(
1070    /// The MPSNNReduceRowMean performs a reduction operation returning the mean value for each row of an image
1071    ///
1072    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowmean?language=objc)
1073    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1074    #[derive(Debug, PartialEq, Eq, Hash)]
1075    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1076    pub struct MPSNNReduceRowMean;
1077);
1078
1079#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1080extern_conformance!(
1081    unsafe impl NSCoding for MPSNNReduceRowMean {}
1082);
1083
1084#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1085extern_conformance!(
1086    unsafe impl NSCopying for MPSNNReduceRowMean {}
1087);
1088
1089#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1090unsafe impl CopyingHelper for MPSNNReduceRowMean {
1091    type Result = Self;
1092}
1093
1094#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1095extern_conformance!(
1096    unsafe impl NSObjectProtocol for MPSNNReduceRowMean {}
1097);
1098
1099#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1100extern_conformance!(
1101    unsafe impl NSSecureCoding for MPSNNReduceRowMean {}
1102);
1103
1104#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1105impl MPSNNReduceRowMean {
1106    extern_methods!(
1107        /// Specifies information to apply the reduction operation on an image.
1108        ///
1109        /// Parameter `device`: The device the filter will run on
1110        ///
1111        /// Returns: A valid MPSNNReduceRowMean object or nil, if failure.
1112        #[unsafe(method(initWithDevice:))]
1113        #[unsafe(method_family = init)]
1114        pub unsafe fn initWithDevice(
1115            this: Allocated<Self>,
1116            device: &ProtocolObject<dyn MTLDevice>,
1117        ) -> Retained<Self>;
1118
1119        /// NSSecureCoding compatability
1120        ///
1121        /// See
1122        /// MPSKernel#initWithCoder.
1123        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1124        ///
1125        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1126        ///
1127        /// Returns: A new MPSNNReduceRowMean object, or nil if failure.
1128        ///
1129        /// # Safety
1130        ///
1131        /// `a_decoder` possibly has further requirements.
1132        #[unsafe(method(initWithCoder:device:))]
1133        #[unsafe(method_family = init)]
1134        pub unsafe fn initWithCoder_device(
1135            this: Allocated<Self>,
1136            a_decoder: &NSCoder,
1137            device: &ProtocolObject<dyn MTLDevice>,
1138        ) -> Option<Retained<Self>>;
1139    );
1140}
1141
1142/// Methods declared on superclass `MPSKernel`.
1143#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1144impl MPSNNReduceRowMean {
1145    extern_methods!(
1146        /// Called by NSCoder to decode MPSKernels
1147        ///
1148        /// This isn't the right interface to decode a MPSKernel, but
1149        /// it is the one that NSCoder uses. To enable your NSCoder
1150        /// (e.g. NSKeyedUnarchiver) to set which device to use
1151        /// extend the object to adopt the MPSDeviceProvider
1152        /// protocol. Otherwise, the Metal system default device
1153        /// will be used.
1154        ///
1155        /// # Safety
1156        ///
1157        /// `a_decoder` possibly has further requirements.
1158        #[unsafe(method(initWithCoder:))]
1159        #[unsafe(method_family = init)]
1160        pub unsafe fn initWithCoder(
1161            this: Allocated<Self>,
1162            a_decoder: &NSCoder,
1163        ) -> Option<Retained<Self>>;
1164    );
1165}
1166
1167/// Methods declared on superclass `NSObject`.
1168#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1169impl MPSNNReduceRowMean {
1170    extern_methods!(
1171        #[unsafe(method(init))]
1172        #[unsafe(method_family = init)]
1173        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1174
1175        #[unsafe(method(new))]
1176        #[unsafe(method_family = new)]
1177        pub unsafe fn new() -> Retained<Self>;
1178    );
1179}
1180
1181extern_class!(
1182    /// The MPSNNReduceColumnMean performs a reduction operation returning the mean value for each column of an image
1183    ///
1184    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnmean?language=objc)
1185    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1186    #[derive(Debug, PartialEq, Eq, Hash)]
1187    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1188    pub struct MPSNNReduceColumnMean;
1189);
1190
1191#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1192extern_conformance!(
1193    unsafe impl NSCoding for MPSNNReduceColumnMean {}
1194);
1195
1196#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1197extern_conformance!(
1198    unsafe impl NSCopying for MPSNNReduceColumnMean {}
1199);
1200
1201#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1202unsafe impl CopyingHelper for MPSNNReduceColumnMean {
1203    type Result = Self;
1204}
1205
1206#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1207extern_conformance!(
1208    unsafe impl NSObjectProtocol for MPSNNReduceColumnMean {}
1209);
1210
1211#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1212extern_conformance!(
1213    unsafe impl NSSecureCoding for MPSNNReduceColumnMean {}
1214);
1215
1216#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1217impl MPSNNReduceColumnMean {
1218    extern_methods!(
1219        /// Specifies information to apply the reduction operation on an image.
1220        ///
1221        /// Parameter `device`: The device the filter will run on
1222        ///
1223        /// Returns: A valid MPSNNReduceColumnMean object or nil, if failure.
1224        #[unsafe(method(initWithDevice:))]
1225        #[unsafe(method_family = init)]
1226        pub unsafe fn initWithDevice(
1227            this: Allocated<Self>,
1228            device: &ProtocolObject<dyn MTLDevice>,
1229        ) -> Retained<Self>;
1230
1231        /// NSSecureCoding compatability
1232        ///
1233        /// See
1234        /// MPSKernel#initWithCoder.
1235        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1236        ///
1237        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1238        ///
1239        /// Returns: A new MPSNNReduceColumnMean object, or nil if failure.
1240        ///
1241        /// # Safety
1242        ///
1243        /// `a_decoder` possibly has further requirements.
1244        #[unsafe(method(initWithCoder:device:))]
1245        #[unsafe(method_family = init)]
1246        pub unsafe fn initWithCoder_device(
1247            this: Allocated<Self>,
1248            a_decoder: &NSCoder,
1249            device: &ProtocolObject<dyn MTLDevice>,
1250        ) -> Option<Retained<Self>>;
1251    );
1252}
1253
1254/// Methods declared on superclass `MPSKernel`.
1255#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1256impl MPSNNReduceColumnMean {
1257    extern_methods!(
1258        /// Called by NSCoder to decode MPSKernels
1259        ///
1260        /// This isn't the right interface to decode a MPSKernel, but
1261        /// it is the one that NSCoder uses. To enable your NSCoder
1262        /// (e.g. NSKeyedUnarchiver) to set which device to use
1263        /// extend the object to adopt the MPSDeviceProvider
1264        /// protocol. Otherwise, the Metal system default device
1265        /// will be used.
1266        ///
1267        /// # Safety
1268        ///
1269        /// `a_decoder` possibly has further requirements.
1270        #[unsafe(method(initWithCoder:))]
1271        #[unsafe(method_family = init)]
1272        pub unsafe fn initWithCoder(
1273            this: Allocated<Self>,
1274            a_decoder: &NSCoder,
1275        ) -> Option<Retained<Self>>;
1276    );
1277}
1278
1279/// Methods declared on superclass `NSObject`.
1280#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1281impl MPSNNReduceColumnMean {
1282    extern_methods!(
1283        #[unsafe(method(init))]
1284        #[unsafe(method_family = init)]
1285        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1286
1287        #[unsafe(method(new))]
1288        #[unsafe(method_family = new)]
1289        pub unsafe fn new() -> Retained<Self>;
1290    );
1291}
1292
1293extern_class!(
1294    /// The MPSNNReduceFeatureChannelsMean performs a reduction operation returning the mean value for each column of an image
1295    ///
1296    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsmean?language=objc)
1297    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1298    #[derive(Debug, PartialEq, Eq, Hash)]
1299    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1300    pub struct MPSNNReduceFeatureChannelsMean;
1301);
1302
1303#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1304extern_conformance!(
1305    unsafe impl NSCoding for MPSNNReduceFeatureChannelsMean {}
1306);
1307
1308#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1309extern_conformance!(
1310    unsafe impl NSCopying for MPSNNReduceFeatureChannelsMean {}
1311);
1312
1313#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1314unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsMean {
1315    type Result = Self;
1316}
1317
1318#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1319extern_conformance!(
1320    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsMean {}
1321);
1322
1323#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1324extern_conformance!(
1325    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsMean {}
1326);
1327
1328#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1329impl MPSNNReduceFeatureChannelsMean {
1330    extern_methods!(
1331        /// Specifies information to apply the reduction operation on an image.
1332        ///
1333        /// Parameter `device`: The device the filter will run on
1334        ///
1335        /// Returns: A valid MPSNNReduceFeatureChannelsMean object or nil, if failure.
1336        #[unsafe(method(initWithDevice:))]
1337        #[unsafe(method_family = init)]
1338        pub unsafe fn initWithDevice(
1339            this: Allocated<Self>,
1340            device: &ProtocolObject<dyn MTLDevice>,
1341        ) -> Retained<Self>;
1342
1343        /// NSSecureCoding compatability
1344        ///
1345        /// See
1346        /// MPSKernel#initWithCoder.
1347        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1348        ///
1349        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1350        ///
1351        /// Returns: A new MPSNNReduceFeatureChannelsMean object, or nil if failure.
1352        ///
1353        /// # Safety
1354        ///
1355        /// `a_decoder` possibly has further requirements.
1356        #[unsafe(method(initWithCoder:device:))]
1357        #[unsafe(method_family = init)]
1358        pub unsafe fn initWithCoder_device(
1359            this: Allocated<Self>,
1360            a_decoder: &NSCoder,
1361            device: &ProtocolObject<dyn MTLDevice>,
1362        ) -> Option<Retained<Self>>;
1363    );
1364}
1365
1366/// Methods declared on superclass `MPSKernel`.
1367#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1368impl MPSNNReduceFeatureChannelsMean {
1369    extern_methods!(
1370        /// Called by NSCoder to decode MPSKernels
1371        ///
1372        /// This isn't the right interface to decode a MPSKernel, but
1373        /// it is the one that NSCoder uses. To enable your NSCoder
1374        /// (e.g. NSKeyedUnarchiver) to set which device to use
1375        /// extend the object to adopt the MPSDeviceProvider
1376        /// protocol. Otherwise, the Metal system default device
1377        /// will be used.
1378        ///
1379        /// # Safety
1380        ///
1381        /// `a_decoder` possibly has further requirements.
1382        #[unsafe(method(initWithCoder:))]
1383        #[unsafe(method_family = init)]
1384        pub unsafe fn initWithCoder(
1385            this: Allocated<Self>,
1386            a_decoder: &NSCoder,
1387        ) -> Option<Retained<Self>>;
1388    );
1389}
1390
1391/// Methods declared on superclass `NSObject`.
1392#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1393impl MPSNNReduceFeatureChannelsMean {
1394    extern_methods!(
1395        #[unsafe(method(init))]
1396        #[unsafe(method_family = init)]
1397        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1398
1399        #[unsafe(method(new))]
1400        #[unsafe(method_family = new)]
1401        pub unsafe fn new() -> Retained<Self>;
1402    );
1403}
1404
1405extern_class!(
1406    /// The MPSNNReduceRowSum performs a reduction operation returning the sum for each row of an image
1407    ///
1408    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducerowsum?language=objc)
1409    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1410    #[derive(Debug, PartialEq, Eq, Hash)]
1411    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1412    pub struct MPSNNReduceRowSum;
1413);
1414
1415#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1416extern_conformance!(
1417    unsafe impl NSCoding for MPSNNReduceRowSum {}
1418);
1419
1420#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1421extern_conformance!(
1422    unsafe impl NSCopying for MPSNNReduceRowSum {}
1423);
1424
1425#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1426unsafe impl CopyingHelper for MPSNNReduceRowSum {
1427    type Result = Self;
1428}
1429
1430#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1431extern_conformance!(
1432    unsafe impl NSObjectProtocol for MPSNNReduceRowSum {}
1433);
1434
1435#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1436extern_conformance!(
1437    unsafe impl NSSecureCoding for MPSNNReduceRowSum {}
1438);
1439
1440#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1441impl MPSNNReduceRowSum {
1442    extern_methods!(
1443        /// Specifies information to apply the reduction operation on an image.
1444        ///
1445        /// Parameter `device`: The device the filter will run on
1446        ///
1447        /// Returns: A valid MPSNNReduceRowSum object or nil, if failure.
1448        #[unsafe(method(initWithDevice:))]
1449        #[unsafe(method_family = init)]
1450        pub unsafe fn initWithDevice(
1451            this: Allocated<Self>,
1452            device: &ProtocolObject<dyn MTLDevice>,
1453        ) -> Retained<Self>;
1454
1455        /// NSSecureCoding compatability
1456        ///
1457        /// See
1458        /// MPSKernel#initWithCoder.
1459        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1460        ///
1461        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1462        ///
1463        /// Returns: A new MPSNNReduceRowSum object, or nil if failure.
1464        ///
1465        /// # Safety
1466        ///
1467        /// `a_decoder` possibly has further requirements.
1468        #[unsafe(method(initWithCoder:device:))]
1469        #[unsafe(method_family = init)]
1470        pub unsafe fn initWithCoder_device(
1471            this: Allocated<Self>,
1472            a_decoder: &NSCoder,
1473            device: &ProtocolObject<dyn MTLDevice>,
1474        ) -> Option<Retained<Self>>;
1475    );
1476}
1477
1478/// Methods declared on superclass `MPSKernel`.
1479#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1480impl MPSNNReduceRowSum {
1481    extern_methods!(
1482        /// Called by NSCoder to decode MPSKernels
1483        ///
1484        /// This isn't the right interface to decode a MPSKernel, but
1485        /// it is the one that NSCoder uses. To enable your NSCoder
1486        /// (e.g. NSKeyedUnarchiver) to set which device to use
1487        /// extend the object to adopt the MPSDeviceProvider
1488        /// protocol. Otherwise, the Metal system default device
1489        /// will be used.
1490        ///
1491        /// # Safety
1492        ///
1493        /// `a_decoder` possibly has further requirements.
1494        #[unsafe(method(initWithCoder:))]
1495        #[unsafe(method_family = init)]
1496        pub unsafe fn initWithCoder(
1497            this: Allocated<Self>,
1498            a_decoder: &NSCoder,
1499        ) -> Option<Retained<Self>>;
1500    );
1501}
1502
1503/// Methods declared on superclass `NSObject`.
1504#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1505impl MPSNNReduceRowSum {
1506    extern_methods!(
1507        #[unsafe(method(init))]
1508        #[unsafe(method_family = init)]
1509        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1510
1511        #[unsafe(method(new))]
1512        #[unsafe(method_family = new)]
1513        pub unsafe fn new() -> Retained<Self>;
1514    );
1515}
1516
1517extern_class!(
1518    /// The MPSNNReduceColumnSum performs a reduction operation returning the sum for each column of an image
1519    ///
1520    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducecolumnsum?language=objc)
1521    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1522    #[derive(Debug, PartialEq, Eq, Hash)]
1523    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1524    pub struct MPSNNReduceColumnSum;
1525);
1526
1527#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1528extern_conformance!(
1529    unsafe impl NSCoding for MPSNNReduceColumnSum {}
1530);
1531
1532#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1533extern_conformance!(
1534    unsafe impl NSCopying for MPSNNReduceColumnSum {}
1535);
1536
1537#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1538unsafe impl CopyingHelper for MPSNNReduceColumnSum {
1539    type Result = Self;
1540}
1541
1542#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1543extern_conformance!(
1544    unsafe impl NSObjectProtocol for MPSNNReduceColumnSum {}
1545);
1546
1547#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1548extern_conformance!(
1549    unsafe impl NSSecureCoding for MPSNNReduceColumnSum {}
1550);
1551
1552#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1553impl MPSNNReduceColumnSum {
1554    extern_methods!(
1555        /// Specifies information to apply the reduction operation on an image.
1556        ///
1557        /// Parameter `device`: The device the filter will run on
1558        ///
1559        /// Returns: A valid MPSNNReduceColumnSum object or nil, if failure.
1560        #[unsafe(method(initWithDevice:))]
1561        #[unsafe(method_family = init)]
1562        pub unsafe fn initWithDevice(
1563            this: Allocated<Self>,
1564            device: &ProtocolObject<dyn MTLDevice>,
1565        ) -> Retained<Self>;
1566
1567        /// NSSecureCoding compatability
1568        ///
1569        /// See
1570        /// MPSKernel#initWithCoder.
1571        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1572        ///
1573        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1574        ///
1575        /// Returns: A new MPSNNReduceColumnSum object, or nil if failure.
1576        ///
1577        /// # Safety
1578        ///
1579        /// `a_decoder` possibly has further requirements.
1580        #[unsafe(method(initWithCoder:device:))]
1581        #[unsafe(method_family = init)]
1582        pub unsafe fn initWithCoder_device(
1583            this: Allocated<Self>,
1584            a_decoder: &NSCoder,
1585            device: &ProtocolObject<dyn MTLDevice>,
1586        ) -> Option<Retained<Self>>;
1587    );
1588}
1589
1590/// Methods declared on superclass `MPSKernel`.
1591#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1592impl MPSNNReduceColumnSum {
1593    extern_methods!(
1594        /// Called by NSCoder to decode MPSKernels
1595        ///
1596        /// This isn't the right interface to decode a MPSKernel, but
1597        /// it is the one that NSCoder uses. To enable your NSCoder
1598        /// (e.g. NSKeyedUnarchiver) to set which device to use
1599        /// extend the object to adopt the MPSDeviceProvider
1600        /// protocol. Otherwise, the Metal system default device
1601        /// will be used.
1602        ///
1603        /// # Safety
1604        ///
1605        /// `a_decoder` possibly has further requirements.
1606        #[unsafe(method(initWithCoder:))]
1607        #[unsafe(method_family = init)]
1608        pub unsafe fn initWithCoder(
1609            this: Allocated<Self>,
1610            a_decoder: &NSCoder,
1611        ) -> Option<Retained<Self>>;
1612    );
1613}
1614
1615/// Methods declared on superclass `NSObject`.
1616#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1617impl MPSNNReduceColumnSum {
1618    extern_methods!(
1619        #[unsafe(method(init))]
1620        #[unsafe(method_family = init)]
1621        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1622
1623        #[unsafe(method(new))]
1624        #[unsafe(method_family = new)]
1625        pub unsafe fn new() -> Retained<Self>;
1626    );
1627}
1628
1629extern_class!(
1630    /// The MPSNNReduceFeatureChannelsSum performs a reduction operation returning the sum for each column of an image
1631    ///
1632    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelssum?language=objc)
1633    #[unsafe(super(MPSNNReduceUnary, MPSCNNKernel, MPSKernel, NSObject))]
1634    #[derive(Debug, PartialEq, Eq, Hash)]
1635    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1636    pub struct MPSNNReduceFeatureChannelsSum;
1637);
1638
1639#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1640extern_conformance!(
1641    unsafe impl NSCoding for MPSNNReduceFeatureChannelsSum {}
1642);
1643
1644#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1645extern_conformance!(
1646    unsafe impl NSCopying for MPSNNReduceFeatureChannelsSum {}
1647);
1648
1649#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1650unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsSum {
1651    type Result = Self;
1652}
1653
1654#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1655extern_conformance!(
1656    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsSum {}
1657);
1658
1659#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1660extern_conformance!(
1661    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsSum {}
1662);
1663
1664#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1665impl MPSNNReduceFeatureChannelsSum {
1666    extern_methods!(
1667        /// The scale factor to apply to each feature channel value
1668        ///
1669        /// Each feature channel is multiplied by the weight value to compute a weighted sum or mean across feature channels
1670        /// The default value is 1.0.
1671        #[unsafe(method(weight))]
1672        #[unsafe(method_family = none)]
1673        pub unsafe fn weight(&self) -> c_float;
1674
1675        /// Setter for [`weight`][Self::weight].
1676        #[unsafe(method(setWeight:))]
1677        #[unsafe(method_family = none)]
1678        pub unsafe fn setWeight(&self, weight: c_float);
1679
1680        /// Specifies information to apply the reduction operation on an image.
1681        ///
1682        /// Parameter `device`: The device the filter will run on
1683        ///
1684        /// Returns: A valid MPSNNReduceFeatureChannelsSum object or nil, if failure.
1685        #[unsafe(method(initWithDevice:))]
1686        #[unsafe(method_family = init)]
1687        pub unsafe fn initWithDevice(
1688            this: Allocated<Self>,
1689            device: &ProtocolObject<dyn MTLDevice>,
1690        ) -> Retained<Self>;
1691
1692        /// NSSecureCoding compatability
1693        ///
1694        /// See
1695        /// MPSKernel#initWithCoder.
1696        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1697        ///
1698        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1699        ///
1700        /// Returns: A new MPSNNReduceFeatureChannelsSum object, or nil if failure.
1701        ///
1702        /// # Safety
1703        ///
1704        /// `a_decoder` possibly has further requirements.
1705        #[unsafe(method(initWithCoder:device:))]
1706        #[unsafe(method_family = init)]
1707        pub unsafe fn initWithCoder_device(
1708            this: Allocated<Self>,
1709            a_decoder: &NSCoder,
1710            device: &ProtocolObject<dyn MTLDevice>,
1711        ) -> Option<Retained<Self>>;
1712    );
1713}
1714
1715/// Methods declared on superclass `MPSKernel`.
1716#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1717impl MPSNNReduceFeatureChannelsSum {
1718    extern_methods!(
1719        /// Called by NSCoder to decode MPSKernels
1720        ///
1721        /// This isn't the right interface to decode a MPSKernel, but
1722        /// it is the one that NSCoder uses. To enable your NSCoder
1723        /// (e.g. NSKeyedUnarchiver) to set which device to use
1724        /// extend the object to adopt the MPSDeviceProvider
1725        /// protocol. Otherwise, the Metal system default device
1726        /// will be used.
1727        ///
1728        /// # Safety
1729        ///
1730        /// `a_decoder` possibly has further requirements.
1731        #[unsafe(method(initWithCoder:))]
1732        #[unsafe(method_family = init)]
1733        pub unsafe fn initWithCoder(
1734            this: Allocated<Self>,
1735            a_decoder: &NSCoder,
1736        ) -> Option<Retained<Self>>;
1737    );
1738}
1739
1740/// Methods declared on superclass `NSObject`.
1741#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1742impl MPSNNReduceFeatureChannelsSum {
1743    extern_methods!(
1744        #[unsafe(method(init))]
1745        #[unsafe(method_family = init)]
1746        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1747
1748        #[unsafe(method(new))]
1749        #[unsafe(method_family = new)]
1750        pub unsafe fn new() -> Retained<Self>;
1751    );
1752}
1753
1754extern_class!(
1755    /// The MPSNNReduce performs a reduction operation
1756    /// The reduction operations supported are:
1757    /// - Reduce feature channels mean
1758    ///
1759    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducebinary?language=objc)
1760    #[unsafe(super(MPSCNNBinaryKernel, MPSKernel, NSObject))]
1761    #[derive(Debug, PartialEq, Eq, Hash)]
1762    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1763    pub struct MPSNNReduceBinary;
1764);
1765
1766#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1767extern_conformance!(
1768    unsafe impl NSCoding for MPSNNReduceBinary {}
1769);
1770
1771#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1772extern_conformance!(
1773    unsafe impl NSCopying for MPSNNReduceBinary {}
1774);
1775
1776#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1777unsafe impl CopyingHelper for MPSNNReduceBinary {
1778    type Result = Self;
1779}
1780
1781#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1782extern_conformance!(
1783    unsafe impl NSObjectProtocol for MPSNNReduceBinary {}
1784);
1785
1786#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1787extern_conformance!(
1788    unsafe impl NSSecureCoding for MPSNNReduceBinary {}
1789);
1790
1791#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1792impl MPSNNReduceBinary {
1793    extern_methods!(
1794        /// The source rectangle to use when reading data from primary source
1795        ///
1796        /// A MTLRegion that indicates which part of the primary source to read. If the clipRectPrimarySource does not lie
1797        /// completely within the primary source image, the intersection of the image bounds and clipRectPrimarySource will
1798        /// be used. The primarySourceClipRect replaces the MPSBinaryImageKernel primaryOffset parameter for this filter.
1799        /// The latter is ignored.   Default: MPSRectNoClip, use the entire source texture.
1800        ///
1801        /// The clipRect specified in MPSBinaryImageKernel is used to control the origin in the destination texture
1802        /// where the min, max values are written.  The clipRect.width must be >=2.  The clipRect.height must be >= 1.
1803        #[unsafe(method(primarySourceClipRect))]
1804        #[unsafe(method_family = none)]
1805        pub unsafe fn primarySourceClipRect(&self) -> MTLRegion;
1806
1807        /// Setter for [`primarySourceClipRect`][Self::primarySourceClipRect].
1808        #[unsafe(method(setPrimarySourceClipRect:))]
1809        #[unsafe(method_family = none)]
1810        pub unsafe fn setPrimarySourceClipRect(&self, primary_source_clip_rect: MTLRegion);
1811
1812        /// The source rectangle to use when reading data from secondary source
1813        ///
1814        /// A MTLRegion that indicates which part of the secondary source to read. If the clipRectSecondarySource does not lie
1815        /// completely within the secondary source image, the intersection of the image bounds and clipRectSecondarySource will
1816        /// be used. The secondarySourceClipRect replaces the MPSBinaryImageKernel secondaryOffset parameter for this filter.
1817        /// The latter is ignored.   Default: MPSRectNoClip, use the entire source texture.
1818        ///
1819        /// The clipRect specified in MPSBinaryImageKernel is used to control the origin in the destination texture
1820        /// where the min, max values are written.  The clipRect.width must be >=2.  The clipRect.height must be >= 1.
1821        #[unsafe(method(secondarySourceClipRect))]
1822        #[unsafe(method_family = none)]
1823        pub unsafe fn secondarySourceClipRect(&self) -> MTLRegion;
1824
1825        /// Setter for [`secondarySourceClipRect`][Self::secondarySourceClipRect].
1826        #[unsafe(method(setSecondarySourceClipRect:))]
1827        #[unsafe(method_family = none)]
1828        pub unsafe fn setSecondarySourceClipRect(&self, secondary_source_clip_rect: MTLRegion);
1829
1830        #[cfg(feature = "MPSCoreTypes")]
1831        /// Since the clipRectSource replaces the MPSCNNKernel offset parameter for this filter,
1832        /// this property is deprecated..
1833        #[deprecated]
1834        #[unsafe(method(primaryOffset))]
1835        #[unsafe(method_family = none)]
1836        pub unsafe fn primaryOffset(&self) -> MPSOffset;
1837
1838        #[cfg(feature = "MPSCoreTypes")]
1839        /// Setter for [`primaryOffset`][Self::primaryOffset].
1840        #[deprecated]
1841        #[unsafe(method(setPrimaryOffset:))]
1842        #[unsafe(method_family = none)]
1843        pub unsafe fn setPrimaryOffset(&self, primary_offset: MPSOffset);
1844
1845        #[cfg(feature = "MPSCoreTypes")]
1846        /// Since the clipRectSource replaces the MPSCNNKernel offset parameter for this filter,
1847        /// this property is deprecated..
1848        #[deprecated]
1849        #[unsafe(method(secondaryOffset))]
1850        #[unsafe(method_family = none)]
1851        pub unsafe fn secondaryOffset(&self) -> MPSOffset;
1852
1853        #[cfg(feature = "MPSCoreTypes")]
1854        /// Setter for [`secondaryOffset`][Self::secondaryOffset].
1855        #[deprecated]
1856        #[unsafe(method(setSecondaryOffset:))]
1857        #[unsafe(method_family = none)]
1858        pub unsafe fn setSecondaryOffset(&self, secondary_offset: MPSOffset);
1859
1860        #[unsafe(method(initWithDevice:))]
1861        #[unsafe(method_family = init)]
1862        pub unsafe fn initWithDevice(
1863            this: Allocated<Self>,
1864            device: &ProtocolObject<dyn MTLDevice>,
1865        ) -> Retained<Self>;
1866    );
1867}
1868
1869/// Methods declared on superclass `MPSCNNBinaryKernel`.
1870#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1871impl MPSNNReduceBinary {
1872    extern_methods!(
1873        /// NSSecureCoding compatability
1874        ///
1875        /// While the standard NSSecureCoding/NSCoding method
1876        /// -initWithCoder: should work, since the file can't
1877        /// know which device your data is allocated on, we
1878        /// have to guess and may guess incorrectly.  To avoid
1879        /// that problem, use initWithCoder:device instead.
1880        ///
1881        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
1882        ///
1883        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
1884        ///
1885        /// Returns: A new MPSKernel object, or nil if failure.
1886        ///
1887        /// # Safety
1888        ///
1889        /// `a_decoder` possibly has further requirements.
1890        #[unsafe(method(initWithCoder:device:))]
1891        #[unsafe(method_family = init)]
1892        pub unsafe fn initWithCoder_device(
1893            this: Allocated<Self>,
1894            a_decoder: &NSCoder,
1895            device: &ProtocolObject<dyn MTLDevice>,
1896        ) -> Option<Retained<Self>>;
1897    );
1898}
1899
1900/// Methods declared on superclass `MPSKernel`.
1901#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1902impl MPSNNReduceBinary {
1903    extern_methods!(
1904        /// Called by NSCoder to decode MPSKernels
1905        ///
1906        /// This isn't the right interface to decode a MPSKernel, but
1907        /// it is the one that NSCoder uses. To enable your NSCoder
1908        /// (e.g. NSKeyedUnarchiver) to set which device to use
1909        /// extend the object to adopt the MPSDeviceProvider
1910        /// protocol. Otherwise, the Metal system default device
1911        /// will be used.
1912        ///
1913        /// # Safety
1914        ///
1915        /// `a_decoder` possibly has further requirements.
1916        #[unsafe(method(initWithCoder:))]
1917        #[unsafe(method_family = init)]
1918        pub unsafe fn initWithCoder(
1919            this: Allocated<Self>,
1920            a_decoder: &NSCoder,
1921        ) -> Option<Retained<Self>>;
1922    );
1923}
1924
1925/// Methods declared on superclass `NSObject`.
1926#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1927impl MPSNNReduceBinary {
1928    extern_methods!(
1929        #[unsafe(method(init))]
1930        #[unsafe(method_family = init)]
1931        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1932
1933        #[unsafe(method(new))]
1934        #[unsafe(method_family = new)]
1935        pub unsafe fn new() -> Retained<Self>;
1936    );
1937}
1938
1939extern_class!(
1940    /// [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightsmean?language=objc)
1941    #[unsafe(super(MPSNNReduceBinary, MPSCNNBinaryKernel, MPSKernel, NSObject))]
1942    #[derive(Debug, PartialEq, Eq, Hash)]
1943    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1944    pub struct MPSNNReduceFeatureChannelsAndWeightsMean;
1945);
1946
1947#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1948extern_conformance!(
1949    unsafe impl NSCoding for MPSNNReduceFeatureChannelsAndWeightsMean {}
1950);
1951
1952#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1953extern_conformance!(
1954    unsafe impl NSCopying for MPSNNReduceFeatureChannelsAndWeightsMean {}
1955);
1956
1957#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1958unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsAndWeightsMean {
1959    type Result = Self;
1960}
1961
1962#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1963extern_conformance!(
1964    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsAndWeightsMean {}
1965);
1966
1967#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1968extern_conformance!(
1969    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsAndWeightsMean {}
1970);
1971
1972#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
1973impl MPSNNReduceFeatureChannelsAndWeightsMean {
1974    extern_methods!(
1975        /// Specifies information to apply the reduction operation on an image.
1976        ///
1977        /// Parameter `device`: The device the filter will run on
1978        ///
1979        /// Returns: A valid MPSNNReduceFeatureChannelsAndWeightsMean object or nil, if failure.
1980        #[unsafe(method(initWithDevice:))]
1981        #[unsafe(method_family = init)]
1982        pub unsafe fn initWithDevice(
1983            this: Allocated<Self>,
1984            device: &ProtocolObject<dyn MTLDevice>,
1985        ) -> Retained<Self>;
1986
1987        /// NSSecureCoding compatability
1988        ///
1989        /// See
1990        /// MPSKernel#initWithCoder.
1991        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
1992        ///
1993        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
1994        ///
1995        /// Returns: A new MPSCNNPooling object, or nil if failure.
1996        ///
1997        /// # Safety
1998        ///
1999        /// `a_decoder` possibly has further requirements.
2000        #[unsafe(method(initWithCoder:device:))]
2001        #[unsafe(method_family = init)]
2002        pub unsafe fn initWithCoder_device(
2003            this: Allocated<Self>,
2004            a_decoder: &NSCoder,
2005            device: &ProtocolObject<dyn MTLDevice>,
2006        ) -> Option<Retained<Self>>;
2007    );
2008}
2009
2010/// Methods declared on superclass `MPSKernel`.
2011#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2012impl MPSNNReduceFeatureChannelsAndWeightsMean {
2013    extern_methods!(
2014        /// Called by NSCoder to decode MPSKernels
2015        ///
2016        /// This isn't the right interface to decode a MPSKernel, but
2017        /// it is the one that NSCoder uses. To enable your NSCoder
2018        /// (e.g. NSKeyedUnarchiver) to set which device to use
2019        /// extend the object to adopt the MPSDeviceProvider
2020        /// protocol. Otherwise, the Metal system default device
2021        /// will be used.
2022        ///
2023        /// # Safety
2024        ///
2025        /// `a_decoder` possibly has further requirements.
2026        #[unsafe(method(initWithCoder:))]
2027        #[unsafe(method_family = init)]
2028        pub unsafe fn initWithCoder(
2029            this: Allocated<Self>,
2030            a_decoder: &NSCoder,
2031        ) -> Option<Retained<Self>>;
2032    );
2033}
2034
2035/// Methods declared on superclass `NSObject`.
2036#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2037impl MPSNNReduceFeatureChannelsAndWeightsMean {
2038    extern_methods!(
2039        #[unsafe(method(init))]
2040        #[unsafe(method_family = init)]
2041        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2042
2043        #[unsafe(method(new))]
2044        #[unsafe(method_family = new)]
2045        pub unsafe fn new() -> Retained<Self>;
2046    );
2047}
2048
2049extern_class!(
2050    /// [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnreducefeaturechannelsandweightssum?language=objc)
2051    #[unsafe(super(MPSNNReduceBinary, MPSCNNBinaryKernel, MPSKernel, NSObject))]
2052    #[derive(Debug, PartialEq, Eq, Hash)]
2053    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2054    pub struct MPSNNReduceFeatureChannelsAndWeightsSum;
2055);
2056
2057#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2058extern_conformance!(
2059    unsafe impl NSCoding for MPSNNReduceFeatureChannelsAndWeightsSum {}
2060);
2061
2062#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2063extern_conformance!(
2064    unsafe impl NSCopying for MPSNNReduceFeatureChannelsAndWeightsSum {}
2065);
2066
2067#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2068unsafe impl CopyingHelper for MPSNNReduceFeatureChannelsAndWeightsSum {
2069    type Result = Self;
2070}
2071
2072#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2073extern_conformance!(
2074    unsafe impl NSObjectProtocol for MPSNNReduceFeatureChannelsAndWeightsSum {}
2075);
2076
2077#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2078extern_conformance!(
2079    unsafe impl NSSecureCoding for MPSNNReduceFeatureChannelsAndWeightsSum {}
2080);
2081
2082#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2083impl MPSNNReduceFeatureChannelsAndWeightsSum {
2084    extern_methods!(
2085        /// A boolean to indicate whether the reduction should perform a weighted sum of feature channels with non-zero weights
2086        ///
2087        /// If false, computes a dot product of the feature channels and weights.
2088        /// If true, computes a dot product of the feature channels and weights divided by the number of non-zero weights
2089        #[unsafe(method(doWeightedSumByNonZeroWeights))]
2090        #[unsafe(method_family = none)]
2091        pub unsafe fn doWeightedSumByNonZeroWeights(&self) -> bool;
2092
2093        /// Specifies information to apply the reduction operation on an image.
2094        ///
2095        /// Parameter `device`: The device the filter will run on
2096        ///
2097        /// Returns: A valid MPSNNReduceFeatureChannelsAndWeightsMean object or nil, if failure.
2098        #[unsafe(method(initWithDevice:))]
2099        #[unsafe(method_family = init)]
2100        pub unsafe fn initWithDevice(
2101            this: Allocated<Self>,
2102            device: &ProtocolObject<dyn MTLDevice>,
2103        ) -> Retained<Self>;
2104
2105        /// Specifies information to apply the reduction operation on an image.
2106        ///
2107        /// Parameter `device`: The device the filter will run on
2108        ///
2109        /// Parameter `doWeightedSumByNonZeroWeights`: A boolean to indicate whether to compute a weighted sum or
2110        /// weighted sum divided by the number of non-zero weights
2111        ///
2112        /// Returns: A valid MPSNNReduceFeatureChannelsAndWeightsSum object or nil, if failure.
2113        #[unsafe(method(initWithDevice:doWeightedSumByNonZeroWeights:))]
2114        #[unsafe(method_family = init)]
2115        pub unsafe fn initWithDevice_doWeightedSumByNonZeroWeights(
2116            this: Allocated<Self>,
2117            device: &ProtocolObject<dyn MTLDevice>,
2118            do_weighted_sum_by_non_zero_weights: bool,
2119        ) -> Retained<Self>;
2120
2121        /// NSSecureCoding compatability
2122        ///
2123        /// See
2124        /// MPSKernel#initWithCoder.
2125        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
2126        ///
2127        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
2128        ///
2129        /// Returns: A new MPSCNNPooling object, or nil if failure.
2130        ///
2131        /// # Safety
2132        ///
2133        /// `a_decoder` possibly has further requirements.
2134        #[unsafe(method(initWithCoder:device:))]
2135        #[unsafe(method_family = init)]
2136        pub unsafe fn initWithCoder_device(
2137            this: Allocated<Self>,
2138            a_decoder: &NSCoder,
2139            device: &ProtocolObject<dyn MTLDevice>,
2140        ) -> Option<Retained<Self>>;
2141    );
2142}
2143
2144/// Methods declared on superclass `MPSKernel`.
2145#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2146impl MPSNNReduceFeatureChannelsAndWeightsSum {
2147    extern_methods!(
2148        /// Called by NSCoder to decode MPSKernels
2149        ///
2150        /// This isn't the right interface to decode a MPSKernel, but
2151        /// it is the one that NSCoder uses. To enable your NSCoder
2152        /// (e.g. NSKeyedUnarchiver) to set which device to use
2153        /// extend the object to adopt the MPSDeviceProvider
2154        /// protocol. Otherwise, the Metal system default device
2155        /// will be used.
2156        ///
2157        /// # Safety
2158        ///
2159        /// `a_decoder` possibly has further requirements.
2160        #[unsafe(method(initWithCoder:))]
2161        #[unsafe(method_family = init)]
2162        pub unsafe fn initWithCoder(
2163            this: Allocated<Self>,
2164            a_decoder: &NSCoder,
2165        ) -> Option<Retained<Self>>;
2166    );
2167}
2168
2169/// Methods declared on superclass `NSObject`.
2170#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2171impl MPSNNReduceFeatureChannelsAndWeightsSum {
2172    extern_methods!(
2173        #[unsafe(method(init))]
2174        #[unsafe(method_family = init)]
2175        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2176
2177        #[unsafe(method(new))]
2178        #[unsafe(method_family = new)]
2179        pub unsafe fn new() -> Retained<Self>;
2180    );
2181}
2182
2183extern_class!(
2184    /// The MPSNNLocalCorrelation filter computes the correlation between two images locally with a
2185    /// varying offset on x-y plane between the two source images (controlled by the window and
2186    /// stride properties) and the end result is summed over the feature channels. The results are
2187    /// stored in the different feature channels of the destination image, ordered such that the offset
2188    /// in the x direction is the faster running index.
2189    ///
2190    /// Given two images A and B, the output image has (2*windowInX + 1)*(2*windowInY + 1)
2191    /// feature channels, with each feature channel computed as:
2192    /// O(x, y, f(m, n)) = sum_z{A(x, y, z) * B(x + M[m], y + N[n], z)}
2193    /// where m runs from {0, 1, ... , (2*windowInX)}, n runs from {0, 1, ... , (2*windowInY)},
2194    /// f(m, n) = n * (2*windowInY + 1) + m,
2195    /// M = {-windowInX*strideInX, (-windowInX + 1)*strideInX,  ... 0 ... , (windowInX - 1)*strideInX, windowInX*strideInX},
2196    /// N = {-windowInY*strideInY, (-windowInY + 1)*strideInY,  ... 0 ... , (windowInY - 1)*strideInY, windowInX*strideInY}
2197    ///
2198    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsnnlocalcorrelation?language=objc)
2199    #[unsafe(super(MPSNNReduceBinary, MPSCNNBinaryKernel, MPSKernel, NSObject))]
2200    #[derive(Debug, PartialEq, Eq, Hash)]
2201    #[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2202    pub struct MPSNNLocalCorrelation;
2203);
2204
2205#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2206extern_conformance!(
2207    unsafe impl NSCoding for MPSNNLocalCorrelation {}
2208);
2209
2210#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2211extern_conformance!(
2212    unsafe impl NSCopying for MPSNNLocalCorrelation {}
2213);
2214
2215#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2216unsafe impl CopyingHelper for MPSNNLocalCorrelation {
2217    type Result = Self;
2218}
2219
2220#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2221extern_conformance!(
2222    unsafe impl NSObjectProtocol for MPSNNLocalCorrelation {}
2223);
2224
2225#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2226extern_conformance!(
2227    unsafe impl NSSecureCoding for MPSNNLocalCorrelation {}
2228);
2229
2230#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2231impl MPSNNLocalCorrelation {
2232    extern_methods!(
2233        /// Specifies a symmetric window around 0 for offsetting the secondary source in the x dimension.
2234        ///
2235        /// The default value for windowInX is 0.
2236        #[unsafe(method(windowInX))]
2237        #[unsafe(method_family = none)]
2238        pub unsafe fn windowInX(&self) -> NSUInteger;
2239
2240        /// Setter for [`windowInX`][Self::windowInX].
2241        #[unsafe(method(setWindowInX:))]
2242        #[unsafe(method_family = none)]
2243        pub unsafe fn setWindowInX(&self, window_in_x: NSUInteger);
2244
2245        /// Specifies a symmetric window around 0 for offsetting the secondary source in the y dimension.
2246        ///
2247        /// The default value for windowInY is 0.
2248        #[unsafe(method(windowInY))]
2249        #[unsafe(method_family = none)]
2250        pub unsafe fn windowInY(&self) -> NSUInteger;
2251
2252        /// Setter for [`windowInY`][Self::windowInY].
2253        #[unsafe(method(setWindowInY:))]
2254        #[unsafe(method_family = none)]
2255        pub unsafe fn setWindowInY(&self, window_in_y: NSUInteger);
2256
2257        /// Specifies the stride for the offset in the x dimension.
2258        ///
2259        /// strideInX must be > 0. The default value for strideInX is 1.
2260        #[unsafe(method(strideInX))]
2261        #[unsafe(method_family = none)]
2262        pub unsafe fn strideInX(&self) -> NSUInteger;
2263
2264        /// Setter for [`strideInX`][Self::strideInX].
2265        #[unsafe(method(setStrideInX:))]
2266        #[unsafe(method_family = none)]
2267        pub unsafe fn setStrideInX(&self, stride_in_x: NSUInteger);
2268
2269        /// Specifies the stride for the offset in the y dimension.
2270        ///
2271        /// strideInY must be > 0. The default value for strideInY is 1.
2272        #[unsafe(method(strideInY))]
2273        #[unsafe(method_family = none)]
2274        pub unsafe fn strideInY(&self) -> NSUInteger;
2275
2276        /// Setter for [`strideInY`][Self::strideInY].
2277        #[unsafe(method(setStrideInY:))]
2278        #[unsafe(method_family = none)]
2279        pub unsafe fn setStrideInY(&self, stride_in_y: NSUInteger);
2280
2281        /// Initialize the MPSNNLocalCorrelation filter with default property values.
2282        ///
2283        /// Parameter `device`: The device the filter will run on
2284        ///
2285        /// Returns: A valid MPSNNReduceLocalCorrelation object or nil, if failure.
2286        #[unsafe(method(initWithDevice:))]
2287        #[unsafe(method_family = init)]
2288        pub unsafe fn initWithDevice(
2289            this: Allocated<Self>,
2290            device: &ProtocolObject<dyn MTLDevice>,
2291        ) -> Retained<Self>;
2292
2293        /// Specifies information to apply the local correlation operation on an image.
2294        ///
2295        /// Parameter `device`: The device the filter will run on
2296        ///
2297        /// Parameter `windowInX`: Specifies a symmetric window around 0 for offsetting
2298        /// the secondary source in the x dimension.
2299        ///
2300        /// Parameter `windowInY`: Specifies a symmetric window around 0 for offsetting
2301        /// the secondary source in the y dimension.
2302        ///
2303        /// Parameter `strideInX`: Specifies the stride for the offset in the x dimension.
2304        ///
2305        /// Parameter `strideInY`: Specifies the stride for the offset in the y dimension.
2306        ///
2307        /// Returns: A valid MPSNNReduceLocalCorrelation object or nil, if failure.
2308        #[unsafe(method(initWithDevice:windowInX:windowInY:strideInX:strideInY:))]
2309        #[unsafe(method_family = init)]
2310        pub unsafe fn initWithDevice_windowInX_windowInY_strideInX_strideInY(
2311            this: Allocated<Self>,
2312            device: &ProtocolObject<dyn MTLDevice>,
2313            window_in_x: NSUInteger,
2314            window_in_y: NSUInteger,
2315            stride_in_x: NSUInteger,
2316            stride_in_y: NSUInteger,
2317        ) -> Retained<Self>;
2318
2319        /// NSSecureCoding compatability
2320        ///
2321        /// See
2322        /// MPSKernel#initWithCoder.
2323        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSCNNPooling
2324        ///
2325        /// Parameter `device`: The MTLDevice on which to make the MPSCNNPooling
2326        ///
2327        /// Returns: A new MPSCNNPooling object, or nil if failure.
2328        ///
2329        /// # Safety
2330        ///
2331        /// `a_decoder` possibly has further requirements.
2332        #[unsafe(method(initWithCoder:device:))]
2333        #[unsafe(method_family = init)]
2334        pub unsafe fn initWithCoder_device(
2335            this: Allocated<Self>,
2336            a_decoder: &NSCoder,
2337            device: &ProtocolObject<dyn MTLDevice>,
2338        ) -> Option<Retained<Self>>;
2339    );
2340}
2341
2342/// Methods declared on superclass `MPSKernel`.
2343#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2344impl MPSNNLocalCorrelation {
2345    extern_methods!(
2346        /// Called by NSCoder to decode MPSKernels
2347        ///
2348        /// This isn't the right interface to decode a MPSKernel, but
2349        /// it is the one that NSCoder uses. To enable your NSCoder
2350        /// (e.g. NSKeyedUnarchiver) to set which device to use
2351        /// extend the object to adopt the MPSDeviceProvider
2352        /// protocol. Otherwise, the Metal system default device
2353        /// will be used.
2354        ///
2355        /// # Safety
2356        ///
2357        /// `a_decoder` possibly has further requirements.
2358        #[unsafe(method(initWithCoder:))]
2359        #[unsafe(method_family = init)]
2360        pub unsafe fn initWithCoder(
2361            this: Allocated<Self>,
2362            a_decoder: &NSCoder,
2363        ) -> Option<Retained<Self>>;
2364    );
2365}
2366
2367/// Methods declared on superclass `NSObject`.
2368#[cfg(all(feature = "MPSCNNKernel", feature = "MPSCore", feature = "MPSKernel"))]
2369impl MPSNNLocalCorrelation {
2370    extern_methods!(
2371        #[unsafe(method(init))]
2372        #[unsafe(method_family = init)]
2373        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
2374
2375        #[unsafe(method(new))]
2376        #[unsafe(method_family = new)]
2377        pub unsafe fn new() -> Retained<Self>;
2378    );
2379}