|
@@ -4950,12 +4950,13 @@ void tnsHSL2RGB(real *hsl, real *rgb) {
|
|
rgb[2] = hue2rgb(p, q, hsl[0] - 1./3);
|
|
rgb[2] = hue2rgb(p, q, hsl[0] - 1./3);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+// https://web.archive.org/web/20180423091842/http://www.equasys.de/colorconversion.html
|
|
void tnsYUV2RGB(real* yuv,real* rgb){
|
|
void tnsYUV2RGB(real* yuv,real* rgb){
|
|
yuv[0]=1.1643*(yuv[0]-0.0625);
|
|
yuv[0]=1.1643*(yuv[0]-0.0625);
|
|
yuv[1]-=0.5; yuv[2]-=0.5;
|
|
yuv[1]-=0.5; yuv[2]-=0.5;
|
|
- rgb[0] = (yuv[0] + 1.28033 * yuv[2]);
|
|
|
|
- rgb[1] = (yuv[0] - 0.21482 * yuv[1] - 0.38059 * yuv[2]);
|
|
|
|
- rgb[2] = (yuv[0] + 2.12798 * yuv[1]);
|
|
|
|
|
|
+ rgb[0] = (yuv[0] + 1.793 * yuv[2]);
|
|
|
|
+ rgb[1] = (yuv[0] - 0.213 * yuv[1] - 0.533 * yuv[2]);
|
|
|
|
+ rgb[2] = (yuv[0] + 2.112 * yuv[1]);
|
|
}
|
|
}
|
|
|
|
|
|
void tnsClearAll(){
|
|
void tnsClearAll(){
|