objc2_model_io/generated/
MDLMaterial.rs1use 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#[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#[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#[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#[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#[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 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(setMipFilter:))]
348 #[unsafe(method_family = none)]
349 pub unsafe fn setMipFilter(&self, mip_filter: MDLMaterialMipMapFilterMode);
350 );
351}
352
353impl 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 #[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 #[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 #[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 #[unsafe(method(setTransform:))]
405 #[unsafe(method_family = none)]
406 pub unsafe fn setTransform(&self, transform: Option<&MDLTransform>);
407 );
408}
409
410impl 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 #[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 #[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 #[unsafe(method(setType:))]
523 #[unsafe(method_family = none)]
524 pub unsafe fn setType(&self, r#type: MDLMaterialPropertyType);
525
526 #[unsafe(method(name))]
528 #[unsafe(method_family = none)]
529 pub unsafe fn name(&self) -> Retained<NSString>;
530
531 #[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 #[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 #[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 #[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 #[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 #[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 #[unsafe(method(setLuminance:))]
592 #[unsafe(method_family = none)]
593 pub unsafe fn setLuminance(&self, luminance: c_float);
594 );
595}
596
597impl 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 #[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 #[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
643impl 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 #[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 #[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
706impl 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 #[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
759impl 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
774impl 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 #[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 #[unsafe(method(name))]
803 #[unsafe(method_family = none)]
804 pub unsafe fn name(&self) -> Retained<NSString>;
805
806 #[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
845impl 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 #[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
922impl 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#[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 #[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 #[unsafe(method(name))]
1036 #[unsafe(method_family = none)]
1037 pub unsafe fn name(&self) -> Retained<NSString>;
1038
1039 #[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 #[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 #[unsafe(method(setMaterialFace:))]
1077 #[unsafe(method_family = none)]
1078 pub unsafe fn setMaterialFace(&self, material_face: MDLMaterialFace);
1079 );
1080}
1081
1082impl 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}