1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Color compatibility with uTox

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-08-29 14:33:19 +02:00
parent 6348976df7
commit 938650fa40
3 changed files with 5 additions and 6 deletions

View File

@ -190,7 +190,7 @@ vpx_image Camera::getLastVPXImage()
int w = frame.size().width, h = frame.size().height;
vpx_img_alloc(&img, VPX_IMG_FMT_I420, w, h, 1); // I420 == YUV420P, same as YV12 with U and V switched
qWarning() << "Camera::getLastVPXImage: Using experimental RGB32 conversion code" << w << ","<<h;
//qWarning() << "Camera::getLastVPXImage: Using experimental RGB32 conversion code" << w << ","<<h;
size_t i=0, j=0;
for( int line = 0; line < h; ++line )
@ -205,8 +205,8 @@ vpx_image Camera::getLastVPXImage()
uint8_t b = srcrow[x][0];
img.planes[VPX_PLANE_Y][i] = ((66*r + 129*g + 25*b) >> 8) + 16;
img.planes[VPX_PLANE_U][j] = ((-38*r + -74*g + 112*b) >> 8) + 128;
img.planes[VPX_PLANE_V][j] = ((112*r + -94*g + -18*b) >> 8) + 128;
img.planes[VPX_PLANE_V][j] = ((-38*r + -74*g + 112*b) >> 8) + 128;
img.planes[VPX_PLANE_U][j] = ((112*r + -94*g + -18*b) >> 8) + 128;
i++;
j++;

View File

@ -89,8 +89,8 @@ QImage NetCamView::convert(vpx_image& frame)
QImage img(w, h, QImage::Format_RGB32);
uint8_t* yData = frame.planes[VPX_PLANE_Y];
uint8_t* uData = frame.planes[VPX_PLANE_U];
uint8_t* vData = frame.planes[VPX_PLANE_V];
uint8_t* uData = frame.planes[VPX_PLANE_V];
uint8_t* vData = frame.planes[VPX_PLANE_U];
for (int i = 0; i< h; i++)
{
uint32_t* scanline = (uint32_t*)img.scanLine(i);

View File

@ -64,7 +64,6 @@ void SelfCamView::showEvent(QShowEvent* event)
void SelfCamView::updateDisplay()
{
cam->getLastVPXImage();
displayLabel->setPixmap(QPixmap::fromImage(cam->getLastImage()));
}