Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Ap Almohamedalsadou Fatima
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Fatima Almohamed Alsadou
Ap Almohamedalsadou Fatima
Commits
c6b97f9b
Commit
c6b97f9b
authored
1 year ago
by
Almohamed Alsadou Fatima
Browse files
Options
Downloads
Patches
Plain Diff
fonction enregistrement_image_fichier
parent
f46904d3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
projet/classBlock.py
+7
-3
7 additions, 3 deletions
projet/classBlock.py
projet/enregistrement_image_fichier.py
+27
-0
27 additions, 0 deletions
projet/enregistrement_image_fichier.py
projet/enregistrementcalbuth
+0
-0
0 additions, 0 deletions
projet/enregistrementcalbuth
with
34 additions
and
3 deletions
projet/classBlock.py
+
7
−
3
View file @
c6b97f9b
...
@@ -13,7 +13,7 @@ class Bloc :
...
@@ -13,7 +13,7 @@ class Bloc :
4
4
$$$ bloc2=Bloc((0,8),(8,0),(0,0,255),0)
$$$ bloc2=Bloc((0,8),(8,0),(0,0,255),0)
$$$ bloc2.decoupage_sous_blocs()
$$$ bloc2.decoupage_sous_blocs()
(8)
[(0,8),(4.0,4.0),(4.0,8),(8,4.0),(0,4.0),(4.0,0),(4.0,4.0),(8,0)]
"""
"""
...
@@ -44,8 +44,12 @@ class Bloc :
...
@@ -44,8 +44,12 @@ class Bloc :
def
decoupage_sous_blocs
(
self
)
->
list
[
tuple
[
int
,
int
],
tuple
[
int
,
int
],
tuple
[
int
,
int
],
tuple
[
int
,
int
]]
:
def
decoupage_sous_blocs
(
self
)
->
list
[
tuple
[
int
,
int
],
tuple
[
int
,
int
],
tuple
[
int
,
int
],
tuple
[
int
,
int
]]
:
"""
retourne les coordonnees des quatres sous bloc decoupes a partir du bloc sel
"""
retourne les coordonnees des quatres sous bloc decoupes a partir du bloc sel
"""
"""
#return [(self.pxbasdroite[0]//2,self.pxhautgauche[1]),(self.pxbasdroite[0],self.pxhautgauche[1]),((self.pxbasdroite)[0]//2,self.pxhautgauche[1]//2),(self.pxbasdroite[0],self.pxhautgauche[1]//2)]
return
[(
0
,
self
.
pxhautgauche
[
1
]),(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
]
/
2
)
\
return
[(
0
,(
self
.
pxhautgauche
)[
1
]),(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
]
/
2
),(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
]),(
self
.
pxbasdroite
[
0
],
self
.
pxhautgauche
[
1
]
/
2
),(
0
,
self
.
pxhautgauche
[
1
]
/
2
),(
self
.
pxbasdroite
[
0
]
/
2
,
0
),(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
]
/
2
),(
self
.
pxbasdroite
[
0
],
0
)]
,(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
])
\
,(
self
.
pxbasdroite
[
0
],
self
.
pxhautgauche
[
1
]
/
2
)
\
,(
0
,
self
.
pxhautgauche
[
1
]
/
2
),(
self
.
pxbasdroite
[
0
]
/
2
,
0
)
\
,(
self
.
pxbasdroite
[
0
]
/
2
,
self
.
pxhautgauche
[
1
]
/
2
)
\
,(
self
.
pxbasdroite
[
0
],
0
)]
...
...
This diff is collapsed.
Click to expand it.
projet/enregistrement_image_fichier.py
0 → 100644
+
27
−
0
View file @
c6b97f9b
from
PIL
import
Image
def
enregistrement_image_fichier
(
chemin_image
:
str
,
fichier
:
str
):
"""
enregistre limage image dans le fichier fichier sous une forme textuel
Précondition : le fichier et limage existent
Exemple(s) :
$$$
"""
imageaconvertir
=
Image
.
open
(
chemin_image
)
dimension_image
=
imageaconvertir
.
size
with
open
(
fichier
,
'
w
'
)
as
f
:
for
(
x
,
y
)
in
range
(
len
(
dimension_image
)):
fichier
.
write
((
x
,
y
),
'
imageaconvertir.getpixel(x,y)
'
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
projet/enregistrementcalbuth
0 → 100644
+
0
−
0
View file @
c6b97f9b
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment