MEX bilinear scan converter (from calcsws)