Function to shortcut extraction, normalization and eventually colorization of masks to base64 ! excludes image.
ExtractMasks_toBase64(
...,
objects,
offsets,
display_progress = TRUE,
mode = c("rgb", "gray")[1],
write_to,
base64_id,
base64_att
)
A list of base64 encoded images corresponding to objects extracted.
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
.
integer vector, IDEAS objects ids numbers to use. This argument is not mandatory, if missing, the default, all objects will be used.
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
.
whether to display a progress bar. Default is TRUE.
(objectParam
argument) color mode export. Either "rgb"
, "gray"
. Default is "rgb"
.
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"
.
whether to add id attribute to base64 exported object.
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.
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'
(="")