Applied Digital Optics: From Micro-optics to Nanophotonics