diff options
Diffstat (limited to 'modules/freetype2/docs/reference/ft2-lcd_filtering.html')
-rw-r--r-- | modules/freetype2/docs/reference/ft2-lcd_filtering.html | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/modules/freetype2/docs/reference/ft2-lcd_filtering.html b/modules/freetype2/docs/reference/ft2-lcd_filtering.html index 27d74da8a..1e5d5ed71 100644 --- a/modules/freetype2/docs/reference/ft2-lcd_filtering.html +++ b/modules/freetype2/docs/reference/ft2-lcd_filtering.html @@ -1,9 +1,9 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" -"http://www.w3.org/TR/html4/loose.dtd"> +"https://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> -<title>FreeType-2.7.1 API Reference</title> +<title>FreeType-2.9.1 API Reference</title> <style type="text/css"> a:link { color: #0000EF; } a:visited { color: #51188E; } @@ -100,7 +100,7 @@ <body> <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table> -<h1>FreeType-2.7.1 API Reference</h1> +<h1>FreeType-2.9.1 API Reference</h1> <h1 id="lcd_filtering">LCD Filtering</h1> <h2>Synopsis</h2> @@ -110,8 +110,8 @@ </table> -<p>Subpixel rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Since these subpixels are color pixels, using them unfiltered creates severe color fringes. Use the <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. The filter sacrifices some of the higher resolution to reduce color fringes, making the glyph image slightly blurrier. Positional improvements will remain.</p> -<p>Note that no filter is active by default, and that this function is <b>not</b> implemented in default builds of the library. You need to #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ‘ftoption.h’ file in order to activate it and explicitly call <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> to enable it.</p> +<p>Should you #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING in your ‘ftoption.h’, which enables patented ClearType-style rendering, the LCD-optimized glyph bitmaps should be filtered to reduce color fringes inherent to this technology. The default FreeType LCD rendering uses different technology, and API described below, although available, does nothing.</p> +<p>ClearType-style LCD rendering exploits the color-striped structure of LCD pixels, increasing the available resolution in the direction of the stripe (usually horizontal RGB) by a factor of 3. Since these subpixels are color pixels, using them unfiltered creates severe color fringes. Use the <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> API to specify a low-pass filter, which is then applied to subpixel-rendered bitmaps generated through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. The filter sacrifices some of the higher resolution to reduce color fringes, making the glyph image slightly blurrier. Positional improvements will remain.</p> <p>A filter should have two properties:</p> <p>1) It should be normalized, meaning the sum of the 5 components should be 256 (0x100). It is possible to go above or under this target sum, however: going under means tossing out contrast, going over means invoking clamping and thereby non-linearities that increase contrast somewhat at the expense of greater distortion and color-fringing. Contrast is better enhanced through stem darkening.</p> <p>2) It should be color-balanced, meaning a filter ‘{ a, b, c, b, a }’ where a + b = c. It distributes the computed coverage for one subpixel to all subpixels equally, sacrificing some won resolution but drastically reducing color-fringing. Positioning improvements remain! Note that color-fringing can only really be minimized when using a color-balanced filter and alpha-blending the glyph onto a surface in linear space; see <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>.</p> @@ -217,6 +217,23 @@ FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> ) <b>FT_Library_SetLcdFilterWeights</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library, <span class="keyword">unsigned</span> <span class="keyword">char</span> *weights ); + + + /* + * @type: + * FT_LcdFiveTapFilter + * + * @description: + * A <span class="keyword">typedef</span> for passing the five LCD filter weights to + * @<a href="ft2-base_interface.html#FT_Face_Properties">FT_Face_Properties</a> within an @<a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a> structure. + * + * @since: + * 2.8 + * + */ +#define FT_LCD_FILTER_FIVE_TAPS 5 + + <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Byte">FT_Byte</a> FT_LcdFiveTapFilter[FT_LCD_FILTER_FIVE_TAPS]; </pre> <p>This function can be used to enable LCD filter with custom weights, instead of using presets in <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a>.</p> @@ -236,6 +253,7 @@ <h4>note</h4> <p>Due to <b>PATENTS</b> covering subpixel rendering, this function doesn't do anything except returning ‘FT_Err_Unimplemented_Feature’ if the configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not defined in your build of the library, which should correspond to all default builds of FreeType.</p> +<p>LCD filter weights can also be set per face using <a href="ft2-base_interface.html#FT_Face_Properties">FT_Face_Properties</a> with <a href="ft2-parameter_tags.html#FT_PARAM_TAG_LCD_FILTER_WEIGHTS">FT_PARAM_TAG_LCD_FILTER_WEIGHTS</a>.</p> <h4>since</h4> <p>2.4.0</p> |