objc2_metal_performance_shaders/generated/MPSImage/
MPSImageTranspose.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2::__framework_prelude::*;
5use objc2_foundation::*;
6use objc2_metal::*;
7
8use crate::*;
9
10extern_class!(
11    /// The MPSImageTranspose transposes an image
12    ///
13    /// This kernel accepts uint and int textures in addition to unorm and floating-point textures.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/metalperformanceshaders/mpsimagetranspose?language=objc)
16    #[unsafe(super(MPSUnaryImageKernel, MPSKernel, NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    #[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
19    pub struct MPSImageTranspose;
20);
21
22#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
23extern_conformance!(
24    unsafe impl NSCoding for MPSImageTranspose {}
25);
26
27#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
28extern_conformance!(
29    unsafe impl NSCopying for MPSImageTranspose {}
30);
31
32#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
33unsafe impl CopyingHelper for MPSImageTranspose {
34    type Result = Self;
35}
36
37#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
38extern_conformance!(
39    unsafe impl NSObjectProtocol for MPSImageTranspose {}
40);
41
42#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
43extern_conformance!(
44    unsafe impl NSSecureCoding for MPSImageTranspose {}
45);
46
47#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
48impl MPSImageTranspose {
49    extern_methods!();
50}
51
52/// Methods declared on superclass `MPSUnaryImageKernel`.
53#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
54impl MPSImageTranspose {
55    extern_methods!(
56        /// Standard init with default properties per filter type
57        ///
58        /// Parameter `device`: The device that the filter will be used on. May not be NULL.
59        ///
60        /// Returns: a pointer to the newly initialized object. This will fail, returning
61        /// nil if the device is not supported. Devices must be
62        /// MTLFeatureSet_iOS_GPUFamily2_v1 or later.
63        #[unsafe(method(initWithDevice:))]
64        #[unsafe(method_family = init)]
65        pub unsafe fn initWithDevice(
66            this: Allocated<Self>,
67            device: &ProtocolObject<dyn MTLDevice>,
68        ) -> Retained<Self>;
69
70        /// NSSecureCoding compatability
71        ///
72        /// While the standard NSSecureCoding/NSCoding method
73        /// -initWithCoder: should work, since the file can't
74        /// know which device your data is allocated on, we
75        /// have to guess and may guess incorrectly.  To avoid
76        /// that problem, use initWithCoder:device instead.
77        ///
78        /// Parameter `aDecoder`: The NSCoder subclass with your serialized MPSKernel
79        ///
80        /// Parameter `device`: The MTLDevice on which to make the MPSKernel
81        ///
82        /// Returns: A new MPSKernel object, or nil if failure.
83        ///
84        /// # Safety
85        ///
86        /// `a_decoder` possibly has further requirements.
87        #[unsafe(method(initWithCoder:device:))]
88        #[unsafe(method_family = init)]
89        pub unsafe fn initWithCoder_device(
90            this: Allocated<Self>,
91            a_decoder: &NSCoder,
92            device: &ProtocolObject<dyn MTLDevice>,
93        ) -> Option<Retained<Self>>;
94    );
95}
96
97/// Methods declared on superclass `MPSKernel`.
98#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
99impl MPSImageTranspose {
100    extern_methods!(
101        /// Called by NSCoder to decode MPSKernels
102        ///
103        /// This isn't the right interface to decode a MPSKernel, but
104        /// it is the one that NSCoder uses. To enable your NSCoder
105        /// (e.g. NSKeyedUnarchiver) to set which device to use
106        /// extend the object to adopt the MPSDeviceProvider
107        /// protocol. Otherwise, the Metal system default device
108        /// will be used.
109        ///
110        /// # Safety
111        ///
112        /// `a_decoder` possibly has further requirements.
113        #[unsafe(method(initWithCoder:))]
114        #[unsafe(method_family = init)]
115        pub unsafe fn initWithCoder(
116            this: Allocated<Self>,
117            a_decoder: &NSCoder,
118        ) -> Option<Retained<Self>>;
119    );
120}
121
122/// Methods declared on superclass `NSObject`.
123#[cfg(all(feature = "MPSCore", feature = "MPSImageKernel", feature = "MPSKernel"))]
124impl MPSImageTranspose {
125    extern_methods!(
126        #[unsafe(method(init))]
127        #[unsafe(method_family = init)]
128        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
129
130        #[unsafe(method(new))]
131        #[unsafe(method_family = new)]
132        pub unsafe fn new() -> Retained<Self>;
133    );
134}