At function

master
WIPocket 3 years ago
parent 0e56d3c7c3
commit a9eed4f96c
No known key found for this signature in database
GPG Key ID: 3C8207ED1C3146F8

@ -58,6 +58,12 @@ class Picture:
assert result.h == ht assert result.h == ht
return result return result
def at(x, y):
return self.pixels[
int(max(0, min(self.h - 1, y))),
int(max(0, min(self.w - 1, x))),
]
def _to_pil(self): def _to_pil(self):
# Create int iterable # Create int iterable
# TODO: If this is slow, we should use a generator. # TODO: If this is slow, we should use a generator.

Loading…
Cancel
Save