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

Header file for asset export functionalities. More...

Go to the source code of this file.

Namespaces

namespace  hmap
 

Enumerations

enum  hmap::MeshType : int { hmap::TRI_OPTIMIZED , hmap::TRI }
 Enumeration for different mesh types. More...
 
enum  hmap::AssetExportFormat : int {
  hmap::_3DS , hmap::_3MF , hmap::ASSBIN , hmap::ASSXML ,
  hmap::FXBA , hmap::FBX , hmap::COLLADA , hmap::X3D ,
  hmap::GLTF , hmap::GLB , hmap::GTLF2 , hmap::GLB2 ,
  hmap::PLY , hmap::PLYB , hmap::STP , hmap::STL ,
  hmap::STLB , hmap::OBJ , hmap::OBJNOMTL
}
 Enumeration for asset export formats supported by Assimp. More...
 

Functions

bool hmap::export_asset (const std::string &fname, const Array &array, MeshType mesh_type=MeshType::TRI, AssetExportFormat export_format=AssetExportFormat::GLB2, float elevation_scaling=0.2f, const std::string &texture_fname="", const std::string &normal_map_fname="", float max_error=5e-4f)
 Exports a heightmap to various 3D file formats.
 
std::string hmap::export_as_ascii (const Array &array, const Vec2< int > &export_shape={64, 64}, const std::string chars_map=" .:-=+*#%@")
 Export a 2D array as an ASCII-art string representation.
 
void hmap::export_as_cubemap (const std::string &fname, const Array &z, int cubemap_resolution=128, float overlap=0.25f, int ir=16, Cmap cmap=Cmap::GRAY, bool splitted=false, Array *p_cubemap=nullptr)
 Exports a 2D array as a cubemap texture with continuity enforcement and overlapping regions.
 
void hmap::export_banner_png (const std::string &fname, const std::vector< Array > &arrays, int cmap, bool hillshading=false)
 Exports a set of arrays as a banner PNG image file.
 
void hmap::export_normal_map_png (const std::string &fname, const Array &array, int depth=CV_8U)
 Exports the heightmap normal map as an 8-bit PNG file.
 
void hmap::export_splatmap_png (const std::string &fname, const Array *p_r, const Array *p_g=nullptr, const Array *p_b=nullptr, const Array *p_a=nullptr, int depth=CV_8U)
 Exports four arrays as an RGBA PNG splatmap.
 
void hmap::export_tiled (const std::string &fname_radical, const std::string &fname_extension, const Array &array, const Vec2< int > &tiling, int leading_zeros=0, int depth=CV_8U, bool overlapping_edges=false, bool reverse_tile_y_indexing=false)
 Exports a 2D array as a set of grayscale PNG image tiles.
 
Array hmap::read_to_array (const std::string &fname)
 Reads an image file and converts it to a 2D array.
 
void hmap::write_raw_16bit (const std::string &fname, const Array &array)
 Exports an array to a 16-bit 'raw' file format, commonly used for Unity terrain imports.
 
std::filesystem::path hmap::add_filename_suffix (const std::filesystem::path &file_path, const std::string &suffix)
 

Detailed Description

Header file for asset export functionalities.

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

This header file declares functions and types related to exporting assets in various formats. It includes functionality for exporting heightmaps, generating 3D assets in different file formats, and handling export options such as mesh types, file formats, and scaling factors.