36 m_variance(variance), m_threshold(threshold), m_convolution(kernel) {
40 return "BgDFTConvolutionImageSource(" +
getImageRepr() +
")";
44 ImageTile& tile,
int start_x,
int start_y,
int width,
int height)
const {
47 int clip_x =
std::max(start_x - hx, 0);
48 int clip_y =
std::max(start_y - hy, 0);
49 int clip_w =
std::min(width + hx * 2, image->getWidth() - clip_x);
50 int clip_h =
std::min(height + hy * 2, image->getHeight() - clip_y);
54 clip_w, clip_h, [image, clip_x, clip_y](
int x,
int y) {
55 return image->getValue(clip_x +
x, clip_y +
y);
59 clip_w, clip_h, [
this, clip_x, clip_y](
int x,
int y) {
73 return clipped_variance->getValue(x, y) < m_threshold;
79 clipped_img, mask, 0., 0.);
93 int off_x = start_x - clip_x;
94 int off_y = start_y - clip_y;
95 for (
int y = 0;
y < height; ++
y) {
96 for (
int x = 0;
x < width; ++
x) {
99 x + start_x,
y + start_y,
100 conv_masked->getValue(
x + off_x,
y + off_y) / conv_mask->getValue(
x + off_x,
y + off_y)