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
@@ -150,7 +150,10 @@ ConfigureFormatDialog::ConfigureFormatDialog( QWidget *parent ) :
|
||||
m_comboBoxPixelFormat->setSizePolicy( sizePolicyPixelFormat );
|
||||
m_comboBoxPixelFormat->setAcceptDrops( true );
|
||||
m_comboBoxPixelFormat->clear();
|
||||
m_comboBoxPixelFormat->insertItems( 0, PlaYUVerFrame::supportedPixelFormatListNames() );
|
||||
for( UInt i=0; i<PlaYUVerFrame::supportedPixelFormatListNames().size();i++ )
|
||||
{
|
||||
m_comboBoxPixelFormat->insertItem( i, PlaYUVerFrame::supportedPixelFormatListNames()[i].data() );
|
||||
}
|
||||
m_comboBoxPixelFormat->setCurrentIndex( 1 );
|
||||
|
||||
MainLayout->addItem( new QSpacerItem( 10, 20, QSizePolicy::Minimum ) );
|
||||
|
||||
@@ -51,11 +51,10 @@ Void QualityHandle::createActions()
|
||||
|
||||
m_mapperQualityMetric = new QSignalMapper( this );
|
||||
|
||||
QStringList qualityMetrics = PlaYUVerFrame::supportedQualityMetricsList();
|
||||
QAction* currAction;
|
||||
for( Int i = 0; i < qualityMetrics.size(); i++ )
|
||||
for( UInt i = 0; i < PlaYUVerFrame::supportedQualityMetricsList().size(); i++ )
|
||||
{
|
||||
currAction = new QAction( qualityMetrics.at( i ), this );
|
||||
currAction = new QAction( PlaYUVerFrame::supportedQualityMetricsList()[i].data(), this );
|
||||
currAction->setCheckable( true );
|
||||
m_actionGroupQualityMetric->addAction( currAction );
|
||||
connect( currAction, SIGNAL( triggered() ), m_mapperQualityMetric, SLOT( map() ) );
|
||||
|
||||
@@ -49,7 +49,10 @@ QualityMeasurementSidebar::QualityMeasurementSidebar( QWidget* parent, PlaYUVerS
|
||||
RecLabel->setAlignment( Qt::AlignVCenter | Qt::AlignRight );
|
||||
|
||||
m_comboBoxMetric = new QComboBox;
|
||||
m_comboBoxMetric->insertItems( 0, PlaYUVerFrame::supportedQualityMetricsList() );
|
||||
for( UInt i=0; i<PlaYUVerFrame::supportedQualityMetricsList().size();i++ )
|
||||
{
|
||||
m_comboBoxMetric->insertItem( i, PlaYUVerFrame::supportedQualityMetricsList()[i].data() );
|
||||
}
|
||||
m_comboBoxMetric->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||
m_comboBoxMetric->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||
|
||||
@@ -204,7 +207,7 @@ Void QualityMeasurementSidebar::updateSidebarData()
|
||||
Void QualityMeasurementSidebar::updateQualityMetric( Int idx )
|
||||
{
|
||||
m_comboBoxMetric->setCurrentIndex( idx );
|
||||
QString labelQuality = PlaYUVerFrame::supportedQualityMetricsList().at( idx );
|
||||
QString labelQuality( PlaYUVerFrame::supportedQualityMetricsList()[idx].data() );
|
||||
m_ppcLabelQualityLabel[LUMA]->setText( labelQuality + " Y" );
|
||||
m_ppcLabelQualityLabel[CHROMA_U]->setText( labelQuality + " U" );
|
||||
m_ppcLabelQualityLabel[CHROMA_V]->setText( labelQuality + " V" );
|
||||
|
||||
+2
-1
@@ -218,7 +218,8 @@ Void VideoHandle::update()
|
||||
QString resolution;
|
||||
if( pcFrame )
|
||||
{
|
||||
m_pcColorSpace->setText( PlaYUVerFrame::supportedPixelFormatListNames().at( pcFrame->getPelFormat() ) );
|
||||
QString pelFmt( PlaYUVerFrame::supportedPixelFormatListNames()[pcFrame->getPelFormat()].data() );
|
||||
m_pcColorSpace->setText( pelFmt );
|
||||
resolution.append( QString( "%1x%2" ).arg( pcFrame->getWidth() ).arg( pcFrame->getHeight() ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
#include <QMouseEvent>
|
||||
|
||||
@@ -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