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.
This commit is contained in:
Anuj Verma 2020-08-23 05:35:46 +05:30
parent 7c2a64b709
commit 8cce50b9b8
3 changed files with 19 additions and 3 deletions

View File

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

View File

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

View File

@ -78,6 +78,7 @@ FT_BEGIN_HEADER
* FT_FWord
* FT_UFWord
* FT_F2Dot14
* FT_F6Dot10
* FT_UnitVector
* FT_F26Dot6
* FT_Data
@ -264,6 +265,17 @@ FT_BEGIN_HEADER
typedef signed short FT_F2Dot14;
/**************************************************************************
*
* @type:
* FT_F6Dot10
*
* @description:
* A signed 6.10 fixed-point type used for signed distance values.
*/
typedef signed short FT_F6Dot10;
/**************************************************************************
*
* @type: