Package org.lwjgl.util.msdfgen
Class MSDFGen
java.lang.Object
org.lwjgl.util.msdfgen.MSDFGen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final intstatic final intEnum values:static final intEnum values:static final intEnum values:static final intEnum values:static final int -
Method Summary
Modifier and TypeMethodDescriptionstatic intmsdf_bitmap_alloc(int type, int width, int height, MSDFGenBitmap bitmap) Allocates a new MSDF bitmap object to render a shape into using the internal allocator.static voidmsdf_bitmap_free(MSDFGenBitmap bitmap) Calls the destructor of the given bitmap and frees its memory using the internal allocator.static intmsdf_bitmap_get_byte_size(MSDFGenBitmap bitmap, org.lwjgl.PointerBuffer size) Retrieves the size of the pixel data of the given bitmap in bytes.static intmsdf_bitmap_get_channel_count(MSDFGenBitmap bitmap, IntBuffer channel_count) Retrieves the number of color channels used by the given bitmap.static intmsdf_bitmap_get_pixels(MSDFGenBitmap bitmap, org.lwjgl.PointerBuffer pixels) Retrieves the address of the raw pixel data of the given bitmap.static intmsdf_contour_add_edge(long contour, long segment) Adds a new edge to the given contour and returns its associated segment handle.static intmsdf_contour_alloc(org.lwjgl.PointerBuffer contour) Allocates a new contour object using the internal allocator.static intmsdf_contour_bound(long contour, MSDFGenBounds bounds) Adjusts the given bounding box to fit at least the given contour.static intmsdf_contour_bound_miters(long contour, MSDFGenBounds bounds, double border, double miter_limit, int polarity) Adjust the given bounding box to fit at least the given contour including a specified border.static voidmsdf_contour_free(long contour) Calls the destructor of the given bitmap and frees its memory using the internal allocator.static intmsdf_contour_get_edge(long contour, long index, org.lwjgl.PointerBuffer segment) Retrieves an edge (segment) from the given contour at the given index.static intmsdf_contour_get_edge_count(long contour, org.lwjgl.PointerBuffer count) Retrieves the edge count of the given contour.static intmsdf_contour_get_winding(long contour, IntBuffer winding) Retrieves the winding direction of the given contour.static intmsdf_contour_remove_edge(long contour, long segment) Removes the given edge from the given contour if present.static intmsdf_contour_reverse(long contour) Reverses the order of edges in the given contour.static intmsdf_generate_msdf(MSDFGenBitmap output, long shape, MSDFGenTransform transform) static intmsdf_generate_msdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenMultichannelConfig config) static intmsdf_generate_mtsdf(MSDFGenBitmap output, long shape, MSDFGenTransform transform) static intmsdf_generate_mtsdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenMultichannelConfig config) static intmsdf_generate_psdf(MSDFGenBitmap output, long shape, MSDFGenTransform transform) static intmsdf_generate_psdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenConfig config) static intmsdf_generate_sdf(MSDFGenBitmap output, long shape, MSDFGenTransform transform) static intmsdf_generate_sdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenConfig config) static intmsdf_segment_alloc(int type, org.lwjgl.PointerBuffer segment) Allocates a new segment of the given type and populates the given address with the address of the newly allocated segment.static intmsdf_segment_bound(long segment, MSDFGenBounds bounds) Adjusts the given bounding box to fit at least the given segment.static voidmsdf_segment_free(long segment) Calls the destructor of the given segment and frees its memory using the internal allocator.static intmsdf_segment_get_color(long segment, IntBuffer color) Retrieves the color of the given segment.static intmsdf_segment_get_direction(long segment, double param, MSDFGenVector2 direction) Retrieves the direction of the given segment at the given point.static intmsdf_segment_get_direction_change(long segment, double param, MSDFGenVector2 direction_change) Retrieves the direction change of the given segment at the given point.static intmsdf_segment_get_point(long segment, long index, MSDFGenVector2 point) Retrieves a point at the given index from the given segment.static intmsdf_segment_get_point_count(long segment, org.lwjgl.PointerBuffer count) Retrieves the point count of the given segment.static intmsdf_segment_get_type(long segment, IntBuffer type) Retrieves the type of the given segment.static intmsdf_segment_move_end_point(long segment, MSDFGenVector2 point) Moves the end point of the given segment.static intmsdf_segment_move_start_point(long segment, MSDFGenVector2 point) Moves the start point of the given segment.static intmsdf_segment_point(long segment, double param, MSDFGenVector2 point) Retrieves the point on the given edge segment specified by the given parameter.static intmsdf_segment_set_color(long segment, int color) Sets the color of the given segment.static intmsdf_segment_set_point(long segment, long index, MSDFGenVector2 point) Sets the coordinates of a point at the given index in the given segment.static intmsdf_shape_add_contour(long shape, org.lwjgl.PointerBuffer contour) Adds a new contour to the given shape.static intmsdf_shape_alloc(org.lwjgl.PointerBuffer shape) Allocates a new MSDF shape object using the internal allocator.static intmsdf_shape_bound(long shape, MSDFGenBounds bounds) Adjusts the given bounding box to fit the given shape.static intmsdf_shape_bound_miters(long shape, MSDFGenBounds bounds, double border, double miter_limit, int polarity) Adjusts the given bounding box to fit the given shape including a mitered border.static intmsdf_shape_edge_colors_by_distance(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants using the distance.static intmsdf_shape_edge_colors_ink_trap(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants using the ink trap algorithm.static intmsdf_shape_edge_colors_simple(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants.static voidmsdf_shape_free(long shape) Calls the destructor of the given bitmap and frees its memory using the internal allocator.static intmsdf_shape_get_bounds(long shape, MSDFGenBounds bounds) Retrieves the bounds of the given shape.static intmsdf_shape_get_contour(long shape, long index, org.lwjgl.PointerBuffer contour) Retrieves a contour at a given index from the given shape.static intmsdf_shape_get_contour_count(long shape, org.lwjgl.PointerBuffer size) Retrieves the number of contours allocated within the given shape object.static intmsdf_shape_get_edge_count(long shape, org.lwjgl.PointerBuffer count) Retrieves the number of edges of the given shape.static intmsdf_shape_has_inverse_y_axis(long shape, IntBuffer inverse_y_axis) Retrieves the inverse-y-axis flag of the given shape.static intmsdf_shape_normalize(long shape) Normalizes the given shape.static intmsdf_shape_one_shot_distance(long shape, MSDFGenVector2 origin, DoubleBuffer distance) Finds the distance between shape and origin.static intmsdf_shape_orient_contours(long shape) Orients all contours associated with the given shape before rendering.static intmsdf_shape_remove_contour(long shape, long contour) Removes the given contour from the given shape if present.static intmsdf_shape_validate(long shape, IntBuffer result) Validates the given shape.static intnmsdf_bitmap_alloc(int type, int width, int height, long bitmap) Unsafe version of:bitmap_allocstatic voidnmsdf_bitmap_free(long bitmap) Unsafe version of:bitmap_freestatic intnmsdf_bitmap_get_byte_size(long bitmap, long size) Unsafe version of:bitmap_get_byte_sizestatic intnmsdf_bitmap_get_channel_count(long bitmap, long channel_count) Unsafe version of:bitmap_get_channel_countstatic intnmsdf_bitmap_get_pixels(long bitmap, long pixels) Unsafe version of:bitmap_get_pixelsstatic intnmsdf_contour_add_edge(long contour, long segment) Unsafe version of:contour_add_edgestatic intnmsdf_contour_alloc(long contour) Unsafe version of:contour_allocstatic intnmsdf_contour_bound(long contour, long bounds) Unsafe version of:contour_boundstatic intnmsdf_contour_bound_miters(long contour, long bounds, double border, double miter_limit, int polarity) Unsafe version of:contour_bound_mitersstatic voidnmsdf_contour_free(long contour) Unsafe version of:contour_freestatic intnmsdf_contour_get_edge(long contour, long index, long segment) Unsafe version of:contour_get_edgestatic intnmsdf_contour_get_edge_count(long contour, long count) Unsafe version of:contour_get_edge_countstatic intnmsdf_contour_get_winding(long contour, long winding) Unsafe version of:contour_get_windingstatic intnmsdf_contour_remove_edge(long contour, long segment) Unsafe version of:contour_remove_edgestatic intnmsdf_contour_reverse(long contour) Unsafe version of:contour_reversestatic intnmsdf_generate_msdf(long output, long shape, long transform) Unsafe version of:generate_msdfstatic intnmsdf_generate_msdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_msdf_with_configstatic intnmsdf_generate_mtsdf(long output, long shape, long transform) Unsafe version of:generate_mtsdfstatic intnmsdf_generate_mtsdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_mtsdf_with_configstatic intnmsdf_generate_psdf(long output, long shape, long transform) Unsafe version of:generate_psdfstatic intnmsdf_generate_psdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_psdf_with_configstatic intnmsdf_generate_sdf(long output, long shape, long transform) Unsafe version of:generate_sdfstatic intnmsdf_generate_sdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_sdf_with_configstatic intnmsdf_segment_alloc(int type, long segment) Unsafe version of:segment_allocstatic intnmsdf_segment_bound(long segment, long bounds) Unsafe version of:segment_boundstatic voidnmsdf_segment_free(long segment) Unsafe version of:segment_freestatic intnmsdf_segment_get_color(long segment, long color) Unsafe version of:segment_get_colorstatic intnmsdf_segment_get_direction(long segment, double param, long direction) Unsafe version of:segment_get_directionstatic intnmsdf_segment_get_direction_change(long segment, double param, long direction_change) Unsafe version of:segment_get_direction_changestatic intnmsdf_segment_get_point(long segment, long index, long point) Unsafe version of:segment_get_pointstatic intnmsdf_segment_get_point_count(long segment, long count) Unsafe version of:segment_get_point_countstatic intnmsdf_segment_get_type(long segment, long type) Unsafe version of:segment_get_typestatic intnmsdf_segment_move_end_point(long segment, long point) Unsafe version of:segment_move_end_pointstatic intnmsdf_segment_move_start_point(long segment, long point) Unsafe version of:segment_move_start_pointstatic intnmsdf_segment_point(long segment, double param, long point) Unsafe version of:segment_pointstatic intnmsdf_segment_set_color(long segment, int color) Unsafe version of:segment_set_colorstatic intnmsdf_segment_set_point(long segment, long index, long point) Unsafe version of:segment_set_pointstatic intnmsdf_shape_add_contour(long shape, long contour) Unsafe version of:shape_add_contourstatic intnmsdf_shape_alloc(long shape) Unsafe version of:shape_allocstatic intnmsdf_shape_bound(long shape, long bounds) Unsafe version of:shape_boundstatic intnmsdf_shape_bound_miters(long shape, long bounds, double border, double miter_limit, int polarity) Unsafe version of:shape_bound_mitersstatic intnmsdf_shape_edge_colors_by_distance(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_by_distancestatic intnmsdf_shape_edge_colors_ink_trap(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_ink_trapstatic intnmsdf_shape_edge_colors_simple(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_simplestatic voidnmsdf_shape_free(long shape) Unsafe version of:shape_freestatic intnmsdf_shape_get_bounds(long shape, long bounds) Unsafe version of:shape_get_boundsstatic intnmsdf_shape_get_contour(long shape, long index, long contour) Unsafe version of:shape_get_contourstatic intnmsdf_shape_get_contour_count(long shape, long size) Unsafe version of:shape_get_contour_countstatic intnmsdf_shape_get_edge_count(long shape, long count) Unsafe version of:shape_get_edge_countstatic intnmsdf_shape_has_inverse_y_axis(long shape, long inverse_y_axis) Unsafe version of:shape_has_inverse_y_axisstatic intnmsdf_shape_normalize(long shape) Unsafe version of:shape_normalizestatic intnmsdf_shape_one_shot_distance(long shape, long origin, long distance) Unsafe version of:shape_one_shot_distancestatic intnmsdf_shape_orient_contours(long shape) Unsafe version of:shape_orient_contoursstatic intnmsdf_shape_remove_contour(long shape, long contour) Unsafe version of:shape_remove_contourstatic intnmsdf_shape_validate(long shape, long result) Unsafe version of:shape_validate
-
Field Details
-
MSDF_FALSE
public static final int MSDF_FALSE- See Also:
-
MSDF_TRUE
public static final int MSDF_TRUE- See Also:
-
MSDF_SUCCESS
public static final int MSDF_SUCCESS- See Also:
-
MSDF_ERR_FAILED
public static final int MSDF_ERR_FAILED- See Also:
-
MSDF_ERR_INVALID_ARG
public static final int MSDF_ERR_INVALID_ARG- See Also:
-
MSDF_ERR_INVALID_TYPE
public static final int MSDF_ERR_INVALID_TYPE- See Also:
-
MSDF_ERR_INVALID_SIZE
public static final int MSDF_ERR_INVALID_SIZE- See Also:
-
MSDF_ERR_INVALID_INDEX
public static final int MSDF_ERR_INVALID_INDEX- See Also:
-
MSDF_BITMAP_TYPE_SDF
public static final int MSDF_BITMAP_TYPE_SDFEnum values:
- See Also:
-
MSDF_BITMAP_TYPE_PSDF
public static final int MSDF_BITMAP_TYPE_PSDFEnum values:
- See Also:
-
MSDF_BITMAP_TYPE_MSDF
public static final int MSDF_BITMAP_TYPE_MSDFEnum values:
- See Also:
-
MSDF_BITMAP_TYPE_MTSDF
public static final int MSDF_BITMAP_TYPE_MTSDFEnum values:
- See Also:
-
MSDF_SEGMENT_TYPE_LINEAR
public static final int MSDF_SEGMENT_TYPE_LINEAREnum values:
- See Also:
-
MSDF_SEGMENT_TYPE_QUADRATIC
public static final int MSDF_SEGMENT_TYPE_QUADRATICEnum values:
- See Also:
-
MSDF_SEGMENT_TYPE_CUBIC
public static final int MSDF_SEGMENT_TYPE_CUBICEnum values:
- See Also:
-
MSDF_EDGE_COLOR_BLACK
public static final int MSDF_EDGE_COLOR_BLACKEnum values:
- See Also:
-
MSDF_EDGE_COLOR_RED
public static final int MSDF_EDGE_COLOR_REDEnum values:
- See Also:
-
MSDF_EDGE_COLOR_GREEN
public static final int MSDF_EDGE_COLOR_GREENEnum values:
- See Also:
-
MSDF_EDGE_COLOR_YELLOW
public static final int MSDF_EDGE_COLOR_YELLOWEnum values:
- See Also:
-
MSDF_EDGE_COLOR_BLUE
public static final int MSDF_EDGE_COLOR_BLUEEnum values:
- See Also:
-
MSDF_EDGE_COLOR_MAGENTA
public static final int MSDF_EDGE_COLOR_MAGENTAEnum values:
- See Also:
-
MSDF_EDGE_COLOR_CYAN
public static final int MSDF_EDGE_COLOR_CYANEnum values:
- See Also:
-
MSDF_EDGE_COLOR_WHITE
public static final int MSDF_EDGE_COLOR_WHITEEnum values:
- See Also:
-
MSDF_ERROR_CORRECTION_MODE_DISABLED
public static final int MSDF_ERROR_CORRECTION_MODE_DISABLEDEnum values:
- See Also:
-
MSDF_ERROR_CORRECTION_MODE_INDISCRIMINATE
public static final int MSDF_ERROR_CORRECTION_MODE_INDISCRIMINATEEnum values:
- See Also:
-
MSDF_ERROR_CORRECTION_MODE_EDGE_PRIORITY
public static final int MSDF_ERROR_CORRECTION_MODE_EDGE_PRIORITYEnum values:
- See Also:
-
MSDF_ERROR_CORRECTION_MODE_EDGE_ONLY
public static final int MSDF_ERROR_CORRECTION_MODE_EDGE_ONLYEnum values:
- See Also:
-
MSDF_DISTANCE_CHECK_MODE_NONE
public static final int MSDF_DISTANCE_CHECK_MODE_NONE- See Also:
-
MSDF_DISTANCE_CHECK_MODE_AT_EDGE
public static final int MSDF_DISTANCE_CHECK_MODE_AT_EDGE- See Also:
-
MSDF_DISTANCE_CHECK_MODE_ALWAYS
public static final int MSDF_DISTANCE_CHECK_MODE_ALWAYS- See Also:
-
-
Method Details
-
nmsdf_bitmap_alloc
public static int nmsdf_bitmap_alloc(int type, int width, int height, long bitmap) Unsafe version of:bitmap_alloc -
msdf_bitmap_alloc
Allocates a new MSDF bitmap object to render a shape into using the internal allocator.- Parameters:
type- the type of bitmap to allocate. One of:BITMAP_TYPE_SDFBITMAP_TYPE_PSDFBITMAP_TYPE_MSDFBITMAP_TYPE_MTSDFwidth- the width of the bitmap in pixelsheight- the height of the bitmap in pixelsbitmap- a pointer to anmsdf_bitmap_tstructure to allocate a new bitmap into- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_bitmap_get_channel_count
public static int nmsdf_bitmap_get_channel_count(long bitmap, long channel_count) Unsafe version of:bitmap_get_channel_count -
msdf_bitmap_get_channel_count
Retrieves the number of color channels used by the given bitmap.- Parameters:
bitmap- a pointer to anmsdf_bitmap_tstructure to retrieve the channel count fromchannel_count- a pointer to a variable which is populated with the number of color channels used by the given bitmap- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_bitmap_get_pixels
public static int nmsdf_bitmap_get_pixels(long bitmap, long pixels) Unsafe version of:bitmap_get_pixels -
msdf_bitmap_get_pixels
Retrieves the address of the raw pixel data of the given bitmap.- Parameters:
bitmap- a pointer to anmsdf_bitmap_tstructure to retrieve the raw pixel data frompixels- a pointer to an address which is populated with the raw pixel data of the given bitmap- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_bitmap_get_byte_size
public static int nmsdf_bitmap_get_byte_size(long bitmap, long size) Unsafe version of:bitmap_get_byte_size -
msdf_bitmap_get_byte_size
Retrieves the size of the pixel data of the given bitmap in bytes.- Parameters:
bitmap- a pointer to anmsdf_bitmap_tstructure to retrieve the size of the raw pixel data fromsize- a pointer to a variable which is populated with the byte size of the raw pixel data of the given bitmap- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_bitmap_free
public static void nmsdf_bitmap_free(long bitmap) Unsafe version of:bitmap_free -
msdf_bitmap_free
Calls the destructor of the given bitmap and frees its memory using the internal allocator.- Parameters:
bitmap- a pointer to anmsdf_bitmap_tstructure to be freed.
-
nmsdf_shape_alloc
public static int nmsdf_shape_alloc(long shape) Unsafe version of:shape_alloc -
msdf_shape_alloc
public static int msdf_shape_alloc(org.lwjgl.PointerBuffer shape) Allocates a new MSDF shape object using the internal allocator.- Parameters:
shape- a pointer to an address which is populated with the address of the newly allocated shape.- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_get_bounds
public static int nmsdf_shape_get_bounds(long shape, long bounds) Unsafe version of:shape_get_bounds -
msdf_shape_get_bounds
Retrieves the bounds of the given shape.- Parameters:
shape- a pointer to a shape object to retrieve the bounds frombounds- a pointer to a variable which is populated with the bounds of the given shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_add_contour
public static int nmsdf_shape_add_contour(long shape, long contour) Unsafe version of:shape_add_contour -
msdf_shape_add_contour
public static int msdf_shape_add_contour(long shape, org.lwjgl.PointerBuffer contour) Adds a new contour to the given shape.- Parameters:
shape- a pointer to a shape object to add a new contour tocontour- a pointer to a contour handle to be populated with a new contour that was added to the shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_remove_contour
public static int nmsdf_shape_remove_contour(long shape, long contour) Unsafe version of:shape_remove_contour -
msdf_shape_remove_contour
public static int msdf_shape_remove_contour(long shape, long contour) Removes the given contour from the given shape if present.- Parameters:
shape- a pointer to a shape object to remove the given contour fromcontour- a pointer to the contour to remove from the shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_get_contour_count
public static int nmsdf_shape_get_contour_count(long shape, long size) Unsafe version of:shape_get_contour_count -
msdf_shape_get_contour_count
public static int msdf_shape_get_contour_count(long shape, org.lwjgl.PointerBuffer size) Retrieves the number of contours allocated within the given shape object.- Parameters:
shape- a pointer to a shape object from which to retrieve the contour countsize- a pointer to a variable which is populated with the number of contours of the given shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_get_contour
public static int nmsdf_shape_get_contour(long shape, long index, long contour) Unsafe version of:shape_get_contour -
msdf_shape_get_contour
public static int msdf_shape_get_contour(long shape, long index, org.lwjgl.PointerBuffer contour) Retrieves a contour at a given index from the given shape.- Parameters:
shape- a pointer to a shape object from which to retrieve a contourindex- the index of the contour to retrievecontour- a pointer to an address which is populated with the address of the contour at the given index if present- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_get_edge_count
public static int nmsdf_shape_get_edge_count(long shape, long count) Unsafe version of:shape_get_edge_count -
msdf_shape_get_edge_count
public static int msdf_shape_get_edge_count(long shape, org.lwjgl.PointerBuffer count) Retrieves the number of edges of the given shape.- Parameters:
shape- a pointer to a shape from which to retrieve the edge countcount- a pointer to a variable which is populated with the number of edges defined by the given shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_has_inverse_y_axis
public static int nmsdf_shape_has_inverse_y_axis(long shape, long inverse_y_axis) Unsafe version of:shape_has_inverse_y_axis -
msdf_shape_has_inverse_y_axis
Retrieves the inverse-y-axis flag of the given shape.- Parameters:
shape- a pointer to a shape from which to fetch the inverse-y-axis flaginverse_y_axis- a pointer to a variable which is populated withTRUEwhen the y-axis of the given shape is inverted. Otherwise the variable will be set toFALSE.- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_normalize
public static int nmsdf_shape_normalize(long shape) Unsafe version of:shape_normalize -
msdf_shape_normalize
public static int msdf_shape_normalize(long shape) Normalizes the given shape.- Parameters:
shape- a pointer to a shape to normalize- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_validate
public static int nmsdf_shape_validate(long shape, long result) Unsafe version of:shape_validate -
msdf_shape_validate
Validates the given shape. -
nmsdf_shape_bound
public static int nmsdf_shape_bound(long shape, long bounds) Unsafe version of:shape_bound -
msdf_shape_bound
Adjusts the given bounding box to fit the given shape.- Parameters:
shape- a pointer to a shape to fit into the given bounding boxbounds- a pointer to a bounding box which should at least fit the given shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_bound_miters
public static int nmsdf_shape_bound_miters(long shape, long bounds, double border, double miter_limit, int polarity) Unsafe version of:shape_bound_miters -
msdf_shape_bound_miters
public static int msdf_shape_bound_miters(long shape, MSDFGenBounds bounds, double border, double miter_limit, int polarity) Adjusts the given bounding box to fit the given shape including a mitered border.- Parameters:
shape- a pointer to a shape to fit into the given bounding boxbounds- a pointer to a bounding box which should at least fit the given shape including the specified borderborder- the size of the bordermiter_limit- the miter limit valuepolarity- the miter polarity- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_orient_contours
public static int nmsdf_shape_orient_contours(long shape) Unsafe version of:shape_orient_contours -
msdf_shape_orient_contours
public static int msdf_shape_orient_contours(long shape) Orients all contours associated with the given shape before rendering.- Parameters:
shape- a pointer to a shape whose contours to orient- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_edge_colors_simple
public static int nmsdf_shape_edge_colors_simple(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_simple -
msdf_shape_edge_colors_simple
public static int msdf_shape_edge_colors_simple(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants.- Parameters:
shape- a pointer to a shape whose edges to color with the default MSDF colorsangle_threshold- the threshold angle in degrees- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_edge_colors_ink_trap
public static int nmsdf_shape_edge_colors_ink_trap(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_ink_trap -
msdf_shape_edge_colors_ink_trap
public static int msdf_shape_edge_colors_ink_trap(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants using the ink trap algorithm.- Parameters:
shape- a pointer to a shape whose edges to color with the default MSDF colorsangle_threshold- the threshold angle in degrees- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_edge_colors_by_distance
public static int nmsdf_shape_edge_colors_by_distance(long shape, double angle_threshold) Unsafe version of:shape_edge_colors_by_distance -
msdf_shape_edge_colors_by_distance
public static int msdf_shape_edge_colors_by_distance(long shape, double angle_threshold) Colors the edges of the given shape using the default MSDF colors specified by theMSDF_COLOR_prefixed constants using the distance.- Parameters:
shape- a pointer to a shape whose edges to color with the default MSDF colorsangle_threshold- the threshold angle in degrees- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_one_shot_distance
public static int nmsdf_shape_one_shot_distance(long shape, long origin, long distance) Unsafe version of:shape_one_shot_distance -
msdf_shape_one_shot_distance
public static int msdf_shape_one_shot_distance(long shape, MSDFGenVector2 origin, DoubleBuffer distance) Finds the distance between shape and origin.- Parameters:
shape- a pointer to the shape to find the distance toorigin- the point to find the distance relative to the given shape todistance- a pointer to a variable to be populated with the calculated distance to the given shape- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_shape_free
public static void nmsdf_shape_free(long shape) Unsafe version of:shape_free -
msdf_shape_free
public static void msdf_shape_free(long shape) Calls the destructor of the given bitmap and frees its memory using the internal allocator.- Parameters:
shape- a pointer to a shape object to be freed
-
nmsdf_contour_alloc
public static int nmsdf_contour_alloc(long contour) Unsafe version of:contour_alloc -
msdf_contour_alloc
public static int msdf_contour_alloc(org.lwjgl.PointerBuffer contour) Allocates a new contour object using the internal allocator.- Parameters:
contour- a pointer to an address which is populated with the address of the newly allocated contour object- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_add_edge
public static int nmsdf_contour_add_edge(long contour, long segment) Unsafe version of:contour_add_edge -
msdf_contour_add_edge
public static int msdf_contour_add_edge(long contour, long segment) Adds a new edge to the given contour and returns its associated segment handle.- Parameters:
contour- a pointer to the contour to add a new edge (segment) tosegment- a pointer to the segment to add as an edge- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_remove_edge
public static int nmsdf_contour_remove_edge(long contour, long segment) Unsafe version of:contour_remove_edge -
msdf_contour_remove_edge
public static int msdf_contour_remove_edge(long contour, long segment) Removes the given edge from the given contour if present.- Parameters:
contour- a pointer to the contour to remove the given edge (segment) fromsegment- a pointer to the segment to remove from the given contour- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_get_edge_count
public static int nmsdf_contour_get_edge_count(long contour, long count) Unsafe version of:contour_get_edge_count -
msdf_contour_get_edge_count
public static int msdf_contour_get_edge_count(long contour, org.lwjgl.PointerBuffer count) Retrieves the edge count of the given contour.- Parameters:
contour- a pointer to the contour to retrieve the edge count fromcount- a pointer to a variable which is populated with the edge count of the given contour- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_get_edge
public static int nmsdf_contour_get_edge(long contour, long index, long segment) Unsafe version of:contour_get_edge -
msdf_contour_get_edge
public static int msdf_contour_get_edge(long contour, long index, org.lwjgl.PointerBuffer segment) Retrieves an edge (segment) from the given contour at the given index.- Parameters:
contour- a pointer to the contour from which to retrieve the given edge segmentindex- the index from which to retrieve the edge segmentsegment- a pointer to an address which is populated with the address of the edge segment at the given index if present- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_bound
public static int nmsdf_contour_bound(long contour, long bounds) Unsafe version of:contour_bound -
msdf_contour_bound
Adjusts the given bounding box to fit at least the given contour.- Parameters:
contour- a pointer to the contour which should at least fit into the given bounding boxbounds- a pointer to the bounding box to fit the given contour into- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_bound_miters
public static int nmsdf_contour_bound_miters(long contour, long bounds, double border, double miter_limit, int polarity) Unsafe version of:contour_bound_miters -
msdf_contour_bound_miters
public static int msdf_contour_bound_miters(long contour, MSDFGenBounds bounds, double border, double miter_limit, int polarity) Adjust the given bounding box to fit at least the given contour including a specified border.- Parameters:
contour- a pointer to the contour which should at least fit into the given bounding boxbounds- a pointer to the bounding box to fit the given contour including the specified borderborder- the size of the bordermiter_limit- the miter limit valuepolarity- the miter polarity- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_get_winding
public static int nmsdf_contour_get_winding(long contour, long winding) Unsafe version of:contour_get_winding -
msdf_contour_get_winding
Retrieves the winding direction of the given contour.- Parameters:
contour- a pointer to the contour of which to retrieve the winding directionwinding- a pointer to a variables which is populated with the winding direction of the given contour- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_reverse
public static int nmsdf_contour_reverse(long contour) Unsafe version of:contour_reverse -
msdf_contour_reverse
public static int msdf_contour_reverse(long contour) Reverses the order of edges in the given contour.- Parameters:
contour- a pointer to the contour which to reverse the edge order for- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_contour_free
public static void nmsdf_contour_free(long contour) Unsafe version of:contour_free -
msdf_contour_free
public static void msdf_contour_free(long contour) Calls the destructor of the given bitmap and frees its memory using the internal allocator.- Parameters:
contour- a pointer to the contour to free
-
nmsdf_segment_alloc
public static int nmsdf_segment_alloc(int type, long segment) Unsafe version of:segment_alloc -
msdf_segment_alloc
public static int msdf_segment_alloc(int type, org.lwjgl.PointerBuffer segment) Allocates a new segment of the given type and populates the given address with the address of the newly allocated segment.- Parameters:
type- the type of segment to allocate. One of:SEGMENT_TYPE_LINEARSEGMENT_TYPE_QUADRATICSEGMENT_TYPE_CUBICsegment- a pointer to an address which is populated with the address of the newly allocated segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_type
public static int nmsdf_segment_get_type(long segment, long type) Unsafe version of:segment_get_type -
msdf_segment_get_type
Retrieves the type of the given segment.- Parameters:
segment- a pointer to the segment of which to retrieve the typetype- a pointer to a variable which is populated with the type of the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_point_count
public static int nmsdf_segment_get_point_count(long segment, long count) Unsafe version of:segment_get_point_count -
msdf_segment_get_point_count
public static int msdf_segment_get_point_count(long segment, org.lwjgl.PointerBuffer count) Retrieves the point count of the given segment.- Parameters:
segment- a pointer to the segment of which to retrieve the number of pointscount- a pointer to a variable which is populated with the number of points of the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_point
public static int nmsdf_segment_get_point(long segment, long index, long point) Unsafe version of:segment_get_point -
msdf_segment_get_point
Retrieves a point at the given index from the given segment.- Parameters:
segment- a pointer to the segment from which to retrieve a pointindex- the index of the point to retrievepoint- a pointer to a point which is populated with the coordinates of the point at the given index if present- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_set_point
public static int nmsdf_segment_set_point(long segment, long index, long point) Unsafe version of:segment_set_point -
msdf_segment_set_point
Sets the coordinates of a point at the given index in the given segment.- Parameters:
segment- a pointer to the segment of which to set the pointindex- the index of the point to setpoint- a pointer to a point which is copied to the given index within the segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_color
public static int nmsdf_segment_get_color(long segment, long color) Unsafe version of:segment_get_color -
msdf_segment_get_color
Retrieves the color of the given segment.- Parameters:
segment- a pointer to the segment of which to retrieve the colorcolor- a pointer to a variable which is populated with the color of the given segment. Will be one of the constants prefixed withMSDF_COLOR_.- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_set_color
public static int nmsdf_segment_set_color(long segment, int color) Unsafe version of:segment_set_color -
msdf_segment_set_color
public static int msdf_segment_set_color(long segment, int color) Sets the color of the given segment.- Parameters:
segment- a pointer to the segment of which to set the colorcolor- the color to set. One of:EDGE_COLOR_BLACKEDGE_COLOR_REDEDGE_COLOR_GREENEDGE_COLOR_YELLOWEDGE_COLOR_BLUEEDGE_COLOR_MAGENTAEDGE_COLOR_CYANEDGE_COLOR_WHITE- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_direction
public static int nmsdf_segment_get_direction(long segment, double param, long direction) Unsafe version of:segment_get_direction -
msdf_segment_get_direction
Retrieves the direction of the given segment at the given point.- Parameters:
segment- a pointer to the segment of which to retrieve the directionparam- the point at which to retrieve the segment directiondirection- a pointer to a variable which is populated with the direction of the given segment at the given point- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_get_direction_change
public static int nmsdf_segment_get_direction_change(long segment, double param, long direction_change) Unsafe version of:segment_get_direction_change -
msdf_segment_get_direction_change
public static int msdf_segment_get_direction_change(long segment, double param, MSDFGenVector2 direction_change) Retrieves the direction change of the given segment at the given point.- Parameters:
segment- a pointer to the segment of which to retrieve the direction changeparam- the point at which to retrieve the segment direction changedirection_change- a pointer to a variable which is populated with the direction change of the given segment at the given point- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_point
public static int nmsdf_segment_point(long segment, double param, long point) Unsafe version of:segment_point -
msdf_segment_point
Retrieves the point on the given edge segment specified by the given parameter.- Parameters:
segment- a pointer to the segment of which to retrieve the edge pointparam- the point at which to samplepoint- a pointer to a variable which is populated with the edge point at the given location from the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_bound
public static int nmsdf_segment_bound(long segment, long bounds) Unsafe version of:segment_bound -
msdf_segment_bound
Adjusts the given bounding box to fit at least the given segment.- Parameters:
segment- a pointer to the segment which should at least fit in the given bounding boxbounds- a pointer to the bounding box which should at least fit the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_move_start_point
public static int nmsdf_segment_move_start_point(long segment, long point) Unsafe version of:segment_move_start_point -
msdf_segment_move_start_point
Moves the start point of the given segment.- Parameters:
segment- a pointer to the segment of which to adjust the start pointpoint- a pointer to the new start point of the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_move_end_point
public static int nmsdf_segment_move_end_point(long segment, long point) Unsafe version of:segment_move_end_point -
msdf_segment_move_end_point
Moves the end point of the given segment.- Parameters:
segment- a pointer to the segment of which to adjust the end pointpoint- a pointer to the new end point of the given segment- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_segment_free
public static void nmsdf_segment_free(long segment) Unsafe version of:segment_free -
msdf_segment_free
public static void msdf_segment_free(long segment) Calls the destructor of the given segment and frees its memory using the internal allocator.- Parameters:
segment- a pointer to the segment to free
-
nmsdf_generate_sdf
public static int nmsdf_generate_sdf(long output, long shape, long transform) Unsafe version of:generate_sdf -
msdf_generate_sdf
- Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_SDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_psdf
public static int nmsdf_generate_psdf(long output, long shape, long transform) Unsafe version of:generate_psdf -
msdf_generate_psdf
- Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_PSDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_msdf
public static int nmsdf_generate_msdf(long output, long shape, long transform) Unsafe version of:generate_msdf -
msdf_generate_msdf
- Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_MSDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_mtsdf
public static int nmsdf_generate_mtsdf(long output, long shape, long transform) Unsafe version of:generate_mtsdf -
msdf_generate_mtsdf
- Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_MTSDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_sdf_with_config
public static int nmsdf_generate_sdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_sdf_with_config -
msdf_generate_sdf_with_config
public static int msdf_generate_sdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenConfig config) - Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_SDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during renderingconfig- a pointer to the config which is applied to the sprite generator before rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_psdf_with_config
public static int nmsdf_generate_psdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_psdf_with_config -
msdf_generate_psdf_with_config
public static int msdf_generate_psdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenConfig config) - Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_PSDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during renderingconfig- a pointer to the config which is applied to the sprite generator before rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_msdf_with_config
public static int nmsdf_generate_msdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_msdf_with_config -
msdf_generate_msdf_with_config
public static int msdf_generate_msdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenMultichannelConfig config) - Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_MSDF.shape- a pointer to the shape to render to the given bitmaptransform- the transform which is applied to the given shape during renderingconfig- a pointer to the config which is applied to the sprite generator before rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-
nmsdf_generate_mtsdf_with_config
public static int nmsdf_generate_mtsdf_with_config(long output, long shape, long transform, long config) Unsafe version of:generate_mtsdf_with_config -
msdf_generate_mtsdf_with_config
public static int msdf_generate_mtsdf_with_config(MSDFGenBitmap output, long shape, MSDFGenTransform transform, MSDFGenMultichannelConfig config) - Parameters:
output- a pointer to a bitmap that was allocated withbitmap_allocto which the given shape is rendered. The bitmap must be of typeBITMAP_TYPE_MTSDF.shape- A pointer to the shape to render to the given bitmap.transform- the transform which is applied to the given shape during renderingconfig- a pointer to the config which is applied to the sprite generator before rendering- Returns:
SUCCESSon success, otherwise one of the constants prefixed withMSDF_ERR_.
-