ImageHeightmap Class Reference
Encapsulates an image that will be interpreted as a heightmap. More...
#include <ImageHeightmap.hh>
Public Member Functions | |
ImageHeightmap () | |
Constructor. | |
std::string | Filename () const |
Get the full filename of loaded heightmap image/dem. | |
void | FillHeightMap (int _subSampling, unsigned int _vertSize, const gz::math::Vector3d &_size, const gz::math::Vector3d &_scale, bool _flipY, std::vector< float > &_heights) const |
Create a lookup table of the terrain's height. | |
unsigned int | Height () const |
Get the terrain's height. | |
int | Load (const std::string &_filename="") |
Load an image file as a heightmap. | |
float | MaxElevation () const |
Get the maximum terrain's elevation. | |
unsigned int | Width () const |
Get the terrain's width. | |
Public Member Functions inherited from HeightmapData | |
virtual | ~HeightmapData ()=default |
Destructor. | |
virtual float | MinElevation () const |
Get the min terrain's elevation. | |
Detailed Description
Encapsulates an image that will be interpreted as a heightmap.
Constructor & Destructor Documentation
◆ ImageHeightmap()
ImageHeightmap | ( | ) |
Constructor.
- Parameters
-
[in] _filename the path to the image
Member Function Documentation
◆ Filename()
|
virtual |
Get the full filename of loaded heightmap image/dem.
- Returns
- The filename used to load the heightmap image/dem
Implements HeightmapData.
◆ FillHeightMap()
|
virtual |
Create a lookup table of the terrain's height.
- Parameters
-
[in] _subsampling Multiplier used to increase the resolution. Ex: A subsampling of 2 in a terrain of 129x129 means that the height vector will be 257 * 257. [in] _vertSize Number of points per row. [in] _size Real dimensions of the terrain. [in] _scale Vector3 used to scale the height. [in] _flipY If true, it inverts the order in which the vector is filled. [out] _heights Vector containing the terrain heights.
Implements HeightmapData.
◆ Height()
|
virtual |
◆ Load()
int Load | ( | const std::string & | _filename = "" | ) |
Load an image file as a heightmap.
- Parameters
-
[in] _filename the path to the image file.
- Returns
- True when the operation succeeds to open a file.
◆ MaxElevation()
|
virtual |
Get the maximum terrain's elevation.
- Returns
- The maximum terrain's elevation.
Implements HeightmapData.
◆ Width()
|
virtual |
The documentation for this class was generated from the following file: