mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Merge pull request #18409
Co-authored-by: autocraft-bot[bot] <354215646+autocraft-bot[bot]@users.noreply.github.com>
This commit is contained in:
commit
2cc1b98562
1 file changed
+15
-3
@@ -532,9 +532,21 @@ mod tests {
|
||||
assert!(read_radius(sigma(25.0, bounds)) > 97);
|
||||
let area = output_area(&p, s.content_bounds(), bounds, None);
|
||||
let full = apply_tiled(&s, &p, area, bounds, None, 4096, None);
|
||||
let tiled = apply_tiled(&s, &p, area, bounds, None, 128, None);
|
||||
let inner = Rect::new(0, 0, size, size);
|
||||
let d = max_diff(&full.read_region(inner), &tiled.read_region(inner));
|
||||
// Keep every tile that contributes checked pixels, including each edge tile's
|
||||
// original rectangle and halo. The remaining tiles lie wholly outside the canvas.
|
||||
let tile = 128;
|
||||
let tile_start = |pixel: i32, origin: i32| origin + (pixel - origin).div_euclid(tile) * tile;
|
||||
let visible_tiles = Rect::new(
|
||||
tile_start(bounds.x0, area.x0),
|
||||
tile_start(bounds.y0, area.y0),
|
||||
tile_start(bounds.x1 - 1, area.x0) + tile,
|
||||
tile_start(bounds.y1 - 1, area.y0) + tile,
|
||||
)
|
||||
.intersect(&area);
|
||||
let tiled = apply_tiled(&s, &p, visible_tiles, bounds, None, tile, None);
|
||||
let center = size / 2;
|
||||
assert!(max_diff(&full.pixel(center, center), &s.pixel(center, center)) > 1e-4, "the full frame must be relit");
|
||||
let d = max_diff(&full.read_region(bounds), &tiled.read_region(bounds));
|
||||
assert!(d <= 1e-4, "tile seam {d}");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user