Changeset 32729 for trunk/psLib
- Timestamp:
- Nov 21, 2011, 10:51:45 AM (15 years ago)
- File:
-
- 1 edited
-
trunk/psLib/src/imageops/psImageConvolve.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageConvolve.c
r32728 r32729 834 834 double s = 0.0; 835 835 for (int n = -i; n < convRange; n++, vr++, vg++) { 836 psAssert (vr - image->data.F32[j] < image->numCols, "counting error"); 836 837 s += *vg * *vr; 837 838 g += *vg; … … 841 842 /* If that's all the pixels we have, then we're done already */ 842 843 if (Nx > Nrange) { 843 /* Smooth middle pixels */844 /* Smooth middle pixels; if Nx < 2*Nrange, this pass is skipped */ 844 845 for (int i = Nrange; i < Nx - Nrange; i++, vi++) { 845 846 psF32 *vr = vi - Nrange; … … 847 848 double s = 0; 848 849 for (int n = -Nrange; n < Nrange + 1; n++, vr++, vg++) { 850 psAssert (vr - image->data.F32[j] < image->numCols, "counting error"); 849 851 s += *vg * *vr; 850 852 } … … 852 854 } 853 855 /* Smooth last Nrange pixels, with renorm */ 854 for (int i = Nx - Nrange; i < Nx; i++, vi++) { 856 // if Nx < 2*Nrange, this pass starts at i == Nrange 857 int xMin = PS_MAX(Nx - Nrange, Nrange); 858 for (int i = xMin; i < Nx; i++, vi++) { 855 859 psF32 *vr = vi - Nrange; 856 860 psF32 *vg = gauss - Nrange; … … 858 862 double s = 0.0; 859 863 for (int n = -Nrange; n < Nx - i; n++, vr++, vg++) { 864 psAssert (vr - image->data.F32[j] < image->numCols, "counting error"); 860 865 s += *vg * *vr; 861 866 g += *vg;
Note:
See TracChangeset
for help on using the changeset viewer.
