HighMap library (C++)
Loading...
Searching...
No Matches
synthesis.hpp File Reference

Provides functions for synthesizing new heightmaps from input arrays. More...

Go to the source code of this file.

Namespaces

namespace  hmap
namespace  hmap::gpu

Functions

Array hmap::loose_symmetry (const Array &array, SymmetryType symmetry_type=SymmetryType::SYMMETRY_LEFT_TO_RIGHT, float strength=1.f, int factor=4, int patch_size=16, int analysis_stride=2, int synthesis_stride=8, int sparsity=1, bool flatten_center=false, float flatten_radius=0.05f)
 Synthesize a heightmap with natural, approximate symmetry using exemplar-based super-resolution.
Array hmap::non_parametric_sampling (const Array &array, glm::ivec2 patch_shape, std::uint32_t seed, float error_threshold=0.1f)
 Synthesize a new heightmap based on an input array using a non-parametric sampling method.
Array hmap::quilting (const std::vector< const Array * > &p_arrays, glm::ivec2 patch_base_shape, glm::ivec2 tiling, float overlap, std::uint32_t seed, std::vector< Array * > secondary_arrays={}, bool patch_flip=true, bool patch_rotate=true, bool patch_transpose=true, float filter_width_ratio=0.25f)
 Synthesize a new heightmap by stitching together small patches from input heightmaps.
Array hmap::quilting_blend (const std::vector< const Array * > &p_arrays, glm::ivec2 patch_base_shape, float overlap, std::uint32_t seed, bool patch_flip=true, bool patch_rotate=true, bool patch_transpose=true, float filter_width_ratio=0.25f)
 Synthesize a new heightmap by stitching together small patches from a list of input heightmaps.
Array hmap::quilting_expand (const Array &array, float expansion_ratio, glm::ivec2 patch_base_shape, float overlap, std::uint32_t seed, std::vector< Array * > secondary_arrays={}, bool keep_input_shape=false, bool patch_flip=true, bool patch_rotate=true, bool patch_transpose=true, float filter_width_ratio=0.25f)
 Synthesize a new heightmap by expanding the input heightmap and stitching patches.
Array hmap::quilting_shuffle (const Array &array, glm::ivec2 patch_base_shape, float overlap, std::uint32_t seed, std::vector< Array * > secondary_arrays={}, bool patch_flip=true, bool patch_rotate=true, bool patch_transpose=true, float filter_width_ratio=0.25f)
 Synthesize a new heightmap by reshuffling patches of the input heightmap.
Array hmap::terrain_super_resolution (const Array &array, const Array &exemplar, int factor, int patch_size=16, int analysis_stride=8, int synthesis_stride=8, int sparsity=1)
 Synthesize a high-resolution heightmap from a low-resolution input using an exemplar-based sparse patch representation (terrain amplification).
void hmap::gpu::fill_masked_holes (Array &z, const Array &mask, int iterations_max=500, float tolerance=1e-5f, float omega=0.f, float detail_amplitude=1.f, int patch_size=16, std::uint32_t seed=0, int sync_interval=1, const UvTile &region=UvTile::unit(), ICommunicator &comm=SingleArrayComm::instance())
 Fill masked holes in a heightmap by reconstructing the masked regions from the surrounding terrain using GPU biharmonic interpolation.

Detailed Description

Provides functions for synthesizing new heightmaps from input arrays.

Author
Otto Link (otto..nosp@m.link.nosp@m..bv@g.nosp@m.mail.nosp@m..com)

This header file defines functions for synthesizing new heightmaps by using various techniques such as non-parametric sampling, patch quilting, and blending. These functions allow for the generation of larger or modified heightmaps based on input data, using methods like patch stitching and random sampling.

Functions provided:

  • loose_symmetry: Synthesizes a heightmap with natural, approximate symmetry using exemplar-based super-resolution.
  • non_parametric_sampling: Generates a new heightmap using non-parametric sampling.
  • quilting: Synthesizes a new heightmap by stitching patches from a set of input heightmaps.
  • quilting_blend: Similar to quilting, but includes blending of patches.
  • quilting_expand: Synthesizes a larger heightmap by expanding and stitching patches from an input heightmap.
  • quilting_shuffle: Similar to quilting_expand, but reshuffles patches to generate a new heightmap with the same shape.
  • terrain_super_resolution: Amplifies a low-resolution heightmap using sparse patch coding against a high-resolution exemplar.