zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ftstroke.c File Reference
#include <ft2build.h>
#include <FT_STROKER_H>
#include <FT_TRIGONOMETRY_H>
#include <FT_OUTLINE_H>
#include <FT_INTERNAL_MEMORY_H>
#include <FT_INTERNAL_DEBUG_H>
#include <FT_INTERNAL_OBJECTS_H>
#include "basepic.h"

Go to the source code of this file.

Macros

#define FT_ARC_CUBIC_ANGLE   ( FT_ANGLE_PI / 2 )
 
#define FT_EPSILON   2
 
#define FT_IS_SMALL(x)   ( (x) > -FT_EPSILON && (x) < FT_EPSILON )
 
#define FT_SIDE_TO_ROTATE(s)   ( FT_ANGLE_PI2 - (s) * FT_ANGLE_PI )
 
#define FT_SMALL_CONIC_THRESHOLD   ( FT_ANGLE_PI / 6 )
 
#define FT_SMALL_CUBIC_THRESHOLD   ( FT_ANGLE_PI / 8 )
 
#define FT_STROKE_TAG_BEGIN_END   ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END )
 

Typedefs

typedef struct
FT_StrokeBorderRec_ * 
FT_StrokeBorder
 
typedef struct FT_StrokeBorderRec_ FT_StrokeBorderRec
 
typedef struct FT_StrokerRec_ FT_StrokerRec
 
typedef enum FT_StrokeTags_ FT_StrokeTags
 

Enumerations

enum  FT_StrokeTags_ { FT_STROKE_TAG_ON = 1, FT_STROKE_TAG_CUBIC = 2, FT_STROKE_TAG_BEGIN = 4, FT_STROKE_TAG_END = 8 }
 

Functions

static FT_Angle ft_angle_mean (FT_Angle angle1, FT_Angle angle2)
 
static FT_Bool ft_conic_is_small_enough (FT_Vector *base, FT_Angle *angle_in, FT_Angle *angle_out)
 
static void ft_conic_split (FT_Vector *base)
 
static FT_Bool ft_cubic_is_small_enough (FT_Vector *base, FT_Angle *angle_in, FT_Angle *angle_mid, FT_Angle *angle_out)
 
static void ft_cubic_split (FT_Vector *base)
 
 FT_Glyph_Stroke (FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool destroy)
 
 FT_Glyph_StrokeBorder (FT_Glyph *pglyph, FT_Stroker stroker, FT_Bool inside, FT_Bool destroy)
 
 FT_Outline_GetInsideBorder (FT_Outline *outline)
 
 FT_Outline_GetOutsideBorder (FT_Outline *outline)
 
static FT_Pos ft_pos_abs (FT_Pos x)
 
static FT_Error ft_stroke_border_arcto (FT_StrokeBorder border, FT_Vector *center, FT_Fixed radius, FT_Angle angle_start, FT_Angle angle_diff)
 
static void ft_stroke_border_close (FT_StrokeBorder border, FT_Bool reverse)
 
static FT_Error ft_stroke_border_conicto (FT_StrokeBorder border, FT_Vector *control, FT_Vector *to)
 
static FT_Error ft_stroke_border_cubicto (FT_StrokeBorder border, FT_Vector *control1, FT_Vector *control2, FT_Vector *to)
 
static void ft_stroke_border_done (FT_StrokeBorder border)
 
static void ft_stroke_border_export (FT_StrokeBorder border, FT_Outline *outline)
 
static FT_Error ft_stroke_border_get_counts (FT_StrokeBorder border, FT_UInt *anum_points, FT_UInt *anum_contours)
 
static FT_Error ft_stroke_border_grow (FT_StrokeBorder border, FT_UInt new_points)
 
static void ft_stroke_border_init (FT_StrokeBorder border, FT_Memory memory)
 
static FT_Error ft_stroke_border_lineto (FT_StrokeBorder border, FT_Vector *to, FT_Bool movable)
 
static FT_Error ft_stroke_border_moveto (FT_StrokeBorder border, FT_Vector *to)
 
static void ft_stroke_border_reset (FT_StrokeBorder border)
 
static FT_Error ft_stroker_add_reverse_left (FT_Stroker stroker, FT_Bool open)
 
static FT_Error ft_stroker_arcto (FT_Stroker stroker, FT_Int side)
 
 FT_Stroker_BeginSubPath (FT_Stroker stroker, FT_Vector *to, FT_Bool open)
 
static FT_Error ft_stroker_cap (FT_Stroker stroker, FT_Angle angle, FT_Int side)
 
 FT_Stroker_ConicTo (FT_Stroker stroker, FT_Vector *control, FT_Vector *to)
 
 FT_Stroker_CubicTo (FT_Stroker stroker, FT_Vector *control1, FT_Vector *control2, FT_Vector *to)
 
 FT_Stroker_Done (FT_Stroker stroker)
 
 FT_Stroker_EndSubPath (FT_Stroker stroker)
 
 FT_Stroker_Export (FT_Stroker stroker, FT_Outline *outline)
 
 FT_Stroker_ExportBorder (FT_Stroker stroker, FT_StrokerBorder border, FT_Outline *outline)
 
 FT_Stroker_GetBorderCounts (FT_Stroker stroker, FT_StrokerBorder border, FT_UInt *anum_points, FT_UInt *anum_contours)
 
 FT_Stroker_GetCounts (FT_Stroker stroker, FT_UInt *anum_points, FT_UInt *anum_contours)
 
static FT_Error ft_stroker_inside (FT_Stroker stroker, FT_Int side, FT_Fixed line_length)
 
 FT_Stroker_LineTo (FT_Stroker stroker, FT_Vector *to)
 
 FT_Stroker_New (FT_Library library, FT_Stroker *astroker)
 
static FT_Error ft_stroker_outside (FT_Stroker stroker, FT_Int side, FT_Fixed line_length)
 
 FT_Stroker_ParseOutline (FT_Stroker stroker, FT_Outline *outline, FT_Bool opened)
 
static FT_Error ft_stroker_process_corner (FT_Stroker stroker, FT_Fixed line_length)
 
 FT_Stroker_Rewind (FT_Stroker stroker)
 
 FT_Stroker_Set (FT_Stroker stroker, FT_Fixed radius, FT_Stroker_LineCap line_cap, FT_Stroker_LineJoin line_join, FT_Fixed miter_limit)
 
static FT_Error ft_stroker_subpath_start (FT_Stroker stroker, FT_Angle start_angle, FT_Fixed line_length)
 

Variables

const FT_Glyph_Class ft_outline_glyph_class
 

Macro Definition Documentation

#define FT_ARC_CUBIC_ANGLE   ( FT_ANGLE_PI / 2 )

Definition at line 521 of file ftstroke.c.

Referenced by ft_stroke_border_arcto().

#define FT_EPSILON   2

Definition at line 65 of file ftstroke.c.

#define FT_IS_SMALL (   x)    ( (x) > -FT_EPSILON && (x) < FT_EPSILON )
#define FT_SIDE_TO_ROTATE (   s)    ( FT_ANGLE_PI2 - (s) * FT_ANGLE_PI )
#define FT_SMALL_CONIC_THRESHOLD   ( FT_ANGLE_PI / 6 )

Definition at line 62 of file ftstroke.c.

Referenced by ft_conic_is_small_enough(), and FT_Stroker_ConicTo().

#define FT_SMALL_CUBIC_THRESHOLD   ( FT_ANGLE_PI / 8 )

Definition at line 63 of file ftstroke.c.

Referenced by ft_cubic_is_small_enough(), and FT_Stroker_CubicTo().

#define FT_STROKE_TAG_BEGIN_END   ( FT_STROKE_TAG_BEGIN | FT_STROKE_TAG_END )

Definition at line 300 of file ftstroke.c.

Referenced by ft_stroker_add_reverse_left().

Typedef Documentation

typedef struct FT_StrokeBorderRec_ * FT_StrokeBorder
typedef struct FT_StrokeBorderRec_ FT_StrokeBorderRec
typedef struct FT_StrokerRec_ FT_StrokerRec

Enumeration Type Documentation

Enumerator
FT_STROKE_TAG_ON 
FT_STROKE_TAG_CUBIC 
FT_STROKE_TAG_BEGIN 
FT_STROKE_TAG_END 

Definition at line 291 of file ftstroke.c.

Function Documentation

static FT_Angle ft_angle_mean ( FT_Angle  angle1,
FT_Angle  angle2 
)
static

Definition at line 180 of file ftstroke.c.

References FT_Angle_Diff().

Referenced by ft_cubic_is_small_enough(), and FT_Stroker_CubicTo().

static FT_Bool ft_conic_is_small_enough ( FT_Vector base,
FT_Angle angle_in,
FT_Angle angle_out 
)
static
static void ft_conic_split ( FT_Vector base)
static

Definition at line 78 of file ftstroke.c.

References FT_Pos, FT_Vector_::x, and FT_Vector_::y.

Referenced by FT_Stroker_ConicTo().

static FT_Bool ft_cubic_is_small_enough ( FT_Vector base,
FT_Angle angle_in,
FT_Angle angle_mid,
FT_Angle angle_out 
)
static
static void ft_cubic_split ( FT_Vector base)
static

Definition at line 149 of file ftstroke.c.

References d, FT_Pos, FT_Vector_::x, and FT_Vector_::y.

Referenced by FT_Stroker_CubicTo().

FT_Outline_GetInsideBorder ( FT_Outline outline)
FT_Outline_GetOutsideBorder ( FT_Outline outline)
static FT_Error ft_stroke_border_arcto ( FT_StrokeBorder  border,
FT_Vector center,
FT_Fixed  radius,
FT_Angle  angle_start,
FT_Angle  angle_diff 
)
static
static void ft_stroke_border_close ( FT_StrokeBorder  border,
FT_Bool  reverse 
)
static

Definition at line 347 of file ftstroke.c.

References FALSE, FT_ASSERT, FT_STROKE_TAG_BEGIN, and FT_STROKE_TAG_END.

Referenced by ft_stroke_border_moveto(), and FT_Stroker_EndSubPath().

static FT_Error ft_stroke_border_conicto ( FT_StrokeBorder  border,
FT_Vector control,
FT_Vector to 
)
static

Definition at line 455 of file ftstroke.c.

References error, FALSE, FT_ASSERT, ft_stroke_border_grow(), FT_STROKE_TAG_ON, and vec.

Referenced by FT_Stroker_ConicTo().

static FT_Error ft_stroke_border_cubicto ( FT_StrokeBorder  border,
FT_Vector control1,
FT_Vector control2,
FT_Vector to 
)
static
static void ft_stroke_border_done ( FT_StrokeBorder  border)
static

Definition at line 634 of file ftstroke.c.

References FALSE, and FT_FREE.

Referenced by FT_Stroker_Done().

static FT_Error ft_stroke_border_get_counts ( FT_StrokeBorder  border,
FT_UInt anum_points,
FT_UInt anum_contours 
)
static

Definition at line 650 of file ftstroke.c.

References error, FT_Err_Ok, FT_STROKE_TAG_BEGIN, FT_STROKE_TAG_END, and TRUE.

Referenced by FT_Stroker_GetBorderCounts(), and FT_Stroker_GetCounts().

static FT_Error ft_stroke_border_grow ( FT_StrokeBorder  border,
FT_UInt  new_points 
)
static
static void ft_stroke_border_init ( FT_StrokeBorder  border,
FT_Memory  memory 
)
static

Definition at line 610 of file ftstroke.c.

References FALSE, and NULL.

Referenced by FT_Stroker_New().

static FT_Error ft_stroke_border_moveto ( FT_StrokeBorder  border,
FT_Vector to 
)
static

Definition at line 595 of file ftstroke.c.

References FALSE, ft_stroke_border_close(), and ft_stroke_border_lineto().

Referenced by ft_stroker_subpath_start().

static void ft_stroke_border_reset ( FT_StrokeBorder  border)
static

Definition at line 625 of file ftstroke.c.

References FALSE.

Referenced by FT_Stroker_Rewind().

static FT_Error ft_stroker_add_reverse_left ( FT_Stroker  stroker,
FT_Bool  open 
)
static
static FT_Error ft_stroker_arcto ( FT_Stroker  stroker,
FT_Int  side 
)
static
FT_Stroker_BeginSubPath ( FT_Stroker  stroker,
FT_Vector to,
FT_Bool  open 
)

Definition at line 1758 of file ftstroke.c.

References FT_BOOL, FT_Err_Ok, FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, and TRUE.

Referenced by FT_Stroker_ParseOutline().

FT_Stroker_Done ( FT_Stroker  stroker)

Definition at line 858 of file ftstroke.c.

References FT_FREE, ft_stroke_border_done(), and NULL.

FT_Stroker_Export ( FT_Stroker  stroker,
FT_Outline outline 
)

Definition at line 2029 of file ftstroke.c.

References FT_STROKER_BORDER_LEFT, FT_STROKER_BORDER_RIGHT, and FT_Stroker_ExportBorder().

Referenced by FT_Glyph_Stroke().

FT_Stroker_ExportBorder ( FT_Stroker  stroker,
FT_StrokerBorder  border,
FT_Outline outline 
)
FT_Stroker_GetBorderCounts ( FT_Stroker  stroker,
FT_StrokerBorder  border,
FT_UInt anum_points,
FT_UInt anum_contours 
)

Definition at line 1947 of file ftstroke.c.

References error, FT_Err_Invalid_Argument, and ft_stroke_border_get_counts().

Referenced by FT_Glyph_StrokeBorder().

FT_Stroker_GetCounts ( FT_Stroker  stroker,
FT_UInt anum_points,
FT_UInt anum_contours 
)

Definition at line 1978 of file ftstroke.c.

References error, and ft_stroke_border_get_counts().

Referenced by FT_Glyph_Stroke().

FT_Stroker_New ( FT_Library  library,
FT_Stroker astroker 
)

Definition at line 789 of file ftstroke.c.

References error, FT_Err_Invalid_Argument, FT_NEW, ft_stroke_border_init(), library, and NULL.

static FT_Error ft_stroker_process_corner ( FT_Stroker  stroker,
FT_Fixed  line_length 
)
static
FT_Stroker_Rewind ( FT_Stroker  stroker)

Definition at line 845 of file ftstroke.c.

References ft_stroke_border_reset().

Referenced by FT_Stroker_ParseOutline(), and FT_Stroker_Set().

FT_Stroker_Set ( FT_Stroker  stroker,
FT_Fixed  radius,
FT_Stroker_LineCap  line_cap,
FT_Stroker_LineJoin  line_join,
FT_Fixed  miter_limit 
)

Definition at line 819 of file ftstroke.c.

References FT_Stroker_Rewind().

static FT_Error ft_stroker_subpath_start ( FT_Stroker  stroker,
FT_Angle  start_angle,
FT_Fixed  line_length 
)
static

Variable Documentation

const FT_Glyph_Class ft_outline_glyph_class