Density functional characterization of the electronic structure and optical properties of Cr-doped SrTiO3