24 #ifndef SEFRAMEWORK_SEFRAMEWORK_IMAGE_INTERPOLATEDIMAGESOURCE_H_
25 #define SEFRAMEWORK_SEFRAMEWORK_IMAGE_INTERPOLATEDIMAGESOURCE_H_
52 int x,
int y,
int width,
int height)
const override {
55 auto chunk_end_x =
x + width;
57 auto chunk_end_y =
y + height;
60 auto chunk_pixel_x =
std::max(chunk_start_x, 0);
61 auto chunk_pixel_y =
std::max(chunk_start_y, 0);
62 auto chunk_w =
std::min(chunk_end_x - chunk_pixel_x, image->getWidth() - chunk_pixel_x);
63 auto chunk_h =
std::min(chunk_end_y - chunk_pixel_y, image->getHeight() - chunk_pixel_y);
67 auto img_chunk = image->getChunk(chunk_pixel_x, chunk_pixel_y, chunk_w, chunk_h);
68 auto variance_chunk =
m_variance_map->getChunk(chunk_pixel_x, chunk_pixel_y, chunk_w, chunk_h);
71 int off_x =
x - chunk_pixel_x;
72 int off_y =
y - chunk_pixel_y;
74 for (
int iy = 0; iy < height; ++iy) {
75 for (
int ix = 0; ix < width; ++ix) {
76 tile_data.at(ix, iy) =
getInterpolatedValue(*img_chunk, *variance_chunk, ix + off_x, iy + off_y);