ExtractImages_toBase64 {IFC}R Documentation

Shortcut for Batch Images Extraction to Base64

Description

Function to shortcut extraction, normalization and eventually colorization of images to base64 ! excludes mask.

Usage

ExtractImages_toBase64(
  ...,
  objects,
  offsets,
  display_progress = TRUE,
  mode = c("rgb", "gray")[1],
  write_to,
  base64_id,
  base64_att
)

Arguments

...

arguments to be passed to objectExtract with the exception of 'ifd' and 'bypass'(=TRUE).
/!\ If not any of 'fileName', 'info' and 'param' can be found in '...' then attr(offsets, "fileName_image") will be used as 'fileName' input parameter to pass to objectParam.

objects

integer vector, IDEAS objects ids numbers to use. This argument is not mandatory, if missing, the default, all objects will be used.

offsets

object of class 'IFC_offset'. This argument is not mandatory but it may allow to save time for repeated image export on same file.
If 'offsets' are not provided, extra arguments can also be passed with '...' to getOffsets.

display_progress

whether to display a progress bar. Default is TRUE.

mode

(objectParam argument) color mode export. Either "rgb", "gray". Default is "rgb".

write_to

used to compute respectively exported file name.
Exported base64 data-uri will be deduced from this pattern. Allowed export are ".bmp", ".jpg", ".jpeg", ".png", ".tif", ".tiff". Note that ".bmp" is faster but files are not compressed producing bigger data.
Placeholders, if found, will be substituted:
-%d: with full path directory
-%p: with first parent directory
-%e: with extension (without leading .)
-%s: with shortname (i.e. basename without extension)
-%o: with object_id
-%c: with channel_id
A good trick is to use: "%o_%c.bmp".

base64_id

whether to add id attribute to base64 exported object.

base64_att

attributes to add to base64 exported object.
For example, use "class='draggable'".
Note that id (if 'base64_id' is TRUE) and width and height are already used.

Details

If 'param' is provided 'in '...':
-'param$export'<-"base64" and 'param$mode'<-'mode' only will be overwritten.
-if 'write_to' is not missing, 'param$write_to'<-'write_to' will be overwritten. Otherwise, 'param$write_to' will be used.
-if 'base64_id' is not missing, 'param$base64_id'<-'base64_id' will be overwritten. Otherwise, 'param$base64_id' will be used.
-if 'base64_att' is not missing, 'param$base64_att'<-'base64_att' will be overwritten. Otherwise, 'param$base64_att' will be used.

When missing and not found 'param', default values will be used for 'write_to'(="%o_%c.bmp"), 'base64_id'(=FALSE) and 'base64_att'(="")

Value

A list of base64 encoded images corresponding to objects extracted.

Note

Arguments of objectExtract will be deduced from ExtractImages_toBase64 input arguments.


[Package IFC version 0.2.1 Index]