pshalgo.c File Reference

#include <ft2build.h>
#include "pshalgo.h"
#include "pshnterr.h"

Go to the source code of this file.

Defines

#define FT_COMPONENT   trace_pshalgo2
#define COMPUTE_INFLEXS
#define STRONGER
#define PSH_ZONE_MIN   -3200000L
#define PSH_ZONE_MAX   +3200000L
#define xxDEBUG_ZONES
#define psh_print_zone(x)   do { } while ( 0 )
#define psh_corner_is_flat   ft_corner_is_flat
#define psh_corner_orientation   ft_corner_orientation
#define PSH_STRONG_THRESHOLD   32
#define PSH_STRONG_THRESHOLD_MAXIMUM   30
#define PSH_MAX_STRONG_INTERNAL   16

Functions

static FT_Int psh_hint_overlap (PSH_Hint hint1, PSH_Hint hint2)
static void psh_hint_table_done (PSH_Hint_Table table, FT_Memory memory)
static void psh_hint_table_deactivate (PSH_Hint_Table table)
static void psh_hint_table_record (PSH_Hint_Table table, FT_UInt idx)
static void psh_hint_table_record_mask (PSH_Hint_Table table, PS_Mask hint_mask)
static FT_Error psh_hint_table_init (PSH_Hint_Table table, PS_Hint_Table hints, PS_Mask_Table hint_masks, PS_Mask_Table counter_masks, FT_Memory memory)
static void psh_hint_table_activate_mask (PSH_Hint_Table table, PS_Mask hint_mask)
static FT_Pos psh_dimension_quantize_len (PSH_Dimension dim, FT_Pos len, FT_Bool do_snapping)
static FT_Fixed psh_hint_snap_stem_side_delta (FT_Fixed pos, FT_Fixed len)
static void psh_hint_align (PSH_Hint hint, PSH_Globals globals, FT_Int dimension, PSH_Glyph glyph)
static void psh_hint_table_align_hints (PSH_Hint_Table table, PSH_Globals globals, FT_Int dimension, PSH_Glyph glyph)
static void psh_glyph_compute_inflections (PSH_Glyph glyph)
static void psh_glyph_done (PSH_Glyph glyph)
static int psh_compute_dir (FT_Pos dx, FT_Pos dy)
static void psh_glyph_load_points (PSH_Glyph glyph, FT_Int dimension)
static void psh_glyph_save_points (PSH_Glyph glyph, FT_Int dimension)
static FT_Error psh_glyph_init (PSH_Glyph glyph, FT_Outline *outline, PS_Hints ps_hints, PSH_Globals globals)
static void psh_glyph_compute_extrema (PSH_Glyph glyph)
static void psh_hint_table_find_strong_points (PSH_Hint_Table table, PSH_Point point, FT_UInt count, FT_Int threshold, FT_Int major_dir)
static void psh_glyph_find_strong_points (PSH_Glyph glyph, FT_Int dimension)
static void psh_glyph_find_blue_points (PSH_Blues blues, PSH_Glyph glyph)
static void psh_glyph_interpolate_strong_points (PSH_Glyph glyph, FT_Int dimension)
static void psh_glyph_interpolate_normal_points (PSH_Glyph glyph, FT_Int dimension)
static void psh_glyph_interpolate_other_points (PSH_Glyph glyph, FT_Int dimension)
FT_Error ps_hints_apply (PS_Hints ps_hints, FT_Outline *outline, PSH_Globals globals, FT_Render_Mode hint_mode)


Define Documentation

#define COMPUTE_INFLEXS

Definition at line 39 of file pshalgo.c.

#define FT_COMPONENT   trace_pshalgo2

Definition at line 29 of file pshalgo.c.

#define psh_corner_is_flat   ft_corner_is_flat

Definition at line 930 of file pshalgo.c.

Referenced by psh_glyph_init().

#define psh_corner_orientation   ft_corner_orientation

Definition at line 931 of file pshalgo.c.

Referenced by psh_glyph_compute_inflections().

#define PSH_MAX_STRONG_INTERNAL   16

Definition at line 1872 of file pshalgo.c.

Referenced by psh_glyph_interpolate_normal_points().

#define psh_print_zone ( x   )     do { } while ( 0 )

Definition at line 915 of file pshalgo.c.

#define PSH_STRONG_THRESHOLD   32

Definition at line 1661 of file pshalgo.c.

Referenced by psh_glyph_find_strong_points().

#define PSH_STRONG_THRESHOLD_MAXIMUM   30

Definition at line 1664 of file pshalgo.c.

Referenced by psh_glyph_find_strong_points().

#define PSH_ZONE_MAX   +3200000L

Definition at line 894 of file pshalgo.c.

#define PSH_ZONE_MIN   -3200000L

Definition at line 893 of file pshalgo.c.

#define STRONGER

Definition at line 41 of file pshalgo.c.

#define xxDEBUG_ZONES

Definition at line 896 of file pshalgo.c.


Function Documentation

FT_Error ps_hints_apply ( PS_Hints  ps_hints,
FT_Outline outline,
PSH_Globals  globals,
FT_Render_Mode  hint_mode 
)

Definition at line 2177 of file pshalgo.c.

References PSH_GlyphRec_::do_horz_hints, PSH_GlyphRec_::do_horz_snapping, PSH_GlyphRec_::do_stem_adjust, PSH_GlyphRec_::do_vert_hints, PSH_GlyphRec_::do_vert_snapping, error, FALSE, FT_Bool, FT_BOOL, FT_FREE, FT_MulDiv(), FT_MulFix(), FT_NEW, FT_PIX_ROUND, FT_RENDER_MODE_LCD, FT_RENDER_MODE_LCD_V, FT_RENDER_MODE_LIGHT, FT_RENDER_MODE_MONO, PSH_GlyphRec_::globals, FT_Outline_::n_contours, FT_Outline_::n_points, psh_globals_set_scale(), psh_glyph_compute_extrema(), psh_glyph_done(), psh_glyph_find_blue_points(), psh_glyph_find_strong_points(), psh_glyph_init(), psh_glyph_interpolate_normal_points(), psh_glyph_interpolate_other_points(), psh_glyph_interpolate_strong_points(), psh_glyph_load_points(), psh_glyph_save_points(), psh_hint_table_align_hints(), PSH_DimensionRec_::scale_mult, and TRUE.

Referenced by t1_hints_funcs_init(), and t2_hints_funcs_init().

static int psh_compute_dir ( FT_Pos  dx,
FT_Pos  dy 
) [static]

Definition at line 1157 of file pshalgo.c.

References FT_Pos, PSH_DIR_DOWN, PSH_DIR_LEFT, PSH_DIR_NONE, PSH_DIR_RIGHT, and PSH_DIR_UP.

Referenced by psh_glyph_init().

static FT_Pos psh_dimension_quantize_len ( PSH_Dimension  dim,
FT_Pos  len,
FT_Bool  do_snapping 
) [static]

Definition at line 346 of file pshalgo.c.

References PSH_WidthRec_::cur, FT_PIX_ROUND, FT_Pos, PSH_DimensionRec_::stdw, and PSH_WidthsRec_::widths.

Referenced by psh_hint_align().

static void psh_glyph_compute_extrema ( PSH_Glyph  glyph  )  [static]

Definition at line 1392 of file pshalgo.c.

References PSH_GlyphRec_::contours, PSH_ContourRec_::count, for(), if(), n, PSH_GlyphRec_::num_contours, and PSH_ContourRec_::start.

Referenced by ps_hints_apply().

static void psh_glyph_compute_inflections ( PSH_Glyph  glyph  )  [static]

Definition at line 1030 of file pshalgo.c.

References PSH_GlyphRec_::contours, PSH_ContourRec_::count, finished, FT_Pos, if(), n, PSH_GlyphRec_::num_contours, psh_corner_orientation, psh_point_set_inflex, start, and PSH_ContourRec_::start.

static void psh_glyph_done ( PSH_Glyph  glyph  )  [static]

Definition at line 1138 of file pshalgo.c.

References PSH_GlyphRec_::contours, FT_FREE, PSH_GlyphRec_::hint_tables, PSH_GlyphRec_::memory, PSH_GlyphRec_::num_contours, PSH_GlyphRec_::num_points, PSH_GlyphRec_::points, and psh_hint_table_done().

Referenced by ps_hints_apply().

static void psh_glyph_find_blue_points ( PSH_Blues  blues,
PSH_Glyph  glyph 
) [static]

Definition at line 1747 of file pshalgo.c.

References PSH_BluesRec_::blue_fuzz, PSH_Blue_ZoneRec_::cur_bottom, PSH_Blue_ZoneRec_::cur_top, FT_Pos, if(), PSH_BluesRec_::no_overshoots, PSH_BluesRec_::normal_bottom, PSH_BluesRec_::normal_top, PSH_GlyphRec_::num_points, PSH_Blue_ZoneRec_::org_bottom, PSH_Blue_ZoneRec_::org_top, PSH_GlyphRec_::points, PSH_DIR_COMPARE, PSH_DIR_HORIZONTAL, psh_point_is_strong, psh_point_set_fitted, psh_point_set_strong, and y.

Referenced by ps_hints_apply().

static void psh_glyph_find_strong_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 1669 of file pshalgo.c.

References FT_DivFix(), PSH_GlyphRec_::globals, PSH_GlyphRec_::hint_tables, mask, PSH_GlyphRec_::num_points, PSH_GlyphRec_::points, PSH_DIR_HORIZONTAL, PSH_DIR_VERTICAL, psh_hint_table_activate_mask(), psh_hint_table_find_strong_points(), psh_point_is_strong, psh_point_set_strong, PSH_STRONG_THRESHOLD, PSH_STRONG_THRESHOLD_MAXIMUM, and PSH_DimensionRec_::scale_mult.

Referenced by ps_hints_apply().

static FT_Error psh_glyph_init ( PSH_Glyph  glyph,
FT_Outline outline,
PS_Hints  ps_hints,
PSH_Globals  globals 
) [static]

Definition at line 1258 of file pshalgo.c.

References FT_Outline_::contours, PSH_ContourRec_::count, error, FT_CURVE_TAG_ON, FT_MEM_ZERO, FT_NEW_ARRAY, FT_Pos, if(), n, FT_Outline_::n_contours, FT_Outline_::n_points, FT_Outline_::points, points, psh_compute_dir(), psh_corner_is_flat, PSH_DIR_NONE, PSH_POINT_OFF, PSH_POINT_SMOOTH, PSH_ContourRec_::start, FT_Outline_::tags, FT_Vector_::x, and FT_Vector_::y.

Referenced by ps_hints_apply().

static void psh_glyph_interpolate_normal_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 1875 of file pshalgo.c.

References PSH_PointRec_::cur_u, error, FT_FREE, FT_MulDiv(), FT_MulFix(), FT_NEW_ARRAY, FT_Pos, PSH_GlyphRec_::globals, if(), PSH_GlyphRec_::memory, NULL, PSH_GlyphRec_::num_points, PSH_PointRec_::org_u, PSH_GlyphRec_::points, points, PSH_DIR_NONE, PSH_MAX_STRONG_INTERNAL, psh_point_is_extremum, psh_point_is_inflex, psh_point_is_smooth, psh_point_is_strong, psh_point_set_fitted, PSH_POINT_SMOOTH, PSH_DimensionRec_::scale_mult, and u.

Referenced by ps_hints_apply().

static void psh_glyph_interpolate_other_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 2029 of file pshalgo.c.

References PSH_GlyphRec_::contours, PSH_ContourRec_::count, for(), FT_DivFix(), FT_MulFix(), FT_Pos, PSH_GlyphRec_::globals, if(), RooFitShortHand::L(), PSH_GlyphRec_::num_contours, psh_point_is_fitted, PSH_DimensionRec_::scale_delta, PSH_DimensionRec_::scale_mult, start, and PSH_ContourRec_::start.

Referenced by ps_hints_apply().

static void psh_glyph_interpolate_strong_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 1822 of file pshalgo.c.

References FT_MulDiv(), FT_MulFix(), FT_Pos, PSH_GlyphRec_::globals, if(), PSH_GlyphRec_::num_points, PSH_GlyphRec_::points, psh_point_is_edge_max, psh_point_is_edge_min, psh_point_set_fitted, and PSH_DimensionRec_::scale_mult.

Referenced by ps_hints_apply().

static void psh_glyph_load_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 1184 of file pshalgo.c.

References if(), NULL, PSH_GlyphRec_::num_points, PSH_GlyphRec_::outline, FT_Outline_::points, PSH_GlyphRec_::points, FT_Vector_::x, and FT_Vector_::y.

Referenced by ps_hints_apply().

static void psh_glyph_save_points ( PSH_Glyph  glyph,
FT_Int  dimension 
) [static]

Definition at line 1218 of file pshalgo.c.

References if(), n, PSH_GlyphRec_::num_points, PSH_GlyphRec_::outline, FT_Outline_::points, PSH_GlyphRec_::points, psh_point_is_strong, FT_Outline_::tags, x, and FT_Vector_::y.

Referenced by ps_hints_apply().

static void psh_hint_align ( PSH_Hint  hint,
PSH_Globals  globals,
FT_Int  dimension,
PSH_Glyph  glyph 
) [static]

Definition at line 439 of file pshalgo.c.

References align(), PSH_GlyphRec_::do_horz_hints, PSH_GlyphRec_::do_horz_snapping, PSH_GlyphRec_::do_stem_adjust, PSH_GlyphRec_::do_vert_hints, PSH_GlyphRec_::do_vert_snapping, FT_MulFix(), FT_PIX_FLOOR, FT_PIX_ROUND, FT_Pos, len, PSH_HintRec_::parent, PSH_BLUE_ALIGN_BOT, PSH_BLUE_ALIGN_NONE, PSH_BLUE_ALIGN_TOP, psh_blues_snap_stem(), psh_dimension_quantize_len(), psh_hint_is_fitted, psh_hint_set_fitted, psh_hint_snap_stem_side_delta(), PSH_DimensionRec_::scale_delta, and PSH_DimensionRec_::scale_mult.

Referenced by psh_hint_table_align_hints().

static FT_Int psh_hint_overlap ( PSH_Hint  hint1,
PSH_Hint  hint2 
) [static]

Definition at line 55 of file pshalgo.c.

Referenced by psh_hint_table_activate_mask(), and psh_hint_table_record().

static FT_Fixed psh_hint_snap_stem_side_delta ( FT_Fixed  pos,
FT_Fixed  len 
) [static]

Definition at line 424 of file pshalgo.c.

References FT_ABS, and FT_PIX_ROUND.

Referenced by psh_hint_align().

static void psh_hint_table_activate_mask ( PSH_Hint_Table  table,
PS_Mask  hint_mask 
) [static]

Definition at line 246 of file pshalgo.c.

References PS_MaskRec_::bytes, FT_Pos, FT_TRACE0, if(), mask, PS_MaskRec_::num_bits, psh_hint_activate, psh_hint_is_active, psh_hint_overlap(), psh_hint_table_deactivate(), sort(), and val.

Referenced by psh_glyph_find_strong_points().

static void psh_hint_table_align_hints ( PSH_Hint_Table  table,
PSH_Globals  globals,
FT_Int  dimension,
PSH_Glyph  glyph 
) [static]

Definition at line 848 of file pshalgo.c.

References psh_hint_align(), PSH_DimensionRec_::scale_delta, and PSH_DimensionRec_::scale_mult.

Referenced by ps_hints_apply().

static void psh_hint_table_deactivate ( PSH_Hint_Table  table  )  [static]

Definition at line 82 of file pshalgo.c.

References psh_hint_deactivate.

Referenced by psh_hint_table_activate_mask().

static void psh_hint_table_done ( PSH_Hint_Table  table,
FT_Memory  memory 
) [static]

Definition at line 65 of file pshalgo.c.

References FT_FREE.

Referenced by psh_glyph_done().

static void psh_hint_table_find_strong_points ( PSH_Hint_Table  table,
PSH_Point  point,
FT_UInt  count,
FT_Int  threshold,
FT_Int  major_dir 
) [static]

Definition at line 1516 of file pshalgo.c.

References d, for(), FT_Pos, if(), NULL, PSH_DIR_COMPARE, PSH_DIR_HORIZONTAL, PSH_POINT_EDGE_MAX, PSH_POINT_EDGE_MIN, psh_point_is_extremum, psh_point_is_strong, PSH_POINT_NEGATIVE, PSH_POINT_POSITIVE, psh_point_set_strong, and sort().

Referenced by psh_glyph_find_strong_points().

static FT_Error psh_hint_table_init ( PSH_Hint_Table  table,
PS_Hint_Table  hints,
PS_Mask_Table  hint_masks,
PS_Mask_Table  counter_masks,
FT_Memory  memory 
) [static]

Definition at line 173 of file pshalgo.c.

References error, for(), FT_NEW_ARRAY, FT_TRACE0, FT_UNUSED, PS_Hint_TableRec_::hints, mask, PS_Mask_TableRec_::masks, PS_Hint_TableRec_::num_hints, PS_Mask_TableRec_::num_masks, psh_hint_table_record(), psh_hint_table_record_mask(), read, and write.

static void psh_hint_table_record ( PSH_Hint_Table  table,
FT_UInt  idx 
) [static]

Definition at line 98 of file pshalgo.c.

References FT_TRACE0, PSH_HintRec_::parent, psh_hint_activate, psh_hint_is_active, and psh_hint_overlap().

Referenced by psh_hint_table_init(), and psh_hint_table_record_mask().

static void psh_hint_table_record_mask ( PSH_Hint_Table  table,
PS_Mask  hint_mask 
) [static]

Definition at line 145 of file pshalgo.c.

References PS_MaskRec_::bytes, mask, PS_MaskRec_::num_bits, psh_hint_table_record(), and val.

Referenced by psh_hint_table_init().


Generated on Tue Jul 5 15:58:24 2011 for ROOT_528-00b_version by  doxygen 1.5.1