1. A method for coded focal stack photographing, comprising: changing a focal surface within a single exposure time and per-pixel coding a sensor readout for each focal surface to obtain a modulation function M(y, z), where y ⊂ {y 1 , y 2 } is a two-dimensional spatial coordinate and z is a depth coordinate of a latent three-dimensional focal stack F(y, z); coding the latent three-dimensional focal stack F(y, z) into a two-dimensional sensor image I(y) by using the modulation function M(y, z); and achieving one or more of a programmable non-planar focal surface imaging, an interleaved focal stack imaging, and a compressive focal stack imaging, based on the modulation functions M(y, z) and the two-dimensional sensor image I(y), wherein in the programmable non-planar focal surface imaging, an equivalent programmable non-planar sensor surface is obtained by the modulation function M(y, z) corresponding to a shape of the focal surface; wherein in the interleaved focal stack imaging, the latent three-dimensional focal stack F(y, z) is multiplexed into the two-dimensional sensor image I(y), and a demultiplexing and a bicubic interpolation are performed for the latent three-dimensional focal stack F(y, z) to obtain a recovered full-resolution three-dimensional focal stack; and wherein in the compressive focal stack imaging, a recovered full-resolution all-in-focus image and a depth map are obtained from the two-dimensional sensor image I(y) by using a sparsity coding and a compressive sensing reconstruction algorithm in conjunction with a relative blur constraint and a transform domain spatial sparsity constraint.