bm_call: Execute a function call on bitmap objects

View source: R/bm_call.R

bm_callR Documentation

Execute a function call on bitmap objects

Description

bm_call() excutes a function call on bitmap objects. Since its first argument is the bitmap object it is more convenient to use with pipes then directly using base::do.call() plus it is easier to specify additional arguments.

Usage

bm_call(x, .f, ...)

Arguments

x

Either a bm_bitmap(), bm_font(), bm_list(), "magick-image", "nativeRaster", bm_pixmap(), or "raster" object.

.f

A function to execute.

...

Additional arguments to .f.

Value

The return value of .f.

Examples

  font_file <- system.file("fonts/spleen/spleen-8x16.hex.gz", package = "bittermelon")
  font <- read_hex(font_file)
  bml <- as_bm_list("RSTATS", font = font)
  bml <- bm_flip(bml, "both")
  bm <- bm_call(bml, cbind, direction = "RTL")
  print(bm)

trevorld/bittermelon documentation built on Dec. 24, 2024, 10:33 p.m.