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
 public ImageFilterLookUpTable(Image.IImageFilter filter, bool normalization)
 {
     m_weight_array = new int[256];
     Calculate(filter, normalization);
 }
Exemplo n.º 3
0
 public ImageFilterLookUpTable(Image.IImageFilter filter)
     : this(filter, true)
 {
 }
Exemplo n.º 4
0
 void Calculate(Image.IImageFilter filter)
 {
     Calculate(filter, true);
 }