Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
licenseplates
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
licenseplates
Commits
25fc5b3f
Commit
25fc5b3f
authored
Nov 21, 2011
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De rest van mijn files de horen bij mijn vorige commit
parent
2de250dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
14 deletions
+19
-14
src/GrayscaleImage.py
src/GrayscaleImage.py
+19
-14
No files found.
src/GrayscaleImage.py
View file @
25fc5b3f
...
...
@@ -10,19 +10,19 @@ class GrayscaleImage:
self
.
data
=
data
def
__iter__
(
self
):
self
.
i_x
=
-
1
self
.
i_y
=
0
self
.
__
i_x
=
-
1
self
.
__
i_y
=
0
return
self
def
next
(
self
):
self
.
i_x
+=
1
if
self
.
i_x
==
self
.
width
:
self
.
i_x
=
0
self
.
i_y
+=
1
elif
self
.
i_y
==
self
.
height
:
self
.
__
i_x
+=
1
if
self
.
__
i_x
==
self
.
width
:
self
.
__
i_x
=
0
self
.
__
i_y
+=
1
if
self
.
__
i_y
==
self
.
height
:
raise
StopIteration
else
:
return
self
[
self
.
i_y
,
self
.
i_x
]
return
self
.
__i_y
,
self
.
__i_x
,
self
[
self
.
__i_y
,
self
.
__
i_x
]
def
__getitem__
(
self
,
position
):
return
self
.
data
[
position
]
...
...
@@ -38,12 +38,17 @@ class GrayscaleImage:
imshow
(
self
.
data
,
cmap
=
"gray"
)
show
()
def
get_shape
(
self
):
return
self
.
data
.
shape
shape
=
property
(
get_shape
)
def
get_width
(
self
):
return
len
(
self
.
data
[
0
])
return
self
.
get_shape
()[
1
]
width
=
property
(
get_width
)
def
get_height
(
self
):
return
len
(
self
.
data
)
width
=
property
(
get_width
)
return
self
.
get_shape
()[
0
]
height
=
property
(
get_height
)
def
in_bounds
(
self
,
y
,
x
):
return
x
>=
0
and
x
<
self
.
width
and
y
>=
0
and
y
<
self
.
height
\ No newline at end of file
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