mirror of https://github.com/Chlumsky/msdfgen.git
Add msdf_shape_simple_edge_colors function
This commit is contained in:
parent
a142c3d4b3
commit
8d08d7cec7
|
|
@ -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<msdfgen::Shape*>(shape), angle_threshold);
|
||||
return MSDF_SUCCESS;
|
||||
}
|
||||
|
||||
MSDF_API void msdf_shape_free(msdf_shape_handle shape) {
|
||||
delete reinterpret_cast<msdfgen::Shape*>(shape);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in New Issue