source: trunk/poppler/freetype2/include/freetype/ftlcdfil.h @ 165

Last change on this file since 165 was 165, checked in by Eugene Romanenko, 15 years ago

update to latest freetype cvs, (closes #76)

File size: 5.3 KB
Line 
1/***************************************************************************/
2/*                                                                         */
3/*  ftlcdfil.h                                                             */
4/*                                                                         */
5/*    FreeType API for color filtering of subpixel bitmap glyphs           */
6/*    (specification).                                                     */
7/*                                                                         */
8/*  Copyright 2006 by                                                      */
9/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
10/*                                                                         */
11/*  This file is part of the FreeType project, and may only be used,       */
12/*  modified, and distributed under the terms of the FreeType project      */
13/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
14/*  this file you indicate that you have read the license and              */
15/*  understand and accept it fully.                                        */
16/*                                                                         */
17/***************************************************************************/
18
19
20#ifndef __FT_LCD_FILTER_H__
21#define __FT_LCD_FILTER_H__
22
23#include <ft2build.h>
24#include FT_FREETYPE_H
25
26
27FT_BEGIN_HEADER
28
29
30  /****************************************************************************
31   *
32   * @func:
33   *   FT_LcdFilter
34   *
35   * @description:
36   *   A list of values to identify various types of LCD filters.
37   *
38   * @values:
39   *   FT_LCD_FILTER_NONE ::
40   *     Do not perform filtering.  When used with subpixel rendering, this
41   *     results in sometimes severe color fringes.
42   *
43   *   FT_LCD_FILTER_DEFAULT ::
44   *     The default filter reduces color fringes considerably, at the cost
45   *     of a slight blurriness in the output.
46   *
47   *   FT_LCD_FILTER_LIGHT ::
48   *     The light filter is a variant that produces less blurriness at the
49   *     cost of slightly more color fringes than the default one.  It might
50   *     be better than the default one, depending on the monitor, personal
51   *     vision, and taste.
52   *
53   *   FT_LCD_FILTER_LEGACY ::
54   *     This filter corresponds to the original libXft color filter.  It
55   *     provides high contrast output but can exhibit really bad color
56   *     fringes if glyphs are not extremely well hinted to the pixel grid.
57   *     In other words, it only works well if the TrueType bytecode
58   *     interpreter is enabled *and* high-quality hinted fonts are used.
59   *
60   *     This filter is only provided for comparison purposes, and might be
61   *     disabled or stay unsupported in the future.
62   */
63  typedef enum
64  {
65    FT_LCD_FILTER_NONE    = 0,
66    FT_LCD_FILTER_DEFAULT = 1,
67    FT_LCD_FILTER_LIGHT   = 2,
68    FT_LCD_FILTER_LEGACY  = 16,
69
70    FT_LCD_FILTER_MAX   /* do not remove */
71
72  } FT_LcdFilter;
73
74
75  /**************************************************************************
76   *
77   * @func:
78   *   FT_Library_SetLcdFilter
79   *
80   * @description:
81   *   This function is used to apply color filtering to LCD decimated
82   *   bitmaps, like the ones used when calling @FT_Render_Glyph with
83   *   @FT_RENDER_MODE_LCD or @FT_RENDER_MODE_LCD_V.
84   *
85   * @input:
86   *   library ::
87   *     A handle to the target library instance.
88   *
89   *   filter ::
90   *     The filter type.
91   *
92   *     You can use @FT_LCD_FILTER_NONE here to disable this feature, or
93   *     @FT_LCD_FILTER_DEFAULT to use a default filter that should work
94   *     well on most LCD screens.
95   *
96   * @return:
97   *   FreeType error code.  0 means success.
98   *
99   * @note:
100   *   This feature is always disabled by default.  Clients must make an
101   *   explicit call to this function with a `filter' value other than
102   *   @FT_LCD_FILTER_NONE in order to enable it.
103   *
104   *   Due to *PATENTS* covering subpixel rendering, this function doesn't
105   *   do anything except returning `FT_Err_Unimplemented_Feature' if the
106   *   configuration macro FT_CONFIG_OPTION_SUBPIXEL_RENDERING is not
107   *   defined in your build of the library, which should correspond to all
108   *   default builds of the library.
109   *
110   *   The filter affects glyph bitmaps rendered through @FT_Render_Glyph,
111   *   @FT_Outline_Get_Bitmap, @FT_Load_Glyph, and @FT_Load_Char.
112   *
113   *   It does _not_ affect the output of @FT_Outline_Render and
114   *   @FT_Outline_Get_Bitmap.
115   *
116   *   If this feature is activated, the dimensions of LCD glyph bitmaps are
117   *   either larger or taller than the dimensions of the corresponding
118   *   outline with regards to the pixel grid.  For example, for
119   *   @FT_RENDER_MODE_LCD, the filter adds up to 3 pixels to the left, and
120   *   up to 3 pixels to the right.
121   *
122   *   The bitmap offset values are adjusted correctly, so clients shouldn't
123   *   need to modify their layout and glyph positioning code when enabling
124   *   the filter.
125   *
126   */
127  FT_EXPORT( FT_Error )
128  FT_Library_SetLcdFilter( FT_Library    library,
129                           FT_LcdFilter  filter );
130
131  /* */
132
133
134FT_END_HEADER
135
136#endif /* __FT_LCD_FILTER_H__ */
137
138
139/* END */
Note: See TracBrowser for help on using the repository browser.