--------------------------------------------------------------------
| 114 | |
| 115 | //-------------------------------------------------------------------- |
| 116 | void generate(color_type* span, int x, int y, unsigned len) |
| 117 | { |
| 118 | int dd = m_d2 - m_d1; |
| 119 | if (dd < 1) |
| 120 | dd = 1; |
| 121 | m_interpolator->begin(x + 0.5, y + 0.5, len); |
| 122 | do |
| 123 | { |
| 124 | m_interpolator->coordinates(&x, &y); |
| 125 | int d = m_gradient_function->calculate( |
| 126 | x >> downscale_shift, y >> downscale_shift, m_d2); |
| 127 | d = ((d - m_d1) * (int)m_color_function->size()) / dd; |
| 128 | if (d < 0) |
| 129 | d = 0; |
| 130 | if (d >= (int)m_color_function->size()) |
| 131 | d = m_color_function->size() - 1; |
| 132 | *span++ = (*m_color_function)[d]; |
| 133 | ++(*m_interpolator); |
| 134 | } while (--len); |
| 135 | } |
| 136 | |
| 137 | private: |
| 138 | interpolator_type* m_interpolator; |
nothing calls this directly
no test coverage detected