3D camera based on linear-mode gain-modulated avalanche photodiodes