Table 1. Table showing the corner cases and calculation for an arbitrary pixel (where x,y denote pixel coordinates and w,h abbreviates width-in-pixels and height-in-pixels).
Vector | Coordinates | |
---|---|---|
Top-left corner | o | [ox oy oz] |
Top-right corner | o+u | [ox+ux oy+uy oz+uz] |
Bottom-left corner | o+v | [ox+vx oy+vy oz+vz] |
Bottom-right corner | o+u+v | [ox+ux+vx oy+uy+vy oz+uz+vz] |
Any pixel | o+x/w*u+y/h*v | [ox+x/w*ux+y/h*vx oy+x/w*uy+y/h*vy oz+x/w*uz+y/h*vz] |