public void SetFilterOffset(double dx, double dy) { m_dx_dbl = dx; m_dy_dbl = dy; m_dx_int = AggMath.iround(dx * img_subpix_const.SCALE); m_dy_int = AggMath.iround(dy * img_subpix_const.SCALE); }
//-------------------------------------------------------------------- public SpanGenGradient(ISpanInterpolator inter, IGradientValueCalculator gvc, IGradientColorsProvider m_colorsProvider, double d1, double d2) { this.m_interpolator = inter; this.m_grValueCalculator = gvc; this.m_colorsProvider = m_colorsProvider; m_d1 = AggMath.iround(d1 * GR_SUBPIX_SCALE); m_d2 = AggMath.iround(d2 * GR_SUBPIX_SCALE); dd = m_d2 - m_d1; if (dd < 1) { dd = 1; } stepRatio = (float)m_colorsProvider.GradientSteps / (float)dd; }
public void Calculate(double y) { double k = (y - m_y1) * m_1dy; if (k < 0.0) { k = 0.0; } if (k > 1.0) { k = 1.0; } m_r = m_r1 + AggMath.iround(m_dr * k); m_g = m_g1 + AggMath.iround(m_dg * k); m_b = m_b1 + AggMath.iround(m_db * k); m_a = m_a1 + AggMath.iround(m_da * k); m_x = AggMath.iround((m_x1 + m_dx * k) * (double)SUBPIXEL_SCALE); }
//--------------------------------- //from vector clipper static int upscale(double v) { return(AggMath.iround(v * poly_subpix.SCALE)); }