[Opalvoip-svn] SF.net SVN: opalvoip:[34852] ptlib/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2016-06-24 08:58:01
|
Revision: 34852 http://sourceforge.net/p/opalvoip/code/34852 Author: rjongbloed Date: 2016-06-24 08:57:58 +0000 (Fri, 24 Jun 2016) Log Message: ----------- Allow PColourConverter::FillYUV420P() to take a YUV instead of RGB colour Modified Paths: -------------- ptlib/trunk/include/ptlib/vconvert.h ptlib/trunk/src/ptlib/common/vconvert.cxx Modified: ptlib/trunk/include/ptlib/vconvert.h =================================================================== --- ptlib/trunk/include/ptlib/vconvert.h 2016-06-23 10:17:17 UTC (rev 34851) +++ ptlib/trunk/include/ptlib/vconvert.h 2016-06-24 08:57:58 UTC (rev 34852) @@ -319,7 +319,8 @@ static bool FillYUV420P( unsigned x, unsigned y, unsigned width, unsigned height, unsigned frameWidth, unsigned frameHeight, BYTE * yuv, - unsigned r, unsigned g, unsigned b + unsigned r_or_y, unsigned g_or_u, unsigned b_or_v, + bool rgb = true ); protected: Modified: ptlib/trunk/src/ptlib/common/vconvert.cxx =================================================================== --- ptlib/trunk/src/ptlib/common/vconvert.cxx 2016-06-23 10:17:17 UTC (rev 34851) +++ ptlib/trunk/src/ptlib/common/vconvert.cxx 2016-06-24 08:57:58 UTC (rev 34852) @@ -925,7 +925,7 @@ bool PColourConverter::FillYUV420P(unsigned x, unsigned y, unsigned width, unsigned height, unsigned frameWidth, unsigned frameHeight, BYTE * yuv, - unsigned r, unsigned g, unsigned b) + unsigned r_or_y, unsigned g_or_u, unsigned b_or_v, bool rgb) { if (frameWidth == 0) frameWidth = width; @@ -938,7 +938,13 @@ } BYTE Y, U, V; - PColourConverter::RGBtoYUV(r, g, b, Y, U, V); + if (rgb) + PColourConverter::RGBtoYUV(r_or_y, g_or_u, b_or_v, Y, U, V); + else { + Y = (BYTE)r_or_y; + U = (BYTE)g_or_u; + V = (BYTE)b_or_v; + } unsigned planeWidth = (frameWidth+1)&~1; unsigned planeHeight = (frameHeight+1)&~1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |