Respect excluded regions in overlay rendering
This commit is contained in:
parent
0fd527cd78
commit
6de4059291
|
|
@ -154,19 +154,20 @@ class QtImageProcessor:
|
||||||
r, g, b, a = pixels[x, y]
|
r, g, b, a = pixels[x, y]
|
||||||
if a == 0:
|
if a == 0:
|
||||||
continue
|
continue
|
||||||
|
match = self._matches(r, g, b)
|
||||||
excluded = bool(mask_px and mask_px[x, y])
|
excluded = bool(mask_px and mask_px[x, y])
|
||||||
total_all += 1
|
total_all += 1
|
||||||
if self._matches(r, g, b):
|
|
||||||
draw.point((x, y), fill=highlight)
|
|
||||||
matches_all += 1
|
|
||||||
if excluded:
|
if excluded:
|
||||||
total_excl += 1
|
total_excl += 1
|
||||||
if self._matches(r, g, b):
|
if match:
|
||||||
matches_excl += 1
|
matches_excl += 1
|
||||||
else:
|
else:
|
||||||
total_keep += 1
|
total_keep += 1
|
||||||
if self._matches(r, g, b):
|
if match:
|
||||||
|
draw.point((x, y), fill=highlight)
|
||||||
matches_keep += 1
|
matches_keep += 1
|
||||||
|
if match:
|
||||||
|
matches_all += 1
|
||||||
|
|
||||||
self.overlay_img = overlay
|
self.overlay_img = overlay
|
||||||
self.stats = Stats(
|
self.stats = Stats(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue