diff options
author | marha <marha@users.sourceforge.net> | 2010-08-06 10:14:25 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-08-06 10:14:25 +0000 |
commit | 47ed6413ce8f2586b8d542dc46055e075a47022e (patch) | |
tree | b814efb2655c444a4f63ac3cbb7d0cdf4bb3ef2f /freetype/src/base/ftlcdfil.c | |
parent | c115795736eb99a8f2288a06c231b9386f4d011f (diff) | |
download | vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.gz vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.tar.bz2 vcxsrv-47ed6413ce8f2586b8d542dc46055e075a47022e.zip |
Updated to freetype 2.4.1
Diffstat (limited to 'freetype/src/base/ftlcdfil.c')
-rw-r--r-- | freetype/src/base/ftlcdfil.c | 37 |
1 files changed, 31 insertions, 6 deletions
diff --git a/freetype/src/base/ftlcdfil.c b/freetype/src/base/ftlcdfil.c index 80640111c..0da4ba160 100644 --- a/freetype/src/base/ftlcdfil.c +++ b/freetype/src/base/ftlcdfil.c @@ -4,7 +4,7 @@ /* */ /* FreeType API for color filtering of subpixel bitmap glyphs (body). */ /* */ -/* Copyright 2006, 2008, 2009 by */ +/* Copyright 2006, 2008, 2009, 2010 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -267,18 +267,31 @@ FT_EXPORT_DEF( FT_Error ) - FT_Library_SetLcdFilter( FT_Library library, - FT_LcdFilter filter ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ) + { + if ( !library || !weights ) + return FT_Err_Invalid_Argument; + + ft_memcpy( library->lcd_weights, weights, 5 ); + + return FT_Err_Ok; + } + + + FT_EXPORT_DEF( FT_Error ) + FT_Library_SetLcdFilter( FT_Library library, + FT_LcdFilter filter ) { static const FT_Byte light_filter[5] = - { 0, 85, 86, 85, 0 }; + { 0x00, 0x55, 0x56, 0x55, 0x00 }; /* the values here sum up to a value larger than 256, */ /* providing a cheap gamma correction */ static const FT_Byte default_filter[5] = { 0x10, 0x40, 0x70, 0x40, 0x10 }; - if ( library == NULL ) + if ( !library ) return FT_Err_Invalid_Argument; switch ( filter ) @@ -330,12 +343,24 @@ } library->lcd_filter = filter; - return 0; + + return FT_Err_Ok; } #else /* !FT_CONFIG_OPTION_SUBPIXEL_RENDERING */ FT_EXPORT_DEF( FT_Error ) + FT_Library_SetLcdFilterWeights( FT_Library library, + unsigned char *weights ) + { + FT_UNUSED( library ); + FT_UNUSED( weights ); + + return FT_Err_Unimplemented_Feature; + } + + + FT_EXPORT_DEF( FT_Error ) FT_Library_SetLcdFilter( FT_Library library, FT_LcdFilter filter ) { |