Skip to content
Snippets Groups Projects
Commit 74f6804d authored by Kinadinova Dariya's avatar Kinadinova Dariya
Browse files

class Block: init, is_uniform

parent 7a6a97cf
Branches
No related tags found
No related merge requests found
......@@ -8,8 +8,17 @@ from PIL import Image, ImageDraw
class Block:
def __init__(self, image):
"""à_remplacer_par_ce_que_fait_la_fonction
Précondition :
Exemple(s) :
$$$
"""
self.image = image
self.width, self.height = image.size
def is_uniform_block(self, image):
def is_uniform(self, coordinates: tuple()):
"""à_remplacer_par_ce_que_fait_la_fonction
Précondition :
......@@ -17,5 +26,12 @@ class Block:
$$$
"""
x, y = coordinates
if all(self.image.getpixel((x, y)) == self.image.getpixel((x1, y1)) for x in range(self.width) for y in range(self.height)):
return True
else:
return False
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment