An armed police officer fatally shot a man holding an air rifle because he "thought he was going to die", an inquest has heard.