MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ rgba_to_gray() [2/2]

MAYAFLUX_API std::vector< float > MayaFlux::Kinesis::Vision::rgba_to_gray ( std::span< const float >  rgba,
uint32_t  w,
uint32_t  h 
)

Convert RGBA to luminance gray using BT.601 coefficients.

Output is one float per pixel. Alpha channel is discarded. Coefficients: R*0.299 + G*0.587 + B*0.114

Parameters
rgbaInterleaved RGBA span, size must be w * h * 4.
wImage width in pixels.
hImage height in pixels.
Returns
Grayscale float vector of length w * h.

Definition at line 87 of file PixelOps.cpp.

88{
89 std::vector<float> out(static_cast<size_t>(w) * h);
90 rgba_to_gray(rgba, out, w, h);
91 return out;
92}
uint32_t h
Definition InkPress.cpp:28
void rgba_to_gray(std::span< const float > rgba, std::span< float > dst, uint32_t w, uint32_t h)
Convert RGBA to luminance gray using BT.601 coefficients.
Definition PixelOps.cpp:18

References h, and rgba_to_gray().

+ Here is the call graph for this function: