aboutsummaryrefslogtreecommitdiff
path: root/freetype/docs/reference/ft2-lcd_filtering.html
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-06-21 10:45:51 +0200
committermarha <marha@users.sourceforge.net>2013-06-21 10:48:19 +0200
commitfa791414601df61d20d860299dba80fdb62565df (patch)
treeeecc4c74bb78dece330009c571ed57d7f1aaede2 /freetype/docs/reference/ft2-lcd_filtering.html
parent7f9fb534564d0eb8a62cf444e569a07166e5ee03 (diff)
downloadvcxsrv-fa791414601df61d20d860299dba80fdb62565df.tar.gz
vcxsrv-fa791414601df61d20d860299dba80fdb62565df.tar.bz2
vcxsrv-fa791414601df61d20d860299dba80fdb62565df.zip
Upgraded freetype to 2.5.0.1
Diffstat (limited to 'freetype/docs/reference/ft2-lcd_filtering.html')
-rw-r--r--freetype/docs/reference/ft2-lcd_filtering.html18
1 files changed, 16 insertions, 2 deletions
diff --git a/freetype/docs/reference/ft2-lcd_filtering.html b/freetype/docs/reference/ft2-lcd_filtering.html
index 9965c432d..da50ff5f5 100644
--- a/freetype/docs/reference/ft2-lcd_filtering.html
+++ b/freetype/docs/reference/ft2-lcd_filtering.html
@@ -3,7 +3,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-<title>FreeType-2.4.11 API Reference</title>
+<title>FreeType-2.5.0 API Reference</title>
<style type="text/css">
body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
color: #000000;
@@ -35,7 +35,7 @@
<table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
<td width="100%"></td>
<td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
-<center><h1>FreeType-2.4.11 API Reference</h1></center>
+<center><h1>FreeType-2.5.0 API Reference</h1></center>
<center><h1>
LCD Filtering
@@ -49,6 +49,20 @@ LCD Filtering
<table align=center width="87%"><tr><td>
<p>The <a href="ft2-lcd_filtering.html#FT_Library_SetLcdFilter">FT_Library_SetLcdFilter</a> API can be used to specify a low-pass filter which is then applied to LCD-optimized bitmaps generated through <a href="ft2-base_interface.html#FT_Render_Glyph">FT_Render_Glyph</a>. This is useful to reduce color fringes which would occur with unfiltered rendering.</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 &lsquo;ftoption.h&rsquo; file in order to activate it.</p>
+<p>FreeType generates alpha coverage maps, which are linear by nature. For instance, the value 0x80 in bitmap representation means that (within numerical precision) 0x80/0xff fraction of that pixel is covered by the glyph's outline. The blending function for placing text over a background is</p>
+<pre class="colored">
+ dst = alpha * src + (1 - alpha) * dst ,
+</pre>
+<p>which is known as OVER. However, when calculating the output of the OVER operator, the source colors should first be transformed to a linear color space, then alpha blended in that space, and transformed back to the output color space.</p>
+<p>When linear light blending is used, the default FIR5 filtering weights (as given by FT_LCD_FILTER_DEFAULT) are no longer optimal, as they have been designed for black on white rendering while lacking gamma correction. To preserve color neutrality, weights for a FIR5 filter should be chosen according to two free parameters &lsquo;a&rsquo; and &lsquo;c&rsquo;, and the FIR weights should be</p>
+<pre class="colored">
+ [a - c, a + c, 2 * a, a + c, a - c] .
+</pre>
+<p>This formula generates equal weights for all the color primaries across the filter kernel, which makes it colorless. One suggested set of weights is</p>
+<pre class="colored">
+ [0x10, 0x50, 0x60, 0x50, 0x10] ,
+</pre>
+<p>where &lsquo;a&rsquo; has value 0x30 and &lsquo;b&rsquo; value 0x20. The weights in filter may have a sum larger than 0x100, which increases coloration slightly but also improves contrast.</p>
</td></tr></table><br>
<table align=center width="75%"><tr><td>
<h4><a name="FT_LcdFilter">FT_LcdFilter</a></h4>