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