freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freetype2] master 32760d3: [base] Empower `FT_Library_SetLcdFilterWeigh


From: Alexei Podtelezhnikov
Subject: [freetype2] master 32760d3: [base] Empower `FT_Library_SetLcdFilterWeights'.
Date: Fri, 15 Jan 2016 04:32:25 +0000

branch: master
commit 32760d33d0ebc3ba756d2bc0cce1defdafe51299
Author: Alexei Podtelezhnikov <address@hidden>
Commit: Alexei Podtelezhnikov <address@hidden>

    [base] Empower `FT_Library_SetLcdFilterWeights'.
    
    * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): Enable filter
    in addition to setting weights.
    (FT_Library_SetLcdFilter): Clean out FT_FORCE_LIGHT_LCD_FILTER and
    FT_FORCE_LEGACY_LCD_FILTER.
    * include/freetype/ftlcdfil.h: Documentation update.
---
 ChangeLog                   |   10 ++++++++++
 include/freetype/ftlcdfil.h |    7 ++-----
 src/base/ftlcdfil.c         |   18 ++----------------
 3 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index efa9c75..2f83095 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-01-14  Alexei Podtelezhnikov  <address@hidden>
+
+       [base] Empower `FT_Library_SetLcdFilterWeights'.
+
+       * src/base/ftlcdfil.c (FT_Library_SetLcdFilterWeights): Enable filter
+       in addition to setting weights.
+       (FT_Library_SetLcdFilter): Clean out FT_FORCE_LIGHT_LCD_FILTER and
+       FT_FORCE_LEGACY_LCD_FILTER.
+       * include/freetype/ftlcdfil.h: Documentation update.
+
 2016-01-12  Werner Lemberg  <address@hidden>
 
        Don't use macro names that start with `_[A-Z]' [3/3].
diff --git a/include/freetype/ftlcdfil.h b/include/freetype/ftlcdfil.h
index 3e9f580..95d4023 100644
--- a/include/freetype/ftlcdfil.h
+++ b/include/freetype/ftlcdfil.h
@@ -250,8 +250,8 @@ FT_BEGIN_HEADER
    *   FT_Library_SetLcdFilterWeights
    *
    * @description:
-   *   Use this function to override default or light filter weights
-   *   selected by @FT_Library_SetLcdFilter.
+   *   This function can be used to enable LCD filter with custom weights,
+   *   instead of using presets in @FT_Library_SetLcdFilter.
    *
    * @input:
    *   library ::
@@ -271,9 +271,6 @@ FT_BEGIN_HEADER
    *   defined in your build of the library, which should correspond to all
    *   default builds of FreeType.
    *
-   *   This function must be called after @FT_Library_SetLcdFilter to have
-   *   any effect on default or light filter.
-   *
    * @since:
    *   2.4.0
    */
diff --git a/src/base/ftlcdfil.c b/src/base/ftlcdfil.c
index b2f35dc..8bcbed7 100644
--- a/src/base/ftlcdfil.c
+++ b/src/base/ftlcdfil.c
@@ -296,6 +296,8 @@
       return FT_THROW( Invalid_Argument );
 
     ft_memcpy( library->lcd_weights, weights, 5 );
+    library->lcd_filter_func = _ft_lcd_filter_fir;
+    library->lcd_extra       = 2;
 
     return FT_Err_Ok;
   }
@@ -322,25 +324,9 @@
       break;
 
     case FT_LCD_FILTER_DEFAULT:
-#if defined( FT_FORCE_LEGACY_LCD_FILTER )
-
-      library->lcd_filter_func = _ft_lcd_filter_legacy;
-      library->lcd_extra       = 0;
-
-#elif defined( FT_FORCE_LIGHT_LCD_FILTER )
-
-      ft_memcpy( library->lcd_weights, light_filter, 5 );
-      library->lcd_filter_func = _ft_lcd_filter_fir;
-      library->lcd_extra       = 2;
-
-#else
-
       ft_memcpy( library->lcd_weights, default_filter, 5 );
       library->lcd_filter_func = _ft_lcd_filter_fir;
       library->lcd_extra       = 2;
-
-#endif
-
       break;
 
     case FT_LCD_FILTER_LIGHT:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]