bm_rotate | R Documentation |
bm_rotate()
losslessly rotates bitmaps by 0, 90, 180, or 270 degrees.
If 90
or 270
degrees are indicated the width and height of the bitmap will be flipped.
bm_rotate(x, angle = 0L, clockwise = TRUE)
## S3 method for class 'bm_matrix'
bm_rotate(x, angle = 0L, clockwise = TRUE)
## S3 method for class 'nativeRaster'
bm_rotate(x, angle = 0L, clockwise = TRUE)
## S3 method for class ''magick-image''
bm_rotate(x, angle = 0L, clockwise = TRUE)
## S3 method for class 'raster'
bm_rotate(x, angle = 0L, clockwise = TRUE)
## S3 method for class 'bm_list'
bm_rotate(x, ...)
x |
Either a |
angle |
Angle to rotate bitmap by. |
clockwise |
If |
... |
Additional arguments to be passed to or from methods. |
Depending on x
either a bm_bitmap()
, bm_font()
, bm_list()
, magick-image, "nativeRaster", bm_pixmap()
, or raster object.
bm_distort()
can do other (distorted) rotations by careful
use of its vp
grid::viewport()
argument.
bm_flip()
with direction
"both" and in_place
TRUE
can
rotate glyphs 180 degrees in place.
# as_bm_list.character()
font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
font <- read_hex(font_file)
capital_r <- font[[str2ucp("R")]]
print(bm_rotate(capital_r, 90))
print(bm_rotate(capital_r, 180))
print(bm_rotate(capital_r, 270))
print(bm_rotate(capital_r, 90, clockwise = FALSE))
corn <- farming_crops_16x16()$corn$portrait
corn_180 <- bm_rotate(corn, 180)
if (cli::is_utf8_output() && cli::num_ansi_colors() >= 256L) {
print(corn_180, compress = "v")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.