Lines Matching refs:edges
668 // this structure is used to sort edges according to y-component.
675 struct edge edges[3], edge_tmp;
686 EDGE_ASSIGN(edges[0], x1, y1, x2, y2);
687 EDGE_ASSIGN(edges[1], x1, y1, x3, y3);
688 EDGE_ASSIGN(edges[2], x2, y2, x3, y3);
690 // order edges according to descending length.
691 edge0_len = edges[0].y2 - edges[0].y1;
692 edge1_len = edges[1].y2 - edges[1].y1;
693 edge2_len = edges[2].y2 - edges[2].y1;
697 edge_tmp = edges[0];
698 edges[0] = edges[1];
699 edges[1] = edge_tmp;
705 edge_tmp = edges[0];
706 edges[0] = edges[2];
707 edges[2] = edge_tmp;
715 edge_tmp = edges[1];
716 edges[1] = edges[2];
717 edges[2] = edge_tmp;
720 // y-component of the two longest y-component edges is provably > 0.
722 slope0 = ((float) (edges[0].x1 - edges[0].x2)) /
723 ((float) (edges[0].y2 - edges[0].y1));
724 slope1 = ((float) (edges[1].x1 - edges[1].x2)) /
725 ((float) (edges[1].y2 - edges[1].y1));
728 bound_y1 = max(edges[1].y1, 0);
729 bound_y2 = min(edges[1].y2, pixmap->height-1);
734 calc_x1 = (int32_t) ((float) edges[0].x2 +
735 slope0 * (float) (edges[0].y2 - y) + 0.5);
736 calc_x2 = (int32_t) ((float) edges[1].x2 +
737 slope1 * (float) (edges[1].y2 - y) + 0.5);
745 if (edges[2].y2 - edges[2].y1 > 0) {
747 slope2 = ((float) (edges[2].x1 - edges[2].x2)) /
748 ((float) (edges[2].y2 - edges[2].y1));
750 bound_y1 = max(edges[2].y1, 0);
751 bound_y2 = min(edges[2].y2, pixmap->height-1);
755 calc_x1 = (int32_t) ((float) edges[0].x2 +
756 slope0 * (float) (edges[0].y2 - y) + 0.5);
757 calc_x2 = (int32_t) ((float) edges[2].x2 +
758 slope2 * (float) (edges[2].y2 - y) + 0.5);