diff --git a/projet/Block.py b/projet/Block.py index b8c1127b0633c5db374d3d48eb78e00a48b6e5f3..4ee55d6365f4e932d3a3ace0cab8b9d92d3c9a34 100644 --- a/projet/Block.py +++ b/projet/Block.py @@ -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 + +