Lines Matching refs:polygon_info

418 static PolygonInfo *DestroyPolygonInfo(PolygonInfo *polygon_info)  in DestroyPolygonInfo()  argument
423 if (polygon_info->edges != (EdgeInfo *) NULL) in DestroyPolygonInfo()
425 for (i=0; i < (ssize_t) polygon_info->number_edges; i++) in DestroyPolygonInfo()
426 if (polygon_info->edges[i].points != (PointInfo *) NULL) in DestroyPolygonInfo()
427 polygon_info->edges[i].points=(PointInfo *) in DestroyPolygonInfo()
428 RelinquishMagickMemory(polygon_info->edges[i].points); in DestroyPolygonInfo()
429 polygon_info->edges=(EdgeInfo *) RelinquishMagickMemory( in DestroyPolygonInfo()
430 polygon_info->edges); in DestroyPolygonInfo()
432 return((PolygonInfo *) RelinquishMagickMemory(polygon_info)); in DestroyPolygonInfo()
470 static void LogPolygonInfo(const PolygonInfo *polygon_info) in LogPolygonInfo() argument
480 p=polygon_info->edges; in LogPolygonInfo()
481 for (i=0; i < (ssize_t) polygon_info->number_edges; i++) in LogPolygonInfo()
528 *polygon_info; in ConvertPathToPolygon() local
548 polygon_info=(PolygonInfo *) AcquireMagickMemory(sizeof(*polygon_info)); in ConvertPathToPolygon()
549 if (polygon_info == (PolygonInfo *) NULL) in ConvertPathToPolygon()
556 polygon_info->edges=(EdgeInfo *) AcquireQuantumMemory(number_edges, in ConvertPathToPolygon()
557 sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
558 if (polygon_info->edges == (EdgeInfo *) NULL) in ConvertPathToPolygon()
562 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
564 (void) memset(polygon_info->edges,0,number_edges* in ConvertPathToPolygon()
565 sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
574 polygon_info->edges[edge].number_points=(size_t) n; in ConvertPathToPolygon()
575 polygon_info->edges[edge].scanline=0.0; in ConvertPathToPolygon()
576 polygon_info->edges[edge].highwater=0; in ConvertPathToPolygon()
577 polygon_info->edges[edge].ghostline=ghostline; in ConvertPathToPolygon()
578 polygon_info->edges[edge].direction=(ssize_t) direction; in ConvertPathToPolygon()
579 polygon_info->edges[edge].points=points; in ConvertPathToPolygon()
580 polygon_info->edges[edge].bounds=bounds; in ConvertPathToPolygon()
581 polygon_info->number_edges=0; in ConvertPathToPolygon()
595 polygon_info->edges=(EdgeInfo *) ResizeQuantumMemory( in ConvertPathToPolygon()
596 polygon_info->edges,(size_t) number_edges, in ConvertPathToPolygon()
597 sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
598 if (polygon_info->edges == (EdgeInfo *) NULL) in ConvertPathToPolygon()
603 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
606 polygon_info->edges[edge].number_points=(size_t) n; in ConvertPathToPolygon()
607 polygon_info->edges[edge].scanline=(-1.0); in ConvertPathToPolygon()
608 polygon_info->edges[edge].highwater=0; in ConvertPathToPolygon()
609 polygon_info->edges[edge].ghostline=ghostline; in ConvertPathToPolygon()
610 polygon_info->edges[edge].direction=(ssize_t) (direction > 0); in ConvertPathToPolygon()
613 polygon_info->edges[edge].points=points; in ConvertPathToPolygon()
614 polygon_info->edges[edge].bounds=bounds; in ConvertPathToPolygon()
615 polygon_info->edges[edge].bounds.y1=points[0].y; in ConvertPathToPolygon()
616 polygon_info->edges[edge].bounds.y2=points[n-1].y; in ConvertPathToPolygon()
620 polygon_info->number_edges=edge; in ConvertPathToPolygon()
631 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
659 polygon_info->edges=(EdgeInfo *) ResizeQuantumMemory( in ConvertPathToPolygon()
660 polygon_info->edges,(size_t) number_edges, in ConvertPathToPolygon()
661 sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
662 if (polygon_info->edges == (EdgeInfo *) NULL) in ConvertPathToPolygon()
667 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
670 polygon_info->edges[edge].number_points=(size_t) n; in ConvertPathToPolygon()
671 polygon_info->edges[edge].scanline=(-1.0); in ConvertPathToPolygon()
672 polygon_info->edges[edge].highwater=0; in ConvertPathToPolygon()
673 polygon_info->edges[edge].ghostline=ghostline; in ConvertPathToPolygon()
674 polygon_info->edges[edge].direction=(ssize_t) (direction > 0); in ConvertPathToPolygon()
677 polygon_info->edges[edge].points=points; in ConvertPathToPolygon()
678 polygon_info->edges[edge].bounds=bounds; in ConvertPathToPolygon()
679 polygon_info->edges[edge].bounds.y1=points[0].y; in ConvertPathToPolygon()
680 polygon_info->edges[edge].bounds.y2=points[n-1].y; in ConvertPathToPolygon()
681 polygon_info->number_edges=edge+1; in ConvertPathToPolygon()
690 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
711 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
731 polygon_info->edges=(EdgeInfo *) ResizeQuantumMemory( in ConvertPathToPolygon()
732 polygon_info->edges,(size_t) number_edges, in ConvertPathToPolygon()
733 sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
734 if (polygon_info->edges == (EdgeInfo *) NULL) in ConvertPathToPolygon()
738 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
741 polygon_info->edges[edge].number_points=(size_t) n; in ConvertPathToPolygon()
742 polygon_info->edges[edge].scanline=(-1.0); in ConvertPathToPolygon()
743 polygon_info->edges[edge].highwater=0; in ConvertPathToPolygon()
744 polygon_info->edges[edge].ghostline=ghostline; in ConvertPathToPolygon()
745 polygon_info->edges[edge].direction=(ssize_t) (direction > 0); in ConvertPathToPolygon()
748 polygon_info->edges[edge].points=points; in ConvertPathToPolygon()
749 polygon_info->edges[edge].bounds=bounds; in ConvertPathToPolygon()
750 polygon_info->edges[edge].bounds.y1=points[0].y; in ConvertPathToPolygon()
751 polygon_info->edges[edge].bounds.y2=points[n-1].y; in ConvertPathToPolygon()
755 polygon_info->number_edges=edge; in ConvertPathToPolygon()
758 polygon_info->number_edges=edge; in ConvertPathToPolygon()
759 polygon_info->edges=(EdgeInfo *) ResizeQuantumMemory(polygon_info->edges, in ConvertPathToPolygon()
760 polygon_info->number_edges,sizeof(*polygon_info->edges)); in ConvertPathToPolygon()
761 if (polygon_info->edges == (EdgeInfo *) NULL) in ConvertPathToPolygon()
765 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
767 for (i=0; i < (ssize_t) polygon_info->number_edges; i++) in ConvertPathToPolygon()
772 edge_info=polygon_info->edges+i; in ConvertPathToPolygon()
779 return(DestroyPolygonInfo(polygon_info)); in ConvertPathToPolygon()
782 qsort(polygon_info->edges,(size_t) polygon_info->number_edges, in ConvertPathToPolygon()
783 sizeof(*polygon_info->edges),DrawCompareEdges); in ConvertPathToPolygon()
785 LogPolygonInfo(polygon_info); in ConvertPathToPolygon()
786 return(polygon_info); in ConvertPathToPolygon()
1337 const DrawInfo *draw_info,const PolygonInfo *polygon_info, in DrawBoundingRectangles() argument
1397 if (polygon_info != (PolygonInfo *) NULL) in DrawBoundingRectangles()
1399 bounds=polygon_info->edges[0].bounds; in DrawBoundingRectangles()
1400 for (i=1; i < (ssize_t) polygon_info->number_edges; i++) in DrawBoundingRectangles()
1402 if (polygon_info->edges[i].bounds.x1 < (double) bounds.x1) in DrawBoundingRectangles()
1403 bounds.x1=polygon_info->edges[i].bounds.x1; in DrawBoundingRectangles()
1404 if (polygon_info->edges[i].bounds.y1 < (double) bounds.y1) in DrawBoundingRectangles()
1405 bounds.y1=polygon_info->edges[i].bounds.y1; in DrawBoundingRectangles()
1406 if (polygon_info->edges[i].bounds.x2 > (double) bounds.x2) in DrawBoundingRectangles()
1407 bounds.x2=polygon_info->edges[i].bounds.x2; in DrawBoundingRectangles()
1408 if (polygon_info->edges[i].bounds.y2 > (double) bounds.y2) in DrawBoundingRectangles()
1409 bounds.y2=polygon_info->edges[i].bounds.y2; in DrawBoundingRectangles()
1423 for (i=0; i < (ssize_t) polygon_info->number_edges; i++) in DrawBoundingRectangles()
1425 if (polygon_info->edges[i].direction != 0) in DrawBoundingRectangles()
1433 start.x=(double) (polygon_info->edges[i].bounds.x1-mid); in DrawBoundingRectangles()
1434 start.y=(double) (polygon_info->edges[i].bounds.y1-mid); in DrawBoundingRectangles()
1435 end.x=(double) (polygon_info->edges[i].bounds.x2+mid); in DrawBoundingRectangles()
1436 end.y=(double) (polygon_info->edges[i].bounds.y2+mid); in DrawBoundingRectangles()
1446 if (i < (ssize_t) polygon_info->number_edges) in DrawBoundingRectangles()
4604 static PolygonInfo **DestroyPolygonThreadSet(PolygonInfo **polygon_info) in DestroyPolygonThreadSet() argument
4609 assert(polygon_info != (PolygonInfo **) NULL); in DestroyPolygonThreadSet()
4611 if (polygon_info[i] != (PolygonInfo *) NULL) in DestroyPolygonThreadSet()
4612 polygon_info[i]=DestroyPolygonInfo(polygon_info[i]); in DestroyPolygonThreadSet()
4613 polygon_info=(PolygonInfo **) RelinquishMagickMemory(polygon_info); in DestroyPolygonThreadSet()
4614 return(polygon_info); in DestroyPolygonThreadSet()
4624 **polygon_info; in AcquirePolygonThreadSet() local
4633 polygon_info=(PolygonInfo **) AcquireQuantumMemory(number_threads, in AcquirePolygonThreadSet()
4634 sizeof(*polygon_info)); in AcquirePolygonThreadSet()
4635 if (polygon_info == (PolygonInfo **) NULL) in AcquirePolygonThreadSet()
4641 (void) memset(polygon_info,0,number_threads*sizeof(*polygon_info)); in AcquirePolygonThreadSet()
4644 return(DestroyPolygonThreadSet(polygon_info)); in AcquirePolygonThreadSet()
4645 polygon_info[0]=ConvertPathToPolygon(path_info,exception); in AcquirePolygonThreadSet()
4646 if (polygon_info[0] == (PolygonInfo *) NULL) in AcquirePolygonThreadSet()
4650 return(DestroyPolygonThreadSet(polygon_info)); in AcquirePolygonThreadSet()
4660 polygon_info[i]=(PolygonInfo *) AcquireMagickMemory( in AcquirePolygonThreadSet()
4661 sizeof(*polygon_info[i])); in AcquirePolygonThreadSet()
4662 if (polygon_info[i] == (PolygonInfo *) NULL) in AcquirePolygonThreadSet()
4666 return(DestroyPolygonThreadSet(polygon_info)); in AcquirePolygonThreadSet()
4668 polygon_info[i]->number_edges=0; in AcquirePolygonThreadSet()
4669 edge_info=polygon_info[0]->edges; in AcquirePolygonThreadSet()
4670 polygon_info[i]->edges=(EdgeInfo *) AcquireQuantumMemory( in AcquirePolygonThreadSet()
4671 polygon_info[0]->number_edges,sizeof(*edge_info)); in AcquirePolygonThreadSet()
4672 if (polygon_info[i]->edges == (EdgeInfo *) NULL) in AcquirePolygonThreadSet()
4676 return(DestroyPolygonThreadSet(polygon_info)); in AcquirePolygonThreadSet()
4678 (void) memcpy(polygon_info[i]->edges,edge_info, in AcquirePolygonThreadSet()
4679 polygon_info[0]->number_edges*sizeof(*edge_info)); in AcquirePolygonThreadSet()
4680 for (j=0; j < (ssize_t) polygon_info[i]->number_edges; j++) in AcquirePolygonThreadSet()
4681 polygon_info[i]->edges[j].points=(PointInfo *) NULL; in AcquirePolygonThreadSet()
4682 polygon_info[i]->number_edges=polygon_info[0]->number_edges; in AcquirePolygonThreadSet()
4683 for (j=0; j < (ssize_t) polygon_info[i]->number_edges; j++) in AcquirePolygonThreadSet()
4685 edge_info=polygon_info[0]->edges+j; in AcquirePolygonThreadSet()
4686 polygon_info[i]->edges[j].points=(PointInfo *) AcquireQuantumMemory( in AcquirePolygonThreadSet()
4688 if (polygon_info[i]->edges[j].points == (PointInfo *) NULL) in AcquirePolygonThreadSet()
4692 return(DestroyPolygonThreadSet(polygon_info)); in AcquirePolygonThreadSet()
4694 (void) memcpy(polygon_info[i]->edges[j].points,edge_info->points, in AcquirePolygonThreadSet()
4699 return(polygon_info); in AcquirePolygonThreadSet()
4702 static size_t DestroyEdge(PolygonInfo *polygon_info,const ssize_t edge) in DestroyEdge() argument
4704 assert(edge < (ssize_t) polygon_info->number_edges); in DestroyEdge()
4705 polygon_info->edges[edge].points=(PointInfo *) RelinquishMagickMemory( in DestroyEdge()
4706 polygon_info->edges[edge].points); in DestroyEdge()
4707 polygon_info->number_edges--; in DestroyEdge()
4708 if (edge < (ssize_t) polygon_info->number_edges) in DestroyEdge()
4709 (void) memmove(polygon_info->edges+edge,polygon_info->edges+edge+1, in DestroyEdge()
4710 (size_t) (polygon_info->number_edges-edge)*sizeof(*polygon_info->edges)); in DestroyEdge()
4711 return(polygon_info->number_edges); in DestroyEdge()
4714 static double GetFillAlpha(PolygonInfo *polygon_info,const double mid, in GetFillAlpha() argument
4745 p=polygon_info->edges; in GetFillAlpha()
4746 for (j=0; j < (ssize_t) polygon_info->number_edges; j++, p++) in GetFillAlpha()
4752 (void) DestroyEdge(polygon_info,j); in GetFillAlpha()
4854 p=polygon_info->edges; in GetFillAlpha()
4855 for (j=0; j < (ssize_t) polygon_info->number_edges; j++, p++) in GetFillAlpha()
4903 **magick_restrict polygon_info; in DrawPolygonPrimitive() local
4931 polygon_info=AcquirePolygonThreadSet(primitive_info,exception); in DrawPolygonPrimitive()
4932 if (polygon_info == (PolygonInfo **) NULL) in DrawPolygonPrimitive()
4939 bounds=polygon_info[0]->edges[0].bounds; in DrawPolygonPrimitive()
4942 (void) DrawBoundingRectangles(image,draw_info,polygon_info[0],exception); in DrawPolygonPrimitive()
4943 for (i=1; i < (ssize_t) polygon_info[0]->number_edges; i++) in DrawPolygonPrimitive()
4945 p=polygon_info[0]->edges+i; in DrawPolygonPrimitive()
4963 polygon_info=DestroyPolygonThreadSet(polygon_info); in DrawPolygonPrimitive()
4977 (polygon_info[0]->number_edges == 0)) in DrawPolygonPrimitive()
5034 polygon_info=DestroyPolygonThreadSet(polygon_info); in DrawPolygonPrimitive()
5088 fill_alpha=GetFillAlpha(polygon_info[id],mid,fill,draw_info->fill_rule, in DrawPolygonPrimitive()
5107 polygon_info=DestroyPolygonThreadSet(polygon_info); in DrawPolygonPrimitive()