How to perform RGB->YUV conversion in C/C++?

前端 未结 2 934
闹比i
闹比i 2020-12-05 16:01

How to perform RGB->YUV conversion in C/C++?

I have some Bitmap.. RGB I need to convert it to YUV

Libs? Tuts? Articles?

2条回答
  •  无人及你
    2020-12-05 16:33

    Check this article: http://www.fourcc.org/fccyvrgb.php Conversion is quite easy so you probably could write your own function based on this

    Y  =      (0.257 * R) + (0.504 * G) + (0.098 * B) + 16
    
    Cr = V =  (0.439 * R) - (0.368 * G) - (0.071 * B) + 128
    
    Cb = U = -(0.148 * R) - (0.291 * G) + (0.439 * B) + 128
    

    Previously answered for ActionScript

提交回复
热议问题