MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / generate

Method generate

dep/agg/include/agg_span_gradient.h:116–135  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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;

Callers

nothing calls this directly

Calls 4

beginMethod · 0.45
coordinatesMethod · 0.45
calculateMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected