mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-17 18:54:46 +03:00
more readable
This commit is contained in:
parent
f0c74d32a7
commit
02258f38c5
|
@ -176,6 +176,9 @@ precompute_coeffs(int inSize, int outSize, struct filter *filterp,
|
||||||
k = &kk[xx * kmax];
|
k = &kk[xx * kmax];
|
||||||
for (x = 0; x < xmax; x++) {
|
for (x = 0; x < xmax; x++) {
|
||||||
double w = filterp->filter((x + xmin - center + 0.5) * ss);
|
double w = filterp->filter((x + xmin - center + 0.5) * ss);
|
||||||
|
k[x] = w;
|
||||||
|
ww += w;
|
||||||
|
|
||||||
// We can skip extreme coefficients if they are zeroes.
|
// We can skip extreme coefficients if they are zeroes.
|
||||||
if (w == 0) {
|
if (w == 0) {
|
||||||
// Skip from the start.
|
// Skip from the start.
|
||||||
|
@ -185,15 +188,11 @@ precompute_coeffs(int inSize, int outSize, struct filter *filterp,
|
||||||
// But `w` will not be 0, because it based on `xmin`.
|
// But `w` will not be 0, because it based on `xmin`.
|
||||||
xmin += 1;
|
xmin += 1;
|
||||||
xmax -= 1;
|
xmax -= 1;
|
||||||
// Prevent setting the `k[-1]` item.
|
|
||||||
continue;
|
|
||||||
} else if (x == xmax - 1) {
|
} else if (x == xmax - 1) {
|
||||||
// Truncate the last coefficient for current `xx`.
|
// Truncate the last coefficient for current `xx`.
|
||||||
xmax -= 1;
|
xmax -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
k[x] = w;
|
|
||||||
ww += w;
|
|
||||||
}
|
}
|
||||||
for (x = 0; x < xmax; x++) {
|
for (x = 0; x < xmax; x++) {
|
||||||
if (ww != 0.0)
|
if (ww != 0.0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user