General theory for performing an optical transform | Synapse