objc2_gameplay_kit/generated/
GKNoiseSource.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6
7use crate::*;
8
9extern_class!(
10    /// A GKNoiseSource instance is a description of procedural noise in 3D space.  Noise sources generate values
11    /// between -1.0 and 1.0, inclusive, for any position in continuous 3D space.
12    /// Subclasses represent specific types of noise, each with their own parameters that affect the nature of the noise.
13    /// Noise sources are the starting point for generating and using procedural noise.  The 3D noise values may be manipulated and
14    /// combined with the GKNoise class.  Portions of this 3D noise can be extracted and utilized via the GKNoiseMap class.
15    /// Extracted portions of noise are useful in both 2D and 3D games.  Applications include creating realistic textures,
16    /// height maps for 2D and 3D game world terrain, tile maps for 2D games, and intentionally imperfect game object and
17    /// camera movements in 2D and 3D games.
18    /// This class is not intended to be instantiated.
19    ///
20    ///
21    /// See: GKNoise
22    ///
23    /// See: GKNoiseMap
24    ///
25    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gknoisesource?language=objc)
26    #[unsafe(super(NSObject))]
27    #[derive(Debug, PartialEq, Eq, Hash)]
28    pub struct GKNoiseSource;
29);
30
31extern_conformance!(
32    unsafe impl NSObjectProtocol for GKNoiseSource {}
33);
34
35impl GKNoiseSource {
36    extern_methods!();
37}
38
39/// Methods declared on superclass `NSObject`.
40impl GKNoiseSource {
41    extern_methods!(
42        #[unsafe(method(init))]
43        #[unsafe(method_family = init)]
44        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
45
46        #[unsafe(method(new))]
47        #[unsafe(method_family = new)]
48        pub unsafe fn new() -> Retained<Self>;
49    );
50}
51
52extern_class!(
53    /// Coherent noise is smoothly-changing, semi-random noise.  A given input always produces the same output.
54    /// A small change in input produces a small change in output.  A large change in input produces a random
55    /// change in output. This class is not intended to be instantiated.
56    ///
57    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkcoherentnoisesource?language=objc)
58    #[unsafe(super(GKNoiseSource, NSObject))]
59    #[derive(Debug, PartialEq, Eq, Hash)]
60    pub struct GKCoherentNoiseSource;
61);
62
63extern_conformance!(
64    unsafe impl NSObjectProtocol for GKCoherentNoiseSource {}
65);
66
67impl GKCoherentNoiseSource {
68    extern_methods!(
69        #[unsafe(method(frequency))]
70        #[unsafe(method_family = none)]
71        pub unsafe fn frequency(&self) -> c_double;
72
73        /// Setter for [`frequency`][Self::frequency].
74        #[unsafe(method(setFrequency:))]
75        #[unsafe(method_family = none)]
76        pub unsafe fn setFrequency(&self, frequency: c_double);
77
78        #[unsafe(method(octaveCount))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn octaveCount(&self) -> NSInteger;
81
82        /// Setter for [`octaveCount`][Self::octaveCount].
83        #[unsafe(method(setOctaveCount:))]
84        #[unsafe(method_family = none)]
85        pub unsafe fn setOctaveCount(&self, octave_count: NSInteger);
86
87        #[unsafe(method(lacunarity))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn lacunarity(&self) -> c_double;
90
91        /// Setter for [`lacunarity`][Self::lacunarity].
92        #[unsafe(method(setLacunarity:))]
93        #[unsafe(method_family = none)]
94        pub unsafe fn setLacunarity(&self, lacunarity: c_double);
95
96        #[unsafe(method(seed))]
97        #[unsafe(method_family = none)]
98        pub unsafe fn seed(&self) -> i32;
99
100        /// Setter for [`seed`][Self::seed].
101        #[unsafe(method(setSeed:))]
102        #[unsafe(method_family = none)]
103        pub unsafe fn setSeed(&self, seed: i32);
104    );
105}
106
107/// Methods declared on superclass `NSObject`.
108impl GKCoherentNoiseSource {
109    extern_methods!(
110        #[unsafe(method(init))]
111        #[unsafe(method_family = init)]
112        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
113
114        #[unsafe(method(new))]
115        #[unsafe(method_family = new)]
116        pub unsafe fn new() -> Retained<Self>;
117    );
118}
119
120extern_class!(
121    /// Perlin noise is useful for creating natural-looking textures and realistic-looking terrain.
122    ///
123    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkperlinnoisesource?language=objc)
124    #[unsafe(super(GKCoherentNoiseSource, GKNoiseSource, NSObject))]
125    #[derive(Debug, PartialEq, Eq, Hash)]
126    pub struct GKPerlinNoiseSource;
127);
128
129extern_conformance!(
130    unsafe impl NSObjectProtocol for GKPerlinNoiseSource {}
131);
132
133impl GKPerlinNoiseSource {
134    extern_methods!(
135        #[unsafe(method(persistence))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn persistence(&self) -> c_double;
138
139        /// Setter for [`persistence`][Self::persistence].
140        #[unsafe(method(setPersistence:))]
141        #[unsafe(method_family = none)]
142        pub unsafe fn setPersistence(&self, persistence: c_double);
143
144        #[unsafe(method(perlinNoiseSourceWithFrequency:octaveCount:persistence:lacunarity:seed:))]
145        #[unsafe(method_family = none)]
146        pub unsafe fn perlinNoiseSourceWithFrequency_octaveCount_persistence_lacunarity_seed(
147            frequency: c_double,
148            octave_count: NSInteger,
149            persistence: c_double,
150            lacunarity: c_double,
151            seed: i32,
152        ) -> Retained<Self>;
153
154        #[unsafe(method(initWithFrequency:octaveCount:persistence:lacunarity:seed:))]
155        #[unsafe(method_family = init)]
156        pub unsafe fn initWithFrequency_octaveCount_persistence_lacunarity_seed(
157            this: Allocated<Self>,
158            frequency: c_double,
159            octave_count: NSInteger,
160            persistence: c_double,
161            lacunarity: c_double,
162            seed: i32,
163        ) -> Retained<Self>;
164    );
165}
166
167/// Methods declared on superclass `NSObject`.
168impl GKPerlinNoiseSource {
169    extern_methods!(
170        #[unsafe(method(init))]
171        #[unsafe(method_family = init)]
172        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
173
174        #[unsafe(method(new))]
175        #[unsafe(method_family = new)]
176        pub unsafe fn new() -> Retained<Self>;
177    );
178}
179
180extern_class!(
181    /// Billow noise is similar to Perlin noise, with more rounded shapes and clearly-defined transitions beween values.
182    ///
183    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkbillownoisesource?language=objc)
184    #[unsafe(super(GKCoherentNoiseSource, GKNoiseSource, NSObject))]
185    #[derive(Debug, PartialEq, Eq, Hash)]
186    pub struct GKBillowNoiseSource;
187);
188
189extern_conformance!(
190    unsafe impl NSObjectProtocol for GKBillowNoiseSource {}
191);
192
193impl GKBillowNoiseSource {
194    extern_methods!(
195        #[unsafe(method(persistence))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn persistence(&self) -> c_double;
198
199        /// Setter for [`persistence`][Self::persistence].
200        #[unsafe(method(setPersistence:))]
201        #[unsafe(method_family = none)]
202        pub unsafe fn setPersistence(&self, persistence: c_double);
203
204        #[unsafe(method(billowNoiseSourceWithFrequency:octaveCount:persistence:lacunarity:seed:))]
205        #[unsafe(method_family = none)]
206        pub unsafe fn billowNoiseSourceWithFrequency_octaveCount_persistence_lacunarity_seed(
207            frequency: c_double,
208            octave_count: NSInteger,
209            persistence: c_double,
210            lacunarity: c_double,
211            seed: i32,
212        ) -> Retained<Self>;
213
214        #[unsafe(method(initWithFrequency:octaveCount:persistence:lacunarity:seed:))]
215        #[unsafe(method_family = init)]
216        pub unsafe fn initWithFrequency_octaveCount_persistence_lacunarity_seed(
217            this: Allocated<Self>,
218            frequency: c_double,
219            octave_count: NSInteger,
220            persistence: c_double,
221            lacunarity: c_double,
222            seed: i32,
223        ) -> Retained<Self>;
224    );
225}
226
227/// Methods declared on superclass `NSObject`.
228impl GKBillowNoiseSource {
229    extern_methods!(
230        #[unsafe(method(init))]
231        #[unsafe(method_family = init)]
232        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
233
234        #[unsafe(method(new))]
235        #[unsafe(method_family = new)]
236        pub unsafe fn new() -> Retained<Self>;
237    );
238}
239
240extern_class!(
241    /// Ridged noise is similar to Perlin noise, with sharply-defined, relatively thin peaks.
242    ///
243    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkridgednoisesource?language=objc)
244    #[unsafe(super(GKCoherentNoiseSource, GKNoiseSource, NSObject))]
245    #[derive(Debug, PartialEq, Eq, Hash)]
246    pub struct GKRidgedNoiseSource;
247);
248
249extern_conformance!(
250    unsafe impl NSObjectProtocol for GKRidgedNoiseSource {}
251);
252
253impl GKRidgedNoiseSource {
254    extern_methods!(
255        #[unsafe(method(ridgedNoiseSourceWithFrequency:octaveCount:lacunarity:seed:))]
256        #[unsafe(method_family = none)]
257        pub unsafe fn ridgedNoiseSourceWithFrequency_octaveCount_lacunarity_seed(
258            frequency: c_double,
259            octave_count: NSInteger,
260            lacunarity: c_double,
261            seed: i32,
262        ) -> Retained<Self>;
263
264        #[unsafe(method(initWithFrequency:octaveCount:lacunarity:seed:))]
265        #[unsafe(method_family = init)]
266        pub unsafe fn initWithFrequency_octaveCount_lacunarity_seed(
267            this: Allocated<Self>,
268            frequency: c_double,
269            octave_count: NSInteger,
270            lacunarity: c_double,
271            seed: i32,
272        ) -> Retained<Self>;
273    );
274}
275
276/// Methods declared on superclass `NSObject`.
277impl GKRidgedNoiseSource {
278    extern_methods!(
279        #[unsafe(method(init))]
280        #[unsafe(method_family = init)]
281        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
282
283        #[unsafe(method(new))]
284        #[unsafe(method_family = new)]
285        pub unsafe fn new() -> Retained<Self>;
286    );
287}
288
289extern_class!(
290    /// Voronoi noise partitions the space into angular, polygonal "cells", which are reminiscent
291    /// of stained glass or crystal-like structures.
292    ///
293    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkvoronoinoisesource?language=objc)
294    #[unsafe(super(GKNoiseSource, NSObject))]
295    #[derive(Debug, PartialEq, Eq, Hash)]
296    pub struct GKVoronoiNoiseSource;
297);
298
299extern_conformance!(
300    unsafe impl NSObjectProtocol for GKVoronoiNoiseSource {}
301);
302
303impl GKVoronoiNoiseSource {
304    extern_methods!(
305        #[unsafe(method(frequency))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn frequency(&self) -> c_double;
308
309        /// Setter for [`frequency`][Self::frequency].
310        #[unsafe(method(setFrequency:))]
311        #[unsafe(method_family = none)]
312        pub unsafe fn setFrequency(&self, frequency: c_double);
313
314        #[unsafe(method(displacement))]
315        #[unsafe(method_family = none)]
316        pub unsafe fn displacement(&self) -> c_double;
317
318        /// Setter for [`displacement`][Self::displacement].
319        #[unsafe(method(setDisplacement:))]
320        #[unsafe(method_family = none)]
321        pub unsafe fn setDisplacement(&self, displacement: c_double);
322
323        #[unsafe(method(isDistanceEnabled))]
324        #[unsafe(method_family = none)]
325        pub unsafe fn isDistanceEnabled(&self) -> bool;
326
327        /// Setter for [`isDistanceEnabled`][Self::isDistanceEnabled].
328        #[unsafe(method(setDistanceEnabled:))]
329        #[unsafe(method_family = none)]
330        pub unsafe fn setDistanceEnabled(&self, distance_enabled: bool);
331
332        #[unsafe(method(seed))]
333        #[unsafe(method_family = none)]
334        pub unsafe fn seed(&self) -> i32;
335
336        /// Setter for [`seed`][Self::seed].
337        #[unsafe(method(setSeed:))]
338        #[unsafe(method_family = none)]
339        pub unsafe fn setSeed(&self, seed: i32);
340
341        #[unsafe(method(voronoiNoiseWithFrequency:displacement:distanceEnabled:seed:))]
342        #[unsafe(method_family = none)]
343        pub unsafe fn voronoiNoiseWithFrequency_displacement_distanceEnabled_seed(
344            frequency: c_double,
345            displacement: c_double,
346            distance_enabled: bool,
347            seed: i32,
348        ) -> Retained<Self>;
349
350        #[unsafe(method(initWithFrequency:displacement:distanceEnabled:seed:))]
351        #[unsafe(method_family = init)]
352        pub unsafe fn initWithFrequency_displacement_distanceEnabled_seed(
353            this: Allocated<Self>,
354            frequency: c_double,
355            displacement: c_double,
356            distance_enabled: bool,
357            seed: i32,
358        ) -> Retained<Self>;
359    );
360}
361
362/// Methods declared on superclass `NSObject`.
363impl GKVoronoiNoiseSource {
364    extern_methods!(
365        #[unsafe(method(init))]
366        #[unsafe(method_family = init)]
367        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
368
369        #[unsafe(method(new))]
370        #[unsafe(method_family = new)]
371        pub unsafe fn new() -> Retained<Self>;
372    );
373}
374
375extern_class!(
376    /// Produces a single, constant value at all positions in the space.
377    ///
378    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkconstantnoisesource?language=objc)
379    #[unsafe(super(GKNoiseSource, NSObject))]
380    #[derive(Debug, PartialEq, Eq, Hash)]
381    pub struct GKConstantNoiseSource;
382);
383
384extern_conformance!(
385    unsafe impl NSObjectProtocol for GKConstantNoiseSource {}
386);
387
388impl GKConstantNoiseSource {
389    extern_methods!(
390        #[unsafe(method(value))]
391        #[unsafe(method_family = none)]
392        pub unsafe fn value(&self) -> c_double;
393
394        /// Setter for [`value`][Self::value].
395        #[unsafe(method(setValue:))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn setValue(&self, value: c_double);
398
399        #[unsafe(method(constantNoiseWithValue:))]
400        #[unsafe(method_family = none)]
401        pub unsafe fn constantNoiseWithValue(value: c_double) -> Retained<Self>;
402
403        #[unsafe(method(initWithValue:))]
404        #[unsafe(method_family = init)]
405        pub unsafe fn initWithValue(this: Allocated<Self>, value: c_double) -> Retained<Self>;
406    );
407}
408
409/// Methods declared on superclass `NSObject`.
410impl GKConstantNoiseSource {
411    extern_methods!(
412        #[unsafe(method(init))]
413        #[unsafe(method_family = init)]
414        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
415
416        #[unsafe(method(new))]
417        #[unsafe(method_family = new)]
418        pub unsafe fn new() -> Retained<Self>;
419    );
420}
421
422extern_class!(
423    /// Produces 3D cylindrical noise with an infinite number of cylinders-within-cyliners of constantly-increasing radius.
424    ///
425    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkcylindersnoisesource?language=objc)
426    #[unsafe(super(GKNoiseSource, NSObject))]
427    #[derive(Debug, PartialEq, Eq, Hash)]
428    pub struct GKCylindersNoiseSource;
429);
430
431extern_conformance!(
432    unsafe impl NSObjectProtocol for GKCylindersNoiseSource {}
433);
434
435impl GKCylindersNoiseSource {
436    extern_methods!(
437        #[unsafe(method(frequency))]
438        #[unsafe(method_family = none)]
439        pub unsafe fn frequency(&self) -> c_double;
440
441        /// Setter for [`frequency`][Self::frequency].
442        #[unsafe(method(setFrequency:))]
443        #[unsafe(method_family = none)]
444        pub unsafe fn setFrequency(&self, frequency: c_double);
445
446        #[unsafe(method(cylindersNoiseWithFrequency:))]
447        #[unsafe(method_family = none)]
448        pub unsafe fn cylindersNoiseWithFrequency(frequency: c_double) -> Retained<Self>;
449
450        #[unsafe(method(initWithFrequency:))]
451        #[unsafe(method_family = init)]
452        pub unsafe fn initWithFrequency(
453            this: Allocated<Self>,
454            frequency: c_double,
455        ) -> Retained<Self>;
456    );
457}
458
459/// Methods declared on superclass `NSObject`.
460impl GKCylindersNoiseSource {
461    extern_methods!(
462        #[unsafe(method(init))]
463        #[unsafe(method_family = init)]
464        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
465
466        #[unsafe(method(new))]
467        #[unsafe(method_family = new)]
468        pub unsafe fn new() -> Retained<Self>;
469    );
470}
471
472extern_class!(
473    /// Produces 3D spherical noise with an infinite number of spheres-within-spheres of constantly-increasing radius.
474    ///
475    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkspheresnoisesource?language=objc)
476    #[unsafe(super(GKNoiseSource, NSObject))]
477    #[derive(Debug, PartialEq, Eq, Hash)]
478    pub struct GKSpheresNoiseSource;
479);
480
481extern_conformance!(
482    unsafe impl NSObjectProtocol for GKSpheresNoiseSource {}
483);
484
485impl GKSpheresNoiseSource {
486    extern_methods!(
487        #[unsafe(method(frequency))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn frequency(&self) -> c_double;
490
491        /// Setter for [`frequency`][Self::frequency].
492        #[unsafe(method(setFrequency:))]
493        #[unsafe(method_family = none)]
494        pub unsafe fn setFrequency(&self, frequency: c_double);
495
496        #[unsafe(method(spheresNoiseWithFrequency:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn spheresNoiseWithFrequency(frequency: c_double) -> Retained<Self>;
499
500        #[unsafe(method(initWithFrequency:))]
501        #[unsafe(method_family = init)]
502        pub unsafe fn initWithFrequency(
503            this: Allocated<Self>,
504            frequency: c_double,
505        ) -> Retained<Self>;
506    );
507}
508
509/// Methods declared on superclass `NSObject`.
510impl GKSpheresNoiseSource {
511    extern_methods!(
512        #[unsafe(method(init))]
513        #[unsafe(method_family = init)]
514        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
515
516        #[unsafe(method(new))]
517        #[unsafe(method_family = new)]
518        pub unsafe fn new() -> Retained<Self>;
519    );
520}
521
522extern_class!(
523    /// Produces noise in a checkerboard pattern.
524    ///
525    /// See also [Apple's documentation](https://developer.apple.com/documentation/gameplaykit/gkcheckerboardnoisesource?language=objc)
526    #[unsafe(super(GKNoiseSource, NSObject))]
527    #[derive(Debug, PartialEq, Eq, Hash)]
528    pub struct GKCheckerboardNoiseSource;
529);
530
531extern_conformance!(
532    unsafe impl NSObjectProtocol for GKCheckerboardNoiseSource {}
533);
534
535impl GKCheckerboardNoiseSource {
536    extern_methods!(
537        #[unsafe(method(squareSize))]
538        #[unsafe(method_family = none)]
539        pub unsafe fn squareSize(&self) -> c_double;
540
541        /// Setter for [`squareSize`][Self::squareSize].
542        #[unsafe(method(setSquareSize:))]
543        #[unsafe(method_family = none)]
544        pub unsafe fn setSquareSize(&self, square_size: c_double);
545
546        #[unsafe(method(checkerboardNoiseWithSquareSize:))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn checkerboardNoiseWithSquareSize(square_size: c_double) -> Retained<Self>;
549
550        #[unsafe(method(initWithSquareSize:))]
551        #[unsafe(method_family = init)]
552        pub unsafe fn initWithSquareSize(
553            this: Allocated<Self>,
554            square_size: c_double,
555        ) -> Retained<Self>;
556    );
557}
558
559/// Methods declared on superclass `NSObject`.
560impl GKCheckerboardNoiseSource {
561    extern_methods!(
562        #[unsafe(method(init))]
563        #[unsafe(method_family = init)]
564        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
565
566        #[unsafe(method(new))]
567        #[unsafe(method_family = new)]
568        pub unsafe fn new() -> Retained<Self>;
569    );
570}