Nested for loops (cont'd)
The code in
Listing 3 detects edges
- using adjacent pixels on each row
- and sets the color of
the corresponding pixel in the output picture to red
- if an edge is detected.
(The output picture referred to by display was
instantiated as an instance variable in Listing 1.)