cpp_raster: Raster Image

View source: R/RcppExports.R

cpp_rasterR Documentation

Raster Image

Description

low-level function to create plot raster

Arguments

width

a uint16_t determining the returned image width.

height

a uint16_t determining the returned image height.

obj

a List containing drawing information:
- pch, an integer specifying a symbol to draw. Handled are [0-20]. Otherwise only a pixel will be drawn.
- size, an integer specifying the size in pixel of the shape, from 1 to 255.
- color a 4 rows IntegerMatrix (rgba) of the color used to draw the shape.
- coords, an IntegerMatrix whose rows are points to draw and with:
-* 1st column being img col coordinate in px,
-* 2nd column being img row coordinate in px. - blur_size an integer controlling the size of the blurring gaussian kernel.
- blur_sd a double controlling the sd of the blurring gaussian kernel.

bg_

a Nullable IntegerVector that will be cast to 3D array when not NULL. Default is R_NilValue.
When not NULL, its dimensions should be the same as required by 'width' and 'height', otherwise an error will be thrown.
When not NULL, it will serve as a background to draw new points on top of it.

Details

shape according to 'pch' will be drawn centered at coordinates obj$coord[, 1], obj$coord[, 0] and every pixels being part of the shape will be filled with 'color'. If only one 'color' is provided, this 'color' will be used for each points. If more than one 'color' is provided, then if number of colors (ncol) equals the number of points 'color' will be used as is for each single point. Otherwise, 'color' will be considered as a color-gradient and density will be computed. /!\ please note that IFC:::densCols() is faster to compute color based on density for n < 20000 points, so it's worth using it when number of points are lower.

Value

an IntegerVector with dimensions [height, width, 4]


IFC documentation built on Sept. 14, 2023, 1:08 a.m.