objc2_model_io/generated/
MDLTexture.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::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9use objc2_core_graphics::*;
10use objc2_foundation::*;
11
12use crate::*;
13
14/// The enoding of texel channel elements
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexturechannelencoding?language=objc)
17// NS_ENUM
18#[repr(transparent)]
19#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
20pub struct MDLTextureChannelEncoding(pub NSInteger);
21impl MDLTextureChannelEncoding {
22    #[doc(alias = "MDLTextureChannelEncodingUInt8")]
23    pub const UInt8: Self = Self(1);
24    #[doc(alias = "MDLTextureChannelEncodingUint8")]
25    pub const Uint8: Self = Self(1);
26    #[doc(alias = "MDLTextureChannelEncodingUInt16")]
27    pub const UInt16: Self = Self(2);
28    #[doc(alias = "MDLTextureChannelEncodingUint16")]
29    pub const Uint16: Self = Self(2);
30    #[doc(alias = "MDLTextureChannelEncodingUInt24")]
31    pub const UInt24: Self = Self(3);
32    #[doc(alias = "MDLTextureChannelEncodingUint24")]
33    pub const Uint24: Self = Self(3);
34    #[doc(alias = "MDLTextureChannelEncodingUInt32")]
35    pub const UInt32: Self = Self(4);
36    #[doc(alias = "MDLTextureChannelEncodingUint32")]
37    pub const Uint32: Self = Self(4);
38    #[doc(alias = "MDLTextureChannelEncodingFloat16")]
39    pub const Float16: Self = Self(0x102);
40    #[doc(alias = "MDLTextureChannelEncodingFloat16SR")]
41    pub const Float16SR: Self = Self(0x302);
42    #[doc(alias = "MDLTextureChannelEncodingFloat32")]
43    pub const Float32: Self = Self(0x104);
44}
45
46unsafe impl Encode for MDLTextureChannelEncoding {
47    const ENCODING: Encoding = NSInteger::ENCODING;
48}
49
50unsafe impl RefEncode for MDLTextureChannelEncoding {
51    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
52}
53
54extern_class!(
55    /// MDLTexture
56    /// a description of texels provided by a texture object.
57    ///
58    ///
59    /// A texture optionally generates or loads texels
60    /// through an access to the data property, or one of the other
61    /// properties, otherwise the texture object is a lightweight descriptor
62    /// only.
63    ///
64    ///
65    /// Texel data that will exist when referenced; it may or may not exist
66    /// before
67    ///
68    /// texel width and height of the texture
69    ///
70    /// The number of bytes from the first texel in a row to the first texel
71    /// in the next row. A rowStride of zero indicates that interleaved x,y
72    /// addressing of texels is not possible. This might be the case if the
73    /// texture was compressed in some manner, for example.
74    ///
75    /// The number of channels incoded in a single texel. For example, an RGB
76    /// texture has 3 channels. All channels must have the same encoding.
77    ///
78    /// The encoding of a channel in a single texel.
79    ///
80    /// The texture encodes a cube map. If YES, then the layout of the cube
81    /// map is deduced as a vertical strip if dimension.y is six times
82    /// dimension.x. Other layouts are possible in the future.
83    ///
84    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexture?language=objc)
85    #[unsafe(super(NSObject))]
86    #[derive(Debug, PartialEq, Eq, Hash)]
87    pub struct MDLTexture;
88);
89
90#[cfg(feature = "MDLTypes")]
91unsafe impl MDLNamed for MDLTexture {}
92
93unsafe impl NSObjectProtocol for MDLTexture {}
94
95impl MDLTexture {
96    extern_methods!(
97        #[unsafe(method(init))]
98        #[unsafe(method_family = init)]
99        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
100
101        /// Creates a texture from a source in the main bundle named in a manner matching
102        /// name.
103        #[unsafe(method(textureNamed:))]
104        #[unsafe(method_family = none)]
105        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
106
107        #[unsafe(method(textureNamed:bundle:))]
108        #[unsafe(method_family = none)]
109        pub unsafe fn textureNamed_bundle(
110            name: &NSString,
111            bundle_or_nil: Option<&NSBundle>,
112        ) -> Option<Retained<Self>>;
113
114        #[cfg(feature = "MDLAssetResolver")]
115        #[unsafe(method(textureNamed:assetResolver:))]
116        #[unsafe(method_family = none)]
117        pub unsafe fn textureNamed_assetResolver(
118            name: &NSString,
119            resolver: &ProtocolObject<dyn MDLAssetResolver>,
120        ) -> Option<Retained<Self>>;
121
122        /// Creates a cube texture map image using 6 faces of the same dimensions,
123        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
124        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
125        /// isCube will return YES
126        ///
127        ///
128        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
129        /// - If 6 individual images are given they are assumed to be in order and will be
130        /// loaded as is.
131        /// - if 3 images of double height or width are given they will be treated as
132        /// pairs of + and - in each axis, the order is must be x, then y, then z.
133        /// - if 2 images of triple height or width are given they will be treates as a
134        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
135        /// - if a single image is given it will be used without conversion if in column
136        /// orientation and demosaiced in all other instances.
137        #[unsafe(method(textureCubeWithImagesNamed:))]
138        #[unsafe(method_family = none)]
139        pub unsafe fn textureCubeWithImagesNamed(
140            names: &NSArray<NSString>,
141        ) -> Option<Retained<Self>>;
142
143        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
144        #[unsafe(method_family = none)]
145        pub unsafe fn textureCubeWithImagesNamed_bundle(
146            names: &NSArray<NSString>,
147            bundle_or_nil: Option<&NSBundle>,
148        ) -> Option<Retained<Self>>;
149
150        /// write a texture to URL, deducing type from path extension
151        #[unsafe(method(writeToURL:))]
152        #[unsafe(method_family = none)]
153        pub unsafe fn writeToURL(&self, url: &NSURL) -> bool;
154
155        /// write a particular level of a mipped texture to URL, deducing type from path extension
156        #[unsafe(method(writeToURL:level:))]
157        #[unsafe(method_family = none)]
158        pub unsafe fn writeToURL_level(&self, url: &NSURL, level: NSUInteger) -> bool;
159
160        #[cfg(feature = "objc2-core-foundation")]
161        /// write a texture to URL, using a specific UT type
162        #[unsafe(method(writeToURL:type:))]
163        #[unsafe(method_family = none)]
164        pub unsafe fn writeToURL_type(&self, nsurl: &NSURL, r#type: &CFString) -> bool;
165
166        #[cfg(feature = "objc2-core-foundation")]
167        /// write a particular level of a mipped texture to URL, using a specific UT type
168        #[unsafe(method(writeToURL:type:level:))]
169        #[unsafe(method_family = none)]
170        pub unsafe fn writeToURL_type_level(
171            &self,
172            nsurl: &NSURL,
173            r#type: &CFString,
174            level: NSUInteger,
175        ) -> bool;
176
177        #[cfg(feature = "objc2-core-graphics")]
178        #[unsafe(method(imageFromTexture))]
179        #[unsafe(method_family = none)]
180        pub unsafe fn imageFromTexture(&self) -> Option<Retained<CGImage>>;
181
182        #[cfg(feature = "objc2-core-graphics")]
183        #[unsafe(method(imageFromTextureAtLevel:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn imageFromTextureAtLevel(
186            &self,
187            level: NSUInteger,
188        ) -> Option<Retained<CGImage>>;
189
190        #[unsafe(method(texelDataWithTopLeftOrigin))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn texelDataWithTopLeftOrigin(&self) -> Option<Retained<NSData>>;
193
194        #[unsafe(method(texelDataWithBottomLeftOrigin))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn texelDataWithBottomLeftOrigin(&self) -> Option<Retained<NSData>>;
197
198        #[unsafe(method(texelDataWithTopLeftOriginAtMipLevel:create:))]
199        #[unsafe(method_family = none)]
200        pub unsafe fn texelDataWithTopLeftOriginAtMipLevel_create(
201            &self,
202            level: NSInteger,
203            create: bool,
204        ) -> Option<Retained<NSData>>;
205
206        #[unsafe(method(texelDataWithBottomLeftOriginAtMipLevel:create:))]
207        #[unsafe(method_family = none)]
208        pub unsafe fn texelDataWithBottomLeftOriginAtMipLevel_create(
209            &self,
210            level: NSInteger,
211            create: bool,
212        ) -> Option<Retained<NSData>>;
213
214        #[unsafe(method(rowStride))]
215        #[unsafe(method_family = none)]
216        pub unsafe fn rowStride(&self) -> NSInteger;
217
218        #[unsafe(method(channelCount))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn channelCount(&self) -> NSUInteger;
221
222        #[unsafe(method(mipLevelCount))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn mipLevelCount(&self) -> NSUInteger;
225
226        #[unsafe(method(channelEncoding))]
227        #[unsafe(method_family = none)]
228        pub unsafe fn channelEncoding(&self) -> MDLTextureChannelEncoding;
229
230        #[unsafe(method(isCube))]
231        #[unsafe(method_family = none)]
232        pub unsafe fn isCube(&self) -> bool;
233
234        /// Setter for [`isCube`][Self::isCube].
235        #[unsafe(method(setIsCube:))]
236        #[unsafe(method_family = none)]
237        pub unsafe fn setIsCube(&self, is_cube: bool);
238
239        /// hasAlphaValues
240        /// Can be overridden. If not overridden, hasAlpha will be NO if the texture does not
241        /// have an alpha channel. It wil be YES if the texture has an alpha channel and
242        /// there is at least one non-opaque texel in it.
243        #[unsafe(method(hasAlphaValues))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn hasAlphaValues(&self) -> bool;
246
247        /// Setter for [`hasAlphaValues`][Self::hasAlphaValues].
248        #[unsafe(method(setHasAlphaValues:))]
249        #[unsafe(method_family = none)]
250        pub unsafe fn setHasAlphaValues(&self, has_alpha_values: bool);
251    );
252}
253
254/// Methods declared on superclass `NSObject`.
255impl MDLTexture {
256    extern_methods!(
257        #[unsafe(method(new))]
258        #[unsafe(method_family = new)]
259        pub unsafe fn new() -> Retained<Self>;
260    );
261}
262
263extern_class!(
264    /// MDLURLTexture
265    /// a texture provider initialized with a URL or file path.
266    ///
267    /// if any of the properties of the texture, such as data, are referenced,
268    /// then the texture may be loaded, otherwise, the MDLURLTexture is merely
269    /// a lightweight reference to something that could be loaded
270    ///
271    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlurltexture?language=objc)
272    #[unsafe(super(MDLTexture, NSObject))]
273    #[derive(Debug, PartialEq, Eq, Hash)]
274    pub struct MDLURLTexture;
275);
276
277#[cfg(feature = "MDLTypes")]
278unsafe impl MDLNamed for MDLURLTexture {}
279
280unsafe impl NSObjectProtocol for MDLURLTexture {}
281
282impl MDLURLTexture {
283    extern_methods!(
284        #[unsafe(method(initWithURL:name:))]
285        #[unsafe(method_family = init)]
286        pub unsafe fn initWithURL_name(
287            this: Allocated<Self>,
288            url: &NSURL,
289            name: Option<&NSString>,
290        ) -> Retained<Self>;
291
292        #[unsafe(method(URL))]
293        #[unsafe(method_family = none)]
294        pub unsafe fn URL(&self) -> Retained<NSURL>;
295
296        /// Setter for [`URL`][Self::URL].
297        #[unsafe(method(setURL:))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn setURL(&self, url: &NSURL);
300    );
301}
302
303/// Methods declared on superclass `MDLTexture`.
304impl MDLURLTexture {
305    extern_methods!(
306        #[unsafe(method(init))]
307        #[unsafe(method_family = init)]
308        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
309
310        /// Creates a texture from a source in the main bundle named in a manner matching
311        /// name.
312        #[unsafe(method(textureNamed:))]
313        #[unsafe(method_family = none)]
314        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
315
316        #[unsafe(method(textureNamed:bundle:))]
317        #[unsafe(method_family = none)]
318        pub unsafe fn textureNamed_bundle(
319            name: &NSString,
320            bundle_or_nil: Option<&NSBundle>,
321        ) -> Option<Retained<Self>>;
322
323        #[cfg(feature = "MDLAssetResolver")]
324        #[unsafe(method(textureNamed:assetResolver:))]
325        #[unsafe(method_family = none)]
326        pub unsafe fn textureNamed_assetResolver(
327            name: &NSString,
328            resolver: &ProtocolObject<dyn MDLAssetResolver>,
329        ) -> Option<Retained<Self>>;
330
331        /// Creates a cube texture map image using 6 faces of the same dimensions,
332        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
333        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
334        /// isCube will return YES
335        ///
336        ///
337        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
338        /// - If 6 individual images are given they are assumed to be in order and will be
339        /// loaded as is.
340        /// - if 3 images of double height or width are given they will be treated as
341        /// pairs of + and - in each axis, the order is must be x, then y, then z.
342        /// - if 2 images of triple height or width are given they will be treates as a
343        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
344        /// - if a single image is given it will be used without conversion if in column
345        /// orientation and demosaiced in all other instances.
346        #[unsafe(method(textureCubeWithImagesNamed:))]
347        #[unsafe(method_family = none)]
348        pub unsafe fn textureCubeWithImagesNamed(
349            names: &NSArray<NSString>,
350        ) -> Option<Retained<Self>>;
351
352        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
353        #[unsafe(method_family = none)]
354        pub unsafe fn textureCubeWithImagesNamed_bundle(
355            names: &NSArray<NSString>,
356            bundle_or_nil: Option<&NSBundle>,
357        ) -> Option<Retained<Self>>;
358    );
359}
360
361/// Methods declared on superclass `NSObject`.
362impl MDLURLTexture {
363    extern_methods!(
364        #[unsafe(method(new))]
365        #[unsafe(method_family = new)]
366        pub unsafe fn new() -> Retained<Self>;
367    );
368}
369
370extern_class!(
371    /// MDLCheckerboardTexture
372    /// A two color checkboard with a certain number of divisions
373    ///
374    ///
375    /// the texture will be created if data is referenced, otherwise, this
376    /// object is merely a description
377    ///
378    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlcheckerboardtexture?language=objc)
379    #[unsafe(super(MDLTexture, NSObject))]
380    #[derive(Debug, PartialEq, Eq, Hash)]
381    pub struct MDLCheckerboardTexture;
382);
383
384#[cfg(feature = "MDLTypes")]
385unsafe impl MDLNamed for MDLCheckerboardTexture {}
386
387unsafe impl NSObjectProtocol for MDLCheckerboardTexture {}
388
389impl MDLCheckerboardTexture {
390    extern_methods!(
391        #[unsafe(method(divisions))]
392        #[unsafe(method_family = none)]
393        pub unsafe fn divisions(&self) -> c_float;
394
395        /// Setter for [`divisions`][Self::divisions].
396        #[unsafe(method(setDivisions:))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn setDivisions(&self, divisions: c_float);
399
400        #[cfg(feature = "objc2-core-graphics")]
401        #[unsafe(method(color1))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn color1(&self) -> Option<Retained<CGColor>>;
404
405        #[cfg(feature = "objc2-core-graphics")]
406        /// Setter for [`color1`][Self::color1].
407        #[unsafe(method(setColor1:))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn setColor1(&self, color1: Option<&CGColor>);
410
411        #[cfg(feature = "objc2-core-graphics")]
412        #[unsafe(method(color2))]
413        #[unsafe(method_family = none)]
414        pub unsafe fn color2(&self) -> Option<Retained<CGColor>>;
415
416        #[cfg(feature = "objc2-core-graphics")]
417        /// Setter for [`color2`][Self::color2].
418        #[unsafe(method(setColor2:))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn setColor2(&self, color2: Option<&CGColor>);
421    );
422}
423
424/// Methods declared on superclass `MDLTexture`.
425impl MDLCheckerboardTexture {
426    extern_methods!(
427        #[unsafe(method(init))]
428        #[unsafe(method_family = init)]
429        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
430
431        /// Creates a texture from a source in the main bundle named in a manner matching
432        /// name.
433        #[unsafe(method(textureNamed:))]
434        #[unsafe(method_family = none)]
435        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
436
437        #[unsafe(method(textureNamed:bundle:))]
438        #[unsafe(method_family = none)]
439        pub unsafe fn textureNamed_bundle(
440            name: &NSString,
441            bundle_or_nil: Option<&NSBundle>,
442        ) -> Option<Retained<Self>>;
443
444        #[cfg(feature = "MDLAssetResolver")]
445        #[unsafe(method(textureNamed:assetResolver:))]
446        #[unsafe(method_family = none)]
447        pub unsafe fn textureNamed_assetResolver(
448            name: &NSString,
449            resolver: &ProtocolObject<dyn MDLAssetResolver>,
450        ) -> Option<Retained<Self>>;
451
452        /// Creates a cube texture map image using 6 faces of the same dimensions,
453        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
454        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
455        /// isCube will return YES
456        ///
457        ///
458        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
459        /// - If 6 individual images are given they are assumed to be in order and will be
460        /// loaded as is.
461        /// - if 3 images of double height or width are given they will be treated as
462        /// pairs of + and - in each axis, the order is must be x, then y, then z.
463        /// - if 2 images of triple height or width are given they will be treates as a
464        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
465        /// - if a single image is given it will be used without conversion if in column
466        /// orientation and demosaiced in all other instances.
467        #[unsafe(method(textureCubeWithImagesNamed:))]
468        #[unsafe(method_family = none)]
469        pub unsafe fn textureCubeWithImagesNamed(
470            names: &NSArray<NSString>,
471        ) -> Option<Retained<Self>>;
472
473        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
474        #[unsafe(method_family = none)]
475        pub unsafe fn textureCubeWithImagesNamed_bundle(
476            names: &NSArray<NSString>,
477            bundle_or_nil: Option<&NSBundle>,
478        ) -> Option<Retained<Self>>;
479    );
480}
481
482/// Methods declared on superclass `NSObject`.
483impl MDLCheckerboardTexture {
484    extern_methods!(
485        #[unsafe(method(new))]
486        #[unsafe(method_family = new)]
487        pub unsafe fn new() -> Retained<Self>;
488    );
489}
490
491extern_class!(
492    /// MDLSkyCubeTexture
493    /// A physically realistic sky as a cube texture
494    ///
495    ///
496    /// 1.0 is at the nadir. Use in conjunction with turbidity to give a dawn,
497    /// dusk, or noon look.
498    ///
499    /// will impart very little color to the sky. A value of one simulates a
500    /// great deal of dust and moisture in the sky, and will cause the sun's
501    /// color to spread across the atmosphere.
502    ///
503    /// a value of one will give noon-ish saturated colors.
504    ///
505    /// the sky from the ground. A value of zero will yield a clear sky, a
506    /// value of one will reduce the contrast of the sky, making it a bit foggy.
507    ///
508    ///
509    /// by a color, horizonElevation is angle, in radians, below which the
510    /// replacement should occur. Negative values are below the horizon.
511    ///
512    ///
513    /// the color below the horizonElevation value blended with the w factor up to
514    /// Pi/2.0 past the horizon.
515    /// (e.g. w = 0.0 groundColor is applied immediatly on the horizon with no blend
516    /// w = Pi/2 groundColor is linearly applied all the way to the south pole)
517    /// NOTE: To maintain default behavior a simple length(groundColor) != 0 is used to determine
518    /// if we want to set the ground color (e.g. black and blended immediatly
519    /// on the horizon use (0.0, 0.0, 0.0, 0.0000001))
520    /// 4 component treats the first 3 components as color and w as blend factor
521    /// 3 component treats the first 3 components as color and 0 as blend factor
522    /// 2 component treats the first component as greyscale color and y as blend factor
523    /// 1 component treats the scalar component as greyscale color and 0 as blend factor
524    ///
525    ///
526    /// tone mapping.
527    ///
528    ///
529    ///
530    ///
531    ///
532    /// are not compressed during tone mapping. Values between the x component
533    /// and y component are compressed to the maximum brightness value during
534    /// tone mapping. Values above the limit are clamped.
535    ///
536    ///
537    /// the texture will be created if data is referenced, otherwise, this
538    /// object is merely a description. All parameters have legal values between zero and one.
539    ///
540    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlskycubetexture?language=objc)
541    #[unsafe(super(MDLTexture, NSObject))]
542    #[derive(Debug, PartialEq, Eq, Hash)]
543    pub struct MDLSkyCubeTexture;
544);
545
546#[cfg(feature = "MDLTypes")]
547unsafe impl MDLNamed for MDLSkyCubeTexture {}
548
549unsafe impl NSObjectProtocol for MDLSkyCubeTexture {}
550
551impl MDLSkyCubeTexture {
552    extern_methods!(
553        /// Call updateTexture if parameters have been changed and a new sky is required.
554        #[unsafe(method(updateTexture))]
555        #[unsafe(method_family = none)]
556        pub unsafe fn updateTexture(&self);
557
558        #[unsafe(method(turbidity))]
559        #[unsafe(method_family = none)]
560        pub unsafe fn turbidity(&self) -> c_float;
561
562        /// Setter for [`turbidity`][Self::turbidity].
563        #[unsafe(method(setTurbidity:))]
564        #[unsafe(method_family = none)]
565        pub unsafe fn setTurbidity(&self, turbidity: c_float);
566
567        #[unsafe(method(sunElevation))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn sunElevation(&self) -> c_float;
570
571        /// Setter for [`sunElevation`][Self::sunElevation].
572        #[unsafe(method(setSunElevation:))]
573        #[unsafe(method_family = none)]
574        pub unsafe fn setSunElevation(&self, sun_elevation: c_float);
575
576        #[unsafe(method(sunAzimuth))]
577        #[unsafe(method_family = none)]
578        pub unsafe fn sunAzimuth(&self) -> c_float;
579
580        /// Setter for [`sunAzimuth`][Self::sunAzimuth].
581        #[unsafe(method(setSunAzimuth:))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn setSunAzimuth(&self, sun_azimuth: c_float);
584
585        #[unsafe(method(upperAtmosphereScattering))]
586        #[unsafe(method_family = none)]
587        pub unsafe fn upperAtmosphereScattering(&self) -> c_float;
588
589        /// Setter for [`upperAtmosphereScattering`][Self::upperAtmosphereScattering].
590        #[unsafe(method(setUpperAtmosphereScattering:))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn setUpperAtmosphereScattering(&self, upper_atmosphere_scattering: c_float);
593
594        #[unsafe(method(groundAlbedo))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn groundAlbedo(&self) -> c_float;
597
598        /// Setter for [`groundAlbedo`][Self::groundAlbedo].
599        #[unsafe(method(setGroundAlbedo:))]
600        #[unsafe(method_family = none)]
601        pub unsafe fn setGroundAlbedo(&self, ground_albedo: c_float);
602
603        #[unsafe(method(horizonElevation))]
604        #[unsafe(method_family = none)]
605        pub unsafe fn horizonElevation(&self) -> c_float;
606
607        /// Setter for [`horizonElevation`][Self::horizonElevation].
608        #[unsafe(method(setHorizonElevation:))]
609        #[unsafe(method_family = none)]
610        pub unsafe fn setHorizonElevation(&self, horizon_elevation: c_float);
611
612        #[cfg(feature = "objc2-core-graphics")]
613        #[unsafe(method(groundColor))]
614        #[unsafe(method_family = none)]
615        pub unsafe fn groundColor(&self) -> Option<Retained<CGColor>>;
616
617        #[cfg(feature = "objc2-core-graphics")]
618        /// Setter for [`groundColor`][Self::groundColor].
619        #[unsafe(method(setGroundColor:))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn setGroundColor(&self, ground_color: Option<&CGColor>);
622
623        #[unsafe(method(gamma))]
624        #[unsafe(method_family = none)]
625        pub unsafe fn gamma(&self) -> c_float;
626
627        /// Setter for [`gamma`][Self::gamma].
628        #[unsafe(method(setGamma:))]
629        #[unsafe(method_family = none)]
630        pub unsafe fn setGamma(&self, gamma: c_float);
631
632        #[unsafe(method(exposure))]
633        #[unsafe(method_family = none)]
634        pub unsafe fn exposure(&self) -> c_float;
635
636        /// Setter for [`exposure`][Self::exposure].
637        #[unsafe(method(setExposure:))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn setExposure(&self, exposure: c_float);
640
641        #[unsafe(method(brightness))]
642        #[unsafe(method_family = none)]
643        pub unsafe fn brightness(&self) -> c_float;
644
645        /// Setter for [`brightness`][Self::brightness].
646        #[unsafe(method(setBrightness:))]
647        #[unsafe(method_family = none)]
648        pub unsafe fn setBrightness(&self, brightness: c_float);
649
650        #[unsafe(method(contrast))]
651        #[unsafe(method_family = none)]
652        pub unsafe fn contrast(&self) -> c_float;
653
654        /// Setter for [`contrast`][Self::contrast].
655        #[unsafe(method(setContrast:))]
656        #[unsafe(method_family = none)]
657        pub unsafe fn setContrast(&self, contrast: c_float);
658
659        #[unsafe(method(saturation))]
660        #[unsafe(method_family = none)]
661        pub unsafe fn saturation(&self) -> c_float;
662
663        /// Setter for [`saturation`][Self::saturation].
664        #[unsafe(method(setSaturation:))]
665        #[unsafe(method_family = none)]
666        pub unsafe fn setSaturation(&self, saturation: c_float);
667    );
668}
669
670/// Methods declared on superclass `MDLTexture`.
671impl MDLSkyCubeTexture {
672    extern_methods!(
673        #[unsafe(method(init))]
674        #[unsafe(method_family = init)]
675        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
676
677        /// Creates a texture from a source in the main bundle named in a manner matching
678        /// name.
679        #[unsafe(method(textureNamed:))]
680        #[unsafe(method_family = none)]
681        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
682
683        #[unsafe(method(textureNamed:bundle:))]
684        #[unsafe(method_family = none)]
685        pub unsafe fn textureNamed_bundle(
686            name: &NSString,
687            bundle_or_nil: Option<&NSBundle>,
688        ) -> Option<Retained<Self>>;
689
690        #[cfg(feature = "MDLAssetResolver")]
691        #[unsafe(method(textureNamed:assetResolver:))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn textureNamed_assetResolver(
694            name: &NSString,
695            resolver: &ProtocolObject<dyn MDLAssetResolver>,
696        ) -> Option<Retained<Self>>;
697
698        /// Creates a cube texture map image using 6 faces of the same dimensions,
699        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
700        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
701        /// isCube will return YES
702        ///
703        ///
704        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
705        /// - If 6 individual images are given they are assumed to be in order and will be
706        /// loaded as is.
707        /// - if 3 images of double height or width are given they will be treated as
708        /// pairs of + and - in each axis, the order is must be x, then y, then z.
709        /// - if 2 images of triple height or width are given they will be treates as a
710        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
711        /// - if a single image is given it will be used without conversion if in column
712        /// orientation and demosaiced in all other instances.
713        #[unsafe(method(textureCubeWithImagesNamed:))]
714        #[unsafe(method_family = none)]
715        pub unsafe fn textureCubeWithImagesNamed(
716            names: &NSArray<NSString>,
717        ) -> Option<Retained<Self>>;
718
719        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
720        #[unsafe(method_family = none)]
721        pub unsafe fn textureCubeWithImagesNamed_bundle(
722            names: &NSArray<NSString>,
723            bundle_or_nil: Option<&NSBundle>,
724        ) -> Option<Retained<Self>>;
725    );
726}
727
728/// Methods declared on superclass `NSObject`.
729impl MDLSkyCubeTexture {
730    extern_methods!(
731        #[unsafe(method(new))]
732        #[unsafe(method_family = new)]
733        pub unsafe fn new() -> Retained<Self>;
734    );
735}
736
737extern_class!(
738    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlcolorswatchtexture?language=objc)
739    #[unsafe(super(MDLTexture, NSObject))]
740    #[derive(Debug, PartialEq, Eq, Hash)]
741    pub struct MDLColorSwatchTexture;
742);
743
744#[cfg(feature = "MDLTypes")]
745unsafe impl MDLNamed for MDLColorSwatchTexture {}
746
747unsafe impl NSObjectProtocol for MDLColorSwatchTexture {}
748
749impl MDLColorSwatchTexture {
750    extern_methods!();
751}
752
753/// Methods declared on superclass `MDLTexture`.
754impl MDLColorSwatchTexture {
755    extern_methods!(
756        #[unsafe(method(init))]
757        #[unsafe(method_family = init)]
758        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
759
760        /// Creates a texture from a source in the main bundle named in a manner matching
761        /// name.
762        #[unsafe(method(textureNamed:))]
763        #[unsafe(method_family = none)]
764        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
765
766        #[unsafe(method(textureNamed:bundle:))]
767        #[unsafe(method_family = none)]
768        pub unsafe fn textureNamed_bundle(
769            name: &NSString,
770            bundle_or_nil: Option<&NSBundle>,
771        ) -> Option<Retained<Self>>;
772
773        #[cfg(feature = "MDLAssetResolver")]
774        #[unsafe(method(textureNamed:assetResolver:))]
775        #[unsafe(method_family = none)]
776        pub unsafe fn textureNamed_assetResolver(
777            name: &NSString,
778            resolver: &ProtocolObject<dyn MDLAssetResolver>,
779        ) -> Option<Retained<Self>>;
780
781        /// Creates a cube texture map image using 6 faces of the same dimensions,
782        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
783        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
784        /// isCube will return YES
785        ///
786        ///
787        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
788        /// - If 6 individual images are given they are assumed to be in order and will be
789        /// loaded as is.
790        /// - if 3 images of double height or width are given they will be treated as
791        /// pairs of + and - in each axis, the order is must be x, then y, then z.
792        /// - if 2 images of triple height or width are given they will be treates as a
793        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
794        /// - if a single image is given it will be used without conversion if in column
795        /// orientation and demosaiced in all other instances.
796        #[unsafe(method(textureCubeWithImagesNamed:))]
797        #[unsafe(method_family = none)]
798        pub unsafe fn textureCubeWithImagesNamed(
799            names: &NSArray<NSString>,
800        ) -> Option<Retained<Self>>;
801
802        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn textureCubeWithImagesNamed_bundle(
805            names: &NSArray<NSString>,
806            bundle_or_nil: Option<&NSBundle>,
807        ) -> Option<Retained<Self>>;
808    );
809}
810
811/// Methods declared on superclass `NSObject`.
812impl MDLColorSwatchTexture {
813    extern_methods!(
814        #[unsafe(method(new))]
815        #[unsafe(method_family = new)]
816        pub unsafe fn new() -> Retained<Self>;
817    );
818}
819
820extern_class!(
821    /// MDLNoiseTexture
822    /// a noise texture containing vector or scalar noise
823    ///
824    /// the texture will be created if data is referenced, otherwise, this
825    /// object is merely a description
826    ///
827    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlnoisetexture?language=objc)
828    #[unsafe(super(MDLTexture, NSObject))]
829    #[derive(Debug, PartialEq, Eq, Hash)]
830    pub struct MDLNoiseTexture;
831);
832
833#[cfg(feature = "MDLTypes")]
834unsafe impl MDLNamed for MDLNoiseTexture {}
835
836unsafe impl NSObjectProtocol for MDLNoiseTexture {}
837
838impl MDLNoiseTexture {
839    extern_methods!();
840}
841
842/// Methods declared on superclass `MDLTexture`.
843impl MDLNoiseTexture {
844    extern_methods!(
845        #[unsafe(method(init))]
846        #[unsafe(method_family = init)]
847        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
848
849        /// Creates a texture from a source in the main bundle named in a manner matching
850        /// name.
851        #[unsafe(method(textureNamed:))]
852        #[unsafe(method_family = none)]
853        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
854
855        #[unsafe(method(textureNamed:bundle:))]
856        #[unsafe(method_family = none)]
857        pub unsafe fn textureNamed_bundle(
858            name: &NSString,
859            bundle_or_nil: Option<&NSBundle>,
860        ) -> Option<Retained<Self>>;
861
862        #[cfg(feature = "MDLAssetResolver")]
863        #[unsafe(method(textureNamed:assetResolver:))]
864        #[unsafe(method_family = none)]
865        pub unsafe fn textureNamed_assetResolver(
866            name: &NSString,
867            resolver: &ProtocolObject<dyn MDLAssetResolver>,
868        ) -> Option<Retained<Self>>;
869
870        /// Creates a cube texture map image using 6 faces of the same dimensions,
871        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
872        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
873        /// isCube will return YES
874        ///
875        ///
876        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
877        /// - If 6 individual images are given they are assumed to be in order and will be
878        /// loaded as is.
879        /// - if 3 images of double height or width are given they will be treated as
880        /// pairs of + and - in each axis, the order is must be x, then y, then z.
881        /// - if 2 images of triple height or width are given they will be treates as a
882        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
883        /// - if a single image is given it will be used without conversion if in column
884        /// orientation and demosaiced in all other instances.
885        #[unsafe(method(textureCubeWithImagesNamed:))]
886        #[unsafe(method_family = none)]
887        pub unsafe fn textureCubeWithImagesNamed(
888            names: &NSArray<NSString>,
889        ) -> Option<Retained<Self>>;
890
891        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
892        #[unsafe(method_family = none)]
893        pub unsafe fn textureCubeWithImagesNamed_bundle(
894            names: &NSArray<NSString>,
895            bundle_or_nil: Option<&NSBundle>,
896        ) -> Option<Retained<Self>>;
897    );
898}
899
900/// Methods declared on superclass `NSObject`.
901impl MDLNoiseTexture {
902    extern_methods!(
903        #[unsafe(method(new))]
904        #[unsafe(method_family = new)]
905        pub unsafe fn new() -> Retained<Self>;
906    );
907}
908
909extern_class!(
910    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlnormalmaptexture?language=objc)
911    #[unsafe(super(MDLTexture, NSObject))]
912    #[derive(Debug, PartialEq, Eq, Hash)]
913    pub struct MDLNormalMapTexture;
914);
915
916#[cfg(feature = "MDLTypes")]
917unsafe impl MDLNamed for MDLNormalMapTexture {}
918
919unsafe impl NSObjectProtocol for MDLNormalMapTexture {}
920
921impl MDLNormalMapTexture {
922    extern_methods!(
923        #[unsafe(method(initByGeneratingNormalMapWithTexture:name:smoothness:contrast:))]
924        #[unsafe(method_family = init)]
925        pub unsafe fn initByGeneratingNormalMapWithTexture_name_smoothness_contrast(
926            this: Allocated<Self>,
927            source_texture: &MDLTexture,
928            name: Option<&NSString>,
929            smoothness: c_float,
930            contrast: c_float,
931        ) -> Retained<Self>;
932    );
933}
934
935/// Methods declared on superclass `MDLTexture`.
936impl MDLNormalMapTexture {
937    extern_methods!(
938        #[unsafe(method(init))]
939        #[unsafe(method_family = init)]
940        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
941
942        /// Creates a texture from a source in the main bundle named in a manner matching
943        /// name.
944        #[unsafe(method(textureNamed:))]
945        #[unsafe(method_family = none)]
946        pub unsafe fn textureNamed(name: &NSString) -> Option<Retained<Self>>;
947
948        #[unsafe(method(textureNamed:bundle:))]
949        #[unsafe(method_family = none)]
950        pub unsafe fn textureNamed_bundle(
951            name: &NSString,
952            bundle_or_nil: Option<&NSBundle>,
953        ) -> Option<Retained<Self>>;
954
955        #[cfg(feature = "MDLAssetResolver")]
956        #[unsafe(method(textureNamed:assetResolver:))]
957        #[unsafe(method_family = none)]
958        pub unsafe fn textureNamed_assetResolver(
959            name: &NSString,
960            resolver: &ProtocolObject<dyn MDLAssetResolver>,
961        ) -> Option<Retained<Self>>;
962
963        /// Creates a cube texture map image using 6 faces of the same dimensions,
964        /// ordered +X,-X,+Y,-Y,+Z,-Z If the data is read back the image will be compacted
965        /// into a single vertical stack where dimensions.y = 6 * dimensions.x
966        /// isCube will return YES
967        ///
968        ///
969        /// Parameter `names`: a collection of mosaiced images in a cross formation or column or row.
970        /// - If 6 individual images are given they are assumed to be in order and will be
971        /// loaded as is.
972        /// - if 3 images of double height or width are given they will be treated as
973        /// pairs of + and - in each axis, the order is must be x, then y, then z.
974        /// - if 2 images of triple height or width are given they will be treates as a
975        /// positive set and a negative set in the order +x, +y, +z, then -x, -y, -z.
976        /// - if a single image is given it will be used without conversion if in column
977        /// orientation and demosaiced in all other instances.
978        #[unsafe(method(textureCubeWithImagesNamed:))]
979        #[unsafe(method_family = none)]
980        pub unsafe fn textureCubeWithImagesNamed(
981            names: &NSArray<NSString>,
982        ) -> Option<Retained<Self>>;
983
984        #[unsafe(method(textureCubeWithImagesNamed:bundle:))]
985        #[unsafe(method_family = none)]
986        pub unsafe fn textureCubeWithImagesNamed_bundle(
987            names: &NSArray<NSString>,
988            bundle_or_nil: Option<&NSBundle>,
989        ) -> Option<Retained<Self>>;
990    );
991}
992
993/// Methods declared on superclass `NSObject`.
994impl MDLNormalMapTexture {
995    extern_methods!(
996        #[unsafe(method(new))]
997        #[unsafe(method_family = new)]
998        pub unsafe fn new() -> Retained<Self>;
999    );
1000}