ref: 3939c200f39a28e7c87d60ca4fc9de7b2823dd18
parent: c0a6f20a4b33fefce50dafbf0d7f20aec6b0e724
author: Werner Lemberg <[email protected]>
date: Thu Jul 17 13:24:22 EDT 2014
Minor.
--- a/src/base/ftbitmap.c
+++ b/src/base/ftbitmap.c
@@ -394,9 +394,10 @@
*
* http://accessibility.kde.org/hsl-adjusted.php
*
- * We do the computation with integers only applying gamma of 2.0,
- * The following will never overflow 32 bits. This is a scaled up
+ * We do the computation with integers only, applying a gamma of 2.0.
+ * The following will never overflow 32 bits; it is a scaled-up
* luminosity with premultiplication not yet undone.
+ *
*/
l = 4731UL /* 0.0722 * 65536 */ * bgra[0] * bgra[0] +
@@ -404,7 +405,7 @@
13933UL /* 0.2126 * 65536 */ * bgra[2] * bgra[2];
/*
- * Final transparency can be determined this way:
+ * Final transparency can be determined as follows.
*
* - If alpha is zero, we want 0.
* - If alpha is zero and luminosity is zero, we want 255.
@@ -411,7 +412,9 @@
* - If alpha is zero and luminosity is one, we want 0.
*
* So the formula is a * (1 - l) = a - l * a.
- * Undoing premultiplication and scaling back down we get
+ *
+ * In the actual code, we undo premultiplication and scale down again.
+ *
*/
return a - (FT_Byte)( ( l / a ) >> 16 );