MeshLib C++ Docs
Loading...
Searching...
No Matches
MRDistanceMapLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRDistanceMap.h"
5#include "MRExpected.h"
6#include "MRIOFilters.h"
8#include "MRPch/MRBindingMacros.h"
9
10#include <filesystem>
11
12namespace MR
13{
14
15namespace DistanceMapLoad
16{
20
27MRMESH_API Expected<DistanceMap> fromRaw( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
28[[deprecated( "Use fromRaw( path, settings )")]]
29MR_BIND_IGNORE inline Expected<DistanceMap> fromRaw( const std::filesystem::path& path, ProgressCallback progressCb )
30{
31 return fromRaw( path, DistanceMapLoadSettings {
32 .progress = progressCb,
33 } );
34}
35
36MRMESH_API Expected<DistanceMap> fromMrDistanceMap( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
37[[deprecated( "Use fromMrDistanceMap( path, settings )")]]
38MR_BIND_IGNORE inline Expected<DistanceMap> fromMrDistanceMap( const std::filesystem::path& path, DistanceMapToWorld& params, ProgressCallback progressCb = {} )
39{
40 return fromMrDistanceMap( path, {
41 .distanceMapToWorld = &params,
42 .progress = progressCb,
43 } );
44}
45
46#if !defined( __EMSCRIPTEN__ ) && !defined( MRMESH_NO_TIFF )
47MRMESH_API Expected<DistanceMap> fromTiff( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
48[[deprecated( "Use fromTiff( path, settings )")]]
49MR_BIND_IGNORE inline Expected<DistanceMap> fromTiff( const std::filesystem::path& path, DistanceMapToWorld& params, ProgressCallback progressCb = {} )
50{
51 return fromTiff( path, {
52 .distanceMapToWorld = &params,
53 .progress = progressCb,
54 } );
55}
56#endif
57
58MRMESH_API Expected<DistanceMap> fromAnySupportedFormat( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
59[[deprecated( "Use fromAnySupportedFormat( path, settings )" )]]
60MR_BIND_IGNORE inline Expected<DistanceMap> fromAnySupportedFormat( const std::filesystem::path& path, DistanceMapToWorld* params, ProgressCallback progressCb = {} )
61{
62 return fromAnySupportedFormat( path, {
63 .distanceMapToWorld = params,
64 .progress = progressCb,
65 } );
66}
67
69
70} // namespace DistanceMapLoad
71
72} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:80
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:728
MRMESH_API Expected< DistanceMap > fromRaw(const std::filesystem::path &path, const DistanceMapLoadSettings &settings={})
Load DistanceMap from binary file Format: 2 integer - DistanceMap.resX & DistanceMap....
MRMESH_API Expected< DistanceMap > fromTiff(const std::filesystem::path &path, const DistanceMapLoadSettings &settings={})
MRMESH_API Expected< DistanceMap > fromMrDistanceMap(const std::filesystem::path &path, const DistanceMapLoadSettings &settings={})
MRMESH_API Expected< DistanceMap > fromAnySupportedFormat(const std::filesystem::path &path, const DistanceMapLoadSettings &settings={})
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:25
std::array< Vector3f, 3 > MR_BIND_IGNORE
Definition MRMeshBuilderTypes.h:10
settings for loading distance maps from external formats
Definition MRDistanceMapParams.h:189
ProgressCallback progress
to report load progress and cancel loading if user desires
Definition MRDistanceMapParams.h:193
This structure store data to transform distance map to world coordinates.
Definition MRDistanceMapParams.h:136