~kalon33/corsix-th/master

« back to all changes in this revision

Viewing changes to agg/include/agg_span_gouraud.h

  • Committer: corsixth.bot at gmail
  • Date: 2014-03-31 23:30:23 UTC
  • Revision ID: svn-v4:c39591fa-788f-11de-a72b-d90af8dea425:trunk:2687
Remove trailing whitespaces in .h, .cpp, .c and .lua files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
// Anti-Grain Geometry - Version 2.4
3
3
// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com)
4
4
//
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.
9
9
//
36
36
        };
37
37
 
38
38
        //--------------------------------------------------------------------
39
 
        span_gouraud() : 
 
39
        span_gouraud() :
40
40
            m_vertex(0)
41
41
        {
42
42
            m_cmd[0] = path_cmd_stop;
49
49
                     double x1, double y1,
50
50
                     double x2, double y2,
51
51
                     double x3, double y3,
52
 
                     double d) : 
 
52
                     double d) :
53
53
            m_vertex(0)
54
54
        {
55
55
            colors(c1, c2, c3);
66
66
 
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,
77
77
                      double d)
78
78
        {
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;
89
89
 
90
90
            if(d != 0.0)
91
 
            {   
 
91
            {
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,
137
137
 
138
138
            if(m_coord[0].y > m_coord[2].y)
139
139
            {
140
 
                coord[0] = m_coord[2]; 
 
140
                coord[0] = m_coord[2];
141
141
                coord[2] = m_coord[0];
142
142
            }
143
143