freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] anuj-distance-field 4539881: [sdf] Added documentation for s


From: Anuj Verma
Subject: [freetype2] anuj-distance-field 4539881: [sdf] Added documentation for some structs.
Date: Wed, 5 Aug 2020 08:25:11 -0400 (EDT)

branch: anuj-distance-field
commit 45398811c7ea6bfcfcfda608ba0956bf68a2c7d3
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: 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.
---
 [GSoC]ChangeLog       | 10 ++++++++++
 src/sdf/ftsdf.h       | 28 +++++++++++++++++++++++++---
 src/sdf/ftsdfcommon.h |  2 ++
 src/sdf/ftsdfrend.c   |  2 ++
 src/sdf/ftsdfrend.h   | 29 ++++++++++++++++++++++++++---
 5 files changed, 65 insertions(+), 6 deletions(-)

diff --git a/[GSoC]ChangeLog b/[GSoC]ChangeLog
index 2419c53..319bfc4 100644
--- a/[GSoC]ChangeLog
+++ b/[GSoC]ChangeLog
@@ -1,5 +1,15 @@
 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.
 
        * src/sdf/ftbsdf.c (bsdf_init_distance_map): Handle
diff --git a/src/sdf/ftsdf.h b/src/sdf/ftsdf.h
index 0338092..4d786ad 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 dec4d4d..b069077 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 0de977a..dbd5f00 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 08525a3..7661349 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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]