Explicitly index pixels rather than directly using row-major ordering