--- a/graphicscomposition/openwfcompositionengine/common/src/owfimage.c Tue Apr 20 16:24:43 2010 +0100
+++ b/graphicscomposition/openwfcompositionengine/common/src/owfimage.c Tue Apr 20 16:38:10 2010 +0100
@@ -370,7 +370,49 @@
}
break;
}
-
+ case OWF_IMAGE_UYVY:
+ {
+ OWFuint8* srcPtr = (OWFuint8*) srcLinePtr;
+ OWFint y,u,v,r,g,b,x;
+ for (x = 0; x < count; x++)
+ {
+ u = srcPtr[0] - 128;
+ v = srcPtr[2] - 128;
+ y = srcPtr[3] - 16;
+
+ r = ((298 * y + 409 * u) / 256);
+ g = ((298 * y - 100 * v - 208 * u) / 256);
+ b = ((298 * y + 516 * v) / 256);
+
+ CLIP(r);
+ CLIP(g);
+ CLIP(b);
+
+ dstPtr->color.alpha = 255;
+ dstPtr->color.red = r;
+ dstPtr->color.green = g;
+ dstPtr->color.blue = b;
+ dstPtr++;
+
+ y = srcPtr[1] - 16;
+ r = ((298 * y + 409 * u) / 256);
+ g = ((298 * y - 100 * v - 208 * u) / 256);
+ b = ((298 * y + 516 * v) / 256);
+
+ CLIP(r);
+ CLIP(g);
+ CLIP(b);
+
+ dstPtr->color.alpha = 255;
+ dstPtr->color.red = r;
+ dstPtr->color.green = g;
+ dstPtr->color.blue = b;
+ dstPtr++;
+ srcPtr += 4;
+ }
+ break;
+ }
+
default:
{
return OWF_FALSE; /* source format not supported */
@@ -547,7 +589,49 @@
#endif
break;
}
-
+ case OWF_IMAGE_UYVY:
+ {
+ OWFuint8* srcPtr = (OWFuint8*) srcLinePtr;
+ OWFint y,u,v,r,g,b,x;
+ for (x = 0; x < count; x++)
+ {
+ u = srcPtr[0] - 128;
+ v = srcPtr[2] - 128;
+ y = srcPtr[3] - 16;
+
+ r = ((298 * y + 409 * u) / 256);
+ g = ((298 * y - 100 * v - 208 * u) / 256);
+ b = ((298 * y + 516 * v) / 256);
+
+ CLIP(r);
+ CLIP(g);
+ CLIP(b);
+
+ dstPtr->color.alpha = 255;
+ dstPtr->color.red = r;
+ dstPtr->color.green = g;
+ dstPtr->color.blue = b;
+ dstPtr++;
+
+ y = srcPtr[1] - 16;
+ r = ((298 * y + 409 * u) / 256);
+ g = ((298 * y - 100 * v - 208 * u) / 256);
+ b = ((298 * y + 516 * v) / 256);
+
+ CLIP(r);
+ CLIP(g);
+ CLIP(b);
+
+ dstPtr->color.alpha = 255;
+ dstPtr->color.red = r;
+ dstPtr->color.green = g;
+ dstPtr->color.blue = b;
+ dstPtr++;
+ srcPtr += 4;
+ }
+ break;
+ }
+
default:
{
return OWF_FALSE; /* destination format not supported */
@@ -1797,6 +1881,7 @@
}
case OWF_IMAGE_L8:
+ case OWF_IMAGE_UYVY:
{
return 1;
}
@@ -1852,6 +1937,7 @@
}
case OWF_IMAGE_L8:
+ case OWF_IMAGE_UYVY:
{
padding = 1;
break;