21 #ifndef GF_HEIGHTMAP_H 22 #define GF_HEIGHTMAP_H 27 #include "ColorRamp.h" 34 #ifndef DOXYGEN_SHOULD_SKIP_THIS 64 return m_data.getSize();
81 return m_data(position);
91 m_data(position) = value;
99 std::tuple<double, double> getMinMax()
const;
112 void normalize(
double min = 0.0,
double max = 1.0);
121 void addHill(
Vector2d center,
double radius,
double height);
130 void digHill(
Vector2d center,
double radius,
double height);
145 void addValue(
double value);
152 void scale(
double value);
161 void clamp(
double min = 0.0,
double max = 1.0);
182 double getSlope(
Vector2i position)
const;
191 void thermalErosion(
unsigned iterations,
double talus,
double fraction);
202 void hydraulicErosion(
unsigned iterations,
double rainAmount,
double solubility,
double evaporation,
double capacity);
211 void fastErosion(
unsigned iterations,
double talus,
double fraction);
220 double getErosionScore()
const;
255 Image copyToGrayscaleImage()
const;
273 Image copyToColoredImage(
const ColorRampD& ramp,
double waterLevel = 0.5,
Render render = Render::Colored)
const;
283 #ifndef DOXYGEN_SHOULD_SKIP_THIS 288 #endif // GF_HEIGHTMAP_H void setValue(Vector2i position, double value)
Set the value at the specified position.
Definition: Heightmap.h:90
GF_CORE_API void scale(Matrix3f &mat, Vector2f factor)
Combine the current transform with a scaling.
constexpr T clamp(T val, T lo, T hi)
Clamping function.
Definition: Math.h:284
A heightmap.
Definition: Heightmap.h:44
2D A noise function
Definition: Noise.h:35
Vector2i getSize() const
Get the size of the heightmap.
Definition: Heightmap.h:63
Render
Rendering mode.
Definition: Heightmap.h:229
Class for loading, manipulating and saving images.
Definition: Image.h:80
The namespace for gf classes.
Definition: Action.h:35
double getValue(Vector2i position) const
Get the value at the specified position.
Definition: Heightmap.h:80
A color ramp.
Definition: ColorRamp.h:49