Okay. To explain that particular point, the image is just a 2D array of integers. If a 2D array is stored in a contiguous block of memory in "row-major" order, the corresponding 1D index of the 2D index [row][col] is [row*numCols+col]:
| 0 | 1 | 2 | 3 | ... | numCols-1 |
| numCols+0 | numCols+1 | numCols+2 | numCols+3 | ... | numCols+(numCols-1) |
| 2*numCols+0 | 2*numCols+1 | 2*numCols+2 | 2*numCols+3 | ... | 2*numCols+(numCols-1) |
| 3*numCols+0 | 3*numCols+1 | 3*numCols+2 | 3*numCols+3 | ... | 3*numCols+(numCols-1) |
| ... | ... | ... | ... | ... | ... |
| (numRows-1)*numCols+0 | (numRows-1)*numCols+1 | (numRows-1)*numCols+2 | (numRows-1)*numCols+3 | ... | (numRows-1)*numCols+(numCols-1) |
In the case of an image, x=col, y=row, width=numCols, height=numRows. Would that clear things up?