View Single Post
Old 24th February 2015, 16:28   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
This any good to you ?

EDIT: Take 3
Code:
Function RGB_2_YUV(Int RGB_Color,String Matrix) {
    RGB_Color=RT_BitAnd(RGB_Color,$FFFFFF)
    BlankClip(Width=16,Height=16,Length=1,Color=RGB_Color)
    c=ConvertToYV12(matrix=matrix)
    current_frame=0
    Y=c.YPlaneMin() U=c.UPlaneMin() V=c.VPlaneMin()
    Col = (((Y*256)+U)*256)+V
    return Col
}

RGB=$FFFFFF
Matrix= "Rec601"             # "Rec601", "Rec709", "PC601", "PC709"


YUV=RGB_2_YUV(RGB,Matrix)
SRGB=RT_Hex(RGB,6)
SYUV=RT_Hex(YUV,6)

Messageclip("RGB = $"+SRGB+" : YUV=$"+SYUV + " (Matrix="+Matrix+")")
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 25th February 2015 at 00:19.
StainlessS is offline   Reply With Quote