A Fast Convolution Method and Its Application in Photomask Synthesis for Wafer Contour Fidelity Using Linear Basis Expansions