Skip to main content

c_byte_strides

Function c_byte_strides 

Source
pub fn c_byte_strides(
    shape: &[u64],
    esz: i64,
    layout: Option<PixelLayout>,
    row_stride: Option<usize>,
) -> Vec<i64>
Expand description

Row-major byte strides for shape, with the row dimension replaced by row_stride when one is recorded.

The one definition of the stride convention both wire formats carry: the descriptor ([from_parts]) and the blob (blob::export). See [from_parts] for which dimension is the row dimension per layout, and why a planar image’s plane stride follows the pitch. Also the source of the C API’s ef_tensor_strides, so every surface reports one layout.