Calculation of the effects of velocity gradients and opacity on line transfer in laser-produced plasmas