gray2rgb

Convert gray image to RGB.

Uses grayscale value and assigns it's value to each of three channels for the RGB image version.

Slice!(SliceKind.contiguous, [3], V*)
gray2rgb
pure nothrow
(
V
)
(
Slice!(SliceKind.contiguous, [2], V*) input
,
Slice!(SliceKind.contiguous, [3], V*) prealloc = emptySlice!([3], V)
)

Parameters

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

Grayscale image, to be converted to the RGB.

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

Pre-allocated range, where RGB image will be copied. Default argument is an empty slice, where new data is allocated and returned. If given slice is not of corresponding shape(range.shape[0], range.shape[1], 3), it is discarded and allocated anew.

Return Value

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

Returns RGB version of the given grayscale image.

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

Meta