Resample

Ok, this updated to fix everything I've reported to date, I think. However, note that some of the commits say 'untested', so one of us needs to actually test those: especially the linear-float-to-uchar-srgb path. Also, almost all the new APIs functions themselves are untested, i.e. they're straightforward code but they could have typos/reversed arguments or some such, so should be tested too. And the resample test app should be switched to use those functions instead of the old internal one they currently use.

I'd like to make one more pass over it looking for badness, and I'll file official issues for the two things I know about already.