objc2_metal_performance_shaders/generated/MPSImage/
MPSImageReduce.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 MPSImageReduce performs a reduction operation
13    /// The reduction operations supported are:
14    /// - Reduce row min
15    /// - Reduce column min
16    /// - Reduce row max
17    /// - Reduce column max
18    /// - Reduce row mean
19    /// - Reduce column mean
20    /// - Reduce row sum
21    /// - Reduce column sum
22    ///
23    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereduceunary?language=objc)
24    #[unsafe(super(MPSUnaryImageKernel, MPSKernel, NSObject))]
25    #[derive(Debug, PartialEq, Eq, Hash)]
26    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
27    pub struct MPSImageReduceUnary;
28);
29
30#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
31extern_conformance!(
32    unsafe impl NSCoding for MPSImageReduceUnary {}
33);
34
35#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
36extern_conformance!(
37    unsafe impl NSCopying for MPSImageReduceUnary {}
38);
39
40#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
41unsafe impl CopyingHelper for MPSImageReduceUnary {
42    type Result = Self;
43}
44
45#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
46extern_conformance!(
47    unsafe impl NSObjectProtocol for MPSImageReduceUnary {}
48);
49
50#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
51extern_conformance!(
52    unsafe impl NSSecureCoding for MPSImageReduceUnary {}
53);
54
55#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
56impl MPSImageReduceUnary {
57    extern_methods!(
58        /// The source rectangle to use when reading data.
59        ///
60        /// A MTLRegion that indicates which part of the source to read. If the clipRectSource does not lie
61        /// completely within the source image, the intersection of the image bounds and clipRectSource will
62        /// be used. The clipRectSource replaces the MPSUnaryImageKernel offset parameter for this filter.
63        /// The latter is ignored.   Default: MPSRectNoClip, use the entire source texture.
64        ///
65        /// The clipRect specified in MPSUnaryImageKernel is used to control the origin in the destination texture
66        /// where the min, max values are written.  The clipRect.width must be >=2.  The clipRect.height must be >= 1.
67        #[unsafe(method(clipRectSource))]
68        #[unsafe(method_family = none)]
69        pub unsafe fn clipRectSource(&self) -> MTLRegion;
70
71        /// Setter for [`clipRectSource`][Self::clipRectSource].
72        #[unsafe(method(setClipRectSource:))]
73        #[unsafe(method_family = none)]
74        pub unsafe fn setClipRectSource(&self, clip_rect_source: MTLRegion);
75
76        #[unsafe(method(initWithDevice:))]
77        #[unsafe(method_family = init)]
78        pub unsafe fn initWithDevice(
79            this: Allocated<Self>,
80            device: &ProtocolObject<dyn MTLDevice>,
81        ) -> Retained<Self>;
82    );
83}
84
85/// Methods declared on superclass `MPSUnaryImageKernel`.
86#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
87impl MPSImageReduceUnary {
88    extern_methods!(
89        /// NSSecureCoding compatability
90        ///
91        /// While the standard NSSecureCoding/NSCoding method
92        /// -initWithCoder: should work, since the file can't
93        /// know which device your data is allocated on, we
94        /// have to guess and may guess incorrectly.  To avoid
95        /// that problem, use initWithCoder:device instead.
96        ///
97        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
98        ///
99        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
100        ///
101        /// Returns: A new MPSKernel object, or nil if failure.
102        ///
103        /// # Safety
104        ///
105        /// `a_decoder` possibly has further requirements.
106        #[unsafe(method(initWithCoder:device:))]
107        #[unsafe(method_family = init)]
108        pub unsafe fn initWithCoder_device(
109            this: Allocated<Self>,
110            a_decoder: &NSCoder,
111            device: &ProtocolObject<dyn MTLDevice>,
112        ) -> Option<Retained<Self>>;
113    );
114}
115
116/// Methods declared on superclass `MPSKernel`.
117#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
118impl MPSImageReduceUnary {
119    extern_methods!(
120        /// Called by NSCoder to decode MPSKernels
121        ///
122        /// This isn't the right interface to decode a MPSKernel, but
123        /// it is the one that NSCoder uses. To enable your NSCoder
124        /// (e.g. NSKeyedUnarchiver) to set which device to use
125        /// extend the object to adopt the MPSDeviceProvider
126        /// protocol. Otherwise, the Metal system default device
127        /// will be used.
128        ///
129        /// # Safety
130        ///
131        /// `a_decoder` possibly has further requirements.
132        #[unsafe(method(initWithCoder:))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn initWithCoder(
135            this: Allocated<Self>,
136            a_decoder: &NSCoder,
137        ) -> Option<Retained<Self>>;
138    );
139}
140
141/// Methods declared on superclass `NSObject`.
142#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
143impl MPSImageReduceUnary {
144    extern_methods!(
145        #[unsafe(method(init))]
146        #[unsafe(method_family = init)]
147        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
148
149        #[unsafe(method(new))]
150        #[unsafe(method_family = new)]
151        pub unsafe fn new() -> Retained<Self>;
152    );
153}
154
155extern_class!(
156    /// The MPSImageReduceRowMin performs a reduction operation returning the mininmum value for each row of an image
157    ///
158    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmin?language=objc)
159    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
160    #[derive(Debug, PartialEq, Eq, Hash)]
161    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
162    pub struct MPSImageReduceRowMin;
163);
164
165#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
166extern_conformance!(
167    unsafe impl NSCoding for MPSImageReduceRowMin {}
168);
169
170#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
171extern_conformance!(
172    unsafe impl NSCopying for MPSImageReduceRowMin {}
173);
174
175#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
176unsafe impl CopyingHelper for MPSImageReduceRowMin {
177    type Result = Self;
178}
179
180#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
181extern_conformance!(
182    unsafe impl NSObjectProtocol for MPSImageReduceRowMin {}
183);
184
185#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
186extern_conformance!(
187    unsafe impl NSSecureCoding for MPSImageReduceRowMin {}
188);
189
190#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
191impl MPSImageReduceRowMin {
192    extern_methods!(
193        /// Specifies information to apply the reduction operation on an image.
194        ///
195        /// Parameter `device`: The device the filter will run on
196        ///
197        /// Returns: A valid MPSImageReduce object or nil, if failure.
198        #[unsafe(method(initWithDevice:))]
199        #[unsafe(method_family = init)]
200        pub unsafe fn initWithDevice(
201            this: Allocated<Self>,
202            device: &ProtocolObject<dyn MTLDevice>,
203        ) -> Retained<Self>;
204    );
205}
206
207/// Methods declared on superclass `MPSUnaryImageKernel`.
208#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
209impl MPSImageReduceRowMin {
210    extern_methods!(
211        /// NSSecureCoding compatability
212        ///
213        /// While the standard NSSecureCoding/NSCoding method
214        /// -initWithCoder: should work, since the file can't
215        /// know which device your data is allocated on, we
216        /// have to guess and may guess incorrectly.  To avoid
217        /// that problem, use initWithCoder:device instead.
218        ///
219        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
220        ///
221        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
222        ///
223        /// Returns: A new MPSKernel object, or nil if failure.
224        ///
225        /// # Safety
226        ///
227        /// `a_decoder` possibly has further requirements.
228        #[unsafe(method(initWithCoder:device:))]
229        #[unsafe(method_family = init)]
230        pub unsafe fn initWithCoder_device(
231            this: Allocated<Self>,
232            a_decoder: &NSCoder,
233            device: &ProtocolObject<dyn MTLDevice>,
234        ) -> Option<Retained<Self>>;
235    );
236}
237
238/// Methods declared on superclass `MPSKernel`.
239#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
240impl MPSImageReduceRowMin {
241    extern_methods!(
242        /// Called by NSCoder to decode MPSKernels
243        ///
244        /// This isn't the right interface to decode a MPSKernel, but
245        /// it is the one that NSCoder uses. To enable your NSCoder
246        /// (e.g. NSKeyedUnarchiver) to set which device to use
247        /// extend the object to adopt the MPSDeviceProvider
248        /// protocol. Otherwise, the Metal system default device
249        /// will be used.
250        ///
251        /// # Safety
252        ///
253        /// `a_decoder` possibly has further requirements.
254        #[unsafe(method(initWithCoder:))]
255        #[unsafe(method_family = init)]
256        pub unsafe fn initWithCoder(
257            this: Allocated<Self>,
258            a_decoder: &NSCoder,
259        ) -> Option<Retained<Self>>;
260    );
261}
262
263/// Methods declared on superclass `NSObject`.
264#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
265impl MPSImageReduceRowMin {
266    extern_methods!(
267        #[unsafe(method(init))]
268        #[unsafe(method_family = init)]
269        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
270
271        #[unsafe(method(new))]
272        #[unsafe(method_family = new)]
273        pub unsafe fn new() -> Retained<Self>;
274    );
275}
276
277extern_class!(
278    /// The MPSImageReduceColumnMin performs a reduction operation returning the mininmum value for each column of an image
279    ///
280    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmin?language=objc)
281    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
282    #[derive(Debug, PartialEq, Eq, Hash)]
283    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
284    pub struct MPSImageReduceColumnMin;
285);
286
287#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
288extern_conformance!(
289    unsafe impl NSCoding for MPSImageReduceColumnMin {}
290);
291
292#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
293extern_conformance!(
294    unsafe impl NSCopying for MPSImageReduceColumnMin {}
295);
296
297#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
298unsafe impl CopyingHelper for MPSImageReduceColumnMin {
299    type Result = Self;
300}
301
302#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
303extern_conformance!(
304    unsafe impl NSObjectProtocol for MPSImageReduceColumnMin {}
305);
306
307#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
308extern_conformance!(
309    unsafe impl NSSecureCoding for MPSImageReduceColumnMin {}
310);
311
312#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
313impl MPSImageReduceColumnMin {
314    extern_methods!(
315        /// Specifies information to apply the reduction operation on an image.
316        ///
317        /// Parameter `device`: The device the filter will run on
318        ///
319        /// Returns: A valid MPSImageReduce object or nil, if failure.
320        #[unsafe(method(initWithDevice:))]
321        #[unsafe(method_family = init)]
322        pub unsafe fn initWithDevice(
323            this: Allocated<Self>,
324            device: &ProtocolObject<dyn MTLDevice>,
325        ) -> Retained<Self>;
326    );
327}
328
329/// Methods declared on superclass `MPSUnaryImageKernel`.
330#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
331impl MPSImageReduceColumnMin {
332    extern_methods!(
333        /// NSSecureCoding compatability
334        ///
335        /// While the standard NSSecureCoding/NSCoding method
336        /// -initWithCoder: should work, since the file can't
337        /// know which device your data is allocated on, we
338        /// have to guess and may guess incorrectly.  To avoid
339        /// that problem, use initWithCoder:device instead.
340        ///
341        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
342        ///
343        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
344        ///
345        /// Returns: A new MPSKernel object, or nil if failure.
346        ///
347        /// # Safety
348        ///
349        /// `a_decoder` possibly has further requirements.
350        #[unsafe(method(initWithCoder:device:))]
351        #[unsafe(method_family = init)]
352        pub unsafe fn initWithCoder_device(
353            this: Allocated<Self>,
354            a_decoder: &NSCoder,
355            device: &ProtocolObject<dyn MTLDevice>,
356        ) -> Option<Retained<Self>>;
357    );
358}
359
360/// Methods declared on superclass `MPSKernel`.
361#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
362impl MPSImageReduceColumnMin {
363    extern_methods!(
364        /// Called by NSCoder to decode MPSKernels
365        ///
366        /// This isn't the right interface to decode a MPSKernel, but
367        /// it is the one that NSCoder uses. To enable your NSCoder
368        /// (e.g. NSKeyedUnarchiver) to set which device to use
369        /// extend the object to adopt the MPSDeviceProvider
370        /// protocol. Otherwise, the Metal system default device
371        /// will be used.
372        ///
373        /// # Safety
374        ///
375        /// `a_decoder` possibly has further requirements.
376        #[unsafe(method(initWithCoder:))]
377        #[unsafe(method_family = init)]
378        pub unsafe fn initWithCoder(
379            this: Allocated<Self>,
380            a_decoder: &NSCoder,
381        ) -> Option<Retained<Self>>;
382    );
383}
384
385/// Methods declared on superclass `NSObject`.
386#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
387impl MPSImageReduceColumnMin {
388    extern_methods!(
389        #[unsafe(method(init))]
390        #[unsafe(method_family = init)]
391        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
392
393        #[unsafe(method(new))]
394        #[unsafe(method_family = new)]
395        pub unsafe fn new() -> Retained<Self>;
396    );
397}
398
399extern_class!(
400    /// The MPSImageReduceRowMax performs a reduction operation returning the maximum value for each row of an image
401    ///
402    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmax?language=objc)
403    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
404    #[derive(Debug, PartialEq, Eq, Hash)]
405    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
406    pub struct MPSImageReduceRowMax;
407);
408
409#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
410extern_conformance!(
411    unsafe impl NSCoding for MPSImageReduceRowMax {}
412);
413
414#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
415extern_conformance!(
416    unsafe impl NSCopying for MPSImageReduceRowMax {}
417);
418
419#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
420unsafe impl CopyingHelper for MPSImageReduceRowMax {
421    type Result = Self;
422}
423
424#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
425extern_conformance!(
426    unsafe impl NSObjectProtocol for MPSImageReduceRowMax {}
427);
428
429#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
430extern_conformance!(
431    unsafe impl NSSecureCoding for MPSImageReduceRowMax {}
432);
433
434#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
435impl MPSImageReduceRowMax {
436    extern_methods!(
437        /// Specifies information to apply the reduction operation on an image.
438        ///
439        /// Parameter `device`: The device the filter will run on
440        ///
441        /// Returns: A valid MPSImageReduce object or nil, if failure.
442        #[unsafe(method(initWithDevice:))]
443        #[unsafe(method_family = init)]
444        pub unsafe fn initWithDevice(
445            this: Allocated<Self>,
446            device: &ProtocolObject<dyn MTLDevice>,
447        ) -> Retained<Self>;
448    );
449}
450
451/// Methods declared on superclass `MPSUnaryImageKernel`.
452#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
453impl MPSImageReduceRowMax {
454    extern_methods!(
455        /// NSSecureCoding compatability
456        ///
457        /// While the standard NSSecureCoding/NSCoding method
458        /// -initWithCoder: should work, since the file can't
459        /// know which device your data is allocated on, we
460        /// have to guess and may guess incorrectly.  To avoid
461        /// that problem, use initWithCoder:device instead.
462        ///
463        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
464        ///
465        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
466        ///
467        /// Returns: A new MPSKernel object, or nil if failure.
468        ///
469        /// # Safety
470        ///
471        /// `a_decoder` possibly has further requirements.
472        #[unsafe(method(initWithCoder:device:))]
473        #[unsafe(method_family = init)]
474        pub unsafe fn initWithCoder_device(
475            this: Allocated<Self>,
476            a_decoder: &NSCoder,
477            device: &ProtocolObject<dyn MTLDevice>,
478        ) -> Option<Retained<Self>>;
479    );
480}
481
482/// Methods declared on superclass `MPSKernel`.
483#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
484impl MPSImageReduceRowMax {
485    extern_methods!(
486        /// Called by NSCoder to decode MPSKernels
487        ///
488        /// This isn't the right interface to decode a MPSKernel, but
489        /// it is the one that NSCoder uses. To enable your NSCoder
490        /// (e.g. NSKeyedUnarchiver) to set which device to use
491        /// extend the object to adopt the MPSDeviceProvider
492        /// protocol. Otherwise, the Metal system default device
493        /// will be used.
494        ///
495        /// # Safety
496        ///
497        /// `a_decoder` possibly has further requirements.
498        #[unsafe(method(initWithCoder:))]
499        #[unsafe(method_family = init)]
500        pub unsafe fn initWithCoder(
501            this: Allocated<Self>,
502            a_decoder: &NSCoder,
503        ) -> Option<Retained<Self>>;
504    );
505}
506
507/// Methods declared on superclass `NSObject`.
508#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
509impl MPSImageReduceRowMax {
510    extern_methods!(
511        #[unsafe(method(init))]
512        #[unsafe(method_family = init)]
513        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
514
515        #[unsafe(method(new))]
516        #[unsafe(method_family = new)]
517        pub unsafe fn new() -> Retained<Self>;
518    );
519}
520
521extern_class!(
522    /// The MPSImageReduceColumnMax performs a reduction operation returning the maximum value for each column of an image
523    ///
524    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmax?language=objc)
525    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
526    #[derive(Debug, PartialEq, Eq, Hash)]
527    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
528    pub struct MPSImageReduceColumnMax;
529);
530
531#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
532extern_conformance!(
533    unsafe impl NSCoding for MPSImageReduceColumnMax {}
534);
535
536#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
537extern_conformance!(
538    unsafe impl NSCopying for MPSImageReduceColumnMax {}
539);
540
541#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
542unsafe impl CopyingHelper for MPSImageReduceColumnMax {
543    type Result = Self;
544}
545
546#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
547extern_conformance!(
548    unsafe impl NSObjectProtocol for MPSImageReduceColumnMax {}
549);
550
551#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
552extern_conformance!(
553    unsafe impl NSSecureCoding for MPSImageReduceColumnMax {}
554);
555
556#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
557impl MPSImageReduceColumnMax {
558    extern_methods!(
559        /// Specifies information to apply the reduction operation on an image.
560        ///
561        /// Parameter `device`: The device the filter will run on
562        ///
563        /// Returns: A valid MPSImageReduce object or nil, if failure.
564        #[unsafe(method(initWithDevice:))]
565        #[unsafe(method_family = init)]
566        pub unsafe fn initWithDevice(
567            this: Allocated<Self>,
568            device: &ProtocolObject<dyn MTLDevice>,
569        ) -> Retained<Self>;
570    );
571}
572
573/// Methods declared on superclass `MPSUnaryImageKernel`.
574#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
575impl MPSImageReduceColumnMax {
576    extern_methods!(
577        /// NSSecureCoding compatability
578        ///
579        /// While the standard NSSecureCoding/NSCoding method
580        /// -initWithCoder: should work, since the file can't
581        /// know which device your data is allocated on, we
582        /// have to guess and may guess incorrectly.  To avoid
583        /// that problem, use initWithCoder:device instead.
584        ///
585        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
586        ///
587        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
588        ///
589        /// Returns: A new MPSKernel object, or nil if failure.
590        ///
591        /// # Safety
592        ///
593        /// `a_decoder` possibly has further requirements.
594        #[unsafe(method(initWithCoder:device:))]
595        #[unsafe(method_family = init)]
596        pub unsafe fn initWithCoder_device(
597            this: Allocated<Self>,
598            a_decoder: &NSCoder,
599            device: &ProtocolObject<dyn MTLDevice>,
600        ) -> Option<Retained<Self>>;
601    );
602}
603
604/// Methods declared on superclass `MPSKernel`.
605#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
606impl MPSImageReduceColumnMax {
607    extern_methods!(
608        /// Called by NSCoder to decode MPSKernels
609        ///
610        /// This isn't the right interface to decode a MPSKernel, but
611        /// it is the one that NSCoder uses. To enable your NSCoder
612        /// (e.g. NSKeyedUnarchiver) to set which device to use
613        /// extend the object to adopt the MPSDeviceProvider
614        /// protocol. Otherwise, the Metal system default device
615        /// will be used.
616        ///
617        /// # Safety
618        ///
619        /// `a_decoder` possibly has further requirements.
620        #[unsafe(method(initWithCoder:))]
621        #[unsafe(method_family = init)]
622        pub unsafe fn initWithCoder(
623            this: Allocated<Self>,
624            a_decoder: &NSCoder,
625        ) -> Option<Retained<Self>>;
626    );
627}
628
629/// Methods declared on superclass `NSObject`.
630#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
631impl MPSImageReduceColumnMax {
632    extern_methods!(
633        #[unsafe(method(init))]
634        #[unsafe(method_family = init)]
635        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
636
637        #[unsafe(method(new))]
638        #[unsafe(method_family = new)]
639        pub unsafe fn new() -> Retained<Self>;
640    );
641}
642
643extern_class!(
644    /// The MPSImageReduceRowMean performs a reduction operation returning the mean value for each row of an image
645    ///
646    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowmean?language=objc)
647    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
648    #[derive(Debug, PartialEq, Eq, Hash)]
649    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
650    pub struct MPSImageReduceRowMean;
651);
652
653#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
654extern_conformance!(
655    unsafe impl NSCoding for MPSImageReduceRowMean {}
656);
657
658#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
659extern_conformance!(
660    unsafe impl NSCopying for MPSImageReduceRowMean {}
661);
662
663#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
664unsafe impl CopyingHelper for MPSImageReduceRowMean {
665    type Result = Self;
666}
667
668#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
669extern_conformance!(
670    unsafe impl NSObjectProtocol for MPSImageReduceRowMean {}
671);
672
673#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
674extern_conformance!(
675    unsafe impl NSSecureCoding for MPSImageReduceRowMean {}
676);
677
678#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
679impl MPSImageReduceRowMean {
680    extern_methods!(
681        /// Specifies information to apply the reduction operation on an image.
682        ///
683        /// Parameter `device`: The device the filter will run on
684        ///
685        /// Returns: A valid MPSImageReduce object or nil, if failure.
686        #[unsafe(method(initWithDevice:))]
687        #[unsafe(method_family = init)]
688        pub unsafe fn initWithDevice(
689            this: Allocated<Self>,
690            device: &ProtocolObject<dyn MTLDevice>,
691        ) -> Retained<Self>;
692    );
693}
694
695/// Methods declared on superclass `MPSUnaryImageKernel`.
696#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
697impl MPSImageReduceRowMean {
698    extern_methods!(
699        /// NSSecureCoding compatability
700        ///
701        /// While the standard NSSecureCoding/NSCoding method
702        /// -initWithCoder: should work, since the file can't
703        /// know which device your data is allocated on, we
704        /// have to guess and may guess incorrectly.  To avoid
705        /// that problem, use initWithCoder:device instead.
706        ///
707        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
708        ///
709        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
710        ///
711        /// Returns: A new MPSKernel object, or nil if failure.
712        ///
713        /// # Safety
714        ///
715        /// `a_decoder` possibly has further requirements.
716        #[unsafe(method(initWithCoder:device:))]
717        #[unsafe(method_family = init)]
718        pub unsafe fn initWithCoder_device(
719            this: Allocated<Self>,
720            a_decoder: &NSCoder,
721            device: &ProtocolObject<dyn MTLDevice>,
722        ) -> Option<Retained<Self>>;
723    );
724}
725
726/// Methods declared on superclass `MPSKernel`.
727#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
728impl MPSImageReduceRowMean {
729    extern_methods!(
730        /// Called by NSCoder to decode MPSKernels
731        ///
732        /// This isn't the right interface to decode a MPSKernel, but
733        /// it is the one that NSCoder uses. To enable your NSCoder
734        /// (e.g. NSKeyedUnarchiver) to set which device to use
735        /// extend the object to adopt the MPSDeviceProvider
736        /// protocol. Otherwise, the Metal system default device
737        /// will be used.
738        ///
739        /// # Safety
740        ///
741        /// `a_decoder` possibly has further requirements.
742        #[unsafe(method(initWithCoder:))]
743        #[unsafe(method_family = init)]
744        pub unsafe fn initWithCoder(
745            this: Allocated<Self>,
746            a_decoder: &NSCoder,
747        ) -> Option<Retained<Self>>;
748    );
749}
750
751/// Methods declared on superclass `NSObject`.
752#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
753impl MPSImageReduceRowMean {
754    extern_methods!(
755        #[unsafe(method(init))]
756        #[unsafe(method_family = init)]
757        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
758
759        #[unsafe(method(new))]
760        #[unsafe(method_family = new)]
761        pub unsafe fn new() -> Retained<Self>;
762    );
763}
764
765extern_class!(
766    /// The MPSImageReduceColumnMean performs a reduction operation returning the mean value for each column of an image
767    ///
768    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnmean?language=objc)
769    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
770    #[derive(Debug, PartialEq, Eq, Hash)]
771    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
772    pub struct MPSImageReduceColumnMean;
773);
774
775#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
776extern_conformance!(
777    unsafe impl NSCoding for MPSImageReduceColumnMean {}
778);
779
780#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
781extern_conformance!(
782    unsafe impl NSCopying for MPSImageReduceColumnMean {}
783);
784
785#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
786unsafe impl CopyingHelper for MPSImageReduceColumnMean {
787    type Result = Self;
788}
789
790#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
791extern_conformance!(
792    unsafe impl NSObjectProtocol for MPSImageReduceColumnMean {}
793);
794
795#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
796extern_conformance!(
797    unsafe impl NSSecureCoding for MPSImageReduceColumnMean {}
798);
799
800#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
801impl MPSImageReduceColumnMean {
802    extern_methods!(
803        /// Specifies information to apply the reduction operation on an image.
804        ///
805        /// Parameter `device`: The device the filter will run on
806        ///
807        /// Returns: A valid MPSImageReduce object or nil, if failure.
808        #[unsafe(method(initWithDevice:))]
809        #[unsafe(method_family = init)]
810        pub unsafe fn initWithDevice(
811            this: Allocated<Self>,
812            device: &ProtocolObject<dyn MTLDevice>,
813        ) -> Retained<Self>;
814    );
815}
816
817/// Methods declared on superclass `MPSUnaryImageKernel`.
818#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
819impl MPSImageReduceColumnMean {
820    extern_methods!(
821        /// NSSecureCoding compatability
822        ///
823        /// While the standard NSSecureCoding/NSCoding method
824        /// -initWithCoder: should work, since the file can't
825        /// know which device your data is allocated on, we
826        /// have to guess and may guess incorrectly.  To avoid
827        /// that problem, use initWithCoder:device instead.
828        ///
829        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
830        ///
831        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
832        ///
833        /// Returns: A new MPSKernel object, or nil if failure.
834        ///
835        /// # Safety
836        ///
837        /// `a_decoder` possibly has further requirements.
838        #[unsafe(method(initWithCoder:device:))]
839        #[unsafe(method_family = init)]
840        pub unsafe fn initWithCoder_device(
841            this: Allocated<Self>,
842            a_decoder: &NSCoder,
843            device: &ProtocolObject<dyn MTLDevice>,
844        ) -> Option<Retained<Self>>;
845    );
846}
847
848/// Methods declared on superclass `MPSKernel`.
849#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
850impl MPSImageReduceColumnMean {
851    extern_methods!(
852        /// Called by NSCoder to decode MPSKernels
853        ///
854        /// This isn't the right interface to decode a MPSKernel, but
855        /// it is the one that NSCoder uses. To enable your NSCoder
856        /// (e.g. NSKeyedUnarchiver) to set which device to use
857        /// extend the object to adopt the MPSDeviceProvider
858        /// protocol. Otherwise, the Metal system default device
859        /// will be used.
860        ///
861        /// # Safety
862        ///
863        /// `a_decoder` possibly has further requirements.
864        #[unsafe(method(initWithCoder:))]
865        #[unsafe(method_family = init)]
866        pub unsafe fn initWithCoder(
867            this: Allocated<Self>,
868            a_decoder: &NSCoder,
869        ) -> Option<Retained<Self>>;
870    );
871}
872
873/// Methods declared on superclass `NSObject`.
874#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
875impl MPSImageReduceColumnMean {
876    extern_methods!(
877        #[unsafe(method(init))]
878        #[unsafe(method_family = init)]
879        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
880
881        #[unsafe(method(new))]
882        #[unsafe(method_family = new)]
883        pub unsafe fn new() -> Retained<Self>;
884    );
885}
886
887extern_class!(
888    /// The MPSImageReduceRowSum performs a reduction operation returning the sum for each row of an image
889    ///
890    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducerowsum?language=objc)
891    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
892    #[derive(Debug, PartialEq, Eq, Hash)]
893    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
894    pub struct MPSImageReduceRowSum;
895);
896
897#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
898extern_conformance!(
899    unsafe impl NSCoding for MPSImageReduceRowSum {}
900);
901
902#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
903extern_conformance!(
904    unsafe impl NSCopying for MPSImageReduceRowSum {}
905);
906
907#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
908unsafe impl CopyingHelper for MPSImageReduceRowSum {
909    type Result = Self;
910}
911
912#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
913extern_conformance!(
914    unsafe impl NSObjectProtocol for MPSImageReduceRowSum {}
915);
916
917#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
918extern_conformance!(
919    unsafe impl NSSecureCoding for MPSImageReduceRowSum {}
920);
921
922#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
923impl MPSImageReduceRowSum {
924    extern_methods!(
925        /// Specifies information to apply the reduction operation on an image.
926        ///
927        /// Parameter `device`: The device the filter will run on
928        ///
929        /// Returns: A valid MPSImageReduce object or nil, if failure.
930        #[unsafe(method(initWithDevice:))]
931        #[unsafe(method_family = init)]
932        pub unsafe fn initWithDevice(
933            this: Allocated<Self>,
934            device: &ProtocolObject<dyn MTLDevice>,
935        ) -> Retained<Self>;
936    );
937}
938
939/// Methods declared on superclass `MPSUnaryImageKernel`.
940#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
941impl MPSImageReduceRowSum {
942    extern_methods!(
943        /// NSSecureCoding compatability
944        ///
945        /// While the standard NSSecureCoding/NSCoding method
946        /// -initWithCoder: should work, since the file can't
947        /// know which device your data is allocated on, we
948        /// have to guess and may guess incorrectly.  To avoid
949        /// that problem, use initWithCoder:device instead.
950        ///
951        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
952        ///
953        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
954        ///
955        /// Returns: A new MPSKernel object, or nil if failure.
956        ///
957        /// # Safety
958        ///
959        /// `a_decoder` possibly has further requirements.
960        #[unsafe(method(initWithCoder:device:))]
961        #[unsafe(method_family = init)]
962        pub unsafe fn initWithCoder_device(
963            this: Allocated<Self>,
964            a_decoder: &NSCoder,
965            device: &ProtocolObject<dyn MTLDevice>,
966        ) -> Option<Retained<Self>>;
967    );
968}
969
970/// Methods declared on superclass `MPSKernel`.
971#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
972impl MPSImageReduceRowSum {
973    extern_methods!(
974        /// Called by NSCoder to decode MPSKernels
975        ///
976        /// This isn't the right interface to decode a MPSKernel, but
977        /// it is the one that NSCoder uses. To enable your NSCoder
978        /// (e.g. NSKeyedUnarchiver) to set which device to use
979        /// extend the object to adopt the MPSDeviceProvider
980        /// protocol. Otherwise, the Metal system default device
981        /// will be used.
982        ///
983        /// # Safety
984        ///
985        /// `a_decoder` possibly has further requirements.
986        #[unsafe(method(initWithCoder:))]
987        #[unsafe(method_family = init)]
988        pub unsafe fn initWithCoder(
989            this: Allocated<Self>,
990            a_decoder: &NSCoder,
991        ) -> Option<Retained<Self>>;
992    );
993}
994
995/// Methods declared on superclass `NSObject`.
996#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
997impl MPSImageReduceRowSum {
998    extern_methods!(
999        #[unsafe(method(init))]
1000        #[unsafe(method_family = init)]
1001        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1002
1003        #[unsafe(method(new))]
1004        #[unsafe(method_family = new)]
1005        pub unsafe fn new() -> Retained<Self>;
1006    );
1007}
1008
1009extern_class!(
1010    /// The MPSImageReduceColumnSum performs a reduction operation returning the sum for each column of an image
1011    ///
1012    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagereducecolumnsum?language=objc)
1013    #[unsafe(super(MPSImageReduceUnary, MPSUnaryImageKernel, MPSKernel, NSObject))]
1014    #[derive(Debug, PartialEq, Eq, Hash)]
1015    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1016    pub struct MPSImageReduceColumnSum;
1017);
1018
1019#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1020extern_conformance!(
1021    unsafe impl NSCoding for MPSImageReduceColumnSum {}
1022);
1023
1024#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1025extern_conformance!(
1026    unsafe impl NSCopying for MPSImageReduceColumnSum {}
1027);
1028
1029#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1030unsafe impl CopyingHelper for MPSImageReduceColumnSum {
1031    type Result = Self;
1032}
1033
1034#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1035extern_conformance!(
1036    unsafe impl NSObjectProtocol for MPSImageReduceColumnSum {}
1037);
1038
1039#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1040extern_conformance!(
1041    unsafe impl NSSecureCoding for MPSImageReduceColumnSum {}
1042);
1043
1044#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1045impl MPSImageReduceColumnSum {
1046    extern_methods!(
1047        /// Specifies information to apply the reduction operation on an image.
1048        ///
1049        /// Parameter `device`: The device the filter will run on
1050        ///
1051        /// Returns: A valid MPSImageReduce object or nil, if failure.
1052        #[unsafe(method(initWithDevice:))]
1053        #[unsafe(method_family = init)]
1054        pub unsafe fn initWithDevice(
1055            this: Allocated<Self>,
1056            device: &ProtocolObject<dyn MTLDevice>,
1057        ) -> Retained<Self>;
1058    );
1059}
1060
1061/// Methods declared on superclass `MPSUnaryImageKernel`.
1062#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1063impl MPSImageReduceColumnSum {
1064    extern_methods!(
1065        /// NSSecureCoding compatability
1066        ///
1067        /// While the standard NSSecureCoding/NSCoding method
1068        /// -initWithCoder: should work, since the file can't
1069        /// know which device your data is allocated on, we
1070        /// have to guess and may guess incorrectly.  To avoid
1071        /// that problem, use initWithCoder:device instead.
1072        ///
1073        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
1074        ///
1075        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
1076        ///
1077        /// Returns: A new MPSKernel object, or nil if failure.
1078        ///
1079        /// # Safety
1080        ///
1081        /// `a_decoder` possibly has further requirements.
1082        #[unsafe(method(initWithCoder:device:))]
1083        #[unsafe(method_family = init)]
1084        pub unsafe fn initWithCoder_device(
1085            this: Allocated<Self>,
1086            a_decoder: &NSCoder,
1087            device: &ProtocolObject<dyn MTLDevice>,
1088        ) -> Option<Retained<Self>>;
1089    );
1090}
1091
1092/// Methods declared on superclass `MPSKernel`.
1093#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1094impl MPSImageReduceColumnSum {
1095    extern_methods!(
1096        /// Called by NSCoder to decode MPSKernels
1097        ///
1098        /// This isn't the right interface to decode a MPSKernel, but
1099        /// it is the one that NSCoder uses. To enable your NSCoder
1100        /// (e.g. NSKeyedUnarchiver) to set which device to use
1101        /// extend the object to adopt the MPSDeviceProvider
1102        /// protocol. Otherwise, the Metal system default device
1103        /// will be used.
1104        ///
1105        /// # Safety
1106        ///
1107        /// `a_decoder` possibly has further requirements.
1108        #[unsafe(method(initWithCoder:))]
1109        #[unsafe(method_family = init)]
1110        pub unsafe fn initWithCoder(
1111            this: Allocated<Self>,
1112            a_decoder: &NSCoder,
1113        ) -> Option<Retained<Self>>;
1114    );
1115}
1116
1117/// Methods declared on superclass `NSObject`.
1118#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
1119impl MPSImageReduceColumnSum {
1120    extern_methods!(
1121        #[unsafe(method(init))]
1122        #[unsafe(method_family = init)]
1123        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1124
1125        #[unsafe(method(new))]
1126        #[unsafe(method_family = new)]
1127        pub unsafe fn new() -> Retained<Self>;
1128    );
1129}