summaryrefslogtreecommitdiff
path: root/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c')
-rw-r--r--Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c54
1 files changed, 34 insertions, 20 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c b/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
index 8bcbed7aab3..611b39f570c 100644
--- a/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
+++ b/Build/source/libs/freetype2/freetype-src/src/base/ftlcdfil.c
@@ -4,7 +4,7 @@
/* */
/* FreeType API for color filtering of subpixel bitmap glyphs (body). */
/* */
-/* Copyright 2006-2016 by */
+/* Copyright 2006-2017 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,14 +30,13 @@
#define USE_LEGACY
/* FIR filter used by the default and light filters */
- static void
- _ft_lcd_filter_fir( FT_Bitmap* bitmap,
- FT_Render_Mode mode,
- FT_Library library )
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights )
{
- FT_Byte* weights = library->lcd_weights;
- FT_UInt width = (FT_UInt)bitmap->width;
- FT_UInt height = (FT_UInt)bitmap->rows;
+ FT_UInt width = (FT_UInt)bitmap->width;
+ FT_UInt height = (FT_UInt)bitmap->rows;
/* horizontal in-place FIR filter */
@@ -176,7 +175,7 @@
static void
_ft_lcd_filter_legacy( FT_Bitmap* bitmap,
FT_Render_Mode mode,
- FT_Library library )
+ FT_Byte* weights )
{
FT_UInt width = (FT_UInt)bitmap->width;
FT_UInt height = (FT_UInt)bitmap->rows;
@@ -189,7 +188,7 @@
{ 65538 * 1/13, 65538 * 1/6, 65538 * 9/13 }
};
- FT_UNUSED( library );
+ FT_UNUSED( weights );
/* horizontal in-place intra-pixel filter */
@@ -295,8 +294,8 @@
if ( !weights )
return FT_THROW( Invalid_Argument );
- ft_memcpy( library->lcd_weights, weights, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights, weights, FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
return FT_Err_Ok;
@@ -307,10 +306,10 @@
FT_Library_SetLcdFilter( FT_Library library,
FT_LcdFilter filter )
{
- static const FT_Byte default_filter[5] =
- { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
- static const FT_Byte light_filter[5] =
- { 0x00, 0x55, 0x56, 0x55, 0x00 };
+ static const FT_LcdFiveTapFilter default_weights =
+ { 0x08, 0x4d, 0x56, 0x4d, 0x08 };
+ static const FT_LcdFiveTapFilter light_weights =
+ { 0x00, 0x55, 0x56, 0x55, 0x00 };
if ( !library )
@@ -324,14 +323,18 @@
break;
case FT_LCD_FILTER_DEFAULT:
- ft_memcpy( library->lcd_weights, default_filter, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights,
+ default_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
break;
case FT_LCD_FILTER_LIGHT:
- ft_memcpy( library->lcd_weights, light_filter, 5 );
- library->lcd_filter_func = _ft_lcd_filter_fir;
+ ft_memcpy( library->lcd_weights,
+ light_weights,
+ FT_LCD_FILTER_FIVE_TAPS );
+ library->lcd_filter_func = ft_lcd_filter_fir;
library->lcd_extra = 2;
break;
@@ -356,6 +359,17 @@
#else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
+ FT_BASE( void )
+ ft_lcd_filter_fir( FT_Bitmap* bitmap,
+ FT_Render_Mode mode,
+ FT_LcdFiveTapFilter weights )
+ {
+ FT_UNUSED( bitmap );
+ FT_UNUSED( mode );
+ FT_UNUSED( weights );
+ }
+
+
FT_EXPORT_DEF( FT_Error )
FT_Library_SetLcdFilterWeights( FT_Library library,
unsigned char *weights )