[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] GSoC-2020-anuj 8cce50b: Be more explicit about the output of
From: |
Anuj Verma |
Subject: |
[freetype2] GSoC-2020-anuj 8cce50b: Be more explicit about the output of the SDF rasterizers. |
Date: |
Sat, 22 Aug 2020 21:36:52 -0400 (EDT) |
branch: GSoC-2020-anuj
commit 8cce50b9b8d770f03d32abf260a8602c220c5e02
Author: Anuj Verma <anujv@iitbhilai.ac.in>
Commit: Anuj Verma <anujv@iitbhilai.ac.in>
Be more explicit about the output of the SDF rasterizers.
* include/freetype/fttypes.h (FT_F6Dot10): Add a new data type which can be\
used to convert the output buffer appropriately.
* include/freetype/freetype.h (FT_Render_Mode): Add information about the
output while using `FT_RENDER_MODE_SDF'.
* include/freetype/ftimage.h (FT_Pixel_Mode): Add more information about the
`FT_PIXEL_MODE_GRAY16' pixel mode.
---
include/freetype/freetype.h | 4 +++-
include/freetype/ftimage.h | 6 ++++--
include/freetype/fttypes.h | 12 ++++++++++++
3 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index aca7fcf..4b7da64 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -3247,7 +3247,9 @@ FT_BEGIN_HEADER
* pixel in a SDF bitmap contains information about the nearest edge of
* the glyph outline. The distances are calculated from the center of
* the pixel and are positive if they are filled by the outline (i.e.
- * inside the outline) and negative otherwise.
+ * inside the outline) and negative otherwise. The output bitmap buffer
+ * is represented as 6.10 fixed point values, use @FT_6Dot10 and convert
+ * accordingly.
*
* @note:
* The selected render mode only affects vector glyphs of a font.
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 5b41ca2..b2b9f78 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -160,8 +160,10 @@ FT_BEGIN_HEADER
* FT_PIXEL_MODE_GRAY16 ::
* A 16-bit per pixel bitmap used to represent signed distances in a
* signed distance field bitmap. This is currently only used while
- * rendering using @FT_RENDER_MODE_SDF. Note that this is a 2.14
- * fixed-point fractional value.
+ * rendering using @FT_RENDER_MODE_SDF. One Impotant Note:
+ * This pixel format is represented as 6.10 fixed point format. That
+ * means you have to divide the values by 1024.0F in order to get
+ * actual data that is outputted by the SDF rasterizers.
*
* FT_PIXEL_MODE_LCD ::
* An 8-bit bitmap, representing RGB or BGR decimated glyph images used
diff --git a/include/freetype/fttypes.h b/include/freetype/fttypes.h
index aaeb9e8..8200ba0 100644
--- a/include/freetype/fttypes.h
+++ b/include/freetype/fttypes.h
@@ -78,6 +78,7 @@ FT_BEGIN_HEADER
* FT_FWord
* FT_UFWord
* FT_F2Dot14
+ * FT_F6Dot10
* FT_UnitVector
* FT_F26Dot6
* FT_Data
@@ -267,6 +268,17 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @type:
+ * FT_F6Dot10
+ *
+ * @description:
+ * A signed 6.10 fixed-point type used for signed distance values.
+ */
+ typedef signed short FT_F6Dot10;
+
+
+ /**************************************************************************
+ *
+ * @type:
* FT_F26Dot6
*
* @description:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] GSoC-2020-anuj 8cce50b: Be more explicit about the output of the SDF rasterizers.,
Anuj Verma <=