28 #include FT_INTERNAL_DEBUG_H 33 #include FT_INTERNAL_CALC_H 34 #include FT_INTERNAL_OBJECTS_H 37 typedef struct TBBox_Rec_
75 #define CHECK_X( p, bbox ) \ 76 ( p->x < bbox.xMin || p->x > bbox.xMax ) 78 #define CHECK_Y( p, bbox ) \ 79 ( p->y < bbox.yMin || p->y > bbox.yMax ) 105 BBox_Conic_Check(
FT_Pos y1,
111 if ( y1 <= y3 && y2 == y1 )
116 if ( y2 >= y1 && y2 <= y3 )
121 if ( y2 >= y3 && y2 <= y1 )
130 y1 = y3 = y1 -
FT_MulDiv( y2 - y1, y2 - y1, y1 - 2*y2 + y3 );
133 if ( y1 < *min ) *min = y1;
134 if ( y3 > *max ) *max = y3;
172 if (
CHECK_X( control, user->bbox ) )
173 BBox_Conic_Check( user->last.x,
179 if (
CHECK_Y( control, user->bbox ) )
180 BBox_Conic_Check( user->last.y,
220 BBox_Cubic_Check(
FT_Pos p1,
237 while ( q2 > *max || q3 > *max )
240 if ( q1 + q2 > q3 + q4 )
247 q4 = ( q4 + q3 ) / 8;
258 q1 = ( q1 + q2 ) / 8;
264 if ( q1 == q2 && q1 >= q3 )
269 if ( q3 == q4 && q2 <= q4 )
283 while ( q2 < *
min || q3 < *
min )
286 if ( q1 + q2 < q3 + q4 )
293 q4 = ( q4 + q3 ) / 8;
304 q1 = ( q1 + q2 ) / 8;
310 if ( q1 == q2 && q1 <= q3 )
315 if ( q3 == q4 && q2 >= q4 )
326 test_cubic_extrema(
FT_Pos y1,
358 if ( u > 0 && u < 0x10000L )
364 if ( y > *max ) *max =
y;
370 BBox_Cubic_Check(
FT_Pos y1,
378 if ( y1 < *
min ) *
min = y1;
379 else if ( y1 > *max ) *max = y1;
381 if ( y4 < *
min ) *
min = y4;
382 else if ( y4 > *max ) *max = y4;
388 if ( y1 <= y2 && y2 <= y4 && y1 <= y3 && y3 <= y4 )
394 if ( y1 >= y2 && y2 >= y4 && y1 >= y3 && y3 >= y4 )
401 FT_Pos a = y4 - 3*y3 + 3*y2 - y1;
457 test_cubic_extrema( y1, y2, y3, y4, t,
min, max );
471 test_cubic_extrema( y1, y2, y3, y4, t,
min, max );
478 test_cubic_extrema( y1, y2, y3, y4, t,
min, max );
481 test_cubic_extrema( y1, y2, y3, y4, t,
min, max );
527 if (
CHECK_X( control1, user->bbox ) ||
528 CHECK_X( control2, user->bbox ) )
529 BBox_Cubic_Check( user->last.x,
536 if (
CHECK_Y( control1, user->bbox ) ||
537 CHECK_Y( control2, user->bbox ) )
538 BBox_Cubic_Check( user->last.y,
571 return FT_THROW( Invalid_Argument );
629 #ifdef FT_CONFIG_OPTION_PIC 631 Init_Class_bbox_interface(&bbox_interface);
FT_BEGIN_HEADER FT_Outline_Get_BBox(FT_Outline *outline, FT_BBox *abbox)
FT_DivFix(FT_Long a, FT_Long b)
FT_DEFINE_OUTLINE_FUNCS(bbox_interface,(FT_Outline_MoveTo_Func) BBox_Move_To,(FT_Outline_LineTo_Func) BBox_Move_To,(FT_Outline_ConicTo_Func) BBox_Conic_To,(FT_Outline_CubicTo_Func) BBox_Cubic_To, 0, 0) FT_Outline_Get_BBox(FT_Outline *outline
FT_BEGIN_HEADER typedef signed long FT_Pos
GLboolean GLboolean GLboolean GLboolean a
struct TBBox_Rec_ TBBox_Rec
GLint GLint GLint GLint GLint GLint y
return FT_THROW(Missing_Property)
GLint GLint GLint GLint GLint x
#define FT_Outline_ConicTo_Func
GLboolean GLboolean GLboolean b
#define FT_Outline_MoveTo_Func
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
float min(float a, float b)
#define FT_Outline_LineTo_Func
FT_BEGIN_HEADER FT_Outline_Decompose(FT_Outline *outline, const FT_Outline_Funcs *func_interface, void *user)
FT_BEGIN_HEADER FT_SqrtFixed(FT_Int32 x)
FT_MulFix(FT_Long a, FT_Long b)
#define FT_Outline_CubicTo_Func
#define FT_CURVE_TAG(flag)