Remove Qt dependencies inside PlaYUVerFrame: one step closer to define PlaYUVerLib
This commit is contained in:
1 parent
dfa2c92a9a
commit
1b84cbb18a
9 files changed
+33
-29
No files matched your search
@@ -40,15 +40,15 @@
|
||||
namespace plaYUVer
|
||||
{
|
||||
|
||||
QStringList PlaYUVerFrame::supportedPixelFormatListNames()
|
||||
std::vector<std::string> PlaYUVerFrame::supportedPixelFormatListNames()
|
||||
{
|
||||
QStringList formats;
|
||||
std::vector<std::string> formatsList;
|
||||
Int numberFormats = PLAYUVER_NUMBER_FORMATS;
|
||||
for( Int i = 0; i < numberFormats; i++ )
|
||||
{
|
||||
formats << g_PlaYUVerFramePelFormatsList[i].name;
|
||||
formatsList.push_back( g_PlaYUVerFramePelFormatsList[i].name );
|
||||
}
|
||||
return formats;
|
||||
return formatsList;
|
||||
}
|
||||
|
||||
PlaYUVerFrame::PlaYUVerFrame( UInt width, UInt height, Int pel_format )
|
||||
|
||||
+7
-10
@@ -28,7 +28,7 @@
|
||||
#include <iostream>
|
||||
#include <cstdio>
|
||||
#include <cassert>
|
||||
#include <QtCore>
|
||||
#include <vector>
|
||||
#include "PlaYUVerDefs.h"
|
||||
#include "PlaYUVerFrameStats.h"
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
NUMBER_FORMATS
|
||||
};
|
||||
|
||||
static QStringList supportedPixelFormatListNames();
|
||||
static std::vector<std::string> supportedPixelFormatListNames();
|
||||
|
||||
PlaYUVerFrame( UInt width = 0, UInt height = 0, Int pel_format = 0 );
|
||||
PlaYUVerFrame( PlaYUVerFrame * );
|
||||
@@ -185,14 +185,12 @@ public:
|
||||
NUMBER_METRICS,
|
||||
};
|
||||
|
||||
static QStringList supportedQualityMetricsList()
|
||||
static std::vector<std::string> supportedQualityMetricsList()
|
||||
{
|
||||
QStringList metrics;
|
||||
metrics << "PSNR"
|
||||
<< "MSE"
|
||||
<< "SSIM" // SSIM
|
||||
;
|
||||
assert( metrics.size() == NUMBER_METRICS );
|
||||
std::vector<std::string> metrics;
|
||||
metrics.push_back( "PSNR" );
|
||||
metrics.push_back( "MSE" );
|
||||
metrics.push_back( "SSIM" );
|
||||
return metrics;
|
||||
}
|
||||
|
||||
@@ -215,7 +213,6 @@ private:
|
||||
Pel*** m_pppcInputPel;
|
||||
UChar* m_pcRGB32;
|
||||
|
||||
Void adjustSelectedAreaDims( QRect &area, Int pel_format );
|
||||
Void init( UInt width, UInt height, Int pel_format );
|
||||
Void openPixfc();
|
||||
Void closePixfc();
|
||||
|
||||
@@ -80,10 +80,9 @@ Void PlaYUVerFrameStats::calcHistogram()
|
||||
|
||||
if( !m_pdHistogram )
|
||||
{
|
||||
qWarning( ) << "PlaYUVerFrameStats::calcHistogramValuess: "
|
||||
"Unable to allocate memory!"
|
||||
<< endl;
|
||||
|
||||
// qWarning( ) << "PlaYUVerFrameStats::calcHistogramValuess: "
|
||||
// "Unable to allocate memory!"
|
||||
// << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,8 +209,8 @@ Bool PlaYUVerStream::open( QString filename, UInt width, UInt height, Int input_
|
||||
return m_bInit;
|
||||
}
|
||||
|
||||
m_cStreamInformationString = "[" + m_cFormatName + " / " + m_cCodedName + " / " + PlaYUVerFrame::supportedPixelFormatListNames().at( m_iPixelFormat ) + "] "
|
||||
+ QFileInfo( m_cFilename ).fileName();
|
||||
QString pelFmtName( PlaYUVerFrame::supportedPixelFormatListNames()[m_iPixelFormat].data() );
|
||||
m_cStreamInformationString = "[" + m_cFormatName + " / " + m_cCodedName + " / " + pelFmtName + "] " + QFileInfo( m_cFilename ).fileName();
|
||||
|
||||
m_iCurrFrameNum = -1;
|
||||
|
||||
@@ -304,10 +304,10 @@ Bool PlaYUVerStream::guessFormat( QString filename, UInt& rWidth, UInt& rHeight,
|
||||
{
|
||||
bGuessed = false;
|
||||
// Guess pixel format
|
||||
QStringList formats_list = PlaYUVerFrame::supportedPixelFormatListNames();
|
||||
QVector<std::string> formats_list = QVector<std::string>::fromStdVector( PlaYUVerFrame::supportedPixelFormatListNames() );
|
||||
for( Int i = 0; i < formats_list.size(); i++ )
|
||||
{
|
||||
if( FilenameShort.contains( formats_list.at( i ), Qt::CaseInsensitive ) )
|
||||
if( FilenameShort.contains( formats_list.at( i ).data(), Qt::CaseInsensitive ) )
|
||||
{
|
||||
rInputFormat = i;
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user