CS 111 - 10/25/12
Picture pixel position manipulation
move the colors in position (x, y)
to position (x2, y2)
Mirror Image is one such example
the pixel at position (x, y)
is moved to (wid-1 - x, y)
Assume a picture of width of 100
Original x New X
0 99
1 98
2 97
10 89
99 0
98 1
97 2
Once these start, ending pairs are known
it is often easy to determine a formula that
computes these results
90 degree rotation:
Assume a picture of size width: 100, height: 75
Original Rotated
x y x y
0 0 74 0
0 1 73 0
0 2 72 0
rotated y = original x
rotated x = height - 1 - y