[sdf] Added documentation for some structs.

* src/sdf/ftsdfrend.h
      .../ftsdfrend.c
      .../ftsdfcommon.h
      .../ftsdf.h
  : Added documentation for a few structs.
This commit is contained in:
Anuj Verma 2020-08-05 17:55:02 +05:30
parent a9fbef27ab
commit 45398811c7
5 changed files with 65 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2020-08-5 Anuj Verma <anujv@iitbhilai.ac.in>
[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 <anujv@iitbhilai.ac.in>
[sdf -> bsdf] Extended to work with monochrome bitmaps.

View File

@ -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;

View File

@ -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 )
{

View File

@ -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,

View File

@ -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;