rgb2yuv

Convert RGB image format to YUV.

YUV images in dcv are organized in the same buffer plane where quantity of luma and chroma values are the same (as in YUV444 format).

Slice!(SliceKind.contiguous, [3], V*)
rgb2yuv
pure nothrow
(
V
)
(
Slice!(SliceKind.contiguous, [3], V*) input
,
Slice!(SliceKind.contiguous, [3], V*) prealloc = emptySlice!([3], V)
)
in { assert (input.length!2 == 3, "Invalid channel count."); }

Parameters

input
Type: Slice!(SliceKind.contiguous, [3], V*)

Input RGB image.

prealloc
Type: Slice!(SliceKind.contiguous, [3], V*)

Optional pre-allocated buffer. If given, has to be of same shape as input image, otherwise gets reallocated.

Return Value

Type: Slice!(SliceKind.contiguous, [3], V*)

Resulting YUV image slice.

Note: Input and pre-allocated slices' strides must be identical.

Meta