A complete characterization of pre-Mueller and Mueller matrices in polarization optics