xyz2Bgr

Convert XYZ input to BGR.

Slice!(ReturnType*, 3)
xyz2Bgr
(
ReturnType = double
T
)
(
Slice!(T, 3) input
)

Examples

import std.math : approxEqual;

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

Slice!(double*, 3) xyz = [
    0.412456, 0.212673, 0.019334,
    0.357576, 0.715152, 0.119192,
    0.180438, 0.072175, 0.950304,
    0.178518, 0.187821, 0.204505
].sliced(4, 1, 3);
// dfmt on

assert(approxEqual(xyz.xyz2Bgr, bgr, 0.01, 1e-04));

Meta