use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialSemantic(pub NSUInteger);
impl MDLMaterialSemantic {
#[doc(alias = "MDLMaterialSemanticBaseColor")]
pub const BaseColor: Self = Self(0);
#[doc(alias = "MDLMaterialSemanticSubsurface")]
pub const Subsurface: Self = Self(1);
#[doc(alias = "MDLMaterialSemanticMetallic")]
pub const Metallic: Self = Self(2);
#[doc(alias = "MDLMaterialSemanticSpecular")]
pub const Specular: Self = Self(3);
#[doc(alias = "MDLMaterialSemanticSpecularExponent")]
pub const SpecularExponent: Self = Self(4);
#[doc(alias = "MDLMaterialSemanticSpecularTint")]
pub const SpecularTint: Self = Self(5);
#[doc(alias = "MDLMaterialSemanticRoughness")]
pub const Roughness: Self = Self(6);
#[doc(alias = "MDLMaterialSemanticAnisotropic")]
pub const Anisotropic: Self = Self(7);
#[doc(alias = "MDLMaterialSemanticAnisotropicRotation")]
pub const AnisotropicRotation: Self = Self(8);
#[doc(alias = "MDLMaterialSemanticSheen")]
pub const Sheen: Self = Self(9);
#[doc(alias = "MDLMaterialSemanticSheenTint")]
pub const SheenTint: Self = Self(10);
#[doc(alias = "MDLMaterialSemanticClearcoat")]
pub const Clearcoat: Self = Self(11);
#[doc(alias = "MDLMaterialSemanticClearcoatGloss")]
pub const ClearcoatGloss: Self = Self(12);
#[doc(alias = "MDLMaterialSemanticEmission")]
pub const Emission: Self = Self(13);
#[doc(alias = "MDLMaterialSemanticBump")]
pub const Bump: Self = Self(14);
#[doc(alias = "MDLMaterialSemanticOpacity")]
pub const Opacity: Self = Self(15);
#[doc(alias = "MDLMaterialSemanticInterfaceIndexOfRefraction")]
pub const InterfaceIndexOfRefraction: Self = Self(16);
#[doc(alias = "MDLMaterialSemanticMaterialIndexOfRefraction")]
pub const MaterialIndexOfRefraction: Self = Self(17);
#[doc(alias = "MDLMaterialSemanticObjectSpaceNormal")]
pub const ObjectSpaceNormal: Self = Self(18);
#[doc(alias = "MDLMaterialSemanticTangentSpaceNormal")]
pub const TangentSpaceNormal: Self = Self(19);
#[doc(alias = "MDLMaterialSemanticDisplacement")]
pub const Displacement: Self = Self(20);
#[doc(alias = "MDLMaterialSemanticDisplacementScale")]
pub const DisplacementScale: Self = Self(21);
#[doc(alias = "MDLMaterialSemanticAmbientOcclusion")]
pub const AmbientOcclusion: Self = Self(22);
#[doc(alias = "MDLMaterialSemanticAmbientOcclusionScale")]
pub const AmbientOcclusionScale: Self = Self(23);
#[doc(alias = "MDLMaterialSemanticNone")]
pub const None: Self = Self(0x8000);
#[doc(alias = "MDLMaterialSemanticUserDefined")]
pub const UserDefined: Self = Self(0x8001);
}
unsafe impl Encode for MDLMaterialSemantic {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialSemantic {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialPropertyType(pub NSUInteger);
impl MDLMaterialPropertyType {
#[doc(alias = "MDLMaterialPropertyTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "MDLMaterialPropertyTypeString")]
pub const String: Self = Self(1);
#[doc(alias = "MDLMaterialPropertyTypeURL")]
pub const URL: Self = Self(2);
#[doc(alias = "MDLMaterialPropertyTypeTexture")]
pub const Texture: Self = Self(3);
#[doc(alias = "MDLMaterialPropertyTypeColor")]
pub const Color: Self = Self(4);
#[doc(alias = "MDLMaterialPropertyTypeFloat")]
pub const Float: Self = Self(5);
#[doc(alias = "MDLMaterialPropertyTypeFloat2")]
pub const Float2: Self = Self(6);
#[doc(alias = "MDLMaterialPropertyTypeFloat3")]
pub const Float3: Self = Self(7);
#[doc(alias = "MDLMaterialPropertyTypeFloat4")]
pub const Float4: Self = Self(8);
#[doc(alias = "MDLMaterialPropertyTypeMatrix44")]
pub const Matrix44: Self = Self(9);
#[doc(alias = "MDLMaterialPropertyTypeBuffer")]
pub const Buffer: Self = Self(10);
}
unsafe impl Encode for MDLMaterialPropertyType {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialPropertyType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialTextureWrapMode(pub NSUInteger);
impl MDLMaterialTextureWrapMode {
#[doc(alias = "MDLMaterialTextureWrapModeClamp")]
pub const Clamp: Self = Self(0);
#[doc(alias = "MDLMaterialTextureWrapModeRepeat")]
pub const Repeat: Self = Self(1);
#[doc(alias = "MDLMaterialTextureWrapModeMirror")]
pub const Mirror: Self = Self(2);
}
unsafe impl Encode for MDLMaterialTextureWrapMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialTextureWrapMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialTextureFilterMode(pub NSUInteger);
impl MDLMaterialTextureFilterMode {
#[doc(alias = "MDLMaterialTextureFilterModeNearest")]
pub const Nearest: Self = Self(0);
#[doc(alias = "MDLMaterialTextureFilterModeLinear")]
pub const Linear: Self = Self(1);
}
unsafe impl Encode for MDLMaterialTextureFilterMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialTextureFilterMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialMipMapFilterMode(pub NSUInteger);
impl MDLMaterialMipMapFilterMode {
#[doc(alias = "MDLMaterialMipMapFilterModeNearest")]
pub const Nearest: Self = Self(0);
#[doc(alias = "MDLMaterialMipMapFilterModeLinear")]
pub const Linear: Self = Self(1);
}
unsafe impl Encode for MDLMaterialMipMapFilterMode {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialMipMapFilterMode {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLTextureFilter;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLTextureFilter {}
);
impl MDLTextureFilter {
extern_methods!(
#[unsafe(method(sWrapMode))]
#[unsafe(method_family = none)]
pub unsafe fn sWrapMode(&self) -> MDLMaterialTextureWrapMode;
#[unsafe(method(setSWrapMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setSWrapMode(&self, s_wrap_mode: MDLMaterialTextureWrapMode);
#[unsafe(method(tWrapMode))]
#[unsafe(method_family = none)]
pub unsafe fn tWrapMode(&self) -> MDLMaterialTextureWrapMode;
#[unsafe(method(setTWrapMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setTWrapMode(&self, t_wrap_mode: MDLMaterialTextureWrapMode);
#[unsafe(method(rWrapMode))]
#[unsafe(method_family = none)]
pub unsafe fn rWrapMode(&self) -> MDLMaterialTextureWrapMode;
#[unsafe(method(setRWrapMode:))]
#[unsafe(method_family = none)]
pub unsafe fn setRWrapMode(&self, r_wrap_mode: MDLMaterialTextureWrapMode);
#[unsafe(method(minFilter))]
#[unsafe(method_family = none)]
pub unsafe fn minFilter(&self) -> MDLMaterialTextureFilterMode;
#[unsafe(method(setMinFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setMinFilter(&self, min_filter: MDLMaterialTextureFilterMode);
#[unsafe(method(magFilter))]
#[unsafe(method_family = none)]
pub unsafe fn magFilter(&self) -> MDLMaterialTextureFilterMode;
#[unsafe(method(setMagFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setMagFilter(&self, mag_filter: MDLMaterialTextureFilterMode);
#[unsafe(method(mipFilter))]
#[unsafe(method_family = none)]
pub unsafe fn mipFilter(&self) -> MDLMaterialMipMapFilterMode;
#[unsafe(method(setMipFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setMipFilter(&self, mip_filter: MDLMaterialMipMapFilterMode);
);
}
impl MDLTextureFilter {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLTextureSampler;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLTextureSampler {}
);
impl MDLTextureSampler {
extern_methods!(
#[cfg(feature = "MDLTexture")]
#[unsafe(method(texture))]
#[unsafe(method_family = none)]
pub unsafe fn texture(&self) -> Option<Retained<MDLTexture>>;
#[cfg(feature = "MDLTexture")]
#[unsafe(method(setTexture:))]
#[unsafe(method_family = none)]
pub unsafe fn setTexture(&self, texture: Option<&MDLTexture>);
#[unsafe(method(hardwareFilter))]
#[unsafe(method_family = none)]
pub unsafe fn hardwareFilter(&self) -> Option<Retained<MDLTextureFilter>>;
#[unsafe(method(setHardwareFilter:))]
#[unsafe(method_family = none)]
pub unsafe fn setHardwareFilter(&self, hardware_filter: Option<&MDLTextureFilter>);
#[cfg(feature = "MDLTransform")]
#[unsafe(method(transform))]
#[unsafe(method_family = none)]
pub unsafe fn transform(&self) -> Option<Retained<MDLTransform>>;
#[cfg(feature = "MDLTransform")]
#[unsafe(method(setTransform:))]
#[unsafe(method_family = none)]
pub unsafe fn setTransform(&self, transform: Option<&MDLTransform>);
);
}
impl MDLTextureSampler {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLMaterialProperty;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLMaterialProperty {}
);
extern_conformance!(
unsafe impl NSCopying for MDLMaterialProperty {}
);
unsafe impl CopyingHelper for MDLMaterialProperty {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MDLMaterialProperty {}
);
impl MDLMaterialProperty {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithName:semantic:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
) -> Retained<Self>;
#[unsafe(method(initWithName:semantic:float:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic_float(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
value: c_float,
) -> Retained<Self>;
#[unsafe(method(initWithName:semantic:URL:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic_URL(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
url: Option<&NSURL>,
) -> Retained<Self>;
#[unsafe(method(initWithName:semantic:string:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic_string(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
string: Option<&NSString>,
) -> Retained<Self>;
#[unsafe(method(initWithName:semantic:textureSampler:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic_textureSampler(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
texture_sampler: Option<&MDLTextureSampler>,
) -> Retained<Self>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(initWithName:semantic:color:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_semantic_color(
this: Allocated<Self>,
name: &NSString,
semantic: MDLMaterialSemantic,
color: &CGColor,
) -> Retained<Self>;
#[unsafe(method(setProperties:))]
#[unsafe(method_family = none)]
pub unsafe fn setProperties(&self, property: &MDLMaterialProperty);
#[unsafe(method(semantic))]
#[unsafe(method_family = none)]
pub unsafe fn semantic(&self) -> MDLMaterialSemantic;
#[unsafe(method(setSemantic:))]
#[unsafe(method_family = none)]
pub unsafe fn setSemantic(&self, semantic: MDLMaterialSemantic);
#[unsafe(method(type))]
#[unsafe(method_family = none)]
pub unsafe fn r#type(&self) -> MDLMaterialPropertyType;
#[unsafe(method(setType:))]
#[unsafe(method_family = none)]
pub unsafe fn setType(&self, r#type: MDLMaterialPropertyType);
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: &NSString);
#[unsafe(method(stringValue))]
#[unsafe(method_family = none)]
pub unsafe fn stringValue(&self) -> Option<Retained<NSString>>;
#[unsafe(method(setStringValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setStringValue(&self, string_value: Option<&NSString>);
#[unsafe(method(URLValue))]
#[unsafe(method_family = none)]
pub unsafe fn URLValue(&self) -> Option<Retained<NSURL>>;
#[unsafe(method(setURLValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setURLValue(&self, url_value: Option<&NSURL>);
#[unsafe(method(textureSamplerValue))]
#[unsafe(method_family = none)]
pub unsafe fn textureSamplerValue(&self) -> Option<Retained<MDLTextureSampler>>;
#[unsafe(method(setTextureSamplerValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setTextureSamplerValue(
&self,
texture_sampler_value: Option<&MDLTextureSampler>,
);
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(color))]
#[unsafe(method_family = none)]
pub unsafe fn color(&self) -> Option<Retained<CGColor>>;
#[cfg(feature = "objc2-core-graphics")]
#[unsafe(method(setColor:))]
#[unsafe(method_family = none)]
pub unsafe fn setColor(&self, color: Option<&CGColor>);
#[unsafe(method(floatValue))]
#[unsafe(method_family = none)]
pub unsafe fn floatValue(&self) -> c_float;
#[unsafe(method(setFloatValue:))]
#[unsafe(method_family = none)]
pub unsafe fn setFloatValue(&self, float_value: c_float);
#[unsafe(method(luminance))]
#[unsafe(method_family = none)]
pub unsafe fn luminance(&self) -> c_float;
#[unsafe(method(setLuminance:))]
#[unsafe(method_family = none)]
pub unsafe fn setLuminance(&self, luminance: c_float);
);
}
impl MDLMaterialProperty {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLMaterialPropertyConnection;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLMaterialPropertyConnection {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLMaterialPropertyConnection {}
);
impl MDLMaterialPropertyConnection {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithOutput:input:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithOutput_input(
this: Allocated<Self>,
output: &MDLMaterialProperty,
input: &MDLMaterialProperty,
) -> Retained<Self>;
#[unsafe(method(output))]
#[unsafe(method_family = none)]
pub unsafe fn output(&self) -> Option<Retained<MDLMaterialProperty>>;
#[unsafe(method(input))]
#[unsafe(method_family = none)]
pub unsafe fn input(&self) -> Option<Retained<MDLMaterialProperty>>;
);
}
impl MDLMaterialPropertyConnection {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLMaterialPropertyNode;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLMaterialPropertyNode {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLMaterialPropertyNode {}
);
impl MDLMaterialPropertyNode {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithInputs_outputs_evaluationFunction(
this: Allocated<Self>,
inputs: &NSArray<MDLMaterialProperty>,
outputs: &NSArray<MDLMaterialProperty>,
function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
) -> Retained<Self>;
#[cfg(feature = "block2")]
#[unsafe(method(evaluationFunction))]
#[unsafe(method_family = none)]
pub unsafe fn evaluationFunction(
&self,
) -> NonNull<block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>>;
#[cfg(feature = "block2")]
#[unsafe(method(setEvaluationFunction:))]
#[unsafe(method_family = none)]
pub unsafe fn setEvaluationFunction(
&self,
evaluation_function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
);
#[unsafe(method(inputs))]
#[unsafe(method_family = none)]
pub unsafe fn inputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
#[unsafe(method(outputs))]
#[unsafe(method_family = none)]
pub unsafe fn outputs(&self) -> Retained<NSArray<MDLMaterialProperty>>;
);
}
impl MDLMaterialPropertyNode {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MDLMaterialPropertyNode, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLMaterialPropertyGraph;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLMaterialPropertyGraph {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLMaterialPropertyGraph {}
);
impl MDLMaterialPropertyGraph {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithNodes:connections:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithNodes_connections(
this: Allocated<Self>,
nodes: &NSArray<MDLMaterialPropertyNode>,
connections: &NSArray<MDLMaterialPropertyConnection>,
) -> Retained<Self>;
#[unsafe(method(evaluate))]
#[unsafe(method_family = none)]
pub unsafe fn evaluate(&self);
#[unsafe(method(nodes))]
#[unsafe(method_family = none)]
pub unsafe fn nodes(&self) -> Retained<NSArray<MDLMaterialPropertyNode>>;
#[unsafe(method(connections))]
#[unsafe(method_family = none)]
pub unsafe fn connections(&self) -> Retained<NSArray<MDLMaterialPropertyConnection>>;
);
}
impl MDLMaterialPropertyGraph {
extern_methods!(
#[cfg(feature = "block2")]
#[unsafe(method(initWithInputs:outputs:evaluationFunction:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithInputs_outputs_evaluationFunction(
this: Allocated<Self>,
inputs: &NSArray<MDLMaterialProperty>,
outputs: &NSArray<MDLMaterialProperty>,
function: &block2::DynBlock<dyn Fn(NonNull<MDLMaterialPropertyNode>)>,
) -> Retained<Self>;
);
}
impl MDLMaterialPropertyGraph {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLScatteringFunction;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLScatteringFunction {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLScatteringFunction {}
);
impl MDLScatteringFunction {
extern_methods!(
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: &NSString);
#[unsafe(method(baseColor))]
#[unsafe(method_family = none)]
pub unsafe fn baseColor(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(emission))]
#[unsafe(method_family = none)]
pub unsafe fn emission(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(specular))]
#[unsafe(method_family = none)]
pub unsafe fn specular(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(materialIndexOfRefraction))]
#[unsafe(method_family = none)]
pub unsafe fn materialIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(interfaceIndexOfRefraction))]
#[unsafe(method_family = none)]
pub unsafe fn interfaceIndexOfRefraction(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(normal))]
#[unsafe(method_family = none)]
pub unsafe fn normal(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(ambientOcclusion))]
#[unsafe(method_family = none)]
pub unsafe fn ambientOcclusion(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(ambientOcclusionScale))]
#[unsafe(method_family = none)]
pub unsafe fn ambientOcclusionScale(&self) -> Retained<MDLMaterialProperty>;
);
}
impl MDLScatteringFunction {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
extern_class!(
#[unsafe(super(MDLScatteringFunction, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLPhysicallyPlausibleScatteringFunction;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLPhysicallyPlausibleScatteringFunction {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLPhysicallyPlausibleScatteringFunction {}
);
impl MDLPhysicallyPlausibleScatteringFunction {
extern_methods!(
#[unsafe(method(version))]
#[unsafe(method_family = none)]
pub unsafe fn version(&self) -> NSInteger;
#[unsafe(method(subsurface))]
#[unsafe(method_family = none)]
pub unsafe fn subsurface(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(metallic))]
#[unsafe(method_family = none)]
pub unsafe fn metallic(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(specularAmount))]
#[unsafe(method_family = none)]
pub unsafe fn specularAmount(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(specularTint))]
#[unsafe(method_family = none)]
pub unsafe fn specularTint(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(roughness))]
#[unsafe(method_family = none)]
pub unsafe fn roughness(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(anisotropic))]
#[unsafe(method_family = none)]
pub unsafe fn anisotropic(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(anisotropicRotation))]
#[unsafe(method_family = none)]
pub unsafe fn anisotropicRotation(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(sheen))]
#[unsafe(method_family = none)]
pub unsafe fn sheen(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(sheenTint))]
#[unsafe(method_family = none)]
pub unsafe fn sheenTint(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(clearcoat))]
#[unsafe(method_family = none)]
pub unsafe fn clearcoat(&self) -> Retained<MDLMaterialProperty>;
#[unsafe(method(clearcoatGloss))]
#[unsafe(method_family = none)]
pub unsafe fn clearcoatGloss(&self) -> Retained<MDLMaterialProperty>;
);
}
impl MDLPhysicallyPlausibleScatteringFunction {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct MDLMaterialFace(pub NSUInteger);
impl MDLMaterialFace {
#[doc(alias = "MDLMaterialFaceFront")]
pub const Front: Self = Self(0);
#[doc(alias = "MDLMaterialFaceBack")]
pub const Back: Self = Self(1);
#[doc(alias = "MDLMaterialFaceDoubleSided")]
pub const DoubleSided: Self = Self(2);
}
unsafe impl Encode for MDLMaterialFace {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for MDLMaterialFace {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MDLMaterial;
);
#[cfg(feature = "MDLTypes")]
extern_conformance!(
unsafe impl MDLNamed for MDLMaterial {}
);
extern_conformance!(
unsafe impl NSFastEnumeration for MDLMaterial {}
);
extern_conformance!(
unsafe impl NSObjectProtocol for MDLMaterial {}
);
impl MDLMaterial {
extern_methods!(
#[unsafe(method(initWithName:scatteringFunction:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithName_scatteringFunction(
this: Allocated<Self>,
name: &NSString,
scattering_function: &MDLScatteringFunction,
) -> Retained<Self>;
#[unsafe(method(setProperty:))]
#[unsafe(method_family = none)]
pub unsafe fn setProperty(&self, property: &MDLMaterialProperty);
#[unsafe(method(removeProperty:))]
#[unsafe(method_family = none)]
pub unsafe fn removeProperty(&self, property: &MDLMaterialProperty);
#[unsafe(method(propertyNamed:))]
#[unsafe(method_family = none)]
pub unsafe fn propertyNamed(
&self,
name: &NSString,
) -> Option<Retained<MDLMaterialProperty>>;
#[unsafe(method(propertyWithSemantic:))]
#[unsafe(method_family = none)]
pub unsafe fn propertyWithSemantic(
&self,
semantic: MDLMaterialSemantic,
) -> Option<Retained<MDLMaterialProperty>>;
#[unsafe(method(propertiesWithSemantic:))]
#[unsafe(method_family = none)]
pub unsafe fn propertiesWithSemantic(
&self,
semantic: MDLMaterialSemantic,
) -> Retained<NSArray<MDLMaterialProperty>>;
#[unsafe(method(removeAllProperties))]
#[unsafe(method_family = none)]
pub unsafe fn removeAllProperties(&self);
#[cfg(feature = "MDLAssetResolver")]
#[unsafe(method(resolveTexturesWithResolver:))]
#[unsafe(method_family = none)]
pub unsafe fn resolveTexturesWithResolver(
&self,
resolver: &ProtocolObject<dyn MDLAssetResolver>,
);
#[cfg(feature = "MDLAssetResolver")]
#[unsafe(method(loadTexturesUsingResolver:))]
#[unsafe(method_family = none)]
pub unsafe fn loadTexturesUsingResolver(
&self,
resolver: &ProtocolObject<dyn MDLAssetResolver>,
);
#[unsafe(method(scatteringFunction))]
#[unsafe(method_family = none)]
pub unsafe fn scatteringFunction(&self) -> Retained<MDLScatteringFunction>;
#[unsafe(method(name))]
#[unsafe(method_family = none)]
pub unsafe fn name(&self) -> Retained<NSString>;
#[unsafe(method(setName:))]
#[unsafe(method_family = none)]
pub unsafe fn setName(&self, name: &NSString);
#[unsafe(method(baseMaterial))]
#[unsafe(method_family = none)]
pub unsafe fn baseMaterial(&self) -> Option<Retained<MDLMaterial>>;
#[unsafe(method(setBaseMaterial:))]
#[unsafe(method_family = none)]
pub unsafe fn setBaseMaterial(&self, base_material: Option<&MDLMaterial>);
#[unsafe(method(objectAtIndexedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn objectAtIndexedSubscript(
&self,
idx: NSUInteger,
) -> Option<Retained<MDLMaterialProperty>>;
#[unsafe(method(objectForKeyedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn objectForKeyedSubscript(
&self,
name: &NSString,
) -> Option<Retained<MDLMaterialProperty>>;
#[unsafe(method(count))]
#[unsafe(method_family = none)]
pub unsafe fn count(&self) -> NSUInteger;
#[unsafe(method(materialFace))]
#[unsafe(method_family = none)]
pub unsafe fn materialFace(&self) -> MDLMaterialFace;
#[unsafe(method(setMaterialFace:))]
#[unsafe(method_family = none)]
pub unsafe fn setMaterialFace(&self, material_face: MDLMaterialFace);
);
}
impl MDLMaterial {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub unsafe fn new() -> Retained<Self>;
);
}