Page 29 of 60
"Basic of computer science ”
by Shubham Shewale
e.g. 2) draw the image from given code:
(1, 1, 0, 6, 1, 1)
(1, 0, 8, 1)
(0, 2, 1, 1, 0, 2, 1, 1, 0, 2)
(0, 2, 1, 1, 0, 2, 1, 1, 0, 2)
(0, 10)
(0, 10)
(0, 1, 1, 0, 6, 1, 0, 1)
(0, 2, 1, 0, 4, 1, 0, 2)
(1, 0, 2, 1, 1, 1, 1, 0, 2, 1)
(1, 1, 0, 2, 1, 1, 0, 2, 1, 1)
Solution:
0 = Shaded pixel
1 = un-shaded pixel
We will gate the image like this: