diff --git a/core/msdfgen-c.cpp b/core/msdfgen-c.cpp index 812a418..2e751f1 100644 --- a/core/msdfgen-c.cpp +++ b/core/msdfgen-c.cpp @@ -252,6 +252,14 @@ MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape) { return MSDF_SUCCESS; } +MSDF_API int msdf_shape_simple_edge_colors(msdf_shape_handle shape, const double angle_threshold) { + if(shape == nullptr) { + return MSDF_ERR_INVALID_ARG; + } + msdfgen::edgeColoringSimple(*reinterpret_cast(shape), angle_threshold); + return MSDF_SUCCESS; +} + MSDF_API void msdf_shape_free(msdf_shape_handle shape) { delete reinterpret_cast(shape); } diff --git a/msdfgen-c.h b/msdfgen-c.h index d11a0dd..378af8d 100644 --- a/msdfgen-c.h +++ b/msdfgen-c.h @@ -273,6 +273,15 @@ MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_ */ MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape); +/** + * Colors the edges of the given shape using the default MSDF colors specified by thee + * MSDF_COLOR_ prefixed constants. + * @param shape A pointer to a shape whose edges to color with the default MSDF colors. + * @param angle_threshold The threshold angle in degrees. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ +MSDF_API int msdf_shape_simple_edge_colors(msdf_shape_handle shape, double angle_threshold); + /** * Calls the destructor of the given bitmap and frees its memory using the * internal allocator.