2000.03.21 10:13 "Re: raster scaling", by Frank D. Cringle
The gist of my question is, "How do I _quickly_ scale down a monochrome image?" In particular, I want to preserve "on" pixels in large (~10k x ~10k pixels) images.
Take a look at the ZoomImage() function in viewfax.c in ftp://ftp.sgi.com/sgi/fax/contrib/viewfax/viewfax-2.4.tar.gz
It only does 2:1 linear (4 pixels to 1 pixel) zooms. Higher factors (of 2) are achieved by calling the function repeatedly. It uses a lookup table to convert 8 input pixels to 2 output pixels. The same principle can be extended to use a bigger table and more highly unrolled inner loops, but at some stage cache misses start slowing things down.
Frank Cringle, email@example.com
voice: (+49 2304) 467101; fax: 943357