This invention describes a corneal topographer with a light source to project a pattern light on the cornea, imaging optics for collecting the reflection from the cornea and projecting it on to a photo-sensor, an optical mask to modulate the light beam such that focusing error of the corneal image results in displacement of its spatial spectrum relative to a reference spectrum. Defocus maps, depth-maps and a corneal topogram can be constructed by measuring and processing the spectral displacement corresponding different sub-regions of the cornea. The cornea topographer is compact and inexpensive. The corneal topograph can be used in refractive eye surgery and in contact lens fitting.