[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2020-anuj b8f4ab8 1/2: [sdf] Added raster params struct
From: |
Anuj Verma |
Subject: |
[freetype2] GSoC-2020-anuj b8f4ab8 1/2: [sdf] Added raster params struct. |
Date: |
Mon, 17 Aug 2020 06:55:18 -0400 (EDT) |
branch: GSoC-2020-anuj
commit b8f4ab8304cfa4baf83f172cad26a92fa5760399
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>
[sdf] Added raster params struct.
* src/sdf/ftsdf.h (SDF_Raster_Params): Added struct which is used to pass
params to both `sdf' and `bsdf' rasterizer.
* src/sdf/sdf.c (*): Include source files in order to make a single object
of the
module.
* src/sdf/ftsdfrend.h (SDF_Renderer_Module): Add a '*' to make the comment
similar to the rest in the module.
---
src/sdf/ftsdf.h | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/sdf/ftsdfrend.h | 1 +
src/sdf/sdf.c | 5 +++++
3 files changed, 69 insertions(+)
diff --git a/src/sdf/ftsdf.h b/src/sdf/ftsdf.h
index 8e52a68..37eaa6a 100644
--- a/src/sdf/ftsdf.h
+++ b/src/sdf/ftsdf.h
@@ -2,6 +2,69 @@
#ifndef FTSDF_H_
#define FTSDF_H_
+#include <ft2build.h>
+#include FT_CONFIG_CONFIG_H
+#include <freetype/ftimage.h>
+
+/* common properties and function */
+#include "ftsdfcommon.h"
+
+FT_BEGIN_HEADER
+
+ /**************************************************************************
+ *
+ * @struct:
+ * SDF_Raster_Params
+ *
+ * @description:
+ * This struct must be passed to 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:
+ * 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.
+ *
+ * overlaps ::
+ * Set this to true to generate SDF for glyphs having overlapping
+ * contours. The overlapping support is limited to glyph which do
+ * not have self intersecting contours. Also, removing overlaps
+ * require a considerable amount of extra memory and this is not
+ * valid while generating SDF from bitmap.
+ *
+ * @note:
+ * It is valid for both `sdf' and `bsdf' renderer.
+ *
+ */
+ typedef struct SDF_Raster_Params_
+ {
+ FT_Raster_Params root;
+ FT_UInt spread;
+ FT_Bool flip_sign;
+ FT_Bool flip_y;
+ FT_Bool overlaps;
+
+ } SDF_Raster_Params;
+
+FT_END_HEADER
#endif /* FTSDF_H_ */
diff --git a/src/sdf/ftsdfrend.h b/src/sdf/ftsdfrend.h
index 4131a52..219acd5 100644
--- a/src/sdf/ftsdfrend.h
+++ b/src/sdf/ftsdfrend.h
@@ -50,6 +50,7 @@ FT_BEGIN_HEADER
* @note:
* All properties except `overlaps' is valid for both `sdf' and
* `bsdf' renderer.
+ *
*/
typedef struct SDF_Renderer_Module_
{
diff --git a/src/sdf/sdf.c b/src/sdf/sdf.c
index 93a4c65..7867787 100644
--- a/src/sdf/sdf.c
+++ b/src/sdf/sdf.c
@@ -1,3 +1,8 @@
+#define FT_MAKE_OPTION_SINGLE_OBJECT
+
+#include "ftsdfrend.c"
+#include "ftbsdf.c"
+#include "ftsdf.c"
/* END */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2020-anuj b8f4ab8 1/2: [sdf] Added raster params struct.,
Anuj Verma <=