Changeset 32745 for trunk/psLib/src/imageops/psImageConvolve.c
- Timestamp:
- Nov 22, 2011, 10:17:13 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageConvolve.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageConvolve.c
r32729 r32745 626 626 /* Smooth first Nrange pixels, with renorm */ \ 627 627 for (int i = 0; i < xMax; i++, vi++, vo++) { \ 628 int convRange = PS_MIN(Nrange + 1, Nx - xMax + 1); \628 int convRange = PS_MIN(Nrange + 1, Nx - i); \ 629 629 ps##TYPE *vr = vi - i; \ 630 630 ps##TYPE *vg = gauss - i; \ … … 650 650 } \ 651 651 /* Smooth last Nrange pixels, with renorm */ \ 652 /* XXX does this miss the last column? */ \ 653 for (int i = Nx - Nrange; i < Nx; i++, vi++, vo++) { \ 652 /* if Nx < 2*Nrange, this pass starts at i == Nrange */ \ 653 int xMin = PS_MAX(Nx - Nrange, Nrange); \ 654 for (int i = xMin; i < Nx; i++, vi++, vo++) { \ 654 655 ps##TYPE *vr = vi - Nrange; \ 655 656 ps##TYPE *vg = gauss - Nrange; \ … … 717 718 calculation = save; \ 718 719 } \ 719 /* Smooth last Nrange pixels, with renorm */ \ 720 for (int j = Ny - Nrange; j < Ny; j++) { \ 720 /* Smooth last Nrange pixels, with renorm */ \ 721 /* if Ny < 2*Nrange, this pass starts at j == Nrange */ \ 722 int yMin = PS_MAX(Ny - Nrange, Nrange); \ 723 for (int j = yMin; j < Ny; j++) { \ 721 724 /* save the Nrange-offset output row, then zero */ \ 722 725 memset(calculation->data.TYPE, 0, Nx*sizeof(ps##TYPE)); \ … … 834 837 double s = 0.0; 835 838 for (int n = -i; n < convRange; n++, vr++, vg++) { 836 psAssert (vr - image->data.F32[j] < image->numCols, "counting error");837 839 s += *vg * *vr; 838 840 g += *vg; … … 848 850 double s = 0; 849 851 for (int n = -Nrange; n < Nrange + 1; n++, vr++, vg++) { 850 psAssert (vr - image->data.F32[j] < image->numCols, "counting error");851 852 s += *vg * *vr; 852 853 } … … 862 863 double s = 0.0; 863 864 for (int n = -Nrange; n < Nx - i; n++, vr++, vg++) { 864 psAssert (vr - image->data.F32[j] < image->numCols, "counting error");865 865 s += *vg * *vr; 866 866 g += *vg; … … 904 904 } 905 905 /* Smooth last Nrange pixels, with renorm */ 906 for (int j = Ny - Nrange; j < Ny; j++) { 906 // if Ny < 2*Nrange, this pass starts at j == Nrange 907 int yMin = PS_MAX(Ny - Nrange, Nrange); 908 for (int j = yMin; j < Ny; j++) { 907 909 psF32 *vg = gauss - Nrange; 908 910 double g = 0.0;
Note:
See TracChangeset
for help on using the changeset viewer.
