1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
//! 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>;
);
}