Commit 35ccd4c
committed
Adjust to favor the left input pixel for nearest-neighbor interpolation
This fixes a subtle issue where a resampled pixel falling exactly
between two input pixels would normally round half up, but would also be
rendered with rounding half up, resulting in the resampled pixel
having the wrong value. The code now functionally rounds half down,
which cancels out the effect of rendering rounding half up in these
situations, and otherwise makes no difference.1 parent dd24e05 commit 35ccd4c
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
215 | 227 | | |
216 | 228 | | |
217 | 229 | | |
| |||
0 commit comments