Major refactoring now using State instead of ProotState.
Expect runtime bugs
This commit is contained in:
parent
18cf352d1a
commit
56b34cd083
3 changed files with 225 additions and 92 deletions
|
|
@ -76,8 +76,10 @@ def generate_point_array_from_image(image):
|
|||
cached_point_arrays = load_cached_point_arrays()
|
||||
|
||||
if image_hash in cached_point_arrays:
|
||||
print("Found existing point array matching png: " + image.filename + " using existing array.")
|
||||
return [Point2D(point["x"], point["y"], tuple(point["color"])) for point in cached_point_arrays[image_hash]]
|
||||
|
||||
print("No existing point array matching png: " + image.filename + " found. Generating now.")
|
||||
width, height = image.size
|
||||
pixel_array = []
|
||||
|
||||
|
|
@ -91,6 +93,7 @@ def generate_point_array_from_image(image):
|
|||
cached_point_arrays[image_hash] = pixel_array
|
||||
save_cached_point_arrays(cached_point_arrays)
|
||||
|
||||
print("Point array generated and stored.")
|
||||
return [Point2D(point["x"], point["y"], tuple(point["color"])) for point in pixel_array]
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue