File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,24 +56,21 @@ namespace agg
5656#ifndef MPL_FIX_AGG_IMAGE_FILTER_LUT_BUGS
5757 unsigned pivot = diameter () << (image_subpixel_shift - 1 );
5858 for (i = 0 ; i < pivot; i++)
59+ #else
60+ unsigned pivot = (diameter () << (image_subpixel_shift - 1 )) - 1 ;
61+ for (i = 0 ; i < pivot + 1 ; i++)
62+ #endif
5963 {
6064 double x = double (i) / double (image_subpixel_scale);
6165 double y = filter.calc_weight (x);
6266 m_weight_array[pivot + i] =
6367 m_weight_array[pivot - i] = (int16)iround (y * image_filter_scale);
6468 }
6569 unsigned end = (diameter () << image_subpixel_shift) - 1 ;
70+ #ifndef MPL_FIX_AGG_IMAGE_FILTER_LUT_BUGS
6671 m_weight_array[0 ] = m_weight_array[end];
6772#else
68- unsigned pivot = (diameter () << (image_subpixel_shift - 1 )) - 1 ;
69- for (i = 0 ; i <= pivot + 1 ; i++)
70- {
71- double x = double (i) / double (image_subpixel_scale);
72- double y = filter.calc_weight (x);
73- int16 value = iround (y * image_filter_scale);
74- m_weight_array[pivot + i] = value;
75- if (i <= pivot) m_weight_array[pivot - i] = value;
76- }
73+ m_weight_array[end] = (int16)iround (filter.calc_weight (diameter () / 2 ) * image_filter_scale);
7774#endif
7875 if (normalization)
7976 {
You can’t perform that action at this time.
0 commit comments