Microstructure of functionally graded tools and materials covered by thin films studied by x-ray diffraction