pixelPack

Convert [M, N, P] slice to MxN slice of P arrays.

pixelPack
(
size_t chnls
InputType
size_t dims
SliceKind kind
)
(
Slice!(InputType*, dims, kind) image
)

Examples

// dfmt off
Slice!(double*, 3) rgb = [
    1.0, 0.0, 0.0,
    0.0, 1.0, 0.0,
    0.0, 0.0, 1.0,
    0.470588, 0.470588, 0.470588
].sliced(4, 1, 3);
// dfmt on

auto packed = pixelPack!3(rgb);
assert(packed.shape == [4 * 1]);
assert(packed[0].length == 3);

Meta