iround() public static method

public static iround ( double v ) : int
v double
return int
Exemplo n.º 1
0
        void Calculate(Image.IImageFilter filter, bool normalization)
        {
            double r = filter.GetRadius();

            ReallocLut(r);
            int i;
            int pivot = Diameter << (ImgSubPixConst.SHIFT - 1);

            for (i = 0; i < pivot; i++)
            {
                double x = (double)i / (double)ImgSubPixConst.SCALE;
                double y = filter.CalculateWeight(x);
                m_weight_array[pivot + i]     =
                    m_weight_array[pivot - i] = AggBasics.iround(y * ImgFilterConst.SCALE);
            }
            int end = (Diameter << ImgSubPixConst.SHIFT) - 1;

            m_weight_array[0] = m_weight_array[end];
            if (normalization)
            {
                Normalize();
            }
        }
Exemplo n.º 2
0
 //---------------------------------
 //from vector clipper
 static int upscale(double v)
 {
     return AggBasics.iround(v * poly_subpix.SCALE);
 }