2009年9月9日 星期三

Invert Chrominance Phase

I saw there is a effect from Premiere Pro which is called Invert Chrominance Phase.
And I guess it probably exchange the UV in YUV color space. And the result color from my testing code looks almost same as the result in Premiere.
Following is the HLSL code for that. Formulat is from Wiki.

float y, u, v;
y = dot(thePixel.rgb, float3(0.299, 0.587, 0.114));
u = dot(thePixel.rgb, float3(-0.14713, -0.28886, 0.436));
v = dot(thePixel.rgb, float3( 0.615, -0.51499, -0.10001));

thePixel.r = y + 1.13983 * u ;
thePixel.g = y - 0.39465 * v - 0.58060 * u ;
thePixel.b = y + 2.03211 * v ;

0 comments:

发表评论