From 9910e8ce8717a5a456a73c2be613cffbe315f076 Mon Sep 17 00:00:00 2001 From: Chris Loer Date: Fri, 7 Jul 2017 13:31:53 -0700 Subject: [core] C++ port of TinySDF --- src/mbgl/util/tiny_sdf.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/mbgl/util/tiny_sdf.hpp (limited to 'src/mbgl/util/tiny_sdf.hpp') diff --git a/src/mbgl/util/tiny_sdf.hpp b/src/mbgl/util/tiny_sdf.hpp new file mode 100644 index 0000000000..33c9280cbd --- /dev/null +++ b/src/mbgl/util/tiny_sdf.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include + +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 -- cgit v1.2.1