AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2000.03.21 01:13 "scale question", by Scott&Patty
2000.03.21 01:23 "raster scaling", by Scott&Patty
2000.03.21 10:13 "Re: raster scaling", by Frank D. Cringle

2000.03.21 10:13 "Re: raster scaling", by Frank D. Cringle

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, fdc@cliwe.ping.de
voice: (+49 2304) 467101; fax: 943357