Calculate accurate weighted average in YdownXdown
When iterating through the destination image while scaling down, we know the fractional source area that should in theory cover a destination pixel. In practice a pixel has size 1 and the averaging box and number of source pixels must be integral. We can correct the resulting error by assigning weights into the averaging box. The former implementation weighted "only a bit" with the d0 / d1 variables, but it didn't take x fractions into account and also missed to pad up the weight to 1 for consecutive y rows. That seems to be the main reason why the outcome of the former YdownXdown looked "coarse" and "jagged". This commit implements the wighted average almost exactly as Tim Kientzle suggested it in "Scaling Bitmaps with Bresenham" (C/C++ User's Journal, October 1995), just extended for 2 dimensions and adapted to the exiting Splash.cc code.
splash_scale_smoothbresenham in 4 minutes and 39 seconds (queued for 3 seconds)7 jobs for