Processing nanostructured metal and metal-matrix coatings by thermal and cold spraying