Replaces values in matrix mat according to mask msk. Depending of add_noise parameter values will be replaced with noise or not.
a NumericMatrix.
a IntegerMatrix.
logical, if true adds normal noise. Rcpp::Rf_rnorm(bg, sd) function is used. Default is true.
double, mean value of the background added if add_noise is true. Default is 0.0
double, standard deviation of the background added if add_noise is true. Default is 0.0
a NumericMatrix with replaced according to msk.