From 5b2abedc83f39b2143214ec008fd45db2009a476 Mon Sep 17 00:00:00 2001 From: KitsuneAlex Date: Sat, 4 May 2024 18:36:33 +0200 Subject: [PATCH] Add documentation to the main msdfgen-core functions --- msdfgen_c.h | 138 ++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 102 insertions(+), 36 deletions(-) diff --git a/msdfgen_c.h b/msdfgen_c.h index 2c582d9..326bce7 100644 --- a/msdfgen_c.h +++ b/msdfgen_c.h @@ -163,7 +163,7 @@ MSDF_API const msdf_allocator_t* msdf_allocator_get(); * @param width The width of the bitmap in pixels. * @param height The height of the bitmap in pixels. * @param bitmap A pointer to an @code msdf_bitmap_t@endcode structure to allocate a new bitmap into. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_bitmap_alloc(int type, int width, int height, msdf_bitmap_t* bitmap); @@ -171,7 +171,7 @@ MSDF_API int msdf_bitmap_alloc(int type, int width, int height, msdf_bitmap_t* b * Retrieves the number of color channels used by the given bitmap. * @param bitmap A pointer to an @code msdf_bitmap_t@endcode structure to retrieve the channel count from. * @param channel_count A pointer to a variable which is populated with the number of color channels used by the given bitmap. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_bitmap_get_channel_count(const msdf_bitmap_t* bitmap, int* channel_count); @@ -179,7 +179,7 @@ MSDF_API int msdf_bitmap_get_channel_count(const msdf_bitmap_t* bitmap, int* cha * Retrieves the address of the raw pixel data of the given bitmap. * @param bitmap A pointer to an @code msdf_bitmap_t@endcode structure to retrieve the raw pixel data from. * @param pixels A pointer to an address which is populated with the raw pixel data of the given bitmap. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_bitmap_get_pixels(const msdf_bitmap_t* bitmap, void** pixels); @@ -187,7 +187,7 @@ MSDF_API int msdf_bitmap_get_pixels(const msdf_bitmap_t* bitmap, void** pixels); * Retrieves the size of the pixel data of the given bitmap in bytes. * @param bitmap A pointer to an @code msdf_bitmap_t@endcode structure to retrieve the size of the raw pixel data from. * @param size A pointer to a variable which is populated with the byte size of the raw pixel data of the given bitmap. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_bitmap_get_byte_size(const msdf_bitmap_t* bitmap, size_t* size); @@ -203,7 +203,7 @@ MSDF_API void msdf_bitmap_free(msdf_bitmap_t* bitmap); /** * Allocates a new MSDF shape object using the internal allocator. * @param shape A pointer to an address which is populated with the address of the newly allocated shape. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_alloc(msdf_shape_handle* shape); @@ -211,7 +211,7 @@ MSDF_API int msdf_shape_alloc(msdf_shape_handle* shape); * Retrieves the bounds of the given shape. * @param shape A pointer to a shape object to retrieve the bounds from. * @param bounds A pointer to a variable which is populated with the bounds of the given shape. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_get_bounds(msdf_shape_const_handle shape, msdf_bounds_t* bounds); @@ -219,7 +219,7 @@ MSDF_API int msdf_shape_get_bounds(msdf_shape_const_handle shape, msdf_bounds_t* * Adds a new contour to the given shape. * @param shape A pointer to a shape object to add a new contour to. * @param contour A pointer to an address which is populated with the address of the newly created contour. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_handle* contour); @@ -227,7 +227,7 @@ MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_handle * Retrieves the number of contours allocated within the given shape object. * @param shape A pointer to a shape object from which to retrieve the contour count. * @param contour_count A pointer to a variable which is populated with the number of contours of the given shape. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_get_contour_count(msdf_shape_const_handle shape, size_t* contour_count); @@ -236,7 +236,7 @@ MSDF_API int msdf_shape_get_contour_count(msdf_shape_const_handle shape, size_t* * @param shape A pointer to a shape object from which to retrieve a contour. * @param index The index of the contour to retrieve. * @param contour A pointer to an address which is populated with the address of the contour at the given index if present. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_get_contour(msdf_shape_const_handle shape, size_t index, msdf_contour_const_handle* contour); @@ -244,7 +244,7 @@ MSDF_API int msdf_shape_get_contour(msdf_shape_const_handle shape, size_t index, * Retrieves the number of edges of the given shape. * @param shape A pointer to a shape from which to retrieve the edge count. * @param edge_count A pointer to a variable which is populated with the number of edges defined by the given shape. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_get_edge_count(msdf_shape_const_handle shape, size_t* edge_count); @@ -253,14 +253,14 @@ MSDF_API int msdf_shape_get_edge_count(msdf_shape_const_handle shape, size_t* ed * @param shape A pointer to a shape from which to fetch the inverse-y-axis flag. * @param inverse_y_axis A pointer to a variable which is populated with @code MSDF_TRUE@endcode when the * y-axis of the given shape is inverted. Otherwise the variable will be set to @code MSDF_FALSE@endcode. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_has_inverse_y_axis(msdf_shape_const_handle shape, int* inverse_y_axis); /** * Normalizes the given shape. * @param shape A pointer to a shape to normalize. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_normalize(msdf_shape_handle shape); @@ -269,7 +269,7 @@ MSDF_API int msdf_shape_normalize(msdf_shape_handle shape); * @param shape A pointer to a shape to validate. * @param result A pointer to a variable which is populated with @code MSDF_TRUE@endcode when the * validation was successful. Otherwise the variable will be set to @code MSDF_FALSE@endcode. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_validate(msdf_shape_handle shape, int* result); @@ -277,7 +277,7 @@ MSDF_API int msdf_shape_validate(msdf_shape_handle shape, int* result); * Adjusts the given bounding box to fit the given shape. * @param shape A pointer to a shape to fit into the given bounding box. * @param bounds A pointer to a bounding box which should at least fit the given shape. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_bound(msdf_shape_const_handle shape, msdf_bounds_t* bounds); @@ -288,7 +288,7 @@ MSDF_API int msdf_shape_bound(msdf_shape_const_handle shape, msdf_bounds_t* boun * @param border The size of the border. * @param miter_limit The miter limit value. * @param polarity The miter polarity. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); @@ -304,7 +304,7 @@ MSDF_API void msdf_shape_free(msdf_shape_handle shape); /** * Allocates a new contour object using the internal allocator. * @param contour A pointer to an address which is populated with the address of the newly allocated contour object. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_alloc(msdf_contour_handle* contour); @@ -313,7 +313,7 @@ MSDF_API int msdf_contour_alloc(msdf_contour_handle* contour); * @param contour A pointer to the contour to add a new edge (segment) to. * @param segment A pointer to an address which is populated with the address of the newly * added edge segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_add_edge(msdf_contour_handle contour, msdf_segment_handle* segment); @@ -321,7 +321,7 @@ MSDF_API int msdf_contour_add_edge(msdf_contour_handle contour, msdf_segment_han * Retrieves the edge count of the given contour. * @param contour A pointer to the contour to retrieve the edge count from. * @param edge_count A pointer to a variable which is populated with the edge count of the given contour. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_get_edge_count(msdf_contour_const_handle contour, size_t* edge_count); @@ -331,7 +331,7 @@ MSDF_API int msdf_contour_get_edge_count(msdf_contour_const_handle contour, size * @param index The index from which to retrieve the edge segment. * @param segment A pointer to an address which is populated with the address of the * edge segment at the given index if present. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_get_edge(msdf_contour_const_handle contour, size_t index, msdf_segment_const_handle* segment); @@ -339,7 +339,7 @@ MSDF_API int msdf_contour_get_edge(msdf_contour_const_handle contour, size_t ind * Adjusts the given bounding box to fit at least the given contour. * @param contour A pointer to the contour which should at least fit into the given bounding box. * @param bounds A pointer to the bounding box to fit the given contour into. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_bound(msdf_contour_const_handle contour, msdf_bounds_t* bounds); @@ -350,7 +350,7 @@ MSDF_API int msdf_contour_bound(msdf_contour_const_handle contour, msdf_bounds_t * @param border The size of the border. * @param miter_limit The miter limit value. * @param polarity The miter polarity. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_bound_miters(msdf_contour_const_handle contour, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); @@ -359,14 +359,14 @@ MSDF_API int * Retrieves the winding direction of the given contour. * @param contour A pointer to the contour of which to retrieve the winding direction. * @param winding A pointer to a variables which is populated with the winding direction of the given contour. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_get_winding(msdf_contour_const_handle contour, int* winding); /** * Reverses the order of edges in the given contour. * @param contour A pointer to the contour which to reverse the edge order for. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_contour_reverse(msdf_contour_handle contour); @@ -386,7 +386,7 @@ MSDF_API void msdf_contour_free(msdf_contour_handle contour); * @code MSDF_SEGMENT_TYPE_QUADRATIC@endcode or @code MSDF_SEGMENT_TYPE_CUBIC@endcode. * @param segment A pointer to an address which is populated with the address of the newly * allocated segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_alloc(int type, msdf_segment_handle* segment); @@ -394,7 +394,7 @@ MSDF_API int msdf_segment_alloc(int type, msdf_segment_handle* segment); * Retrieves the type of the given segment. * @param segment A pointer to the segment of which to retrieve the type. * @param type A pointer to a variable which is populated with the type of the given segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_type(msdf_segment_const_handle segment, int* type); @@ -402,7 +402,7 @@ MSDF_API int msdf_segment_get_type(msdf_segment_const_handle segment, int* type) * Retrieves the point count of the given segment. * @param segment A pointer to the segment of which to retrieve the number of points. * @param point_count A pointer to a variable which is populated with - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_point_count(msdf_segment_const_handle segment, size_t* point_count); @@ -412,7 +412,7 @@ MSDF_API int msdf_segment_get_point_count(msdf_segment_const_handle segment, siz * @param index The index of the point to retrieve. * @param point A pointer to a point which is populated with the coordinates of the point * at the given index if present. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_point(msdf_segment_const_handle segment, size_t index, msdf_vector2_t* point); @@ -421,7 +421,7 @@ MSDF_API int msdf_segment_get_point(msdf_segment_const_handle segment, size_t in * @param segment A pointer to the segment of which to set the point. * @param index The index of the point to set. * @param point A pointer to a point which is copied to the given index within the segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_set_point(msdf_segment_handle segment, size_t index, const msdf_vector2_t* point); @@ -429,7 +429,7 @@ MSDF_API int msdf_segment_set_point(msdf_segment_handle segment, size_t index, c * Sets the color of the given segment. * @param segment A pointer to the segment of which to set the color. * @param color The color to set. Can be any @code MSDF_COLOR_@endcode value. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_set_color(msdf_segment_handle segment, int color); @@ -438,7 +438,7 @@ MSDF_API int msdf_segment_set_color(msdf_segment_handle segment, int color); * @param segment A pointer to the segment of which to retrieve the color. * @param color A pointer to a variable which is populated with the color of the given segment. * Will be one of the constants prefixed with @code MSDF_COLOR_@endcode. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_color(msdf_segment_const_handle segment, int* color); @@ -448,7 +448,7 @@ MSDF_API int msdf_segment_get_color(msdf_segment_const_handle segment, int* colo * @param param The point at which to retrieve the segment direction. * @param direction A pointer to a variable which is populated with the direction of the given * segment at the given point. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_direction(msdf_segment_const_handle segment, double param, msdf_vector2_t* direction); @@ -458,7 +458,7 @@ MSDF_API int msdf_segment_get_direction(msdf_segment_const_handle segment, doubl * @param param The point at which to retrieve the segment direction change. * @param direction_change A pointer to a variable which is populated with the direction change * of the given segment at the given point. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_get_direction_change(msdf_segment_const_handle segment, double param, msdf_vector2_t* direction_change); @@ -468,7 +468,7 @@ MSDF_API int msdf_segment_get_direction_change(msdf_segment_const_handle segment * @param param The point at which to sample. * @param point A pointer to a variable which is populated with the edge point * at the given location from the given segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_point(msdf_segment_const_handle segment, double param, msdf_vector2_t* point); @@ -476,7 +476,7 @@ MSDF_API int msdf_segment_point(msdf_segment_const_handle segment, double param, * Adjusts the given bounding box to fit at least the given segment. * @param segment A pointer to the segment which should at least fit in the given bounding box. * @param bounds A pointer to the bounding box which should at least fit the given segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_bound(msdf_segment_const_handle segment, msdf_bounds_t* bounds); @@ -484,7 +484,7 @@ MSDF_API int msdf_segment_bound(msdf_segment_const_handle segment, msdf_bounds_t * Moves the start point of the given segment. * @param segment A pointer to the segment of which to adjust the start point. * @param point A pointer to the new start point of the given segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_move_start_point(msdf_segment_handle segment, const msdf_vector2_t* point); @@ -492,7 +492,7 @@ MSDF_API int msdf_segment_move_start_point(msdf_segment_handle segment, const ms * Moves the end point of the given segment. * @param segment A pointer to the segment of which to adjust the end point. * @param point A pointer to the new end point of the given segment. - * @returns @code MSDF_SUCCESS@endcode on success, one of the constants prefixed with @code MSDF_ERR_@endcode. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. */ MSDF_API int msdf_segment_move_end_point(msdf_segment_handle segment, const msdf_vector2_t* point); @@ -505,23 +505,89 @@ MSDF_API void msdf_segment_free(msdf_segment_handle segment); // msdfgen-core API functions +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_SDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_sdf(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_PSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_psdf(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_MSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_msdf(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_MTSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_mtsdf(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform); +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_SDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @param config A pointer to the config which is applied to the sprite generator before rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_sdf_with_config(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform, const msdf_config_t* config); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_PSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @param config A pointer to the config which is applied to the sprite generator before rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_psdf_with_config(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform, const msdf_config_t* config); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_MSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @param config A pointer to the config which is applied to the sprite generator before rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_msdf_with_config(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform, const msdf_multichannel_config_t* config); + +/** + * @param output A pointer to a bitmap that was allocated with @code msdf_bitmap_alloc@endcode to which + * the given shape is rendered. The bitmap must be of type @code MSDF_BITMAP_TYPE_MTSDF@endcode. + * @param shape A pointer to the shape to render to the given bitmap. + * @param transform The transform which is applied to the given shape during rendering. + * @param config A pointer to the config which is applied to the sprite generator before rendering. + * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. + */ MSDF_API int msdf_generate_mtsdf_with_config(msdf_bitmap_t* output, msdf_shape_const_handle shape, const msdf_transform_t* transform,