Path: utzoo!attcan!uunet!samsung!umich!umeecs!msi.umn.edu!cs.umn.edu!moundst!syntel!dal From: dal@syntel.syntel.mn.org (Dale A. Schumacher) Newsgroups: comp.graphics Subject: Fast Image Scaling Message-ID: Date: 20 Oct 90 16:02:12 GMT Lines: 29 The following pseudo-code is from a rough draft of a paper I'm preparing for inclusion in Graphics Gems '91. It is in the public domain. src_x_size: integer; src_y_size: integer; source: array[0..src_x_size-1] of array[0..src_y_size-1] of pixel; dst_x_size: integer; dst_y_size: integer; destination: array[0..dst_x_size-1] of array[0..dst_y_size-1] of pixel; sx, sy, dx, dy: integer; begin dx <- 0; dy <- 0; while dy < dst_y_size do sy <- ((dy * src_y_size) / dst_y_size); while dx < dst_x_size do sx <- ((dx * src_x_size) / dst_x_size); destination[dx][dy] <- source[sx][sy]; endloop; endloop; end; ..... Dale Schumacher 399 Beacon Ave. .: .: (alias: Dalnefre') St. Paul, MN 55104-3527 ..:.. : nic.mr.net!bungia.mn.org!syntel!dal United States of America : :.:.: "The Bandit, master of the quick comeback, the left-handed compliment, :. :. and the subtle jab, the most dangerous verbal assassin in Arcadia, :...: dimly heard his higher reasoning faculties shut down." -metlay