toColorBuffer

fun GrayU8.toColorBuffer(target: ColorBuffer? = null): ColorBuffer(source)

Converts a GrayU8 object into a ColorBuffer where each pixel in the grayscale image is mapped to an RGB color with identical red, green, and blue values.

If the target parameter is provided, the conversion is performed in-place within the specified ColorBuffer. Otherwise, a new ColorBuffer is created and returned. The returned or updated ColorBuffer has an RGB format and uses unsigned 8-bit integers for its color components.

Return

A ColorBuffer containing the RGB representation of the GrayU8 image.

Parameters

target

An optional ColorBuffer to store the converted image. If null, a new ColorBuffer is created.


fun GrayF32.toColorBuffer(target: ColorBuffer? = null): ColorBuffer(source)

Converts a GrayF32 object into a ColorBuffer where each pixel in the grayscale image is mapped to an RGB color with identical red, green, and blue values.

If the target parameter is provided, the conversion is performed in-place within the specified ColorBuffer. Otherwise, a new ColorBuffer is created and returned. The returned or updated ColorBuffer has an RGB format and uses 32-bit floats for its color components.

Return

A ColorBuffer containing the RGB representation of the GrayF32 image.

Parameters

target

An optional ColorBuffer to store the converted image. If null, a new ColorBuffer is created.


fun Planar<GrayU8>.toColorBuffer(target: ColorBuffer? = null): ColorBuffer(source)

Converts a Planar<GrayU8> object into a ColorBuffer with the same number of channels (bands).

If the target parameter is provided, the conversion is performed in-place within the specified ColorBuffer. Otherwise, a new ColorBuffer is created and returned. The returned or updated ColorBuffer has an RGB format and uses unsigned 8-bit integers for its color components.

Return

A ColorBuffer containing the RGB representation of the Planar<GrayU8> image.

Parameters

target

An optional ColorBuffer to store the converted image. If null, a new ColorBuffer is created.


@JvmName(name = "grayF32ToColorBuffer")
fun Planar<GrayF32>.toColorBuffer(target: ColorBuffer? = null): ColorBuffer(source)

Converts a Planar<GrayF32> object into a ColorBuffer with the same number of channels (bands).

If the target parameter is provided, the conversion is performed in-place within the specified ColorBuffer. Otherwise, a new ColorBuffer is created and returned. The returned or updated ColorBuffer has an RGB format and uses 32-bit floats for its color components.

Return

A ColorBuffer containing the RGB representation of the Planar<GrayF32> image.

Parameters

target

An optional ColorBuffer to store the converted image. If null, a new ColorBuffer is created.


fun ImageFlow.toColorBuffer(): ColorBuffer(source)