31 #include FT_INTERNAL_CALC_H
32 #include FT_INTERNAL_OBJECTS_H
35 typedef struct TBBox_Rec_
73 #define CHECK_X( p, bbox ) \
74 ( p->x < bbox.xMin || p->x > bbox.xMax )
76 #define CHECK_Y( p, bbox ) \
77 ( p->y < bbox.yMin || p->y > bbox.yMax )
109 if ( y1 <= y3 && y2 == y1 )
114 if ( y2 >= y1 && y2 <= y3 )
119 if ( y2 >= y3 && y2 <= y1 )
128 y1 = y3 = y1 -
FT_MulDiv( y2 - y1, y2 - y1, y1 - 2*y2 + y3 );
131 if ( y1 < *min ) *min =
y1;
132 if ( y3 > *max ) *max = y3;
170 if (
CHECK_X( control, user->bbox ) )
177 if (
CHECK_Y( control, user->bbox ) )
225 FT_Pos stack[32*3 + 1], *arc;
245 if ( y1 == y2 && y1 == y3 )
266 arc[1] = y1 = ( y1 +
y2 ) / 2;
267 arc[5] = y4 = ( y4 + y3 ) / 2;
268 y2 = ( y2 + y3 ) / 2;
269 arc[2] = y1 = ( y1 +
y2 ) / 2;
270 arc[4] = y4 = ( y4 +
y2 ) / 2;
271 arc[3] = ( y1 + y4 ) / 2;
277 if ( y1 < *min ) *min =
y1;
278 if ( y4 > *max ) *max = y4;
283 }
while ( arc >= stack );
321 if ( u > 0 && u < 0x10000L )
326 if ( y < *min ) *min =
y;
327 if ( y > *max ) *max =
y;
341 if ( y1 < *min ) *min =
y1;
342 else if ( y1 > *max ) *max =
y1;
344 if ( y4 < *min ) *min = y4;
345 else if ( y4 > *max ) *max = y4;
351 if ( y1 <= y2 && y2 <= y4 && y1 <= y3 && y3 <= y4 )
357 if ( y1 >= y2 && y2 >= y4 && y1 >= y3 && y3 >= y4 )
434 if ( t1 > 0x7FFFFFUL )
441 }
while ( t1 > 0x7FFFFFUL );
449 else if ( t1 < 0x400000UL )
456 }
while ( t1 < 0x400000UL );
540 if (
CHECK_X( control1, user->bbox ) ||
541 CHECK_X( control2, user->bbox ) )
549 if (
CHECK_Y( control1, user->bbox ) ||
550 CHECK_Y( control2, user->bbox ) )
590 if ( outline->n_points == 0 || outline->n_contours <= 0 )
592 abbox->xMin = abbox->xMax = 0;
593 abbox->yMin = abbox->yMax = 0;
601 vec = outline->points;
606 for ( n = 1; n < outline->n_points; n++ )
642 #ifdef FT_CONFIG_OPTION_PIC
644 Init_Class_bbox_interface(&bbox_interface);
FT_BEGIN_HEADER FT_Outline_Get_BBox(FT_Outline *outline, FT_BBox *abbox)
static int BBox_Move_To(FT_Vector *to, TBBox_Rec *user)
FT_DivFix(FT_Long a, FT_Long b)
FT_BEGIN_HEADER typedef signed long FT_Pos
static void BBox_Conic_Check(FT_Pos y1, FT_Pos y2, FT_Pos y3, FT_Pos *min, FT_Pos *max)
struct TBBox_Rec_ TBBox_Rec
return FT_Err_Invalid_Argument
GLboolean GLboolean GLboolean GLboolean a
#define FT_Outline_ConicTo_Func
return Display return Display Bool Bool int d
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLfixed GLfixed GLfixed y2
#define FT_Outline_MoveTo_Func
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
static int BBox_Cubic_To(FT_Vector *control1, FT_Vector *control2, FT_Vector *to, TBBox_Rec *user)
#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)
static void BBox_Cubic_Check(FT_Pos y1, FT_Pos y2, FT_Pos y3, FT_Pos y4, FT_Pos *min, FT_Pos *max)
EGLSurface EGLint EGLint y
FT_MulFix(FT_Long a, FT_Long b)
GLdouble GLdouble GLdouble b
#define FT_DEFINE_OUTLINE_FUNCS(class_, move_to_, line_to_, conic_to_,cubic_to_, shift_, delta_)
#define FT_Outline_CubicTo_Func
static void test_cubic_extrema(FT_Pos y1, FT_Pos y2, FT_Pos y3, FT_Pos y4, FT_Fixed u, FT_Pos *min, FT_Pos *max)
#define FT_CURVE_TAG(flag)
static int BBox_Conic_To(FT_Vector *control, FT_Vector *to, TBBox_Rec *user)
return FT_Err_Invalid_Outline