VideoColorMatrix.getKrKb

bool getKrKb(gstvideo.types.VideoColorMatrix matrix, out double Kr, out double Kb)

Get the coefficients used to convert between Y'PbPr and R'G'B' using matrix.

When:

0.0 <= [Y',R',G',B'] <= 1.0)
 (-0.5 <= [Pb,Pr] <= 0.5)

the general conversion is given by:

Y' = Kr*R' + (1-Kr-Kb)*G' + Kb*B'
 Pb = (B'-Y')/(2*(1-Kb))
 Pr = (R'-Y')/(2*(1-Kr))

and the other way around:

R' = Y' + Cr*2*(1-Kr)
 G' = Y' - Cb*2*(1-Kb)*Kb/(1-Kr-Kb) - Cr*2*(1-Kr)*Kr/(1-Kr-Kb)
 B' = Y' + Cb*2*(1-Kb)

Parameters

matrixa #GstVideoColorMatrix
Krresult red channel coefficient
Kbresult blue channel coefficient

Returns

TRUE if matrix was a YUV color format and Kr and Kb contain valid

values.