writemulti | R Documentation |
Writes TIFF.
writemulti(
image,
write_to = raw(0),
tags = list(list(tag = 270, typ = 2, map = "N/A"), list(tag = 306, typ = 2, map =
"N/A")),
as.rgb = FALSE,
compression = TRUE,
what = "int16",
endianness = .Platform$endian,
verbose = FALSE,
verbosity = 1
)
image |
a matrix or array or representing the image: |
write_to |
file name or a raw vector. Default is raw(0). |
tags |
list of extra tags to be included to IFD. Expecting a list whose sub-elements are list containing: |
as.rgb |
whether to write image as RGB. Default is FALSE. It will be possible only for array where 3rd dimension length is 3. |
compression |
whether image should be lossless compressed with deflate algorithm. Default is FALSE. |
what |
bits mode used to store image. Default is |
endianness |
The endian-ness ("big" or "little") of the return object. Default is .Platform$endian. |
verbose |
whether to display information (use for debugging purpose). Default is FALSE. |
verbosity |
quantity of information displayed when verbose is TRUE; 1: normal, 2: rich. Default is 1. |
It invisibly returns full path of exported file or a raw vector when write_to = raw(0)
otherwise.
## Not run:
if(requireNamespace("IFCdata", quietly = TRUE)) {
## use a cif file
file_cif <- system.file("extdata", "example.cif", package = "IFCdata")
## extract image values from cif file
RAW = ExtractImages_toMatrix(fileName = file_cif, mode = "raw", objects = 3,
force_width = FALSE, size = c(0,0))
## create multichannel tiff file
file_tif = writemulti(image = array(unlist(RAW[[1]], use.names = FALSE, recursive = TRUE),
dim = c(dim(RAW[[1]][[1]]), length(RAW[[1]]))),
write_to = tempfile(fileext = ".tif"))
## inspect exported file
IFD = getIFD(file_tif)
sapply(IFD[[1]]$tags, FUN = function(x) x)
## create multiframe tiff file
file_tif = writemulti(image = array(unlist(RAW[[1]], use.names = FALSE, recursive = TRUE),
dim = c(dim(RAW[[1]][[1]]), 1, length(RAW[[1]]))),
write_to = tempfile(fileext = ".tif"))
## inspect exported file
IFDs = c(getIFD(file_tif),getIFD(file_tif, "all"))
lapply(IFDs, FUN = function(i) sapply(i$tags, FUN = function(x) x))
} else {
message(sprintf('Please run `install.packages("IFCdata", repos = "%s", type = "source")` %s',
'https://gitdemont.github.io/IFCdata/',
'to install extra files required to run this example.'))
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.