I understand what a native array is and how to use it. But what is a native slice? Is it just some ‘window’ into another native array? Sort of a virtual array that shares the same memory?
And where does ‘stride set’ come into the native slice? Isn’t a stride usually a space between two rows allowing you to map onto a 1d array that represents 2d data like a rectangle within an image? How to use? I can find no explanation.
It seems when the native slice is created here:
public NativeSlice(NativeArray array, int start, int length);
all you give is an offset and length (presumably a virtual window into the native array). But there is no mention of STRIDE here.
Do you construct a 1-row native slice first, then use SliceWithStide() to specify a stride to use for multiple rows?
(Just general overview here, i’m trying to copy a rectangular area of a larger native array which represents ‘2d image data’ into a smaller native array, somehow, with maximum performance. Is a slice the way to do it, or is there a better way, WITHOUT unsafe code/utility?)