pub struct NDArrayInfo {Show 13 fields
pub total_bytes: usize,
pub bytes_per_element: usize,
pub num_elements: usize,
pub x_size: usize,
pub y_size: usize,
pub color_size: usize,
pub x_dim: usize,
pub y_dim: usize,
pub color_dim: usize,
pub x_stride: usize,
pub y_stride: usize,
pub color_stride: usize,
pub color_mode: NDColorMode,
}Expand description
Computed info about an NDArray’s layout (matching C++ NDArrayInfo_t).
Fields§
§total_bytes: usize§bytes_per_element: usize§num_elements: usize§x_size: usize§y_size: usize§color_size: usize§x_dim: usizeWhich dimension index is X.
y_dim: usizeWhich dimension index is Y.
color_dim: usizeWhich dimension index is color (0 if mono).
x_stride: usizeElements between successive X values.
y_stride: usizeElements between successive Y values.
color_stride: usizeElements between successive color values.
color_mode: NDColorModeResolved color mode.
Implementations§
Source§impl NDArrayInfo
impl NDArrayInfo
Sourcepub fn user_dims(&self) -> [usize; 3]
pub fn user_dims(&self) -> [usize; 3]
C++ userDims = {xDim, yDim, colorDim} (NDPluginROI.cpp:80-82,
NDPluginTransform.cpp:492-494): the map from a logical image axis
(0 = X, 1 = Y, 2 = color) to the physical NDArray::dims slot
that carries it.
Any plugin whose user-facing Dim0/Dim1/Dim2 mean X/Y/color must reach
dims through this map and never with the logical index itself: the two
only coincide for Mono/Bayer/YUV and RGB3 layouts. For RGB1 the array is
[color, x, y], so the X axis lives in dims[1] — indexing dims[0]
for “Dim0” hands back the color axis.
Trait Implementations§
Source§impl Clone for NDArrayInfo
impl Clone for NDArrayInfo
Source§fn clone(&self) -> NDArrayInfo
fn clone(&self) -> NDArrayInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more