diff options
author | Alexei Podtelezhnikov <apodtele@gmail.com> | 2017-09-24 22:18:34 -0400 |
---|---|---|
committer | Alexei Podtelezhnikov <apodtele@gmail.com> | 2017-09-24 22:18:34 -0400 |
commit | 02e80da6090c21d6e59ac955b7f56e1ad4a9850b (patch) | |
tree | 9b747ffb51bebc2226a74fe5cc60cb758978b21c /include/freetype/internal/ftobjs.h | |
parent | 6f2b6f8f72ffb5017ab00fca83185b21f1a9f56d (diff) | |
download | freetype2-02e80da6090c21d6e59ac955b7f56e1ad4a9850b.tar.gz |
Tweak per-face LCD filtering controls.
Thing are simpler with a NULL-function pointer.
* include/freetype/internal/ftobjs.h (FT_Face_InternalRec): New
pointer to the filter function.
(FT_LibraryRec): Remove unused `lcd_filter'.
(FT_Bitmap_LcdFilterFunc, ft_lcd_filter_fir): Move from here...
* include/freetype/ftlcdfil.h (FT_Bitmap_LcdFilterFunc,
ft_lcd_filter_fir): ... to here.
* src/base/ftobjs.c (ft_open_face_internal): NULL-initialize the
per-face filter.
(FT_Face_Properties): Set it.
* src/smooth/ftsmooth.c (ft_smooth_render_generic): Simplify.
* src/base/ftlcdfil.c (ft_lcd_filter_fir, FT_Libary_SetLcdFilter):
Minor.
Diffstat (limited to 'include/freetype/internal/ftobjs.h')
-rw-r--r-- | include/freetype/internal/ftobjs.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index 4231be238..25c328f4f 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -369,9 +369,10 @@ FT_BEGIN_HEADER /* operator. Value~0 means to use the font's value. Value~-1 */ /* means to use the CFF driver's default. */ /* */ - /* lcd_weights :: */ - /* Overrides the library default with custom weights for the 5-tap */ - /* FIR filter. `{0, 0, 0, 0, 0}' means to use the library default. */ + /* lcd_weights :: */ + /* lcd_filter_func :: */ + /* If subpixel rendering is activated, the LCD filtering weights */ + /* and callback function. */ /* */ /* refcount :: */ /* A counter initialized to~1 at the time an @FT_Face structure is */ @@ -393,8 +394,10 @@ FT_BEGIN_HEADER FT_Char no_stem_darkening; FT_Int32 random_seed; + #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - FT_LcdFiveTapFilter lcd_weights; /* preset or custom filter weights */ + FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */ + FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */ #endif FT_Int refcount; @@ -821,18 +824,6 @@ FT_BEGIN_HEADER #define FT_DEBUG_HOOK_TRUETYPE 0 - typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap, - FT_Render_Mode render_mode, - FT_Byte* weights ); - - - /* This is the default LCD filter, an in-place, 5-tap FIR filter. */ - FT_BASE( void ) - ft_lcd_filter_fir( FT_Bitmap* bitmap, - FT_Render_Mode mode, - FT_LcdFiveTapFilter weights ); - - /*************************************************************************/ /* */ /* <Struct> */ @@ -878,9 +869,6 @@ FT_BEGIN_HEADER /* interpreter. Currently, only the TrueType */ /* bytecode debugger uses this. */ /* */ - /* lcd_filter :: If subpixel rendering is activated, the */ - /* selected LCD filter mode. */ - /* */ /* lcd_weights :: If subpixel rendering is activated, the LCD */ /* filter weights, if any. */ /* */ @@ -915,7 +903,6 @@ FT_BEGIN_HEADER FT_DebugHook_Func debug_hooks[4]; #ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING - FT_LcdFilter lcd_filter; FT_LcdFiveTapFilter lcd_weights; /* filter weights, if any */ FT_Bitmap_LcdFilterFunc lcd_filter_func; /* filtering callback */ #endif |