Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!pacbell!att-ih!alberta!calgary!allan From: allan@calgary.UUCP (Jeff Allan) Newsgroups: comp.graphics Subject: Re: Fast Zoom for Suns Message-ID: <1505@vaxb.calgary.UUCP> Date: 31 Mar 88 15:52:27 GMT References: <1054@radio.toronto.edu> Organization: U. of Calgary, Calgary, Ab. Lines: 29 Summary: A proposed solution In article <1054@radio.toronto.edu>, brian@radio.toronto.edu (Brian Glendenning) writes: > Does anyone have a piece of code to do a fast zoom to a window under suntools? > I have a program that acts as a graphics server to a large astronomy package, > and every last little bit of speed will be felt. > 111000111000111000111000111000 > 1010101010101010 Zoom by 3 (say) ---> 111000111000111000111000111000 -> pw_rop > 111000111000111000111000111000 > > (original image line) (zoomed temp array) I'm not really familiar with the Sun but is occurs to me that there is a fast raster copy primitive that operates in the screen buffer. If this is the case then I suggest you use it to "fatbits" your image in two passes: one for vertical and one for horizontal. To double the upper-left corner of a 100 by 100 image (origin in upper-left): for (r=49; r>=0; r--) { pw_copy row(r) into row(2*r) and row(2*r+1) } for (c=49; c>=0; c--) { pw_copy col(c) into col(2*c) and col(2*c+1) } Hope this helps. -- Jeff Allan, University of Calgary ..!{ubc-vision,ihnp4}!alberta!calgary!allan