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
9#include <filesystem>
10
11namespace MR
12{
13
14namespace DistanceMapLoad
15{
19
26MRMESH_API Expected<DistanceMap> fromRaw( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
27[[deprecated( "Use fromRaw( path, settings )")]]
28inline Expected<DistanceMap> fromRaw( const std::filesystem::path& path, ProgressCallback progressCb )
29{
30 return fromRaw( path, DistanceMapLoadSettings {
31 .progress = progressCb,
32 } );
33}
34
35MRMESH_API Expected<DistanceMap> fromMrDistanceMap( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
36[[deprecated( "Use fromMrDistanceMap( path, settings )")]]
37inline Expected<DistanceMap> fromMrDistanceMap( const std::filesystem::path& path, DistanceMapToWorld& params, ProgressCallback progressCb = {} )
38{
39 return fromMrDistanceMap( path, {
40 .distanceMapToWorld = &params,
41 .progress = progressCb,
42 } );
43}
44
45#if !defined( __EMSCRIPTEN__ ) && !defined( MRMESH_NO_TIFF )
46MRMESH_API Expected<DistanceMap> fromTiff( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
47[[deprecated( "Use fromTiff( path, settings )")]]
48inline Expected<DistanceMap> fromTiff( const std::filesystem::path& path, DistanceMapToWorld& params, ProgressCallback progressCb = {} )
49{
50 return fromTiff( path, {
51 .distanceMapToWorld = &params,
52 .progress = progressCb,
53 } );
54}
55#endif
56
57MRMESH_API Expected<DistanceMap> fromAnySupportedFormat( const std::filesystem::path& path, const DistanceMapLoadSettings& settings = {} );
58[[deprecated( "Use fromAnySupportedFormat( path, settings )" )]]
59inline Expected<DistanceMap> fromAnySupportedFormat( const std::filesystem::path& path, DistanceMapToWorld* params, ProgressCallback progressCb = {} )
60{
61 return fromAnySupportedFormat( path, {
62 .distanceMapToWorld = params,
63 .progress = progressCb,
64 } );
65}
66
68
69} // namespace DistanceMapLoad
70
71} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:641
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={})
tl::expected< T, E > Expected
Definition MRExpected.h:59
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