Merge branch 'master' into jfmcarreira-dev

This commit is contained in:
jfmcarreira committed 2014-03-22 18:23:26 +00:00
commit 0a53f4117a
12 files changed
+94 -555

No files matched your search

-5
View File
@@ -50,11 +50,6 @@ ADD_OPTION(USE_FFMPEG "Add FFMPEG support" OFF )
######################################################################################
INCLUDE( cmake/LibQT.cmake )
INCLUDE_DIRECTORIES( ${EXTERNAL_SRC}/scode )
ADD_LIBRARY( Scode ${EXTERNAL_SRC}/scode/viewarea.cpp ${EXTERNAL_SRC}/scode/gridmanager.cpp ${EXTERNAL_SRC}/scode/scosettings.cpp )
SET( LINKER_LIBS ${LINKER_LIBS} Scode )
IF( USE_OPENCV )
FIND_PACKAGE( OpenCV )
IF( NOT OpenCV_FOUND)
-361
View File
@@ -1,361 +0,0 @@
/***************************************************************************
* This file is a part of SCode project *
* IT - Instituto de Telecomunicacoes *
* http://www.it.pt *
* *
* Copyright (C) 2008 by Ricardo N. Rocha Sardo *
* ricardo.sardo@co.it.pt *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <QDir>
#include "scosettings.h"
namespace SCode
{
SCoSettings::SCoSettings() :
m_settings( "IT", "SCoDE" )
{
}
// - - - - - - - - - - - - Main Window Settings - - - - - - - - - - - - - - - -
QPoint SCoSettings::mainWindowPos()
{
return m_settings.value( "MainWindow/pos", QPoint( 200, 200 ) ).toPoint();
}
void SCoSettings::setMainWindowPos( const QPoint & pos )
{
m_settings.setValue( "MainWindow/pos", pos );
}
QSize SCoSettings::mainWindowSize()
{
return m_settings.value( "MainWindow/size", QSize( 500, 400 ) ).toSize();
}
void SCoSettings::setMainWindowSize( const QSize & size )
{
m_settings.setValue( "MainWindow/size", size );
}
QString SCoSettings::lastOpenPath()
{
return m_settings.value( "MainWindow/lastOpenPath", QDir::homePath() ).toString();
}
void SCoSettings::setLastOpenPath( const QString & path )
{
m_settings.setValue( "MainWindow/lastOpenPath", path );
}
// - - - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - - - -
GridManager::Style SCoSettings::gridStyle()
{
return ( GridManager::Style )m_settings.value( "Grid/style", 0 ).toInt();
}
void SCoSettings::setGridStyle( GridManager::Style v )
{
m_settings.setValue( "Grid/style", v );
}
QColor SCoSettings::gridColor()
{
return m_settings.value( "Grid/color", QColor( Qt::white ) ).value<QColor>();
}
void SCoSettings::setGridColor( const QColor & v )
{
m_settings.setValue( "Grid/color", v );
}
int SCoSettings::gridHSpacing()
{
return m_settings.value( "Grid/hSpacing", 16 ).toInt();
}
void SCoSettings::setGridHSpacing( int v )
{
m_settings.setValue( "Grid/hSpacing", v );
}
int SCoSettings::gridVSpacing()
{
return m_settings.value( "Grid/vSpacing", 16 ).toInt();
}
void SCoSettings::setGridVSpacing( int v )
{
m_settings.setValue( "Grid/vSpacing", v );
}
// - - - - - - - - - - - - - Segmentation Settings - - - - - - - - - - - - - -
QBitArray SCoSettings::results2show()
{
QBitArray vectorRes( 20, false );
vectorRes.setBit( 16, true );
vectorRes.setBit( 17, true );
return m_settings.value( "Segmentation/vectorResults", vectorRes ).toBitArray();
}
void SCoSettings::setResults2show( QBitArray vectorRes )
{
m_settings.setValue( "Segmentation/vectorResults", vectorRes );
}
// - - - - - - - - - - - - - MMP-compound Encoder settings - - - - - - - - - - - - - - -
QString SCoSettings::binaryPath()
{
return m_settings.value( "MMP/binaryPath", QDir::currentPath() ).toString();
}
void SCoSettings::setBinaryPath( QString binaryPath )
{
m_settings.setValue( "MMP/binaryPath", binaryPath );
}
QString SCoSettings::oimagePath()
{
return m_settings.value( "MMP/oimagePath", QDir::currentPath() ).toString();
}
void SCoSettings::setOimagePath( QString oimagePath )
{
m_settings.setValue( "MMP/oimagePath", oimagePath );
}
int SCoSettings::blockSize()
{
return m_settings.value( "MMP/blockSize", 8 ).toInt();
}
void SCoSettings::setBlockSize( int blockSize )
{
m_settings.setValue( "MMP/blockSize", blockSize );
}
int SCoSettings::quantization()
{
return m_settings.value( "MMP/quantization", 4 ).toInt();
}
void SCoSettings::setQuantization( int quantization )
{
m_settings.setValue( "MMP/quantization", quantization );
}
int SCoSettings::predictionLevel()
{
return m_settings.value( "MMP/predictionLevel", 0 ).toInt();
}
void SCoSettings::setPredictionLevel( int predictionlevel )
{
m_settings.setValue( "MMP/predictionLevel", predictionlevel );
}
int SCoSettings::defineBounds()
{
return m_settings.value( "MMP/defineBounds", 1 ).toInt();
}
void SCoSettings::setDefineBounds( int definebounds )
{
m_settings.setValue( "MMP/defineBounds", definebounds );
}
int SCoSettings::lambda()
{
return m_settings.value( "MMP/lambda", 1000 ).toInt();
}
void SCoSettings::setLambda( int lambda )
{
m_settings.setValue( "MMP/lambda", lambda );
}
int SCoSettings::dictionary()
{
return m_settings.value( "MMP/dictionary", 5000 ).toInt();
}
void SCoSettings::setDictionary( int dictionary )
{
m_settings.setValue( "MMP/dictionary", dictionary );
}
int SCoSettings::radiusDistortion()
{
return m_settings.value( "MMP/radiusDistortion", 100 ).toInt();
}
void SCoSettings::setRadiusDistortion( int distortion )
{
m_settings.setValue( "MMP/radiusDistortion", distortion );
}
int SCoSettings::losslessDistance()
{
return m_settings.value( "MMP/losslessDistance", 0 ).toInt();
}
void SCoSettings::setLosslessDistance( int distance )
{
m_settings.setValue( "MMP/losslessDistance", distance );
}
int SCoSettings::mmpAutoSeg()
{
return m_settings.value( "MMP/autoSeg", 1 ).toInt();
}
void SCoSettings::setMmpAutoSeg( int autoSeg )
{
m_settings.setValue( "MMP/autoSeg", autoSeg );
}
/*
bool SCoSettings::fastMode()
{
return m_settings.value("MMP/fastMode", 1).toBool();
}
void SCoSettings::setFastMode( bool fastmode )
{
m_settings.setValue("MMP/fastMode" , fastmode);
}
*/
QBitArray SCoSettings::mmpTenCheckBoxs()
{
QBitArray bitArray( 10, false );
return m_settings.value( "MMP/tenCheckBoxs", bitArray ).toBitArray();
}
void SCoSettings::setMmpTenCheckBoxs( QBitArray tenCheckBoxs )
{
m_settings.setValue( "MMP/tenCheckBoxs", tenCheckBoxs );
}
// - - - - - - - - - - - - - MMP-compound Decoder settings - - - - - - - - - - - - - - -
QString SCoSettings::binaryPathDec()
{
return m_settings.value( "MMPdec/binaryPath", QDir::currentPath() ).toString();
}
void SCoSettings::setBinaryPathDec( QString binaryPath )
{
m_settings.setValue( "MMPdec/binaryPath", binaryPath );
}
QString SCoSettings::oimagePathDec()
{
return m_settings.value( "MMPdec/oimagePath", QDir::currentPath() ).toString();
}
void SCoSettings::setOimagePathDec( QString oimagePath )
{
m_settings.setValue( "MMPdec/oimagePath", oimagePath );
}
bool SCoSettings::optOutResDec()
{
return m_settings.value( "MMPdec/optOutRes", 0 ).toBool();
}
void SCoSettings::setOptOutResDec( bool par )
{
m_settings.setValue( "MMPdec/optOutRes", par );
}
QString SCoSettings::outResDec()
{
return m_settings.value( "MMPdec/outRes", "" ).toString();
}
void SCoSettings::setOutResDec( QString str )
{
m_settings.setValue( "MMPdec/outRes", str );
}
bool SCoSettings::optImgYDec()
{
return m_settings.value( "MMPdec/optImgY", 0 ).toBool();
}
void SCoSettings::setOptImgYDec( bool par )
{
m_settings.setValue( "MMPdec/optImgY", par );
}
QString SCoSettings::imgYDec()
{
return m_settings.value( "MMPdec/imgY", "" ).toString();
}
void SCoSettings::setImgYDec( QString str )
{
m_settings.setValue( "MMPdec/imgY", str );
}
bool SCoSettings::optImgUDec()
{
return m_settings.value( "MMPdec/optImgU", 0 ).toBool();
}
void SCoSettings::setOptImgUDec( bool par )
{
m_settings.setValue( "MMPdec/optImgU", par );
}
QString SCoSettings::imgUDec()
{
return m_settings.value( "MMPdec/imgU", "" ).toString();
}
void SCoSettings::setImgUDec( QString str )
{
m_settings.setValue( "MMPdec/imgU", str );
}
bool SCoSettings::optImgVDec()
{
return m_settings.value( "MMPdec/optImgV", 0 ).toBool();
}
void SCoSettings::setOptImgVDec( bool par )
{
m_settings.setValue( "MMPdec/optImgV", par );
}
QString SCoSettings::imgVDec()
{
return m_settings.value( "MMPdec/imgV", "" ).toString();
}
void SCoSettings::setImgVDec( QString str )
{
m_settings.setValue( "MMPdec/imgV", str );
}
} // namespace SCode
-150
View File
@@ -1,150 +0,0 @@
/***************************************************************************
* This file is a part of SCode project *
* IT - Instituto de Telecomunicacoes *
* http://www.it.pt *
* *
* Copyright (C) 2008 by Ricardo N. Rocha Sardo *
* ricardo.sardo@co.it.pt *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef SCODESCOSETTINGS_H
#define SCODESCOSETTINGS_H
#include <QSettings>
#include <QString>
#include <QSize>
#include <QPoint>
#include <QColor>
#include <QString>
#include <QBitArray>
#include "gridmanager.h"
namespace SCode
{
/**
@author Ricardo N. Rocha Sardo <ricardo.sardo@co.it.pt>
*/
class SCoSettings
{
public:
SCoSettings();
// - - - - - - - - - - Main Window Settings - - - - - - - - - - - - -
QPoint mainWindowPos();
void setMainWindowPos( const QPoint &v );
QSize mainWindowSize();
void setMainWindowSize( const QSize &v );
QString lastOpenPath();
void setLastOpenPath( const QString &v );
// - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - -
GridManager::Style gridStyle();
void setGridStyle( GridManager::Style v );
QColor gridColor();
void setGridColor( const QColor &v );
int gridHSpacing();
void setGridHSpacing( int v );
int gridVSpacing();
void setGridVSpacing( int v );
// - - - - - - - - - - - Segmentation Settings - - - - - - - - - - - -
QBitArray results2show();
void setResults2show( QBitArray vectorRes );
// - - - - - - - - - - - - MMP-compound Encoder settings - - - - - - - - - - - -
QString binaryPath();
void setBinaryPath( QString binaryPath );
QString oimagePath();
void setOimagePath( QString binaryPath );
int blockSize();
void setBlockSize( int blockSize );
int quantization();
void setQuantization( int quantization );
int predictionLevel();
void setPredictionLevel( int predictionlevel );
int defineBounds();
void setDefineBounds( int definebounds );
int lambda();
void setLambda( int lambda );
int dictionary();
void setDictionary( int dictionary );
int radiusDistortion();
void setRadiusDistortion( int distortion );
int losslessDistance();
void setLosslessDistance( int distance );
QBitArray mmpTenCheckBoxs();
void setMmpTenCheckBoxs( QBitArray tenCheckBoxs );
int mmpAutoSeg();
void setMmpAutoSeg( int autoSeg );
// - - - - - - - - - - - - MMP-compound Decoder settings - - - - - - - - - - - -
QString binaryPathDec();
void setBinaryPathDec( QString binaryPath );
QString oimagePathDec();
void setOimagePathDec( QString binaryPath );
bool optOutResDec();
void setOptOutResDec( bool par );
QString outResDec();
void setOutResDec( QString str );
bool optImgYDec();
void setOptImgYDec( bool par );
QString imgYDec();
void setImgYDec( QString str );
bool optImgUDec();
void setOptImgUDec( bool par );
QString imgUDec();
void setImgUDec( QString str );
bool optImgVDec();
void setOptImgVDec( bool par );
QString imgVDec();
void setImgVDec( QString str );
private:
QSettings m_settings;
};
} // namespace SCode
#endif // SCODESCOSETTINGS_H
@@ -31,10 +31,10 @@
#include <QPen>
#include <QDebug>
#include "gridmanager.h"
#include "scosettings.h"
#include "GridManager.h"
#include "plaYUVerSettings.h"
namespace SCode
namespace plaYUVer
{
////////////////////////////////////////////////////////////////////////////////
@@ -50,7 +50,7 @@ GridManager::GridManager()
////////////////////////////////////////////////////////////////////////////////
void GridManager::drawGrid( QPixmap &image, const QRect& area, QPainter *painter )
{
SCoSettings settings;
PlaYUVerSettings settings;
int offsetx = 0; // Grid offset doesn't applies to SCODE
int offsety = 0; // project for now...
@@ -148,7 +148,7 @@ QRect GridManager::rectContains( int x, int y ) const
int multiPosX;
int multiPosY;
SCoSettings settings;
PlaYUVerSettings settings;
int hSpacing = settings.gridHSpacing();
int vSpacing = settings.gridVSpacing();
@@ -175,7 +175,7 @@ bool GridManager::contains( int x, int y )
int resX;
int resY;
SCoSettings settings;
PlaYUVerSettings settings;
int hSpacing = settings.gridHSpacing();
int vSpacing = settings.gridVSpacing();
@@ -214,7 +214,7 @@ bool GridManager::isNear( int x, int y )
int multiPosX;
int multiPosY;
SCoSettings settings;
PlaYUVerSettings settings;
int hSpacing = settings.gridHSpacing();
int vSpacing = settings.gridVSpacing();
@@ -269,4 +269,4 @@ bool GridManager::isNear( const QPoint &pos )
return isNear( pos.x(), pos.y() );
}
} // NameSpace SCode
} // NameSpace plaYUVer
@@ -21,8 +21,8 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef SCODEGRID_H
#define SCODEGRID_H
#ifndef __GRIDMANAGER_H__
#define __GRIDMANAGER_H__
#include <QRect>
#include <QColor>
@@ -32,7 +32,7 @@ class QPoint;
class QBitmap;
class QPainter;
namespace SCode
namespace plaYUVer
{
/**
@@ -94,6 +94,6 @@ private:
QPoint m_nearPos;
};
} // NameSpace SCode
} // NameSpace plaYUVer
#endif // SCODEGRID_H
#endif // __GRIDMANAGER_H__
+1 -1
View File
@@ -23,7 +23,7 @@
#include "ConfigureFormatDialog.h"
#include "SubWindowHandle.h"
#include "viewarea.h"
#include "ViewArea.h"
namespace plaYUVer
{
+1 -3
View File
@@ -34,14 +34,12 @@
#include "TypeDef.h"
#include "InputStream.h"
#include "viewarea.h"
#include "ViewArea.h"
#include "PlaYUVerModuleIf.h"
namespace plaYUVer
{
using namespace SCode;
class SubWindowHandle: public QMdiSubWindow
{
Q_OBJECT
@@ -33,10 +33,10 @@
#include <QRectF>
#include <QDebug>
#include "viewarea.h"
#include "gridmanager.h"
#include "ViewArea.h"
#include "GridManager.h"
namespace SCode
namespace plaYUVer
{
static const QColor selectionColor = Qt::cyan;
@@ -749,4 +749,4 @@ void ViewArea::updateMask( const QRect &rect )
}
}
} // NameSpace SCode
} // NameSpace plaYUVer
@@ -21,17 +21,17 @@
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef VIEWAREA_H
#define VIEWAREA_H
#ifndef __VIEWAREA_H__
#define __VIEWAREA_H__
#include <QWidget>
#include <QPixmap>
#include <QBitmap>
#include <QColor>
#include "gridmanager.h"
#include "GridManager.h"
namespace SCode
namespace plaYUVer
{
/**
@@ -157,10 +157,8 @@ private:
bool m_snapToGrid;
bool m_cursorInGrid;
bool flag; //lukas
};
} // NameSpace SCode
} // NameSpace plaYUVer
#endif // VIEWAREA_H
#endif // __VIEWAREA_H__
+12 -9
View File
@@ -637,16 +637,19 @@ void plaYUVerApp::updatePixelValueStatusBar(const QPoint & pos)
Int posX = pos.x(), posY = pos.y();
QString strStatus = QString("X=%1 Y=%2 ").arg(posX).arg(posY);
SubWindowHandle *currentSubWindow = activeSubWindow();
iWidth = currentSubWindow->getInputStream()->getWidth();
iHeight = currentSubWindow->getInputStream()->getHeight();
if( (posX<iWidth) && (posX>=0) && (posY<iHeight) && (posY>=0) )
SubWindowHandle *currentSubWindow = m_pcCurrentSubWindow;
if(currentSubWindow)
{
pixel = currentSubWindow->getInputStream()->getCurrentFrame()->getPixelValueFromYUV(pos, LUMA);
QString strAux = QString("Luma= %1").arg(pixel);
strStatus.append(strAux);
statusBar()->showMessage( strStatus , 0 );
iWidth = currentSubWindow->getInputStream()->getWidth();
iHeight = currentSubWindow->getInputStream()->getHeight();
if( (posX<iWidth) && (posX>=0) && (posY<iHeight) && (posY>=0) )
{
pixel = currentSubWindow->getInputStream()->getCurrentFrame()->getPixelValueFromYUV(pos, LUMA);
QString strAux = QString("Luma= %1").arg(pixel);
strStatus.append(strAux);
statusBar()->showMessage( strStatus , 0 );
}
}
}
+43
View File
@@ -104,4 +104,47 @@ void SCoSettings::setGridVSpacing( int v )
m_settings.setValue( "Grid/vSpacing", v );
}
// - - - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - - - - -
GridManager::Style PlaYUVerSettings::gridStyle()
{
return ( GridManager::Style )m_settings.value( "Grid/style", 0 ).toInt();
}
void PlaYUVerSettings::setGridStyle( GridManager::Style v )
{
m_settings.setValue( "Grid/style", v );
}
QColor PlaYUVerSettings::gridColor()
{
return m_settings.value( "Grid/color", QColor( Qt::white ) ).value<QColor>();
}
void PlaYUVerSettings::setGridColor( const QColor & v )
{
m_settings.setValue( "Grid/color", v );
}
int PlaYUVerSettings::gridHSpacing()
{
return m_settings.value( "Grid/hSpacing", 16 ).toInt();
}
void PlaYUVerSettings::setGridHSpacing( int v )
{
m_settings.setValue( "Grid/hSpacing", v );
}
int PlaYUVerSettings::gridVSpacing()
{
return m_settings.value( "Grid/vSpacing", 16 ).toInt();
}
void PlaYUVerSettings::setGridVSpacing( int v )
{
m_settings.setValue( "Grid/vSpacing", v );
}
} // NAMESPACE
+14 -1
View File
@@ -28,7 +28,7 @@
#include <QtCore>
#include "gridmanager.h"
#include "GridManager.h"
namespace plaYUVer
{
@@ -62,6 +62,19 @@ public:
int gridVSpacing();
void setGridVSpacing( int v );
// - - - - - - - - - - - - Grid Settings - - - - - - - - - - - - - - -
GridManager::Style gridStyle();
void setGridStyle( GridManager::Style v );
QColor gridColor();
void setGridColor( const QColor &v );
int gridHSpacing();
void setGridHSpacing( int v );
int gridVSpacing();
void setGridVSpacing( int v );
private:
QSettings m_settings;
};