objc2-gameplay-kit 0.3.2

Bindings to the GameplayKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-app-kit")]
#[cfg(target_os = "macos")]
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// GKNoise is the object used to manipulate and combine noise in continuous 3D space.  It takes a GKNoiseSource as input.
    /// To extract and use a portion of the noise within the 3D space use the GKNoiseMap class.
    ///
    ///
    /// See: GKNoiseSource
    ///
    /// See: GKNoiseMap
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gknoise?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct GKNoise;
);

extern_conformance!(
    unsafe impl NSObjectProtocol for GKNoise {}
);

impl GKNoise {
    extern_methods!(
        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// Color gradient of this noise, represented as 'value : color' pairs.  Utilized when this noise is rendered to a texture.
        #[unsafe(method(gradientColors))]
        #[unsafe(method_family = none)]
        pub unsafe fn gradientColors(&self) -> Retained<NSDictionary<NSNumber, NSColor>>;

        #[cfg(feature = "objc2-app-kit")]
        #[cfg(target_os = "macos")]
        /// Setter for [`gradientColors`][Self::gradientColors].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setGradientColors:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setGradientColors(&self, gradient_colors: &NSDictionary<NSNumber, NSColor>);

        /// Initializes a constant noise of 0.0 at all positions.
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[cfg(feature = "GKNoiseSource")]
        /// Initializes a noise with the specified noise source.
        ///
        ///
        /// Parameter `noiseSource`: The noise source to use to initially populate the 3D noise space.
        #[unsafe(method(noiseWithNoiseSource:))]
        #[unsafe(method_family = none)]
        pub unsafe fn noiseWithNoiseSource(noise_source: &GKNoiseSource) -> Retained<Self>;

        #[cfg(all(feature = "GKNoiseSource", feature = "objc2-app-kit"))]
        #[cfg(target_os = "macos")]
        /// Initializes a noise with the specified noise source and parameters.
        ///
        ///
        /// Parameter `noiseSource`: The noise source to use to initially populate the 3D noise space.
        ///
        /// Parameter `gradientColors`: The color gradient to use for this noise in 'value : color' pairs.
        #[unsafe(method(noiseWithNoiseSource:gradientColors:))]
        #[unsafe(method_family = none)]
        pub unsafe fn noiseWithNoiseSource_gradientColors(
            noise_source: &GKNoiseSource,
            gradient_colors: &NSDictionary<NSNumber, NSColor>,
        ) -> Retained<Self>;

        #[cfg(feature = "GKNoiseSource")]
        /// Initializes a noise with the specified noise source.
        ///
        ///
        /// Parameter `noiseSource`: The noise source to use to initially populate the 3D noise space.
        #[unsafe(method(initWithNoiseSource:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNoiseSource(
            this: Allocated<Self>,
            noise_source: &GKNoiseSource,
        ) -> Retained<Self>;

        #[cfg(all(feature = "GKNoiseSource", feature = "objc2-app-kit"))]
        #[cfg(target_os = "macos")]
        /// Initializes a noise with the specified noise source and parameters.
        ///
        ///
        /// Parameter `noiseSource`: The noise source to use to initially populate the 3D noise space.
        ///
        /// Parameter `gradientColors`: The color gradient to use for this noise in 'value : color' pairs.
        #[unsafe(method(initWithNoiseSource:gradientColors:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithNoiseSource_gradientColors(
            this: Allocated<Self>,
            noise_source: &GKNoiseSource,
            gradient_colors: &NSDictionary<NSNumber, NSColor>,
        ) -> Retained<Self>;

        /// Initializes a composite noise from one or more component noises.  Useful for combining and layering noises together.
        ///
        ///
        /// Parameter `noises`: The component noises to combine.
        ///
        /// Parameter `selectionNoise`: The noise that governs which component noise is chosen for each position of the resulting noise.
        /// The range of values is equally-subdivided for each component noise.
        #[unsafe(method(noiseWithComponentNoises:selectionNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn noiseWithComponentNoises_selectionNoise(
            noises: &NSArray<GKNoise>,
            selection_noise: &GKNoise,
        ) -> Retained<Self>;

        /// Initializes a composite noise from one or more component noises.  Useful for combining and layering noises together.
        ///
        ///
        /// Parameter `noises`: The component noises to combine.
        ///
        /// Parameter `selectionNoise`: The noise that governs which component noise is chosen for each position of the resulting noise.
        /// The range of values is equally-subdivided for each component noise.
        ///
        /// Parameter `componentBoundaries`: The noise value boundaries of the selection noise to use for the component noises.  Specify
        /// one less boundary than the number of component noises.  This is a parallel array to blendDistances.
        ///
        /// Parameter `blendDistances`: The size of smoothing that is applied to boundaries where two component noises meet.  Specify
        /// one less blend distance than the number of component noises.  This is a parallel array to componentBoundaries.
        #[unsafe(method(noiseWithComponentNoises:selectionNoise:componentBoundaries:boundaryBlendDistances:))]
        #[unsafe(method_family = none)]
        pub unsafe fn noiseWithComponentNoises_selectionNoise_componentBoundaries_boundaryBlendDistances(
            noises: &NSArray<GKNoise>,
            selection_noise: &GKNoise,
            component_boundaries: &NSArray<NSNumber>,
            blend_distances: &NSArray<NSNumber>,
        ) -> Retained<Self>;

        /// Takes the absoltue value of all noise positions.
        #[unsafe(method(applyAbsoluteValue))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyAbsoluteValue(&self);

        /// Clamps all noise values to the specified bounds.
        ///
        ///
        /// Parameter `lowerBound`: The noise value lower bound.
        ///
        /// Parameter `upperBound`: The noise value upper bound.
        #[unsafe(method(clampWithLowerBound:upperBound:))]
        #[unsafe(method_family = none)]
        pub unsafe fn clampWithLowerBound_upperBound(
            &self,
            lower_bound: c_double,
            upper_bound: c_double,
        );

        /// Raises all noise values to the specified power.
        ///
        ///
        /// Parameter `power`: The power to which to raise all noise values.
        #[unsafe(method(raiseToPower:))]
        #[unsafe(method_family = none)]
        pub unsafe fn raiseToPower(&self, power: c_double);

        /// Inverts all noise values, from positive to negative and vice versa.
        #[unsafe(method(invert))]
        #[unsafe(method_family = none)]
        pub unsafe fn invert(&self);

        /// Applies a turbulent displacement to all noise values.
        #[unsafe(method(applyTurbulenceWithFrequency:power:roughness:seed:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyTurbulenceWithFrequency_power_roughness_seed(
            &self,
            frequency: c_double,
            power: c_double,
            roughness: c_int,
            seed: i32,
        );

        /// Remaps all noise values to a smooth curve that passes through the specified control points.
        ///
        ///
        /// Parameter `controlPoints`: Pairs of 'input : output' values to use as control points for the smooth remapping curve.
        /// Duplicate input values are not permitted.
        #[unsafe(method(remapValuesToCurveWithControlPoints:))]
        #[unsafe(method_family = none)]
        pub unsafe fn remapValuesToCurveWithControlPoints(
            &self,
            control_points: &NSDictionary<NSNumber, NSNumber>,
        );

        /// Remaps all noise values to one or more terraces with peaks.  Useful for creating valleys and trenches.
        ///
        ///
        /// Parameter `peakInputValues`: Inputs positions of terrace peaks.
        ///
        /// Parameter `inverted`: Governs the curve direction from peak to peak.
        #[unsafe(method(remapValuesToTerracesWithPeaks:terracesInverted:))]
        #[unsafe(method_family = none)]
        pub unsafe fn remapValuesToTerracesWithPeaks_terracesInverted(
            &self,
            peak_input_values: &NSArray<NSNumber>,
            inverted: bool,
        );

        /// Adds all noise values by the noise values at the same position in specified noise.
        ///
        ///
        /// Parameter `noise`: The noise from which to add values to this noise.
        #[unsafe(method(addWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addWithNoise(&self, noise: &GKNoise);

        /// Multiplies all noise values by the noise values at the same position in specified noise.
        ///
        ///
        /// Parameter `noise`: The noise from which to multiply values to this noise.
        #[unsafe(method(multiplyWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn multiplyWithNoise(&self, noise: &GKNoise);

        /// Takes the minimum value between this noise and the specified noise at each position.
        ///
        ///
        /// Parameter `noise`: The noise to compare against this noise at each position in determining which to take the minimum value from.
        #[unsafe(method(minimumWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn minimumWithNoise(&self, noise: &GKNoise);

        /// Takes the maximum value between this noise and the specified noise at each position.
        ///
        ///
        /// Parameter `noise`: The noise to compare against this noise at each position in determining which to take the maximum value from.
        #[unsafe(method(maximumWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn maximumWithNoise(&self, noise: &GKNoise);

        /// Raises all noise values to the power of the value at the same position of the specified noise.
        ///
        ///
        /// Parameter `noise`: The noise from which to raise this noise's values by.
        #[unsafe(method(raiseToPowerWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn raiseToPowerWithNoise(&self, noise: &GKNoise);

        /// Displaces all noise values by the values at the same positions of the specified noises.
        ///
        ///
        /// Parameter `xDisplacementNoise`: The noise from which to displace along the x-axis this noise's values at the same positions.
        ///
        /// Parameter `yDisplacementNoise`: The noise from which to displace along the y-axis this noise's values at the same positions.
        ///
        /// Parameter `zDisplacementNoise`: The noise from which to displace along the z-axis this noise's values at the same positions.
        #[unsafe(method(displaceXWithNoise:yWithNoise:zWithNoise:))]
        #[unsafe(method_family = none)]
        pub unsafe fn displaceXWithNoise_yWithNoise_zWithNoise(
            &self,
            x_displacement_noise: &GKNoise,
            y_displacement_noise: &GKNoise,
            z_displacement_noise: &GKNoise,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl GKNoise {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}