inst/extra/as.raster.R

as.raster.pixmapGrey <- function(x) {
    r <- gray(t(x@grey))
    dim(r) <- x@size
    class(r) <- "raster"
    r
}
as.raster.pixmapRGB <- function(x) {
    r <- rgb(t(x@red), t(x@green), t(x@blue))
    dim(r) <- x@size
    class(r) <- "raster"
    r
}

Try the RGraphics package in your browser

Any scripts or data that you put into this service are public.

RGraphics documentation built on July 8, 2020, 5:48 p.m.