bm_rotate {bittermelon} | 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(bm_object, angle = 0, clockwise = TRUE)
bm_object |
Either a |
angle |
Angle to rotate bitmap by. |
clockwise |
If |
Either a bm_bitmap()
, bm_list()
, or bm_font()
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), px = px_ascii)
print(bm_rotate(capital_r, 180), px = px_ascii)
print(bm_rotate(capital_r, 270), px = px_ascii)
print(bm_rotate(capital_r, 90, clockwise = FALSE), px = px_ascii)