1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-19 23:33:33 +08:00

Pref: Reuse image array to improve memory performance

This commit is contained in:
LmeSzinc
2024-06-05 00:20:31 +08:00
parent 77d48937fc
commit 58202c6a40
34 changed files with 61 additions and 58 deletions

View File

@@ -217,7 +217,7 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock):
scanner.set_limitation(fleet=0)
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
if template.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
if candidates:
return candidates
@@ -226,7 +226,7 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock):
self.dock_sort_method_dsc_set(False)
candidates = [ship for ship in scanner.scan(self.device.image)
if template.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if template.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
return candidates
@@ -279,7 +279,7 @@ class GemsFarming(CampaignRun, FleetEquipment, Dock):
candidates = []
for item in template:
candidates = [ship for ship in scanner.scan(self.device.image, output=False)
if item.match(self.image_crop(ship.button), similarity=SIM_VALUE)]
if item.match(self.image_crop(ship.button, copy=False), similarity=SIM_VALUE)]
if candidates:
break
return candidates