objc2_model_io/generated/
MDLMaterial.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-graphics")]
7use objc2_core_graphics::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// MDLMaterialSemantic
13///
14/// The material semantics are identifiers for material properties
15/// formally identified by one of the standard material descriptors.
16///
17///
18/// When files containing material properties are loaded and translated
19/// by ModelIO, an appropriate standard material descriptor will be
20/// chosen, and any properties translated from the loaded file can be
21/// retrieved using one of these semantics.
22///
23/// MDLMaterialSemanticBaseColor
24/// The inherent color of a surface to be used as a modulator during shading.
25/// Default is 50% gray
26///
27/// MDLMaterialSemanticSubsurface,
28/// The degree to which light scatters under the surface of a material
29///
30/// MDLMaterialSemanticMetallic
31/// A blend between a material behaving as a dielectric material at zero, and a
32/// metal at one.
33///
34/// MDLMaterialSemanticSpecular
35/// Specular response to incident light
36///
37/// MDLMaterialSemanticSpecularExponent
38/// Power of the specular exponent in the case that a Blinn/Phong BSDF is in use.
39///
40/// MDLMaterialSemanticSpecularTint
41/// At zero, the specular highlight will use the hue, saturation, and intensity
42/// of incoming light to color the specular response; at one, the material's
43/// base color, and the light's intensity will be used.
44///
45/// MDLMaterialSemanticRoughness
46/// Controls diffuse and specular response. A value of zero is smooth and shiny.
47/// At one, a diffuse material will retroreflect, and the specular highlight
48/// will be very spread out.
49///
50/// MDLMaterialSemanticAnisotropic
51/// The degree to which the specular highlight is elongated in the direction of
52/// the local tangent basis. A mesh that does not have a tangent basis will not
53/// respond to this parameter.
54///
55/// MDLMaterialSemanticAnisotropicRotation
56/// The degree to which the anisotropy is rotated relative to the direction of the
57/// local tangent basis. Values from zero to one are mapped to zero to two PI.
58///
59/// MDLMaterialSemanticSheen
60/// A specular tint that appears at glancing angles on an object
61///
62/// MDLMaterialSemanticSheenTint
63/// At zero, the specular highlight will use the hue, saturation, and intensity
64/// of incoming light to color the specular response; at one, the material's
65/// base color, and the light's intensity will be used.
66///
67/// MDLMaterialSemanticClearcoat
68/// A second specular highlight, much like the gloss that results from a clear
69/// coat on an automotive finish
70///
71/// MDLMaterialSemanticClearcoatGloss
72/// The glossiness of the clear coat highlight.
73///
74/// MDLMaterialSemanticEmission
75/// A value that is to be emitted as radiance by a surface
76///
77/// MDLMaterialSemanticBump
78/// A value that perturbs surface normals according to the local gradient of
79/// the property
80///
81/// MDLMaterialSemanticOpacity
82/// The opacity of the surface
83///
84/// MDLMaterialSemanticInterfaceIndexOfRefraction
85/// n1 in Schlick's equation, typically 1.0 for air
86///
87/// MDLMaterialSemanticMaterialIndexOfRefraction
88/// n2 in Schlick's equation
89///
90/// MDLMaterialSemanticObjectSpaceNormal
91/// A value that perturbs surface normals in object space
92///
93/// MDLMaterialSemanticTangentSpaceNormal
94/// A value that perturbs surface normals in a local tangent space
95///
96/// MDLMaterialSemanticDisplacement
97/// Displacement of a surface relative to surface normal
98///
99/// MDLMaterialSemanticDisplacementScale
100/// Scaling factor for displacement
101///
102/// MDLMaterialSemanticAmbientOcclusion
103/// Ambient occlusion describes the accessibility of the surface to the
104/// surrounding radiant environment and is typically used to attenuate it. It is
105/// not intended to attenuate direct illumination sources.
106///
107/// MDLMaterialSemanticAmbientOcclusionScale
108/// The degree to which the ambient occlusion values are applied
109///
110/// MDLMaterialSemanticUserDefined = 0x8000
111/// Properties with this value are created when material properties are
112/// translated for which no known semantic applies.
113/// Semantics defined at greater than this value are available to be user defined.
114/// The first value is also used to indicate
115///
116/// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialsemantic?language=objc)
117// NS_ENUM
118#[repr(transparent)]
119#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
120pub struct MDLMaterialSemantic(pub NSUInteger);
121impl MDLMaterialSemantic {
122    #[doc(alias = "MDLMaterialSemanticBaseColor")]
123    pub const BaseColor: Self = Self(0);
124    #[doc(alias = "MDLMaterialSemanticSubsurface")]
125    pub const Subsurface: Self = Self(1);
126    #[doc(alias = "MDLMaterialSemanticMetallic")]
127    pub const Metallic: Self = Self(2);
128    #[doc(alias = "MDLMaterialSemanticSpecular")]
129    pub const Specular: Self = Self(3);
130    #[doc(alias = "MDLMaterialSemanticSpecularExponent")]
131    pub const SpecularExponent: Self = Self(4);
132    #[doc(alias = "MDLMaterialSemanticSpecularTint")]
133    pub const SpecularTint: Self = Self(5);
134    #[doc(alias = "MDLMaterialSemanticRoughness")]
135    pub const Roughness: Self = Self(6);
136    #[doc(alias = "MDLMaterialSemanticAnisotropic")]
137    pub const Anisotropic: Self = Self(7);
138    #[doc(alias = "MDLMaterialSemanticAnisotropicRotation")]
139    pub const AnisotropicRotation: Self = Self(8);
140    #[doc(alias = "MDLMaterialSemanticSheen")]
141    pub const Sheen: Self = Self(9);
142    #[doc(alias = "MDLMaterialSemanticSheenTint")]
143    pub const SheenTint: Self = Self(10);
144    #[doc(alias = "MDLMaterialSemanticClearcoat")]
145    pub const Clearcoat: Self = Self(11);
146    #[doc(alias = "MDLMaterialSemanticClearcoatGloss")]
147    pub const ClearcoatGloss: Self = Self(12);
148    #[doc(alias = "MDLMaterialSemanticEmission")]
149    pub const Emission: Self = Self(13);
150    #[doc(alias = "MDLMaterialSemanticBump")]
151    pub const Bump: Self = Self(14);
152    #[doc(alias = "MDLMaterialSemanticOpacity")]
153    pub const Opacity: Self = Self(15);
154    #[doc(alias = "MDLMaterialSemanticInterfaceIndexOfRefraction")]
155    pub const InterfaceIndexOfRefraction: Self = Self(16);
156    #[doc(alias = "MDLMaterialSemanticMaterialIndexOfRefraction")]
157    pub const MaterialIndexOfRefraction: Self = Self(17);
158    #[doc(alias = "MDLMaterialSemanticObjectSpaceNormal")]
159    pub const ObjectSpaceNormal: Self = Self(18);
160    #[doc(alias = "MDLMaterialSemanticTangentSpaceNormal")]
161    pub const TangentSpaceNormal: Self = Self(19);
162    #[doc(alias = "MDLMaterialSemanticDisplacement")]
163    pub const Displacement: Self = Self(20);
164    #[doc(alias = "MDLMaterialSemanticDisplacementScale")]
165    pub const DisplacementScale: Self = Self(21);
166    #[doc(alias = "MDLMaterialSemanticAmbientOcclusion")]
167    pub const AmbientOcclusion: Self = Self(22);
168    #[doc(alias = "MDLMaterialSemanticAmbientOcclusionScale")]
169    pub const AmbientOcclusionScale: Self = Self(23);
170    #[doc(alias = "MDLMaterialSemanticNone")]
171    pub const None: Self = Self(0x8000);
172    #[doc(alias = "MDLMaterialSemanticUserDefined")]
173    pub const UserDefined: Self = Self(0x8001);
174}
175
176unsafe impl Encode for MDLMaterialSemantic {
177    const ENCODING: Encoding = NSUInteger::ENCODING;
178}
179
180unsafe impl RefEncode for MDLMaterialSemantic {
181    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
182}
183
184/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertytype?language=objc)
185// NS_ENUM
186#[repr(transparent)]
187#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
188pub struct MDLMaterialPropertyType(pub NSUInteger);
189impl MDLMaterialPropertyType {
190    #[doc(alias = "MDLMaterialPropertyTypeNone")]
191    pub const None: Self = Self(0);
192    #[doc(alias = "MDLMaterialPropertyTypeString")]
193    pub const String: Self = Self(1);
194    #[doc(alias = "MDLMaterialPropertyTypeURL")]
195    pub const URL: Self = Self(2);
196    #[doc(alias = "MDLMaterialPropertyTypeTexture")]
197    pub const Texture: Self = Self(3);
198    #[doc(alias = "MDLMaterialPropertyTypeColor")]
199    pub const Color: Self = Self(4);
200    #[doc(alias = "MDLMaterialPropertyTypeFloat")]
201    pub const Float: Self = Self(5);
202    #[doc(alias = "MDLMaterialPropertyTypeFloat2")]
203    pub const Float2: Self = Self(6);
204    #[doc(alias = "MDLMaterialPropertyTypeFloat3")]
205    pub const Float3: Self = Self(7);
206    #[doc(alias = "MDLMaterialPropertyTypeFloat4")]
207    pub const Float4: Self = Self(8);
208    #[doc(alias = "MDLMaterialPropertyTypeMatrix44")]
209    pub const Matrix44: Self = Self(9);
210    #[doc(alias = "MDLMaterialPropertyTypeBuffer")]
211    pub const Buffer: Self = Self(10);
212}
213
214unsafe impl Encode for MDLMaterialPropertyType {
215    const ENCODING: Encoding = NSUInteger::ENCODING;
216}
217
218unsafe impl RefEncode for MDLMaterialPropertyType {
219    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
220}
221
222/// Texture filtering
223///
224/// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialtexturewrapmode?language=objc)
225// NS_ENUM
226#[repr(transparent)]
227#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
228pub struct MDLMaterialTextureWrapMode(pub NSUInteger);
229impl MDLMaterialTextureWrapMode {
230    #[doc(alias = "MDLMaterialTextureWrapModeClamp")]
231    pub const Clamp: Self = Self(0);
232    #[doc(alias = "MDLMaterialTextureWrapModeRepeat")]
233    pub const Repeat: Self = Self(1);
234    #[doc(alias = "MDLMaterialTextureWrapModeMirror")]
235    pub const Mirror: Self = Self(2);
236}
237
238unsafe impl Encode for MDLMaterialTextureWrapMode {
239    const ENCODING: Encoding = NSUInteger::ENCODING;
240}
241
242unsafe impl RefEncode for MDLMaterialTextureWrapMode {
243    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
244}
245
246/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialtexturefiltermode?language=objc)
247// NS_ENUM
248#[repr(transparent)]
249#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
250pub struct MDLMaterialTextureFilterMode(pub NSUInteger);
251impl MDLMaterialTextureFilterMode {
252    #[doc(alias = "MDLMaterialTextureFilterModeNearest")]
253    pub const Nearest: Self = Self(0);
254    #[doc(alias = "MDLMaterialTextureFilterModeLinear")]
255    pub const Linear: Self = Self(1);
256}
257
258unsafe impl Encode for MDLMaterialTextureFilterMode {
259    const ENCODING: Encoding = NSUInteger::ENCODING;
260}
261
262unsafe impl RefEncode for MDLMaterialTextureFilterMode {
263    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
264}
265
266/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialmipmapfiltermode?language=objc)
267// NS_ENUM
268#[repr(transparent)]
269#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
270pub struct MDLMaterialMipMapFilterMode(pub NSUInteger);
271impl MDLMaterialMipMapFilterMode {
272    #[doc(alias = "MDLMaterialMipMapFilterModeNearest")]
273    pub const Nearest: Self = Self(0);
274    #[doc(alias = "MDLMaterialMipMapFilterModeLinear")]
275    pub const Linear: Self = Self(1);
276}
277
278unsafe impl Encode for MDLMaterialMipMapFilterMode {
279    const ENCODING: Encoding = NSUInteger::ENCODING;
280}
281
282unsafe impl RefEncode for MDLMaterialMipMapFilterMode {
283    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
284}
285
286extern_class!(
287    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexturefilter?language=objc)
288    #[unsafe(super(NSObject))]
289    #[derive(Debug, PartialEq, Eq, Hash)]
290    pub struct MDLTextureFilter;
291);
292
293unsafe impl NSObjectProtocol for MDLTextureFilter {}
294
295impl MDLTextureFilter {
296    extern_methods!(
297        #[unsafe(method(sWrapMode))]
298        #[unsafe(method_family = none)]
299        pub unsafe fn sWrapMode(&self) -> MDLMaterialTextureWrapMode;
300
301        /// Setter for [`sWrapMode`][Self::sWrapMode].
302        #[unsafe(method(setSWrapMode:))]
303        #[unsafe(method_family = none)]
304        pub unsafe fn setSWrapMode(&self, s_wrap_mode: MDLMaterialTextureWrapMode);
305
306        #[unsafe(method(tWrapMode))]
307        #[unsafe(method_family = none)]
308        pub unsafe fn tWrapMode(&self) -> MDLMaterialTextureWrapMode;
309
310        /// Setter for [`tWrapMode`][Self::tWrapMode].
311        #[unsafe(method(setTWrapMode:))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn setTWrapMode(&self, t_wrap_mode: MDLMaterialTextureWrapMode);
314
315        #[unsafe(method(rWrapMode))]
316        #[unsafe(method_family = none)]
317        pub unsafe fn rWrapMode(&self) -> MDLMaterialTextureWrapMode;
318
319        /// Setter for [`rWrapMode`][Self::rWrapMode].
320        #[unsafe(method(setRWrapMode:))]
321        #[unsafe(method_family = none)]
322        pub unsafe fn setRWrapMode(&self, r_wrap_mode: MDLMaterialTextureWrapMode);
323
324        #[unsafe(method(minFilter))]
325        #[unsafe(method_family = none)]
326        pub unsafe fn minFilter(&self) -> MDLMaterialTextureFilterMode;
327
328        /// Setter for [`minFilter`][Self::minFilter].
329        #[unsafe(method(setMinFilter:))]
330        #[unsafe(method_family = none)]
331        pub unsafe fn setMinFilter(&self, min_filter: MDLMaterialTextureFilterMode);
332
333        #[unsafe(method(magFilter))]
334        #[unsafe(method_family = none)]
335        pub unsafe fn magFilter(&self) -> MDLMaterialTextureFilterMode;
336
337        /// Setter for [`magFilter`][Self::magFilter].
338        #[unsafe(method(setMagFilter:))]
339        #[unsafe(method_family = none)]
340        pub unsafe fn setMagFilter(&self, mag_filter: MDLMaterialTextureFilterMode);
341
342        #[unsafe(method(mipFilter))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn mipFilter(&self) -> MDLMaterialMipMapFilterMode;
345
346        /// Setter for [`mipFilter`][Self::mipFilter].
347        #[unsafe(method(setMipFilter:))]
348        #[unsafe(method_family = none)]
349        pub unsafe fn setMipFilter(&self, mip_filter: MDLMaterialMipMapFilterMode);
350    );
351}
352
353/// Methods declared on superclass `NSObject`.
354impl MDLTextureFilter {
355    extern_methods!(
356        #[unsafe(method(init))]
357        #[unsafe(method_family = init)]
358        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
359
360        #[unsafe(method(new))]
361        #[unsafe(method_family = new)]
362        pub unsafe fn new() -> Retained<Self>;
363    );
364}
365
366extern_class!(
367    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdltexturesampler?language=objc)
368    #[unsafe(super(NSObject))]
369    #[derive(Debug, PartialEq, Eq, Hash)]
370    pub struct MDLTextureSampler;
371);
372
373unsafe impl NSObjectProtocol for MDLTextureSampler {}
374
375impl MDLTextureSampler {
376    extern_methods!(
377        #[cfg(feature = "MDLTexture")]
378        #[unsafe(method(texture))]
379        #[unsafe(method_family = none)]
380        pub unsafe fn texture(&self) -> Option<Retained<MDLTexture>>;
381
382        #[cfg(feature = "MDLTexture")]
383        /// Setter for [`texture`][Self::texture].
384        #[unsafe(method(setTexture:))]
385        #[unsafe(method_family = none)]
386        pub unsafe fn setTexture(&self, texture: Option<&MDLTexture>);
387
388        #[unsafe(method(hardwareFilter))]
389        #[unsafe(method_family = none)]
390        pub unsafe fn hardwareFilter(&self) -> Option<Retained<MDLTextureFilter>>;
391
392        /// Setter for [`hardwareFilter`][Self::hardwareFilter].
393        #[unsafe(method(setHardwareFilter:))]
394        #[unsafe(method_family = none)]
395        pub unsafe fn setHardwareFilter(&self, hardware_filter: Option<&MDLTextureFilter>);
396
397        #[cfg(feature = "MDLTransform")]
398        #[unsafe(method(transform))]
399        #[unsafe(method_family = none)]
400        pub unsafe fn transform(&self) -> Option<Retained<MDLTransform>>;
401
402        #[cfg(feature = "MDLTransform")]
403        /// Setter for [`transform`][Self::transform].
404        #[unsafe(method(setTransform:))]
405        #[unsafe(method_family = none)]
406        pub unsafe fn setTransform(&self, transform: Option<&MDLTransform>);
407    );
408}
409
410/// Methods declared on superclass `NSObject`.
411impl MDLTextureSampler {
412    extern_methods!(
413        #[unsafe(method(init))]
414        #[unsafe(method_family = init)]
415        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
416
417        #[unsafe(method(new))]
418        #[unsafe(method_family = new)]
419        pub unsafe fn new() -> Retained<Self>;
420    );
421}
422
423extern_class!(
424    /// If a color is encoded in a floatN property, it is to be interpreted as
425    /// a Rec 709 color.
426    ///
427    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialproperty?language=objc)
428    #[unsafe(super(NSObject))]
429    #[derive(Debug, PartialEq, Eq, Hash)]
430    pub struct MDLMaterialProperty;
431);
432
433#[cfg(feature = "MDLTypes")]
434unsafe impl MDLNamed for MDLMaterialProperty {}
435
436unsafe impl NSCopying for MDLMaterialProperty {}
437
438unsafe impl CopyingHelper for MDLMaterialProperty {
439    type Result = Self;
440}
441
442unsafe impl NSObjectProtocol for MDLMaterialProperty {}
443
444impl MDLMaterialProperty {
445    extern_methods!(
446        #[unsafe(method(init))]
447        #[unsafe(method_family = init)]
448        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
449
450        #[unsafe(method(initWithName:semantic:))]
451        #[unsafe(method_family = init)]
452        pub unsafe fn initWithName_semantic(
453            this: Allocated<Self>,
454            name: &NSString,
455            semantic: MDLMaterialSemantic,
456        ) -> Retained<Self>;
457
458        #[unsafe(method(initWithName:semantic:float:))]
459        #[unsafe(method_family = init)]
460        pub unsafe fn initWithName_semantic_float(
461            this: Allocated<Self>,
462            name: &NSString,
463            semantic: MDLMaterialSemantic,
464            value: c_float,
465        ) -> Retained<Self>;
466
467        #[unsafe(method(initWithName:semantic:URL:))]
468        #[unsafe(method_family = init)]
469        pub unsafe fn initWithName_semantic_URL(
470            this: Allocated<Self>,
471            name: &NSString,
472            semantic: MDLMaterialSemantic,
473            url: Option<&NSURL>,
474        ) -> Retained<Self>;
475
476        #[unsafe(method(initWithName:semantic:string:))]
477        #[unsafe(method_family = init)]
478        pub unsafe fn initWithName_semantic_string(
479            this: Allocated<Self>,
480            name: &NSString,
481            semantic: MDLMaterialSemantic,
482            string: Option<&NSString>,
483        ) -> Retained<Self>;
484
485        #[unsafe(method(initWithName:semantic:textureSampler:))]
486        #[unsafe(method_family = init)]
487        pub unsafe fn initWithName_semantic_textureSampler(
488            this: Allocated<Self>,
489            name: &NSString,
490            semantic: MDLMaterialSemantic,
491            texture_sampler: Option<&MDLTextureSampler>,
492        ) -> Retained<Self>;
493
494        #[cfg(feature = "objc2-core-graphics")]
495        #[unsafe(method(initWithName:semantic:color:))]
496        #[unsafe(method_family = init)]
497        pub unsafe fn initWithName_semantic_color(
498            this: Allocated<Self>,
499            name: &NSString,
500            semantic: MDLMaterialSemantic,
501            color: &CGColor,
502        ) -> Retained<Self>;
503
504        #[unsafe(method(setProperties:))]
505        #[unsafe(method_family = none)]
506        pub unsafe fn setProperties(&self, property: &MDLMaterialProperty);
507
508        #[unsafe(method(semantic))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn semantic(&self) -> MDLMaterialSemantic;
511
512        /// Setter for [`semantic`][Self::semantic].
513        #[unsafe(method(setSemantic:))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn setSemantic(&self, semantic: MDLMaterialSemantic);
516
517        #[unsafe(method(type))]
518        #[unsafe(method_family = none)]
519        pub unsafe fn r#type(&self) -> MDLMaterialPropertyType;
520
521        /// Setter for [`type`][Self::type].
522        #[unsafe(method(setType:))]
523        #[unsafe(method_family = none)]
524        pub unsafe fn setType(&self, r#type: MDLMaterialPropertyType);
525
526        /// See: MDLNamed
527        #[unsafe(method(name))]
528        #[unsafe(method_family = none)]
529        pub unsafe fn name(&self) -> Retained<NSString>;
530
531        /// Setter for [`name`][Self::name].
532        #[unsafe(method(setName:))]
533        #[unsafe(method_family = none)]
534        pub unsafe fn setName(&self, name: &NSString);
535
536        #[unsafe(method(stringValue))]
537        #[unsafe(method_family = none)]
538        pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
539
540        /// Setter for [`stringValue`][Self::stringValue].
541        #[unsafe(method(setStringValue:))]
542        #[unsafe(method_family = none)]
543        pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
544
545        #[unsafe(method(URLValue))]
546        #[unsafe(method_family = none)]
547        pub unsafe fn URLValue(&self) -> Option<Retained<NSURL>>;
548
549        /// Setter for [`URLValue`][Self::URLValue].
550        #[unsafe(method(setURLValue:))]
551        #[unsafe(method_family = none)]
552        pub unsafe fn setURLValue(&self, url_value: Option<&NSURL>);
553
554        #[unsafe(method(textureSamplerValue))]
555        #[unsafe(method_family = none)]
556        pub unsafe fn textureSamplerValue(&self) -> Option<Retained<MDLTextureSampler>>;
557
558        /// Setter for [`textureSamplerValue`][Self::textureSamplerValue].
559        #[unsafe(method(setTextureSamplerValue:))]
560        #[unsafe(method_family = none)]
561        pub unsafe fn setTextureSamplerValue(
562            &self,
563            texture_sampler_value: Option<&MDLTextureSampler>,
564        );
565
566        #[cfg(feature = "objc2-core-graphics")]
567        #[unsafe(method(color))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn color(&self) -> Option<Retained<CGColor>>;
570
571        #[cfg(feature = "objc2-core-graphics")]
572        /// Setter for [`color`][Self::color].
573        #[unsafe(method(setColor:))]
574        #[unsafe(method_family = none)]
575        pub unsafe fn setColor(&self, color: Option<&CGColor>);
576
577        #[unsafe(method(floatValue))]
578        #[unsafe(method_family = none)]
579        pub unsafe fn floatValue(&self) -> c_float;
580
581        /// Setter for [`floatValue`][Self::floatValue].
582        #[unsafe(method(setFloatValue:))]
583        #[unsafe(method_family = none)]
584        pub unsafe fn setFloatValue(&self, float_value: c_float);
585
586        #[unsafe(method(luminance))]
587        #[unsafe(method_family = none)]
588        pub unsafe fn luminance(&self) -> c_float;
589
590        /// Setter for [`luminance`][Self::luminance].
591        #[unsafe(method(setLuminance:))]
592        #[unsafe(method_family = none)]
593        pub unsafe fn setLuminance(&self, luminance: c_float);
594    );
595}
596
597/// Methods declared on superclass `NSObject`.
598impl MDLMaterialProperty {
599    extern_methods!(
600        #[unsafe(method(new))]
601        #[unsafe(method_family = new)]
602        pub unsafe fn new() -> Retained<Self>;
603    );
604}
605
606extern_class!(
607    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertyconnection?language=objc)
608    #[unsafe(super(NSObject))]
609    #[derive(Debug, PartialEq, Eq, Hash)]
610    pub struct MDLMaterialPropertyConnection;
611);
612
613#[cfg(feature = "MDLTypes")]
614unsafe impl MDLNamed for MDLMaterialPropertyConnection {}
615
616unsafe impl NSObjectProtocol for MDLMaterialPropertyConnection {}
617
618impl MDLMaterialPropertyConnection {
619    extern_methods!(
620        #[unsafe(method(init))]
621        #[unsafe(method_family = init)]
622        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
623
624        /// Connects the output to the input
625        #[unsafe(method(initWithOutput:input:))]
626        #[unsafe(method_family = init)]
627        pub unsafe fn initWithOutput_input(
628            this: Allocated<Self>,
629            output: &MDLMaterialProperty,
630            input: &MDLMaterialProperty,
631        ) -> Retained<Self>;
632
633        #[unsafe(method(output))]
634        #[unsafe(method_family = none)]
635        pub unsafe fn output(&self) -> Option<Retained<MDLMaterialProperty>>;
636
637        #[unsafe(method(input))]
638        #[unsafe(method_family = none)]
639        pub unsafe fn input(&self) -> Option<Retained<MDLMaterialProperty>>;
640    );
641}
642
643/// Methods declared on superclass `NSObject`.
644impl MDLMaterialPropertyConnection {
645    extern_methods!(
646        #[unsafe(method(new))]
647        #[unsafe(method_family = new)]
648        pub unsafe fn new() -> Retained<Self>;
649    );
650}
651
652extern_class!(
653    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertynode?language=objc)
654    #[unsafe(super(NSObject))]
655    #[derive(Debug, PartialEq, Eq, Hash)]
656    pub struct MDLMaterialPropertyNode;
657);
658
659#[cfg(feature = "MDLTypes")]
660unsafe impl MDLNamed for MDLMaterialPropertyNode {}
661
662unsafe impl NSObjectProtocol for MDLMaterialPropertyNode {}
663
664impl MDLMaterialPropertyNode {
665    extern_methods!(
666        #[unsafe(method(init))]
667        #[unsafe(method_family = init)]
668        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
669
670        #[cfg(feature = "block2")]
671        #[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
672        #[unsafe(method_family = init)]
673        pub unsafe fn initWithInputs_outputs_evaluationFunction(
674            this: Allocated<Self>,
675            inputs: &NSArray<MDLMaterialProperty>,
676            outputs: &NSArray<MDLMaterialProperty>,
677            function: &block2::Block<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
678        ) -> Retained<Self>;
679
680        #[cfg(feature = "block2")]
681        #[unsafe(method(evaluationFunction))]
682        #[unsafe(method_family = none)]
683        pub unsafe fn evaluationFunction(
684            &self,
685        ) -> NonNull<block2::Block<dyn Fn(NonNull<MDLMaterialPropertyNode>)>>;
686
687        #[cfg(feature = "block2")]
688        /// Setter for [`evaluationFunction`][Self::evaluationFunction].
689        #[unsafe(method(setEvaluationFunction:))]
690        #[unsafe(method_family = none)]
691        pub unsafe fn setEvaluationFunction(
692            &self,
693            evaluation_function: &block2::Block<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
694        );
695
696        #[unsafe(method(inputs))]
697        #[unsafe(method_family = none)]
698        pub unsafe fn inputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
699
700        #[unsafe(method(outputs))]
701        #[unsafe(method_family = none)]
702        pub unsafe fn outputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
703    );
704}
705
706/// Methods declared on superclass `NSObject`.
707impl MDLMaterialPropertyNode {
708    extern_methods!(
709        #[unsafe(method(new))]
710        #[unsafe(method_family = new)]
711        pub unsafe fn new() -> Retained<Self>;
712    );
713}
714
715extern_class!(
716    /// inputs and outputs will contain all of the inputs and outputs
717    /// external to the graph, which are all the inputs and outputs not
718    /// internally connected to something
719    ///
720    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialpropertygraph?language=objc)
721    #[unsafe(super(MDLMaterialPropertyNode, NSObject))]
722    #[derive(Debug, PartialEq, Eq, Hash)]
723    pub struct MDLMaterialPropertyGraph;
724);
725
726#[cfg(feature = "MDLTypes")]
727unsafe impl MDLNamed for MDLMaterialPropertyGraph {}
728
729unsafe impl NSObjectProtocol for MDLMaterialPropertyGraph {}
730
731impl MDLMaterialPropertyGraph {
732    extern_methods!(
733        #[unsafe(method(init))]
734        #[unsafe(method_family = init)]
735        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
736
737        #[unsafe(method(initWithNodes:connections:))]
738        #[unsafe(method_family = init)]
739        pub unsafe fn initWithNodes_connections(
740            this: Allocated<Self>,
741            nodes: &NSArray<MDLMaterialPropertyNode>,
742            connections: &NSArray<MDLMaterialPropertyConnection>,
743        ) -> Retained<Self>;
744
745        #[unsafe(method(evaluate))]
746        #[unsafe(method_family = none)]
747        pub unsafe fn evaluate(&self);
748
749        #[unsafe(method(nodes))]
750        #[unsafe(method_family = none)]
751        pub unsafe fn nodes(&self) -> Retained<NSArray<MDLMaterialPropertyNode>>;
752
753        #[unsafe(method(connections))]
754        #[unsafe(method_family = none)]
755        pub unsafe fn connections(&self) -> Retained<NSArray<MDLMaterialPropertyConnection>>;
756    );
757}
758
759/// Methods declared on superclass `MDLMaterialPropertyNode`.
760impl MDLMaterialPropertyGraph {
761    extern_methods!(
762        #[cfg(feature = "block2")]
763        #[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
764        #[unsafe(method_family = init)]
765        pub unsafe fn initWithInputs_outputs_evaluationFunction(
766            this: Allocated<Self>,
767            inputs: &NSArray<MDLMaterialProperty>,
768            outputs: &NSArray<MDLMaterialProperty>,
769            function: &block2::Block<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
770        ) -> Retained<Self>;
771    );
772}
773
774/// Methods declared on superclass `NSObject`.
775impl MDLMaterialPropertyGraph {
776    extern_methods!(
777        #[unsafe(method(new))]
778        #[unsafe(method_family = new)]
779        pub unsafe fn new() -> Retained<Self>;
780    );
781}
782
783extern_class!(
784    /// The base scattering function is Lambertian, with a Blinn-Phong specular response.
785    /// Specular power for Blinn-Phong can be derived from the roughness property using
786    /// an approximation.
787    ///
788    /// See also [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlscatteringfunction?language=objc)
789    #[unsafe(super(NSObject))]
790    #[derive(Debug, PartialEq, Eq, Hash)]
791    pub struct MDLScatteringFunction;
792);
793
794#[cfg(feature = "MDLTypes")]
795unsafe impl MDLNamed for MDLScatteringFunction {}
796
797unsafe impl NSObjectProtocol for MDLScatteringFunction {}
798
799impl MDLScatteringFunction {
800    extern_methods!(
801        /// See: MDLNamed
802        #[unsafe(method(name))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn name(&self) -> Retained<NSString>;
805
806        /// Setter for [`name`][Self::name].
807        #[unsafe(method(setName:))]
808        #[unsafe(method_family = none)]
809        pub unsafe fn setName(&self, name: &NSString);
810
811        #[unsafe(method(baseColor))]
812        #[unsafe(method_family = none)]
813        pub unsafe fn baseColor(&self) -> Retained<MDLMaterialProperty>;
814
815        #[unsafe(method(emission))]
816        #[unsafe(method_family = none)]
817        pub unsafe fn emission(&self) -> Retained<MDLMaterialProperty>;
818
819        #[unsafe(method(specular))]
820        #[unsafe(method_family = none)]
821        pub unsafe fn specular(&self) -> Retained<MDLMaterialProperty>;
822
823        #[unsafe(method(materialIndexOfRefraction))]
824        #[unsafe(method_family = none)]
825        pub unsafe fn materialIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
826
827        #[unsafe(method(interfaceIndexOfRefraction))]
828        #[unsafe(method_family = none)]
829        pub unsafe fn interfaceIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
830
831        #[unsafe(method(normal))]
832        #[unsafe(method_family = none)]
833        pub unsafe fn normal(&self) -> Retained<MDLMaterialProperty>;
834
835        #[unsafe(method(ambientOcclusion))]
836        #[unsafe(method_family = none)]
837        pub unsafe fn ambientOcclusion(&self) -> Retained<MDLMaterialProperty>;
838
839        #[unsafe(method(ambientOcclusionScale))]
840        #[unsafe(method_family = none)]
841        pub unsafe fn ambientOcclusionScale(&self) -> Retained<MDLMaterialProperty>;
842    );
843}
844
845/// Methods declared on superclass `NSObject`.
846impl MDLScatteringFunction {
847    extern_methods!(
848        #[unsafe(method(init))]
849        #[unsafe(method_family = init)]
850        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
851
852        #[unsafe(method(new))]
853        #[unsafe(method_family = new)]
854        pub unsafe fn new() -> Retained<Self>;
855    );
856}
857
858extern_class!(
859    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlphysicallyplausiblescatteringfunction?language=objc)
860    #[unsafe(super(MDLScatteringFunction, NSObject))]
861    #[derive(Debug, PartialEq, Eq, Hash)]
862    pub struct MDLPhysicallyPlausibleScatteringFunction;
863);
864
865#[cfg(feature = "MDLTypes")]
866unsafe impl MDLNamed for MDLPhysicallyPlausibleScatteringFunction {}
867
868unsafe impl NSObjectProtocol for MDLPhysicallyPlausibleScatteringFunction {}
869
870impl MDLPhysicallyPlausibleScatteringFunction {
871    extern_methods!(
872        #[unsafe(method(version))]
873        #[unsafe(method_family = none)]
874        pub unsafe fn version(&self) -> NSInteger;
875
876        #[unsafe(method(subsurface))]
877        #[unsafe(method_family = none)]
878        pub unsafe fn subsurface(&self) -> Retained<MDLMaterialProperty>;
879
880        #[unsafe(method(metallic))]
881        #[unsafe(method_family = none)]
882        pub unsafe fn metallic(&self) -> Retained<MDLMaterialProperty>;
883
884        #[unsafe(method(specularAmount))]
885        #[unsafe(method_family = none)]
886        pub unsafe fn specularAmount(&self) -> Retained<MDLMaterialProperty>;
887
888        #[unsafe(method(specularTint))]
889        #[unsafe(method_family = none)]
890        pub unsafe fn specularTint(&self) -> Retained<MDLMaterialProperty>;
891
892        #[unsafe(method(roughness))]
893        #[unsafe(method_family = none)]
894        pub unsafe fn roughness(&self) -> Retained<MDLMaterialProperty>;
895
896        #[unsafe(method(anisotropic))]
897        #[unsafe(method_family = none)]
898        pub unsafe fn anisotropic(&self) -> Retained<MDLMaterialProperty>;
899
900        #[unsafe(method(anisotropicRotation))]
901        #[unsafe(method_family = none)]
902        pub unsafe fn anisotropicRotation(&self) -> Retained<MDLMaterialProperty>;
903
904        #[unsafe(method(sheen))]
905        #[unsafe(method_family = none)]
906        pub unsafe fn sheen(&self) -> Retained<MDLMaterialProperty>;
907
908        #[unsafe(method(sheenTint))]
909        #[unsafe(method_family = none)]
910        pub unsafe fn sheenTint(&self) -> Retained<MDLMaterialProperty>;
911
912        #[unsafe(method(clearcoat))]
913        #[unsafe(method_family = none)]
914        pub unsafe fn clearcoat(&self) -> Retained<MDLMaterialProperty>;
915
916        #[unsafe(method(clearcoatGloss))]
917        #[unsafe(method_family = none)]
918        pub unsafe fn clearcoatGloss(&self) -> Retained<MDLMaterialProperty>;
919    );
920}
921
922/// Methods declared on superclass `NSObject`.
923impl MDLPhysicallyPlausibleScatteringFunction {
924    extern_methods!(
925        #[unsafe(method(init))]
926        #[unsafe(method_family = init)]
927        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
928
929        #[unsafe(method(new))]
930        #[unsafe(method_family = new)]
931        pub unsafe fn new() -> Retained<Self>;
932    );
933}
934
935/// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterialface?language=objc)
936// NS_ENUM
937#[repr(transparent)]
938#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
939pub struct MDLMaterialFace(pub NSUInteger);
940impl MDLMaterialFace {
941    #[doc(alias = "MDLMaterialFaceFront")]
942    pub const Front: Self = Self(0);
943    #[doc(alias = "MDLMaterialFaceBack")]
944    pub const Back: Self = Self(1);
945    #[doc(alias = "MDLMaterialFaceDoubleSided")]
946    pub const DoubleSided: Self = Self(2);
947}
948
949unsafe impl Encode for MDLMaterialFace {
950    const ENCODING: Encoding = NSUInteger::ENCODING;
951}
952
953unsafe impl RefEncode for MDLMaterialFace {
954    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
955}
956
957extern_class!(
958    /// [Apple's documentation](https://developer.apple.com/documentation/modelio/mdlmaterial?language=objc)
959    #[unsafe(super(NSObject))]
960    #[derive(Debug, PartialEq, Eq, Hash)]
961    pub struct MDLMaterial;
962);
963
964#[cfg(feature = "MDLTypes")]
965unsafe impl MDLNamed for MDLMaterial {}
966
967unsafe impl NSFastEnumeration for MDLMaterial {}
968
969unsafe impl NSObjectProtocol for MDLMaterial {}
970
971impl MDLMaterial {
972    extern_methods!(
973        #[unsafe(method(initWithName:scatteringFunction:))]
974        #[unsafe(method_family = init)]
975        pub unsafe fn initWithName_scatteringFunction(
976            this: Allocated<Self>,
977            name: &NSString,
978            scattering_function: &MDLScatteringFunction,
979        ) -> Retained<Self>;
980
981        #[unsafe(method(setProperty:))]
982        #[unsafe(method_family = none)]
983        pub unsafe fn setProperty(&self, property: &MDLMaterialProperty);
984
985        #[unsafe(method(removeProperty:))]
986        #[unsafe(method_family = none)]
987        pub unsafe fn removeProperty(&self, property: &MDLMaterialProperty);
988
989        #[unsafe(method(propertyNamed:))]
990        #[unsafe(method_family = none)]
991        pub unsafe fn propertyNamed(
992            &self,
993            name: &NSString,
994        ) -> Option<Retained<MDLMaterialProperty>>;
995
996        #[unsafe(method(propertyWithSemantic:))]
997        #[unsafe(method_family = none)]
998        pub unsafe fn propertyWithSemantic(
999            &self,
1000            semantic: MDLMaterialSemantic,
1001        ) -> Option<Retained<MDLMaterialProperty>>;
1002
1003        #[unsafe(method(propertiesWithSemantic:))]
1004        #[unsafe(method_family = none)]
1005        pub unsafe fn propertiesWithSemantic(
1006            &self,
1007            semantic: MDLMaterialSemantic,
1008        ) -> Retained<NSArray<MDLMaterialProperty>>;
1009
1010        #[unsafe(method(removeAllProperties))]
1011        #[unsafe(method_family = none)]
1012        pub unsafe fn removeAllProperties(&self);
1013
1014        #[cfg(feature = "MDLAssetResolver")]
1015        #[unsafe(method(resolveTexturesWithResolver:))]
1016        #[unsafe(method_family = none)]
1017        pub unsafe fn resolveTexturesWithResolver(
1018            &self,
1019            resolver: &ProtocolObject<dyn MDLAssetResolver>,
1020        );
1021
1022        #[cfg(feature = "MDLAssetResolver")]
1023        #[unsafe(method(loadTexturesUsingResolver:))]
1024        #[unsafe(method_family = none)]
1025        pub unsafe fn loadTexturesUsingResolver(
1026            &self,
1027            resolver: &ProtocolObject<dyn MDLAssetResolver>,
1028        );
1029
1030        #[unsafe(method(scatteringFunction))]
1031        #[unsafe(method_family = none)]
1032        pub unsafe fn scatteringFunction(&self) -> Retained<MDLScatteringFunction>;
1033
1034        /// See: MDLNamed
1035        #[unsafe(method(name))]
1036        #[unsafe(method_family = none)]
1037        pub unsafe fn name(&self) -> Retained<NSString>;
1038
1039        /// Setter for [`name`][Self::name].
1040        #[unsafe(method(setName:))]
1041        #[unsafe(method_family = none)]
1042        pub unsafe fn setName(&self, name: &NSString);
1043
1044        #[unsafe(method(baseMaterial))]
1045        #[unsafe(method_family = none)]
1046        pub unsafe fn baseMaterial(&self) -> Option<Retained<MDLMaterial>>;
1047
1048        /// Setter for [`baseMaterial`][Self::baseMaterial].
1049        #[unsafe(method(setBaseMaterial:))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn setBaseMaterial(&self, base_material: Option<&MDLMaterial>);
1052
1053        #[unsafe(method(objectAtIndexedSubscript:))]
1054        #[unsafe(method_family = none)]
1055        pub unsafe fn objectAtIndexedSubscript(
1056            &self,
1057            idx: NSUInteger,
1058        ) -> Option<Retained<MDLMaterialProperty>>;
1059
1060        #[unsafe(method(objectForKeyedSubscript:))]
1061        #[unsafe(method_family = none)]
1062        pub unsafe fn objectForKeyedSubscript(
1063            &self,
1064            name: &NSString,
1065        ) -> Option<Retained<MDLMaterialProperty>>;
1066
1067        #[unsafe(method(count))]
1068        #[unsafe(method_family = none)]
1069        pub unsafe fn count(&self) -> NSUInteger;
1070
1071        #[unsafe(method(materialFace))]
1072        #[unsafe(method_family = none)]
1073        pub unsafe fn materialFace(&self) -> MDLMaterialFace;
1074
1075        /// Setter for [`materialFace`][Self::materialFace].
1076        #[unsafe(method(setMaterialFace:))]
1077        #[unsafe(method_family = none)]
1078        pub unsafe fn setMaterialFace(&self, material_face: MDLMaterialFace);
1079    );
1080}
1081
1082/// Methods declared on superclass `NSObject`.
1083impl MDLMaterial {
1084    extern_methods!(
1085        #[unsafe(method(init))]
1086        #[unsafe(method_family = init)]
1087        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1088
1089        #[unsafe(method(new))]
1090        #[unsafe(method_family = new)]
1091        pub unsafe fn new() -> Retained<Self>;
1092    );
1093}