Files
MapLibreParticleLab/src/mbgl/util/tiny_sdf.hpp
Bart Louwers 71f6da2722 Add clang-format (#1086)
Co-authored-by: mwilsnd <mwilsnd@gmail.com>
2023-05-01 16:57:37 +02:00

22 lines
716 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#pragma once
#include <mbgl/util/image.hpp>
namespace mbgl {
namespace util {
/*
C++ port of https://github.com/mapbox/tiny-sdf, which is in turn based on
the Felzenszwalb/Huttenlocher distance transform paper
(https://cs.brown.edu/~pff/papers/dt-final.pdf). Note there exists an
alternative C++ implementation from the paper’s authors at
https://cs.brown.edu/~pff/dt/, which this implementation is not based on.
Takes an alpha channel raster input and transforms it into an alpha channel
Signed Distance Field (SDF) output of the same dimensions.
*/
AlphaImage transformRasterToSDF(const AlphaImage& rasterInput, double radius, double cutoff);
} // namespace util
} // namespace mbgl