Characterization of the microstructure in random and textured polycrystals and single crystals by diffraction line profile analysis