an all - optical device for data processing is presented . the device comprises at least one optical waveguide unit made of linear media and configured to provide multiple total internal reflections of light passing therethrough , the waveguide unit comprising a waveguide portion for interaction between reflected light components of input light ; an input aperture arrangement formed by at least one input aperture at an input facet of the waveguide portion ; and an output aperture arrangement forme by at least one output aperture at an output facet of the waveguide portion . the geometry of the input aperture arrangement and the waveguide portion is selected so as to determine an interference pattern resulting from a diffraction - based interaction between light components of a predetermined wavelength while the light components propagate through the waveguide portion , a location of the at least one output aperture relative to features of the interference pattern being selected to provide at the output an appropriate modulation of at least one parameter of the input light .