Thanks for posting these routines mike! K+
In the case of scaling you can do a bit better than this routine. Right now you have a divide per pixel which can be very slow. What you can do instead is called interpolation.
You know that dst_x only increases by 1 each pixel, so the src_x is easy to calculate, it would go
dst = 0 src = 0/image_size
dst = 1 src = 1/image_size
dst = 2 src = 2/image_size
dst = 3 src = 3/image_size
etc.
You can see that src is increasing by 1/image_size for each pixel, and you can take advantage of that.
inc_x# = 1/image_size
dst = 0 src = 0
dst = 1 src = 0+inc_x
dst = 2 src = 0+inc_x+inc_x
dst = 2 src = 0+inc_x+inc_x_inc_x
etc.
So for each pixel you just need to add inc_x to src_x instead of performing a divide.
You can do the same with the y. The only thing to remember is inc_x and src_x would need to be a float.
Cheers!
Jim