When given a set of RawImages the LayeredImage constructor does a copy. This PR adds a constructor that allows LayeredImage to take in the underlying Eigen data array (or numpy array from Python), claim ownership of the memory, and avoid the copy.
We also use ImageStack's new append_image() function to add images to the stack one on one instead of allocating a full list and copying them in. This slightly reduces the peak memory needed. We include a force_move option that allows the ImageStack to take ownership of the image and avoid doing a copy when it inserts it into the vector.
When given a set of
RawImage
s theLayeredImage
constructor does a copy. This PR adds a constructor that allowsLayeredImage
to take in the underlying Eigen data array (or numpy array from Python), claim ownership of the memory, and avoid the copy.We also use
ImageStack
's newappend_image()
function to add images to the stack one on one instead of allocating a full list and copying them in. This slightly reduces the peak memory needed. We include aforce_move
option that allows theImageStack
to take ownership of the image and avoid doing a copy when it inserts it into the vector.