-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
prediction type display filter added
- Loading branch information
Showing
4 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
TEMPLATE = lib | ||
CONFIG += plugin | ||
INCLUDEPATH += ../../src \ | ||
../../libgitlmvc/libgitlevtbus/src | ||
HEADERS = \ | ||
preddisplayfilter.h | ||
SOURCES = \ | ||
preddisplayfilter.cpp | ||
TARGET = $$qtLibraryTarget(libpreddisplayfilter) | ||
DESTDIR = $${OUT_PWD}/../../plugins | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include "preddisplayfilter.h" | ||
#include <QDebug> | ||
|
||
PredDisplayFilter::PredDisplayFilter(QObject *parent) : | ||
QObject(parent) | ||
{ | ||
setName("Pred Type Structure"); | ||
} | ||
|
||
|
||
bool PredDisplayFilter::drawPU (FilterContext* pcContext, QPainter* pcPainter, | ||
ComPU *pcPU, double dScale, QRect* pcScaledArea) | ||
{ | ||
//different mode different color | ||
QColor cSkipClr(QColor(0,0,0,128)); | ||
QColor cInterClr(QColor(51,0,204,128)); | ||
QColor cIntraClr(QColor(204,255,51,128)); | ||
|
||
|
||
PredMode eMode = pcPU->getPredMode(); | ||
pcPainter->setPen(Qt::NoPen); | ||
if(eMode == MODE_INTER) | ||
pcPainter->setBrush(cInterClr); | ||
else if(eMode == MODE_INTRA) | ||
pcPainter->setBrush(cIntraClr); | ||
else if(eMode == MODE_SKIP) | ||
pcPainter->setBrush(cSkipClr); | ||
else | ||
qWarning() << "Unexpected Prediction Type"; | ||
|
||
pcPainter->drawRect(*pcScaledArea); | ||
|
||
return true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef PREDDISPLAYFILTER_H | ||
#define PREDDISPLAYFILTER_H | ||
#include "model/drawengine/abstractfilter.h" | ||
#include <QObject> | ||
|
||
class PredDisplayFilter : public QObject, public AbstractFilter | ||
{ | ||
Q_OBJECT | ||
Q_PLUGIN_METADATA(IID "cn.edu.gitl.sysu.gitlhevcanalyzer.AbstractFilter") | ||
Q_INTERFACES(AbstractFilter) | ||
public: | ||
explicit PredDisplayFilter(QObject *parent = 0); | ||
|
||
virtual bool drawPU (FilterContext* pcContext, QPainter* pcPainter, | ||
ComPU *pcPU, double dScale, QRect* pcScaledArea); | ||
|
||
|
||
|
||
public slots: | ||
|
||
}; | ||
|
||
#endif // PREDDISPLAYFILTER_H |