Change functions related with PlaYUVerFrame and QImage

This commit is contained in:
jfmcarreira committed 2014-02-23 01:16:03 +00:00
1 parent 4560b4e2d8
commit 0d6aa2b5bc
5 files changed
+38 -28

No files matched your search

+24
View File
@@ -25,6 +25,8 @@
#include "PlaYUVerFrame.h"
#include "LibMemAlloc.h"
#include <QImage>
namespace plaYUVer
{
@@ -207,6 +209,28 @@ Void PlaYUVerFrame::CopyFrom( PlaYUVerFrame* input_frame )
}
}
QImage PlaYUVerFrame::getQimage()
{
QImage img( m_uiWidth, m_uiHeight, QImage::Format_RGB888 );
Pel*** bufferRGB = getPelBufferRGB();
if( sizeof(Pel) == sizeof(unsigned char) )
{
for( Int y = 0; y < m_uiHeight; y++ )
{
for( Int x = 0; x < m_uiWidth; x++ )
{
img.setPixel( x, y, qRgb( bufferRGB[0][y][x], bufferRGB[1][y][x], bufferRGB[2][y][x] ) );
}
}
}
else
{
Q_ASSERT( 0 );
}
return img;
}
UInt64 PlaYUVerFrame::getBytesPerFrame()
{
switch( m_iPixelFormat )