Skip to content

Commit

Permalink
prediction type display filter added
Browse files Browse the repository at this point in the history
  • Loading branch information
lheric committed Oct 10, 2013
1 parent 3bd4e18 commit b4009d3
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libplugins/libplugins.pro
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ SUBDIRS = libtudisplayfilter \ #tu structure filter
libcudisplayfilter \ #cu structure filter
libmergedisplayfilter \ #merge display filter
libmvdisplayfilter\ #MV display filter
libintradisplayfilter #intra mode display
libintradisplayfilter\ #intra mode display
libpreddisplayfilter #pred mode display
12 changes: 12 additions & 0 deletions libplugins/libpreddisplayfilter/libpreddisplayfilter.pro
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


34 changes: 34 additions & 0 deletions libplugins/libpreddisplayfilter/preddisplayfilter.cpp
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;
}
23 changes: 23 additions & 0 deletions libplugins/libpreddisplayfilter/preddisplayfilter.h
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

0 comments on commit b4009d3

Please sign in to comment.