Multiplexed readout electronics for imaging spectroscopy of high-energy X-ray and gamma photons