Single-Photon Time-of-Flight camera for 3D ranging and TCSPC