diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog index 2419c53c1..319bfc48e 100644 --- a/[GSoC]ChangeLog +++ b/[GSoC]ChangeLog @@ -1,3 +1,13 @@ +2020-08-5 Anuj Verma + + [sdf] Added documentation for some structs. + + * src/sdf/ftsdfrend.h + .../ftsdfrend.c + .../ftsdfcommon.h + .../ftsdf.h + : Added documentation for a few structs. + 2020-08-5 Anuj Verma [sdf -> bsdf] Extended to work with monochrome bitmaps. diff --git a/src/sdf/ftsdf.h b/src/sdf/ftsdf.h index 0338092ab..4d786adff 100644 --- a/src/sdf/ftsdf.h +++ b/src/sdf/ftsdf.h @@ -11,7 +11,7 @@ FT_BEGIN_HEADER - /* TEMPORARY */ + /* @experimental struct: */ typedef enum Optimizations_ { OPTIMIZATION_NONE = 0, /* default: check all points against all edges */ OPTIMIZATION_BB = 1, /* use bounding box to check nearby grid points */ @@ -30,9 +30,31 @@ FT_BEGIN_HEADER * This struct must be used for the raster render function * `FT_Raster_Render_Func' instead of `FT_Raster_Params' because * the rasterizer require some addition information to render properly. + * So, this struct is used to pass additional parameter to the + * rasterizer. * * @fields: - * [TODO] + * root :: + * The native raster params struct. + * + * spread :: + * This is and essential parameter/property required by the + * rendere. `spread' defines the maximum unsigned value that + * will be present in the final SDF output. For default value + * check `ftsdfcommon.h'. + * + * flip_sign :: + * By default the position values are inside the contours i.e. + * filled by a contour. If this property is true then that output + * will be opposite from the default i.e. negative will be filled + * by a contour. + * + * flip_y :: + * Setting this parameter to true maked the output image flipped + * along the y-axis. + * + * @note: + * It is valid for both `sdf' and `bsdf' renderer. * */ typedef struct SDF_Raster_Params_ @@ -42,7 +64,7 @@ FT_BEGIN_HEADER FT_Bool flip_sign; FT_Bool flip_y; - /* TEMPORARY */ + /* @experimental fields: */ FT_Int optimization; } SDF_Raster_Params; diff --git a/src/sdf/ftsdfcommon.h b/src/sdf/ftsdfcommon.h index dec4d4db1..b069077cb 100644 --- a/src/sdf/ftsdfcommon.h +++ b/src/sdf/ftsdfcommon.h @@ -103,6 +103,8 @@ FT_BEGIN_HEADER */ /* Original Algorithm: https://github.com/chmike/fpsqrt */ + /* Use this to compute the square root of a 16.16 fixed */ + /* point number. */ static FT_16D16 square_root( FT_16D16 val ) { diff --git a/src/sdf/ftsdfrend.c b/src/sdf/ftsdfrend.c index 0de977a39..dbd5f0010 100644 --- a/src/sdf/ftsdfrend.c +++ b/src/sdf/ftsdfrend.c @@ -32,6 +32,7 @@ * */ + /* property setter function */ static FT_Error sdf_property_set( FT_Module module, const char* property_name, @@ -101,6 +102,7 @@ return error; } + /* property getter function */ static FT_Error sdf_property_get( FT_Module module, const char* property_name, diff --git a/src/sdf/ftsdfrend.h b/src/sdf/ftsdfrend.h index 08525a3dd..766134980 100644 --- a/src/sdf/ftsdfrend.h +++ b/src/sdf/ftsdfrend.h @@ -16,10 +16,33 @@ FT_BEGIN_HEADER * SDF_Renderer_Module * * @description: - * [TODO] + * This struct extends the native renderer struct `FT_RendererRec'. + * It is basically used to store various parameters required by the + * renderer and some additional parameters which can be used to + * tweak the output of the renderer. * * @fields: - * [TODO] + * root :: + * The native rendere struct. + * + * spread :: + * This is and essential parameter/property required by the + * rendere. `spread' defines the maximum unsigned value that + * will be present in the final SDF output. For default value + * check `ftsdfcommon.h'. + * + * flip_sign :: + * By default the position values are inside the contours i.e. + * filled by a contour. If this property is true then that output + * will be opposite from the default i.e. negative will be filled + * by a contour. + * + * flip_y :: + * Setting this parameter to true maked the output image flipped + * along the y-axis. + + * @note: + * It is valid for both `sdf' and `bsdf' renderer. * */ typedef struct SDF_Renderer_Module_ @@ -29,7 +52,7 @@ FT_BEGIN_HEADER FT_Bool flip_sign; FT_Bool flip_y; - /* TEMPORARY */ + /* @experimental fields: */ FT_Int optimization; } SDF_Renderer_Module, *SDF_Renderer;