working C++ implementation of exposure time integation