Re: fast magnification routine needed [message #2263] |
Mon, 13 June 1994 13:15 |
velt
Messages: 19 Registered: June 1994
|
Junior Member |
|
|
In article eml@news.service.uci.edu, vshvetsk@fourier.oac.uci.edu (Victor Shvetsky) writes:
>
> I have a 20x20 array that I would like to magnify to 200x200
> It works like this- as my cursor moves around the picture, that part of the picture is magnified in real time in a second window by a facvtor of ten (20->200)
> Right now I am using the REBIN routine,, and I was wondering if there is anuything FASTER than that. Is it possible to STORE THE WHOLE image magnified into the memory and just display a part of it in the window- wouldiot be faster?
> If so, what is the command that SAVES the image into the memory, because
> I know to retrievce, I hhave to typre: tvrd
> Thanks in advance
>
Try pixmaps and device,copy=[ ]. That works absolutely fabulous. I flip through
various (large) images very fast.
Robert Velthuizen
velt@rad.usf.edu
|
|
|
Re: fast magnification routine needed [message #2268 is a reply to message #2263] |
Mon, 13 June 1994 09:34  |
peter
Messages: 80 Registered: February 1994
|
Member |
|
|
Victor Shvetsky (vshvetsk@fourier.oac.uci.edu) wrote:
: I have a 20x20 array that I would like to magnify to 200x200
: It works like this- as my cursor moves around the picture, that part of the picture is magnified in real time in a second window by a facvtor of ten (20->200)
: Right now I am using the REBIN routine,, and I was wondering if there is anuything FASTER than that. Is it possible to STORE THE WHOLE image magnified into the memory and just display a part of it in the window- wouldiot be faster?
: If so, what is the command that SAVES the image into the memory, because
: I know to retrievce, I hhave to typre: tvrd
: Thanks in advance
Victor,
By far the fastest way to copy images around is to let the X server take
care of it. Assuming you have a displayed image, use TVRD to read
the screen, then magnify the whole image with REBIN and display it in a hidden
pixmap (see the /pixmap keyword to WINDOW). Then, use DEVICE, /COPY to
copy sections of the pixmap to your displayed window. You should get
real time performance this way.
Peter
|
|
|
Re: fast magnification routine needed [message #2271 is a reply to message #2268] |
Mon, 13 June 1994 01:06  |
knipp
Messages: 68 Registered: January 1993
|
Member |
|
|
In article eml@news.service.uci.edu, vshvetsk@fourier.oac.uci.edu (Victor Shvetsky) writes:
>
> I have a 20x20 array that I would like to magnify to 200x200
> It works like this- as my cursor moves around the picture, that part of the picture is magnified in real time in a second window by a facvtor of ten (20->200)
> Right now I am using the REBIN routine,, and I was wondering if there is anuything FASTER than that. Is it possible to STORE THE WHOLE image magnified into the memory and just display a part of it in the window- wouldiot be faster?
> If so, what is the command that SAVES the image into the memory, because
> I know to retrievce, I hhave to typre: tvrd
> Thanks in advance
>
If you have got enough memory try the following:
; ima: original image
; mag: magnified with factor 10
window, /free, xsize=cols, ysize=rows ; window for original image
w_ori = !d.window
window, /free, xsize=200, ysize=200 ; window to display zoom
w_zoom = !d.window
mag = rebin(ima, 10*cols, 10*rows)
window, /free, xsize=10*cols, 10*rows, /pixmap ; window for mag. image
; in case the keyword /pixmap is
; NOT working in your environment,
; simply position the window
; outside your screen
; p.e., xpos=1536, ypos=1024
;
w_mag = !d.window
finitum = 0 ; control repeat-loop
repeat begin
wset, w_ori
cursor, xc, yc, /change, /device
if !mouse.button eq 4 then finitum = 1 ; to exit loop
wset, w_zoom
xc_z = xc * 10 - 100 ; test here for inside image
yc_z = yc * 10 - 100
DEVICE, COPY=[xc_z, yc_z, 200, 200, xc-10, yc-10, w_mag]
endrep until finitum
Hope it works,
Karlheinz
____________________________________________________________ __________________
__ ____ __
/ // _ \ / / Karlheinz Knipp phone: +49 511 - 762 4922
/ // /_/ // / University of Hannover fax: +49 511 - 762 2483
/ // ____// / Institute for Photogrammetry
/ // / / / Nienburger Str.1
/_//_/ /_/ FRG 30167 Hannover e-mail: knipp@ipi.uni-hannover.de
|
|
|