use core::{ffi::c_float, ptr::NonNull};
use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::NSObject,
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use super::MTLRasterizationRateSampleArray;
use crate::types::MTLSize;
extern_class!(
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLRasterizationRateLayerDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLRasterizationRateLayerDescriptor {}
);
unsafe impl CopyingHelper for MTLRasterizationRateLayerDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLRasterizationRateLayerDescriptor {}
);
impl MTLRasterizationRateLayerDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(initWithSampleCount:))]
#[unsafe(method_family = init)]
pub fn init_with_sample_count(
this: Allocated<Self>,
sample_count: MTLSize,
) -> Retained<Self>;
#[unsafe(method(initWithSampleCount:horizontal:vertical:))]
#[unsafe(method_family = init)]
pub fn init_with_sample_count_horizontal_vertical(
this: Allocated<Self>,
sample_count: MTLSize,
horizontal: NonNull<c_float>,
vertical: NonNull<c_float>,
) -> Retained<Self>;
#[unsafe(method(maxSampleCount))]
#[unsafe(method_family = none)]
pub fn max_sample_count(&self) -> MTLSize;
#[unsafe(method(horizontalSampleStorage))]
#[unsafe(method_family = none)]
pub fn horizontal_sample_storage(&self) -> NonNull<c_float>;
#[unsafe(method(verticalSampleStorage))]
#[unsafe(method_family = none)]
pub fn vertical_sample_storage(&self) -> NonNull<c_float>;
#[unsafe(method(horizontal))]
#[unsafe(method_family = none)]
pub fn horizontal(&self) -> Retained<MTLRasterizationRateSampleArray>;
#[unsafe(method(vertical))]
#[unsafe(method_family = none)]
pub fn vertical(&self) -> Retained<MTLRasterizationRateSampleArray>;
#[unsafe(method(setSampleCount:))]
#[unsafe(method_family = none)]
pub fn set_sample_count(
&self,
sample_count: MTLSize,
);
);
}