Standard Library function thatrotates and magnifies (or demagnifies) a two-dimensional array.
ang The angle of rotation in degrees clockwise.
mag (optional) The magnification or demagnification factor (see Discussion).
xctr (optional) The x subscript of the center of rotation. If omitted, xctr is equal to the number of columns in image divided by 2.
yctr (optional) The y subscript of the center of rotation. If omitted, yctr is equal to the number of rows in image divided by 2.
Missing Data value to substitute for pixels in the output image that map outside the input image.
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 1 | causes magnification |
mag 1 | 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.