Standard Library function thatrotates and magnifies (or demagnifies) a two-dimensional array.
ang
mag
xctr
yctr
Missing
The magnification factor can be of integer or floating-point data type. It is specified as follows (with 1 being the default value):
mag = 1 | no change |
mag ![]() | causes magnification |
mag ![]() | causes demagnification |
TIP: If you only need to rotate an image by 90-degree increments, the ROTATE function is more efficient to use.
TIP: If you need a more accurate bilinear interpolation method, use the ROT_INT function.
OPENR, unit, FILEPATH('x2y2.dat', Subdir = 'data'), /Get_Lun
Open the file containing the image.
image = BYTARR(320, 256)
Create an array large enough to hold the image.
READU, unit, image
Read the image.
FREE_LUN, unit
Close the file and free the file unit number.
WINDOW, 0, Xsize = 640, Ysize = 256
Create a window large enough to contain two 320-by-256 images.
TV, image, 0
Display the original image in the left-half of the window.
a = ROT(image, 135, 0.63, Missing = 0)
Rotate the image 135 degrees clockwise, and demagnify it by a
; factor of 0.63. Also, pixels that map outside the original image are
; assigned a value of 0.
TV, a, 1
Display rotated, demagnified image in the right-half of the window.
Figure 2-97 Original image (left); rotated/demagnified image (right).
Figure 2-98 Original image (left); rotated/demagnified image (right).
For information on interpolation methods, see Efficiency and Accuracy of Interpolation in Chapter 6 of the PV-WAVE User's Guide.