A1 A2 A3 A4
B1 B2 B3 B4
C1 C2 C3 C4
D1 D2 D3 D4
Assuming that your image (and some coordinates to it indicates), it is stored in memory in a line, as:
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4 D1 D2 D3 D4.
Let me simulate these parameters:
For X, and then through Y:
A1 B1 C1 D1 A2 B2 C2 D2 A3 B3 C3 D3 A4 B4 C4 D4
Now check the line how messy the access will be (like random reading, right?)
Not, for Y, and then through X
A1 A2 A3 A4 B1 B2 B3 B4 C1 C2 C3 C4 D1 D2 D3 D4
Cm? Read it straight ahead!
That's why.
source
share