Iterative approach to line-shape calculations based on the transport-relaxation equation