Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jules-robin
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
isn-malraux-mini-projet
jules-robin
Commits
aa49d058
Commit
aa49d058
authored
Jan 10, 2018
by
Maître Véreux (Jules Barron)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout de la fonction rotationCouleur et de ses fonctions associées, mais avec des erreurs.
parent
77095c43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
Programme.py
Programme.py
+50
-0
No files found.
Programme.py
View file @
aa49d058
...
...
@@ -35,6 +35,7 @@ def afficherImage():
"""
global
image
image
.
show
()
def
infoImage
():
"""Fonction qui donne les informations d'une image.
...
...
@@ -61,7 +62,56 @@ def infoImage():
quitter
=
str
(
input
(
"Pour quitter, appuyer sur une touche : "
))
clearscreen
()
Menu
()
def
rotationCouleur
():
largeur
,
hauteur
=
image
.
size
print
(
"Quelle rotation de couleur voulez vous ?"
)
print
(
" -RGB"
)
print
(
" -BRG"
)
print
(
" -GBR"
)
Rotation
=
str
(
input
(
"Entrez le type de rotation : "
))
if
Rotation
==
(
"RGB"
)
:
rotationRGB
()
elif
Rotation
==
(
"BRG"
)
:
rotationBRG
()
elif
Rotation
==
(
"GBR"
)
:
rotationGBR
else
:
clearscreen
()
rotationCouleur
()
def
rotationRGB
():
largeur
,
hauteur
=
image
.
size
imageRGB
=
image
.
copy
()
imageRGB
.
show
()
clearscreen
()
rotationCouleur
()
def
rotationBRG
():
largeur
,
hauteur
=
image
.
size
imageBRG
=
image
.
copy
()
for
ligne
in
range
(
largeur
):
for
colonne
in
range
(
hauteur
):
Rouge
,
Vert
,
Bleu
=
imageBRG
.
getpixel
((
ligne
,
colonne
))
imageBRG
.
putpixel
((
ligne
,
colonne
),(
Bleu
,
Rouge
,
Vert
))
clearscreen
()
rotationCouleur
()
imageBRG
.
show
()
def
rotationGBR
():
largeur
,
hauteur
=
image
.
size
imageGBR
=
image
.
copy
()
for
ligne
in
range
(
largeur
):
for
colonne
in
range
(
hauteur
):
Rouge
,
Vert
,
Bleu
=
imageGBR
.
getpixel
((
ligne
,
colonne
))
imageGBR
.
putpixel
((
ligne
,
colonne
),(
Vert
,
Bleu
,
Rouge
))
clearscreen
()
rotationCouleur
()
image
.
show
()
def
rotateImage
():
"""Fonction qui fait pivoter une image selon le choix de l'utilisateur.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment