diff options
author | marha <marha@users.sourceforge.net> | 2010-08-06 11:48:36 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-08-06 11:48:36 +0000 |
commit | 20ff8ddf2d9bb41050d10bbc75d61b9161880c7c (patch) | |
tree | 22566fcd9663b2baa565cd0c64eaa662d6ba03ee /freetype/src/base/ftlcdfil.c | |
parent | c29011f2831315d3da9c4727c1e626d80520b97a (diff) | |
parent | 6849d83857b4e470a44ad8b6aa5cfb283fd64c89 (diff) | |
download | vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.gz vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.tar.bz2 vcxsrv-20ff8ddf2d9bb41050d10bbc75d61b9161880c7c.zip |
svn merge ^/branches/released .
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 3ed6d8191..e38fb4bd8 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 ) { |