rotate
rotates an image in multiples of 90 degrees.
Arguments
- image
An
Image
object.- rotation
A character string indicating the desired rotation:
- "CLOCKWISE" (default):
rotate by 90 degrees clockwise.
- "COUNTER":
rotate by 90 degrees counterclockwise.
- "180":
rotate by 180 degrees.
- target
The location where the results should be stored. It can take 3 values:
- "new":
a new
Image
object is created and the results are stored inside (the default).- An
Image
object: the results are stored in another existing
Image
object. This is fast and will not replace the content ofimage
but will replace that oftarget
. Note thattarget
must have the same bit depth and number of channels asimage
. The dimensions must be the same ifrotation="CLOCKWISE"
, or inverted ifrotation="CLOCKWISE"
orrotation="COUNTER"
.
Value
If target="new"
, the function returns an Image
object. If target
is an Image
object, the function
returns nothing and modifies that Image
object in place.
Author
Simon Garnier, garnier@njit.edu
Examples
img <- image(system.file("sample_img/balloon1.png", package = "Rvision"))
img_rotated <- rotate(img)