* src/sdf/ftsdf.c (sdf_shape_dump): Use `FT_TRACEX' instead of `printf'.

This commit is contained in:
Anuj Verma 2020-06-26 11:34:41 +05:30 committed by anujverma
parent 63c2ac5fae
commit f02d1acb89
2 changed files with 44 additions and 35 deletions

View File

@ -1,3 +1,8 @@
2020-06-26 Anuj Verma <anujv@iitbhilai.ac.in>
* src/sdf/ftsdf.c (sdf_shape_dump): Use `FT_TRACEX'
instead of `printf'.
2020-06-26 Anuj Verma <anujv@iitbhilai.ac.in> 2020-06-26 Anuj Verma <anujv@iitbhilai.ac.in>
* src/sdf/ftsdf.c (sdf_shape_dump): Added function to * src/sdf/ftsdf.c (sdf_shape_dump): Added function to

View File

@ -469,14 +469,14 @@
if ( !shape ) if ( !shape )
{ {
printf( "[sdf] sdf_shape_dump: null shape\n" ); FT_TRACE5(( "[sdf] sdf_shape_dump: null shape\n" ));
return; return;
} }
contour_list = shape->contours; contour_list = shape->contours;
printf( "-------------------------------------------------\n" ); FT_TRACE5(( "-------------------------------------------------\n" ));
printf( "[sdf] sdf_shape_dump:\n" ); FT_TRACE5(( "[sdf] sdf_shape_dump:\n" ));
while ( contour_list.head != NULL ) while ( contour_list.head != NULL )
{ {
@ -486,45 +486,45 @@
edge_list = contour->edges; edge_list = contour->edges;
printf( "Contour %d\n", num_contours ); FT_TRACE5(( "Contour %d\n", num_contours ));
while ( edge_list.head != NULL ) while ( edge_list.head != NULL )
{ {
SDF_Edge* edge = (SDF_Edge*)edge_list.head->data; SDF_Edge* edge = (SDF_Edge*)edge_list.head->data;
printf( " Edge %d\n", num_edges ); FT_TRACE5(( " Edge %d\n", num_edges ));
switch (edge->edge_type) { switch (edge->edge_type) {
case SDF_EDGE_LINE: case SDF_EDGE_LINE:
printf( " Edge Type: Line\n" ); FT_TRACE5(( " Edge Type: Line\n" ));
printf( " ---------------\n" ); FT_TRACE5(( " ---------------\n" ));
printf( " Start Pos: %d, %d\n", edge->start_pos.x, FT_TRACE5(( " Start Pos: %d, %d\n", edge->start_pos.x,
edge->start_pos.y ); edge->start_pos.y ));
printf( " End Pos : %d, %d\n", edge->end_pos.x, FT_TRACE5(( " End Pos : %d, %d\n", edge->end_pos.x,
edge->end_pos.y ); edge->end_pos.y ));
break; break;
case SDF_EDGE_CONIC: case SDF_EDGE_CONIC:
printf( " Edge Type: Conic Bezier\n" ); FT_TRACE5(( " Edge Type: Conic Bezier\n" ));
printf( " -----------------------\n" ); FT_TRACE5(( " -----------------------\n" ));
printf( " Start Pos: %d, %d\n", edge->start_pos.x, FT_TRACE5(( " Start Pos: %d, %d\n", edge->start_pos.x,
edge->start_pos.y ); edge->start_pos.y ));
printf( " Ctrl1 Pos: %d, %d\n", edge->control_a.x, FT_TRACE5(( " Ctrl1 Pos: %d, %d\n", edge->control_a.x,
edge->control_a.y ); edge->control_a.y ));
printf( " End Pos : %d, %d\n", edge->end_pos.x, FT_TRACE5(( " End Pos : %d, %d\n", edge->end_pos.x,
edge->end_pos.y ); edge->end_pos.y ));
break; break;
case SDF_EDGE_CUBIC: case SDF_EDGE_CUBIC:
printf( " Edge Type: Cubic Bezier\n" ); FT_TRACE5(( " Edge Type: Cubic Bezier\n" ));
printf( " -----------------------\n" ); FT_TRACE5(( " -----------------------\n" ));
printf( " Start Pos: %d, %d\n", edge->start_pos.x, FT_TRACE5(( " Start Pos: %d, %d\n", edge->start_pos.x,
edge->start_pos.y ); edge->start_pos.y ));
printf( " Ctrl1 Pos: %d, %d\n", edge->control_a.x, FT_TRACE5(( " Ctrl1 Pos: %d, %d\n", edge->control_a.x,
edge->control_a.y ); edge->control_a.y ));
printf( " Ctrl2 Pos: %d, %d\n", edge->control_b.x, FT_TRACE5(( " Ctrl2 Pos: %d, %d\n", edge->control_b.x,
edge->control_b.y ); edge->control_b.y ));
printf( " End Pos : %d, %d\n", edge->end_pos.x, FT_TRACE5(( " End Pos : %d, %d\n", edge->end_pos.x,
edge->end_pos.y ); edge->end_pos.y ));
break; break;
default: default:
break; break;
@ -539,12 +539,12 @@
contour_list.head = contour_list.head->next; contour_list.head = contour_list.head->next;
} }
printf( "\n" ); FT_TRACE5(( "\n" ));
printf( "*note the above values are in 26.6 fixed point format*\n" ); FT_TRACE5(( "*note: the above values are in 26.6 fixed point format*\n" ));
printf( "[sdf] total number of contours = %d\n", num_contours ); FT_TRACE5(( "[sdf] total number of contours = %d\n", num_contours ));
printf( "[sdf] total number of edges = %d\n", total_edges ); FT_TRACE5(( "[sdf] total number of edges = %d\n", total_edges ));
printf( "[sdf] sdf_shape_dump complete\n" ); FT_TRACE5(( "[sdf] sdf_shape_dump complete\n" ));
printf( "-------------------------------------------------\n" ); FT_TRACE5(( "-------------------------------------------------\n" ));
} }
#endif #endif
@ -604,6 +604,8 @@
FT_UNUSED( raster ); FT_UNUSED( raster );
FT_UNUSED( params ); FT_UNUSED( params );
/* temporary */
FT_Memory memory = (FT_Memory)((SDF_TRaster*)raster)->memory; FT_Memory memory = (FT_Memory)((SDF_TRaster*)raster)->memory;
SDF_Shape * shape = NULL; SDF_Shape * shape = NULL;
@ -615,6 +617,8 @@
sdf_shape_done( memory, &shape ); sdf_shape_done( memory, &shape );
/* --------- */
return FT_THROW( Unimplemented_Feature ); return FT_THROW( Unimplemented_Feature );
} }