Skip to content

Commit ba3065d

Browse files
committed
Split primitives header into subheaders
1 parent ef0f9c7 commit ba3065d

45 files changed

Lines changed: 3685 additions & 3583 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

HighMap/include/highmap/interpolate2d.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
*/
1717

1818
#pragma once
19-
#include <stddef.h> // for size_t
19+
#include <stddef.h>
2020

2121
#include <map>
22-
#include <vector> // for vector
22+
#include <vector>
2323

2424
extern "C" // order matters
2525
{
@@ -32,7 +32,7 @@ extern "C" // order matters
3232
#include "delaunay.h"
3333
}
3434

35-
#include "highmap/array.hpp" // for Array
35+
#include "highmap/array.hpp"
3636

3737
namespace hmap
3838
{

HighMap/include/highmap/primitives.hpp

Lines changed: 4 additions & 3333 deletions
Large diffs are not rendered by default.

HighMap/include/highmap/primitives/coherent_noise.hpp

Lines changed: 1418 additions & 0 deletions
Large diffs are not rendered by default.

HighMap/include/highmap/primitives/functions.hpp

Lines changed: 1009 additions & 0 deletions
Large diffs are not rendered by default.

HighMap/include/highmap/primitives/geo.hpp

Lines changed: 883 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2+
Public License. The full license is in the file LICENSE, distributed with
3+
this software. */
4+
5+
/**
6+
* @file random.hpp
7+
* @author Otto Link (otto.link.bv@gmail.com)
8+
* @copyright Copyright (c) 2023
9+
*/
10+
#pragma once
11+
12+
#include "highmap/array.hpp"
13+
14+
namespace hmap
15+
{
16+
17+
/**
18+
* @brief Return an array filled with white noise.
19+
*
20+
* @param shape Array shape.
21+
* @param a Lower bound of random distribution.
22+
* @param b Upper bound of random distribution.
23+
* @param seed Random number seed.
24+
* @return Array White noise.
25+
*
26+
* **Example**
27+
* @include ex_white.cpp
28+
*
29+
* **Result**
30+
* @image html ex_white.png
31+
*
32+
* @see {@link white_sparse}
33+
*/
34+
Array white(glm::ivec2 shape, float a, float b, std::uint32_t seed);
35+
36+
/**
37+
* @brief Return an array filled `1` with a probability based on a density map.
38+
*
39+
* @param density_map Density map.
40+
* @param seed Random number seed.
41+
* @return Array New array.
42+
*
43+
* **Example**
44+
* @include ex_white_density_map.cpp
45+
*
46+
* **Result**
47+
* @image html ex_white_density_map.png
48+
*/
49+
Array white_density_map(const Array &density_map, std::uint32_t seed);
50+
51+
/**
52+
* @brief Return an array sparsely filled with white noise.
53+
*
54+
* @param shape Array shape.
55+
* @param a Lower bound of random distribution.
56+
* @param b Upper bound of random distribution.
57+
* @param density Array filling density, in [0, 1]. If set to 1, the function
58+
* is equivalent to {@link white}.
59+
* @param seed Random number seed.
60+
* @return Array Sparse white noise.
61+
*
62+
* **Example**
63+
* @include ex_white_sparse.cpp
64+
*
65+
* **Result**
66+
* @image html ex_white_sparse.png
67+
*
68+
* @see {@link white}
69+
*/
70+
Array white_sparse(glm::ivec2 shape,
71+
float a,
72+
float b,
73+
float density,
74+
std::uint32_t seed);
75+
76+
/**
77+
* @brief Return an array sparsely filled with random 0 and 1.
78+
*
79+
* @param shape Array shape.
80+
* @param density Array filling density, in [0, 1]. If set to 1, the function
81+
* is equivalent to {@link white}.
82+
* @param seed Random number seed.
83+
* @return Array Sparse white noise.
84+
*/
85+
Array white_sparse_binary(glm::ivec2 shape, float density, std::uint32_t seed);
86+
87+
} // namespace hmap

HighMap/src/convolve/convolve2d_svd.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
22
* Public License. The full license is in the file LICENSE, distributed with
33
* this software. */
4-
#include <algorithm> // for min
5-
#include <cstdint>
6-
#include <vector> // for vector
4+
#include <algorithm> // for fill_n, min
5+
#include <cstdint> // for uint32_t
6+
#include <vector> // for vector
77

88
#include <gsl/gsl_linalg.h> // for gsl_linalg_SV_decomp
9-
#include <gsl/gsl_matrix_double.h> // for gsl_matrix_alloc, gsl_matrix...
10-
#include <gsl/gsl_vector_double.h> // for gsl_vector_alloc, gsl_vector...
11-
12-
#include "highmap/array.hpp" // for Array, operator*
13-
#include "highmap/convolve.hpp" // for convolve1d_i, convolve1d_j
14-
#include "highmap/operator.hpp" // for linspace
15-
#include "highmap/primitives.hpp" // for white_sparse_binary
16-
#include "highmap/transform.hpp" // for rotate
9+
#include <gsl/gsl_matrix_double.h> // for gsl_matrix_alloc, gsl_matri...
10+
#include <gsl/gsl_vector_double.h> // for gsl_vector_alloc, gsl_vecto...
11+
12+
#include "highmap/array.hpp" // for Array, operator*
13+
#include "highmap/convolve.hpp" // for convolve1d_i, convolve1d_j
14+
#include "highmap/operator.hpp" // for linspace
15+
#include "highmap/primitives/random.hpp" // for white_sparse_binary
16+
#include "highmap/transform.hpp" // for rotate
1717

1818
namespace hmap
1919
{

HighMap/src/erosion/hydraulic_benes.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
* this software. */
44

55
#include <algorithm> // for rotate, fill_n, max, min
6-
#include <cstdint>
7-
#include <vector> // for vector
8-
9-
#include "highmap/array.hpp" // for Array, operator*
10-
#include "highmap/boundary.hpp" // for fill_borders, extrapolate_bo...
11-
#include "highmap/erosion.hpp" // for hydraulic_benes, HMAP_DI
12-
#include "highmap/filters.hpp" // for laplace
13-
#include "highmap/math/array.hpp" // for lerp
14-
#include "highmap/primitives.hpp" // for constant
15-
#include "highmap/range.hpp" // for clamp_min, chop
6+
#include <cstdint> // for uint32_t
7+
#include <vector> // for vector
8+
9+
#include "highmap/array.hpp" // for Array, operator*
10+
#include "highmap/boundary.hpp" // for fill_borders, extrapolat...
11+
#include "highmap/erosion.hpp" // for hydraulic_benes, HMAP_DI
12+
#include "highmap/filters.hpp" // for laplace
13+
#include "highmap/math/array.hpp" // for lerp
14+
#include "highmap/primitives/functions.hpp" // for constant
15+
#include "highmap/range.hpp" // for clamp_min, chop
1616

1717
namespace hmap
1818
{

HighMap/src/erosion/hydraulic_musgrave.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
* Public License. The full license is in the file LICENSE, distributed with
33
* this software. */
44
#include <algorithm> // for rotate, min
5-
#include <cstdint>
6-
#include <vector> // for vector
7-
8-
#include "highmap/array.hpp" // for Array, operator*
9-
#include "highmap/boundary.hpp" // for fill_borders, extrapolate_bo...
10-
#include "highmap/erosion.hpp" // for hydraulic_musgrave, HMAP_CD_INV
11-
#include "highmap/filters.hpp" // for laplace
12-
#include "highmap/primitives.hpp" // for constant
5+
#include <cstdint> // for uint32_t
6+
#include <vector> // for vector
7+
8+
#include "highmap/array.hpp" // for Array, operator*
9+
#include "highmap/boundary.hpp" // for fill_borders, extrapolat...
10+
#include "highmap/erosion.hpp" // for hydraulic_musgrave, HMAP...
11+
#include "highmap/filters.hpp" // for laplace
12+
#include "highmap/primitives/functions.hpp" // for constant
1313

1414
namespace hmap
1515
{

HighMap/src/erosion/hydraulic_procedural.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
22
* Public License. The full license is in the file LICENSE, distributed with
33
* this software. */
4-
#include <cmath> // for M_PI, atan
5-
#include <cstdint>
4+
#include <cmath> // for M_PI, atan
5+
#include <cstdint> // for uint32_t
66
#include <functional> // for function
77

8-
#include "highmap/array.hpp" // for Array, operator*, operator+
9-
#include "highmap/blending.hpp" // for blend_gradients
10-
#include "highmap/erosion.hpp" // for ErosionProfile, get_erosi...
11-
#include "highmap/filters.hpp" // for smooth_cpulse, smooth_fil...
12-
#include "highmap/functions.hpp" // for NoiseType
13-
#include "highmap/gradient.hpp" // for gradient_norm, phase_field
14-
#include "highmap/hydrology/hydrology.hpp" // for flow_accumulation_dinf
15-
#include "highmap/math/array.hpp" // for lerp, cos, log10, pow
16-
#include "highmap/math/core.hpp" // for lerp
17-
#include "highmap/morphology.hpp" // for morphological_top_hat
18-
#include "highmap/primitives.hpp" // for noise_fbm
19-
#include "highmap/range.hpp" // for remap
8+
#include "highmap/array.hpp" // for Array, operator*
9+
#include "highmap/blending.hpp" // for blend_gradients
10+
#include "highmap/erosion.hpp" // for ErosionProfile, get...
11+
#include "highmap/filters.hpp" // for smooth_cpulse, smoo...
12+
#include "highmap/functions.hpp" // for NoiseType
13+
#include "highmap/gradient.hpp" // for gradient_norm, phas...
14+
#include "highmap/hydrology/hydrology.hpp" // for flow_accumulation_dinf
15+
#include "highmap/math/array.hpp" // for lerp, cos, log10, pow
16+
#include "highmap/math/core.hpp" // for lerp
17+
#include "highmap/morphology.hpp" // for morphological_top_hat
18+
#include "highmap/primitives/coherent_noise.hpp" // for noise_fbm
19+
#include "highmap/range.hpp" // for remap
2020

2121
namespace hmap::gpu
2222
{

0 commit comments

Comments
 (0)