toGrayF32

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

Converts this ColorBuffer to a grayscale image represented as a GrayF32 object. The red channel of the color buffer is used to calculate the grayscale values.

Return

A GrayF32 instance containing the grayscale representation of the ColorBuffer.

Parameters

target

An optional GrayF32 instance to store the result. If not provided, a new instance will be created.