21#include FT_INTERNAL_OBJECTS_H
22#include FT_INTERNAL_CALC_H
23#include FT_INTERNAL_DEBUG_H
24#include FT_TRIGONOMETRY_H
34#define FT_COMPONENT outline
49#define SCALED( x ) ( ( (x) < 0 ? -( -(x) << shift ) \
50 : ( (x) << shift ) ) - delta )
73 if ( !func_interface )
76 shift = func_interface->shift;
77 delta = func_interface->delta;
85 FT_TRACE5((
"FT_Outline_Decompose: Outline %d\n",
n ));
108 goto Invalid_Outline;
125 v_start.
x = ( v_start.
x + v_last.
x ) / 2;
126 v_start.
y = ( v_start.
y + v_last.
y ) / 2;
135 v_start.
x / 64.0, v_start.
y / 64.0 ));
136 error = func_interface->move_to( &v_start,
user );
185 " with control (%.2f, %.2f)\n",
187 v_control.
x / 64.0, v_control.
y / 64.0 ));
188 error = func_interface->conic_to( &v_control, &
vec,
user );
195 goto Invalid_Outline;
197 v_middle.
x = ( v_control.
x +
vec.
x ) / 2;
198 v_middle.
y = ( v_control.
y +
vec.
y ) / 2;
201 " with control (%.2f, %.2f)\n",
202 v_middle.
x / 64.0, v_middle.
y / 64.0,
203 v_control.
x / 64.0, v_control.
y / 64.0 ));
204 error = func_interface->conic_to( &v_control, &v_middle,
user );
213 " with control (%.2f, %.2f)\n",
214 v_start.
x / 64.0, v_start.
y / 64.0,
215 v_control.
x / 64.0, v_control.
y / 64.0 ));
216 error = func_interface->conic_to( &v_control, &v_start,
user );
226 goto Invalid_Outline;
246 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
248 vec1.
x / 64.0, vec1.
y / 64.0,
249 vec2.
x / 64.0, vec2.
y / 64.0 ));
250 error = func_interface->cubic_to( &vec1, &vec2, &
vec,
user );
257 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
258 v_start.
x / 64.0, v_start.
y / 64.0,
259 vec1.
x / 64.0, vec1.
y / 64.0,
260 vec2.
x / 64.0, vec2.
y / 64.0 ));
261 error = func_interface->cubic_to( &vec1, &vec2, &v_start,
user );
269 v_start.
x / 64.0, v_start.
y / 64.0 ));
270 error = func_interface->line_to( &v_start,
user );
279 FT_TRACE5((
"FT_Outline_Decompose: Done\n",
n ));
305 return FT_THROW( Invalid_Library_Handle );
309 if ( !anoutline || !
memory )
310 return FT_THROW( Invalid_Argument );
314 if ( numContours < 0 ||
315 (
FT_UInt)numContours > numPoints )
316 return FT_THROW( Invalid_Argument );
326 anoutline->n_points = (
FT_Short)numPoints;
327 anoutline->n_contours = (
FT_Short)numContours;
354 if ( n_points == 0 && n_contours == 0 )
358 if ( n_points <= 0 || n_contours <= 0 )
362 for (
n = 0;
n < n_contours;
n++ )
367 if ( end <= end0 || end >= n_points )
373 if (
end != n_points - 1 )
381 return FT_THROW( Invalid_Argument );
399 return FT_THROW( Invalid_Argument );
417 target->flags &= ~FT_OUTLINE_OWNER;
418 target->flags |= is_owner;
434 return FT_THROW( Invalid_Library_Handle );
442 return FT_THROW( Invalid_Argument );
462 FT_Pos xMin, yMin, xMax, yMax;
480 xMin = xMax =
vec->
x;
481 yMin = yMax =
vec->
y;
490 if (
x < xMin ) xMin =
x;
491 if (
x > xMax ) xMax =
x;
494 if (
y < yMin ) yMin =
y;
495 if (
y > yMax ) yMax =
y;
606 return FT_THROW( Invalid_Library_Handle );
612 return FT_THROW( Invalid_Argument );
615 if ( cbox.
xMin < -0x1000000L || cbox.
yMin < -0x1000000L ||
616 cbox.
xMax > 0x1000000L || cbox.
yMax > 0x1000000L )
656 return FT_THROW( Invalid_Argument );
718#define FT_OUTLINE_GET_CONTOUR( outline, c, first, last ) \
721 (first) = ( c > 0 ) ? (outline)->points + \
722 (outline)->contours[c - 1] + 1 \
723 : (outline)->points; \
724 (last) = (outline)->points + (outline)->contours[c]; \
758 if ( intersect >= 0 )
760 if ( intersect == 0 &&
a->y ==
point->
y )
770 x =
a->x + (
b->x -
a->x ) * (
point->
y -
a->y ) / (
b->y -
a->y );
839 if ( ft_contour_enclosed(
outline,
i ) )
861 prev = ( xmin_point ==
first ) ?
last : xmin_point - 1;
864 if (
FT_Atan2( prev->
x - xmin_point->
x, prev->
y - xmin_point->
y ) >
872 else if ( orient != o )
910 if ( xstrength == 0 && ystrength == 0 )
917 return FT_THROW( Invalid_Argument );
936 in.x =
in.y = anchor.
x = anchor.
y = 0;
1033 FT_BBox cbox = { 0, 0, 0, 0 };
1057 xshift =
FT_MAX( xshift, 0 );
1060 yshift =
FT_MAX( yshift, 0 );
1080 v_cur.
x + v_prev.
x ) );
1090 else if (
area < 0 )
void user(int argc, const char *argv[])
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_MulFix(FT_Long a, FT_Long b)
FT_Vector_NormLen(FT_Vector *vector)
#define FT_TRACE5(varformat)
#define FT_CURVE_TAG_CUBIC
#define FT_RASTER_FLAG_AA
#define FT_CURVE_TAG_CONIC
#define FT_CURVE_TAG(flag)
#define FT_OUTLINE_POINTS_MAX
#define FT_OUTLINE_REVERSE_FILL
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_NEW_ARRAY(ptr, count)
#define FT_ARRAY_COPY(dest, source, count)
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
static const FT_Outline null_outline
FT_Outline_Check(FT_Outline *outline)
FT_Outline_EmboldenXY(FT_Outline *outline, FT_Pos xstrength, FT_Pos ystrength)
FT_Outline_Reverse(FT_Outline *outline)
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
FT_Outline_Get_Bitmap(FT_Library library, FT_Outline *outline, const FT_Bitmap *abitmap)
FT_Outline_Get_Orientation(FT_Outline *outline)
FT_Outline_New(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline)
FT_Outline_Decompose(FT_Outline *outline, const FT_Outline_Funcs *func_interface, void *user)
FT_Vector_Transform(FT_Vector *vector, const FT_Matrix *matrix)
FT_Outline_Embolden(FT_Outline *outline, FT_Pos strength)
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
FT_Outline_Done(FT_Library library, FT_Outline *outline)
FT_Outline_Render(FT_Library library, FT_Outline *outline, FT_Raster_Params *params)
FT_Outline_Copy(const FT_Outline *source, FT_Outline *target)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
@ FT_ORIENTATION_POSTSCRIPT
@ FT_ORIENTATION_TRUETYPE
enum FT_Orientation_ FT_Orientation
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_Atan2(FT_Fixed x, FT_Fixed y)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLdouble GLdouble GLdouble GLdouble q
GLboolean GLboolean GLboolean b
GLenum const GLfloat * params
GLboolean GLboolean GLboolean GLboolean a
GLsizei const GLfloat * points
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
static char memory[1024 *256]
static Real area(Real A[2], Real B[2], Real C[2])
static unsigned __int64 next
FT_Raster_Render_Func raster_render
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out