MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / loadDistanceMapFromImage

Function loadDistanceMapFromImage

scripts/mrbind/helpers.cpp:150–156  ·  view source on GitHub ↗

load distance map from a grayscale image file threshold - threshold of valid values [0.; 1.]. pixel with color less then threshold set invalid

Source from the content-addressed store, hash-verified

148 // load distance map from a grayscale image file
149 // threshold - threshold of valid values [0.; 1.]. pixel with color less then threshold set invalid
150 Expected<MR::DistanceMap> loadDistanceMapFromImage( const std::filesystem::path& filename, float threshold = 1.f / 255 )
151 {
152 auto resLoad = ImageLoad::fromAnySupportedFormat( filename );
153 if ( !resLoad.has_value() )
154 return unexpected( resLoad.error() );
155 return convertImageToDistanceMap( *resLoad, threshold );
156 }
157}
158
159// This stuff makes it so that `MRTest` and our other apps can use the module directly, without having to add it to `PYTHONPATH`.

Callers

nothing calls this directly

Calls 4

errorMethod · 0.80
fromAnySupportedFormatFunction · 0.50
unexpectedFunction · 0.50

Tested by

no test coverage detected