2
2
// Anti-Grain Geometry - Version 2.4
3
3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
5
// Permission to copy, use, modify, sell and distribute this software
6
// is granted provided this copyright notice appears in all copies.
5
// Permission to copy, use, modify, sell and distribute this software
6
// is granted provided this copyright notice appears in all copies.
7
7
// This software is provided "as is" without express or implied
8
8
// warranty, and with no claim as to its suitability for any purpose.
67
67
//--------------------------------------------------------------------
68
68
// Sets the triangle and dilates it if needed.
69
// The trick here is to calculate beveled joins in the vertices of the
70
// triangle and render it as a 6-vertex polygon.
71
// It's necessary to achieve numerical stability.
69
// The trick here is to calculate beveled joins in the vertices of the
70
// triangle and render it as a 6-vertex polygon.
71
// It's necessary to achieve numerical stability.
72
72
// However, the coordinates to interpolate colors are calculated
73
73
// as miter joins (calc_intersection).
74
void triangle(double x1, double y1,
74
void triangle(double x1, double y1,
75
75
double x2, double y2,
76
76
double x3, double y3,
79
m_coord[0].x = m_x[0] = x1;
79
m_coord[0].x = m_x[0] = x1;
80
80
m_coord[0].y = m_y[0] = y1;
81
m_coord[1].x = m_x[1] = x2;
81
m_coord[1].x = m_x[1] = x2;
82
82
m_coord[1].y = m_y[1] = y2;
83
m_coord[2].x = m_x[2] = x3;
83
m_coord[2].x = m_x[2] = x3;
84
84
m_coord[2].y = m_y[2] = y3;
85
85
m_cmd[0] = path_cmd_move_to;
86
86
m_cmd[1] = path_cmd_line_to;
88
88
m_cmd[3] = path_cmd_stop;
92
92
dilate_triangle(m_coord[0].x, m_coord[0].y,
93
93
m_coord[1].x, m_coord[1].y,
94
94
m_coord[2].x, m_coord[2].y,