Learn R Programming

ggalign (version 1.0.1)

raster_magick_interal: Rasterize the input object

Description

An internal function designed to implement the functionality of raster_magick(). It assumes the input arguments are valid and does not perform any additional checks.

Usage

.raster_magick(x, ...)

# S3 method for Layer .raster_magick(x, ...)

# S3 method for list .raster_magick(x, ...)

# S3 method for ggplot .raster_magick(x, ...)

# S3 method for grob .raster_magick(x, magick = NULL, ..., res = NULL, interpolate = FALSE)

# S3 method for gList .raster_magick(x, magick = NULL, ..., res = NULL, interpolate = FALSE)

# S3 method for ggalignRasterMagick .raster_magick(x, magick = NULL, ..., res = NULL, interpolate = FALSE)

# S3 method for zeroGrob .raster_magick(x, ...)

# S3 method for default .raster_magick(x, ...)

Value

An object with the same class of the input.

Arguments

x

An object to rasterize, can be a grob(), layer(), ggplot(), or a list of such objects.

...

Not used currently.

magick

A function (purrr-style formula is accepted) that takes an image_read() object as input and returns an object compatible with as.raster(). You can use any of the image_*() functions from the magick package to process the raster image.

res

An integer sets the desired resolution in pixels.

interpolate

A logical value indicating whether to linearly interpolate the image (the alternative is to use nearest-neighbour interpolation, which gives a more blocky result).