Functional Nanostructured Thin Films and Devices