ReactOS 0.4.16-dev-122-g325d74c
test_bbox.c File Reference
#include <ft2build.h>
#include <time.h>
Include dependency graph for test_bbox.c:

Go to the source code of this file.

Macros

#define XSCALE   65536
 
#define XX(x)   ((FT_Pos)(x*XSCALE))
 
#define XVEC(x, y)   { XX(x), XX(y) }
 
#define XVAL(x)   ((x)/(1.0*XSCALE))
 
#define REPEAT   1000000L
 

Functions

static long get_time (void)
 
static void dump_outline (FT_Outline *outline)
 
static void profile_outline (FT_Outline *outline, long repeat)
 
int main (int argc, char **argv)
 

Variables

static FT_Vector dummy_vec_1 [4]
 
static char dummy_tag_1 [4]
 
static short dummy_contour_1 [1]
 
static FT_Outline dummy_outline_1
 
static FT_Vector dummy_vec_2 [4]
 
static FT_Outline dummy_outline_2
 
static FT_Vector dummy_vec_3 [4]
 
static FT_Outline dummy_outline_3
 

Macro Definition Documentation

◆ REPEAT

#define REPEAT   1000000L

Definition at line 173 of file test_bbox.c.

◆ XSCALE

#define XSCALE   65536

Definition at line 26 of file test_bbox.c.

◆ XVAL

#define XVAL (   x)    ((x)/(1.0*XSCALE))

Definition at line 29 of file test_bbox.c.

◆ XVEC

#define XVEC (   x,
  y 
)    { XX(x), XX(y) }

Definition at line 28 of file test_bbox.c.

◆ XX

#define XX (   x)    ((FT_Pos)(x*XSCALE))

Definition at line 27 of file test_bbox.c.

Function Documentation

◆ dump_outline()

static void dump_outline ( FT_Outline outline)
static

Definition at line 112 of file test_bbox.c.

113 {
115
116 /* compute and display cbox */
118 printf( "cbox = [%.2f %.2f %.2f %.2f]\n",
119 XVAL( bbox.xMin ),
120 XVAL( bbox.yMin ),
121 XVAL( bbox.xMax ),
122 XVAL( bbox.yMax ) );
123
124 /* compute and display bbox */
126 printf( "bbox = [%.2f %.2f %.2f %.2f]\n",
127 XVAL( bbox.xMin ),
128 XVAL( bbox.yMin ),
129 XVAL( bbox.xMax ),
130 XVAL( bbox.yMax ) );
131 }
#define printf
Definition: freeldr.h:97
FT_BBox bbox
Definition: ftbbox.c:446
FT_BEGIN_HEADER FT_Outline_Get_BBox(FT_Outline *outline, FT_BBox *abbox)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
Definition: ftoutln.c:478
FT_Pos xMin
Definition: ftimage.h:117
FT_Pos yMax
Definition: ftimage.h:118
FT_Pos yMin
Definition: ftimage.h:117
FT_Pos xMax
Definition: ftimage.h:118
Definition: mesh.c:5330
#define XVAL(x)
Definition: test_bbox.c:29

◆ get_time()

static long get_time ( void  )
static

Definition at line 16 of file test_bbox.c.

17 {
18 return clock() * 10000L / CLOCKS_PER_SEC;
19 }
#define CLOCKS_PER_SEC
Definition: time.h:81
_Check_return_ _CRTIMP clock_t __cdecl clock(void)
Definition: clock.c:23

Referenced by profile_outline().

◆ main()

int main ( int argc  ,
char **  argv 
)

Definition at line 175 of file test_bbox.c.

176 {
177 printf( "outline #1\n" );
179
180 printf( "outline #2\n" );
182
183 printf( "outline #3\n" );
185
186 return 0;
187 }
#define REPEAT
Definition: test_bbox.c:173
static FT_Outline dummy_outline_2
Definition: test_bbox.c:80
static void profile_outline(FT_Outline *outline, long repeat)
Definition: test_bbox.c:136
static FT_Outline dummy_outline_3
Definition: test_bbox.c:100
static FT_Outline dummy_outline_1
Definition: test_bbox.c:60

◆ profile_outline()

static void profile_outline ( FT_Outline outline,
long  repeat 
)
static

Definition at line 136 of file test_bbox.c.

138 {
140 long count;
141 long time0;
142
143 time0 = get_time();
144 for ( count = repeat; count > 0; count-- )
146
147 time0 = get_time() - time0;
148 printf( "time = %6.3f cbox = [%8.4f %8.4f %8.4f %8.4f]\n",
149 ((double)time0/10000.0),
150 XVAL( bbox.xMin ),
151 XVAL( bbox.yMin ),
152 XVAL( bbox.xMax ),
153 XVAL( bbox.yMax ) );
154 printf( "cbox_hex = [%08X %08X %08X %08X]\n",
156
157
158 time0 = get_time();
159 for ( count = repeat; count > 0; count-- )
161
162 time0 = get_time() - time0;
163 printf( "time = %6.3f bbox = [%8.4f %8.4f %8.4f %8.4f]\n",
164 ((double)time0/10000.0),
165 XVAL( bbox.xMin ),
166 XVAL( bbox.yMin ),
167 XVAL( bbox.xMax ),
168 XVAL( bbox.yMax ) );
169 printf( "bbox_hex = [%08X %08X %08X %08X]\n",
171 }
GLuint GLuint GLsizei count
Definition: gl.h:1545
static long get_time(void)
Definition: test_bbox.c:16
static int repeat
Definition: xmllint.c:137

Referenced by main().

Variable Documentation

◆ dummy_contour_1

short dummy_contour_1[1]
static
Initial value:
=
{
3
}

Definition at line 55 of file test_bbox.c.

◆ dummy_outline_1

FT_Outline dummy_outline_1
static
Initial value:
=
{
1,
4,
0
}
static char dummy_tag_1[4]
Definition: test_bbox.c:47
static FT_Vector dummy_vec_1[4]
Definition: test_bbox.c:32
static short dummy_contour_1[1]
Definition: test_bbox.c:55

Definition at line 60 of file test_bbox.c.

Referenced by main().

◆ dummy_outline_2

FT_Outline dummy_outline_2
static
Initial value:
=
{
1,
4,
0
}
static FT_Vector dummy_vec_2[4]
Definition: test_bbox.c:72

Definition at line 80 of file test_bbox.c.

Referenced by main().

◆ dummy_outline_3

FT_Outline dummy_outline_3
static
Initial value:
=
{
1,
4,
0
}
static FT_Vector dummy_vec_3[4]
Definition: test_bbox.c:92

Definition at line 100 of file test_bbox.c.

Referenced by main().

◆ dummy_tag_1

char dummy_tag_1[4]
static
Initial value:
=
{
}
#define FT_CURVE_TAG_CUBIC
Definition: ftimage.h:455
#define FT_CURVE_TAG_ON
Definition: ftimage.h:453

Definition at line 47 of file test_bbox.c.

◆ dummy_vec_1

FT_Vector dummy_vec_1[4]
static
Initial value:
=
{
XVEC( 408.9111, 535.3164 ),
XVEC( 455.8887, 634.396 ),
XVEC( -37.8765, 786.2207 ),
}
#define XVEC(x, y)
Definition: test_bbox.c:28

Definition at line 32 of file test_bbox.c.

◆ dummy_vec_2

FT_Vector dummy_vec_2[4]
static
Initial value:
=
{
XVEC( 100.0, 100.0 ),
XVEC( 100.0, 200.0 ),
XVEC( 200.0, 200.0 ),
}

Definition at line 72 of file test_bbox.c.

◆ dummy_vec_3

FT_Vector dummy_vec_3[4]
static
Initial value:
=
{
XVEC( 100.0, 127.0 ),
XVEC( 200.0, 127.0 ),
XVEC( 0.0, 136.0 ),
}

Definition at line 92 of file test_bbox.c.