From bcfdc06ba5fede684ee6dbaef93bbf278565addf Mon Sep 17 00:00:00 2001 From: Louis Chmielewski <louischmielewski@MacBook-Air-de-Louis.local> Date: Sun, 17 Mar 2024 15:37:50 +0100 Subject: [PATCH] est_bloc_uniforme class bloc --- .DS_Store | Bin 10244 -> 10244 bytes Projet/.DS_Store | Bin 6148 -> 6148 bytes Projet/src/.DS_Store | Bin 6148 -> 6148 bytes Projet/src/bloc.py | 14 ++++++++++++-- Projet/src/decoupe_image.py | 1 + .../src/{fonctions.py => manip_couleurs.py} | 0 6 files changed, 13 insertions(+), 2 deletions(-) rename Projet/src/{fonctions.py => manip_couleurs.py} (100%) diff --git a/.DS_Store b/.DS_Store index a6129eb245f3d17cafa480434911d783df23afcd..013240d825733ae89c123f8a4061e1cadff14adf 100644 GIT binary patch delta 148 zcmZn(XbIS$CJ<}Gz`(%3!l1{H&XCDalAG`1l9ZF5#K6G7ktt#jGUM`5M^yO~yz&JZ zhQZ1Cxdk9Y8Pps$Hw(x!su=BJU|?Wl2w*5;$Y;o6NJX`VfuSL3#^ue&1ntBCSmz`= delta 148 zcmZn(XbIS$CJ?K7lYxPOg+Y%YogtH<Bsbs1B`GIAiGhKE<89!BDC<i{9Z}^|@X8lt z7zQWj=N2%4fa-$H%>wd_Du%Zi7#P?X0vL)I@)@!iQc<m8U|<NezO?z6pq&^1s3Io6 diff --git a/Projet/.DS_Store b/Projet/.DS_Store index 0116c89f37a6e79ad9ddb9eb7a803a279f48370f..906135ea4eaf9269ff662b419f2139306d97e4c5 100644 GIT binary patch delta 24 gcmZoMXffFEj*Us#cJc={36_SW8J9Qnu>TMM0CDRHF8}}l delta 24 gcmZoMXffFEj*UqvZt@2<2^NNjR+l#Ou>TMM0C1`Z?*IS* diff --git a/Projet/src/.DS_Store b/Projet/src/.DS_Store index 044889880fc94c6fc63cae57f79ab2e0f0af49ae..e68ebb3a7fe22ce3d21badb20a2758a5823aeefe 100644 GIT binary patch delta 138 zcmZoMXfc=|#>B`mu~2NHo+2aj!~p9_j17#;6MGD$1sGBoQW=sN@)=4Q3K&uu;u$g- zav2gC(iu`GUJ%h?lx1LG(EASt3?Lu~md#_xWGG;Whw95=NM$HxDB5@~pKUWc2R{cB dBge*%-<c=#ix_e+GB7YSFfcG|_7K^_3;?1=BPIX< delta 83 zcmZoMXfc=|#>CJ*u~2NHo+2aD!~pBb1|lqz`5E;Dc^J|d@)`0Nk{L=EGC{1(GZ^#P mCSPDYwV9oRpM!~^ee*%a@640=MGP4kCfo2xZ;laJ!3+SEFcw4r diff --git a/Projet/src/bloc.py b/Projet/src/bloc.py index 9f80b00..ef5af53 100755 --- a/Projet/src/bloc.py +++ b/Projet/src/bloc.py @@ -11,7 +11,7 @@ """ from PIL import Image, ImageDraw -from fonctions import * +from manip_couleurs import * class Bloc: """Classe d'un bloc d'une image en pixel @@ -29,12 +29,22 @@ class Bloc: def __eq__(self, other): """ Renvoie True si 2 images sont identiques au pixel près - Précondition : + Précondition : aucune Exemple(s) : $$$ """ return self.image == other.image + + def est_bloc_uniforme(self): + """ + Renvoie True si le bloc est un bloc uniforme + Précondition : + Exemple(s) : + $$$ + + """ + return pixel_hl == pixel_lr diff --git a/Projet/src/decoupe_image.py b/Projet/src/decoupe_image.py index 4dd49ad..6ecb4d4 100755 --- a/Projet/src/decoupe_image.py +++ b/Projet/src/decoupe_image.py @@ -10,6 +10,7 @@ """ from PIL import Image, ImageDraw + def decoupe_image(image: Bloc, ordre: int) -> Bloc: """ Decoupe un bloc en quatre bloc "ordre" fois diff --git a/Projet/src/fonctions.py b/Projet/src/manip_couleurs.py similarity index 100% rename from Projet/src/fonctions.py rename to Projet/src/manip_couleurs.py -- GitLab