src/sdf


Log

Author Commit Date CI Message
Werner Lemberg b6e8a712 2021-01-17T07:18:48 Update all copyright notices.
Werner Lemberg c6ff2556 2020-12-26T10:50:21 [sdf] Use 'counter-clockwise', not 'anti-clockwise'. We prefer US nomenclature. * src/sdf/ftsdf.c (SDF_Contour_Orientation): s/SDF_ORIENTATION-ACW/SDF_ORIENTATION_CCW/. Update all users.
Anuj Verma 10a5dfec 2020-12-26T08:34:38 [sdf] Remove custom memory tracker. The internal FreeType memory tracker is sufficient. * src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER, SDF_MemoryUser, sdf_alloc, sdf_free, SDF_ALLOC, SDF_FREE, SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP, SDF_MEMORY_TRACKER_DONE): Removed. s/SDF_ALLOC/FT_ALLOC/. s/SDF_FREE/FT_FREE/. Other updates.
Werner Lemberg 286e9e0d 2020-12-24T08:41:12 [sdf] Two more copyright notices.
Werner Lemberg 3c983eb8 2020-12-24T08:36:09 [sdf] Fix `make multi`. * src/sdf/ftsdf.c: Include `ftoutln.h`.
Werner Lemberg aa1b5362 2020-12-24T08:32:04 [sdf] Fix tracing. * include/freetype/internal.fttrace.h: Add 'bsdf' component. * src/sdf/ftbsdf.c, src/sdf/ftsdf.c (FT_COMPONENT): Define.
Werner Lemberg 04a64432 2020-12-24T08:29:05 [sdf] Add copyright notices.
Anuj Verma b298a644 2020-08-21T04:59:08 [sdf] Add debugging function. * src/sdf/ftsdf.c (sdf_shape_dump): New function.
Anuj Verma 6444875f 2020-08-21T03:59:23 [sdf] Add brief technical overview of both rasterizers.
Anuj Verma 6cd6df55 2020-08-20T21:57:43 [sdf] Add 'bsdf' renderer to 'sdf' module. * src/sdf/ftsdfrend.c (ft_bsdf_render): New function. (ft_bitmap_sdf_renderer_class): New structure.
Anuj Verma d27d107f 2020-08-20T21:25:46 [sdf] Add interface functions for the 'bsdf' rasterizer. * src/sdf/ftsdf.c (bsdf_raster_new, bsdf_raster_reset, bsdf_raster_set_mode, bsdf_raster_render, bsdf_raster_done): New functions. (ft_bitmap_sdf_raster): New variable. * src/sdf/ftsdf.h: Updated.
Anuj Verma a2113475 2020-08-20T21:21:33 [sdf] Add function to copy SDF data into output bitmap. * src/sdf/ftbsdf.c (finalize_sdf): New function.
Anuj Verma e2ae96b9 2020-08-20T21:19:32 [sdf] Add '8-point sequential Euclidean distance mapping' algorithm. * src/sdf/ftbsdf.c (compare_neighbor, first_pass, second_pass, edt8): New functions.
Anuj Verma 6b9a8044 2020-08-20T21:09:23 [sdf] Add function to copy source bitmap to distance map. * src/sdf/ftbsdf.c (bsdf_init_distance_map): New function.
Anuj Verma 0f644f38 2020-08-20T09:25:15 [sdf] Add functions to compute pixel edge distances. * src/sdf/ftbsdf.c (compute_edge_distance, bsdf_approximate_edge): New functions.
Anuj Verma c5761764 2020-08-20T09:20:26 [sdf] Add function to find edge pixels in a grid of alpha values. * src/sdf/ftbsdf.c (bsdf_is_edge): New function.
Anuj Verma 9bbb3611 2020-08-20T09:17:38 [sdf] Add essential structures for the 'bsdf' rasterizer. * src/sdf/ftbsdf.c (ONE): New macro. (BSDF_TRaster, ED, BSDF_Worker): New structures. (zero_ed): New constant.
Anuj Verma 05f6088d 2020-08-20T07:54:13 [sdf] Added basic overlapping contour support. * src/sdf/ftsdf.c (sdf_generate_with_overlaps): New function. (sdf_raster_render): Enable it.
Anuj Verma 879ca87f 2020-08-19T16:57:38 [sdf] Add build infrastructure. * src/sdf/module.mk, src/sfd/rules.mk: New files. * src/sdf/ftsdf.h (ft_sdf_raster): New forward declaration. * include/freetype/ftmoderr.h (FT_MODERRDEF): Add error definition for the 'sdf' module. * include/freetype/internal/fttrace.h (FT_TRACE_DEF): Add trace definition for the `sdf' module. * modules.cfg (RASTER_MODULES): Add the `sdf' module to the list of rasterizers.
Anuj Verma 665ac967 2020-08-19T16:29:51 [sdf] Add interface functions for the 'sdf' rasterizer. * src/sdf/ftsdf.c (sdf_raster_new, sdf_raster_reset, sdf_raster_set_mode, sdf_raster_render, sdf_raster_done): New functions. (ft_sdf_raster): New structure.
Anuj Verma 1010f2c3 2020-08-19T16:25:08 [sdf] Add subdivision and bounding box optimization. * src/sdf/ftsdf.c (sdf_generate_bounding_box): New function, which is an optimized version of `sdf_generate`. (sdf_generate_subdivision): New function.
Anuj Verma 986d3108 2020-08-19T12:56:58 [sdf] Add function to generate SDF. * src/sdf/ftsdf.c (sdf_generate): New function, currently disabled. This is a proof-of-concept implementation: It doesn't use any optimization, it simply checks all grid points against all contours.
Anuj Verma 0d52f4ae 2020-08-19T12:22:34 [sdf] Add functions to get shortest distance from any edge/contour. * src/sdf/ftsdf.c (sdf_edge_get_min_distance): New function. (sdf_contour_get_min_distance): New function, currently disabled.
Anuj Verma 81e32986 2020-08-18T17:49:56 [sdf] Add shortest distance finding functions. * src/sdf/ftsdf.c (get_min_distance_line, get_min_distance_conic, get_min_distance_cubic): New functions. Note that `get_min_distance_conic` comes with two implementations (using an analytical and an iterative method, to be controlled with the `USE_NEWTON_FOR_CONIC` macro).
Anuj Verma c918b54f 2020-08-18T10:28:16 [sdf] Add function to resolve corner distances. * src/sdf/ftsdf.c (resolve_corner): New function.
Anuj Verma a255125f 2020-08-18T10:17:46 [sdf] Add essential math functions. * src/sdf/ftsdf.c (cube_root, arc_cos) [!USE_NEWTON_FOR_CONIC]: New auxiliary functions. * src/sdf/ftsdf.c (solve_quadratic_equation, solve_cubic_equation) [!USE_NEWTON_FOR_CONIC]: New functions.
Anuj Verma cd413845 2020-08-18T10:14:20 [sdf] Add utility functions for contours. * src/sdf/ftsdf.c (get_control_box, get_contour_orientation): New functions. (split_conic, split_cubic, split_sdf_conic, split_sdf_cubic, split_sdf_shape): New functions.
Anuj Verma 2de1b563 2020-08-17T16:36:30 [sdf] Add functions to decompose `FT_Outline`. * src/sdf/ftsdf.c (sdf_move_to, sdf_line_to, sdf_conic_to, sdf_cubic_to): New auxiliary decomposition functions. (sdf_compose_funcs): New structure. (sdf_outline_decompose): New function.
Anuj Verma cf0464d8 2020-08-17T16:24:39 [sdf] Structs, enums, macros, and functions for 'sdf' rasterizer. * src/sdf/ftsdf.c (FT_DEBUG_INNER, FT_ASSIGNP_INNER) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New macros. (SDF_MemoryUser) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New struct for memory usage tracing. (sdf_alloc, sdf_free) [FT_DEBUG_LEVEL_TRACE && FT_DEBUG_MEMORY]: New functions for memory usage tracing. (SDF_ALLOC, SDF_FREE): New macros for memory management. (SDF_MEMORY_TRACKER_DECLARE, SDF_MEMORY_TRACKER_SETUP, SDF_MEMORY_TRACKER_DONE): New macros to set up memory usage tracing. (USE_NEWTON_FOR_CONIC, MAX_NEWTON_DIVISIONS, MAX_NEWTON_STEPS, CORNER_CHECK_EPSILON, CG_DIMEN): New configuration macros for controlling the process of finding the shortest distance. (MUL_26D6, VEC_26D6_DOT): New auxiliary macros. (SDF_TRaster, SDF_Edge, SDF_Contour, SDF_Shape, SDF_Signed_Distance, SDF_Params): New structs for setting up SDF data. (SDF_Edge_Type, SDF_Contour_Orientation): New enums for SDF data. (zero_vector, null_edge, null_contour, null_shape, max_sdf): Useful constants. (sdf_edge_new, sdf_edge_done, sdf_contour_new, sdf_contour_done, sdf_shape_new, sdf_shape_done): New constructors and destructors.
Anuj Verma c6ec87ec 2020-08-17T16:11:56 [sdf] Add raster parameters structure. * src/sdf/ftsdf.h (SDF_Raster_Params): New structure. * src/sdf/sdf.c: Include source files in order to make a single object of the module.
Anuj Verma 56d27d32 2020-08-17T11:47:26 [sdf] Add 'sdf' renderer. * src/sdf/ftsdf.c: Add 'sdf' renderer along with its interface functions. Also add functions to set and get properties.
Anuj Verma 21627032 2020-08-17T11:40:57 [sdf] Add common elements for 'sdf' and 'bsdf' renderers. * src/sdf/ftsdfrend.h (SDF_Rendere_Module, ft_sdf_renderer_class, ft_bitmap_sdf_renderer_class): New structures. * src/sdf/ftsdfcommon.h (DEFAULT_SPREAD, MIN_SPREAD_MAX_SPREAD, USE_SQUARED_DISTANCES): New macros. (FT_INT_26D6, FT_INT_16D16, FT_26D6_16D16): New macros. (FT_CALL, VECTOR_LENGTH_16D16): New macros. (FT_26D6_Vec, FT_16D16_Vec, FT_16D16, FT_26D6, FT_6D10, FT_CBox): New typedefs. (square_root): New macro. * src/sdf/ftsdferrs.h: Add module error setup.
Anuj Verma cd6ff28a 2020-08-16T17:09:22 [sdf] Add files for new 'sdf' module. Here is a breakdown of what the files will contain. * src/sdf/ftsdfrend.c, src/sdf/ftsdfrend.h: The 'sdf' and 'bsdf' renderers. * src/sdf/ftsdf.c, src/sdf/ftsdf.h: The rasterizer for the 'sdf' renderer. * src/sdf/ftbsdf.c, src/sdf/ftbsdf.h: The rasterizer for the 'bsdf' renderer. * src/sdf/ftsdfcommon.h: Commmon properties and functions for both rasterizers. * src/sdf/ftsdferrs.h: Common error defines. * src/sdf/sdf.c: For building a single object of the entire module.