Closed crlf0710 closed 4 years ago
Gaps that are multiples of the element size may as well be handled through increasing the logical image size. But for other gaps, the elements no longer form a single slice as they are not contiguous in memory. As current DSTs in Rust can only represent contiguous memory, I have not yet found any way to nicely represent a reference to such a memory region that is as generic as a [T]
-slice.
I realized a different variant of this problem: It could be very useful to view a rgba
-image as an rgb
-image without an alpha channel in some cases. Skipping the alpha channel to make this zerocopy leads to the exact same problem, as mem::size_of::<[u8; 3]> == 3
but the gap should have size 1
.
I think i see your position.
Currently the code assumes that the rows are continuous. In reality, there might be
Layout
s that want to align the start of each row somehow, leaving some small gap between rows and at the end?