Ultrathin Optical Devices with Engineered Functionalities