Design of continuous and quantized amplitude holograms by generalized projections