Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADM_flyDialog] add analyzer option #355

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
70 changes: 67 additions & 3 deletions avidemux/qt4/ADM_UIs/include/DIA_flyDialogQt4.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
#include <QMouseEvent>
#include <QPoint>
#include <QRect>
#include <QGraphicsScene>
#include <QImage>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>

#include "ADM_default.h"
#include "ADM_rgb.h"
Expand All @@ -53,9 +58,10 @@ enum class ControlOption
{
None = 0,
PeekOriginalBtn = 1 << 0,
UserWidgetAfterControls = 1 << 1,
UserWidgetBeforePeekBtn = 1 << 2,
UserWidgetAfterPeekBtn = 1 << 3
AnalyzerBtn = 1 << 1,
UserWidgetAfterControls = 1 << 2,
UserWidgetBeforePeekBtn = 1 << 3,
UserWidgetAfterPeekBtn = 1 << 4
};

inline ControlOption operator|(ControlOption a, ControlOption b)
Expand Down Expand Up @@ -94,6 +100,8 @@ class ADM_UIQT46_EXPORT ADM_QCanvas : public QWidget
};

class flyControl;
class ADM_analyzerDialog;
class flyDialogsAnalyzer;
/**
\class ADM_flyDialog
\brief Base class for flyDialog
Expand Down Expand Up @@ -124,6 +132,11 @@ class ADM_UIQT46_EXPORT ADM_flyDialog : public QObject
std::vector<QWidget *> buttonList; // useful for manipulating tab order
QDialog *_parent;
bool _bypassFilter;
// Analyzer
bool _analyze;
ADM_analyzerDialog * _analyzerDialog;
QGraphicsScene * _analyzerScenes[4];
flyDialogsAnalyzer * _flyAnalyzer;



Expand Down Expand Up @@ -187,6 +200,8 @@ public slots:
virtual void backOneMinute(void);
virtual void fwdOneMinute(void);
virtual void play(bool status);
virtual void analyzerReleased(void);
virtual void analyzerClosed(void);
virtual void peekOriginalPressed(void);
virtual void peekOriginalReleased(void);
virtual void timeout(void);
Expand Down Expand Up @@ -308,4 +323,53 @@ class ADM_UIQT46_EXPORT ADM_rubberControl : public QWidget
void mouseMoveEvent(QMouseEvent *);
};

class ADM_UIQT46_EXPORT ADM_analyzerDialog : public QDialog
{
Q_OBJECT
private:
QHBoxLayout * hboxlayout;
QVBoxLayout * vboxlayout;
QGraphicsView * gv[4];
QPushButton * btns[4];
bool btnChkd[4];
void adjustGraphs();
void resizeEvent(QResizeEvent *event);
void showEvent(QShowEvent *event);
private slots:
void btnToggled(bool f);
public:
QGraphicsScene * gsc[4];
ADM_analyzerDialog(QWidget *parent);
~ADM_analyzerDialog();

};

class ADM_UIQT46_EXPORT flyDialogsAnalyzer
{
private:
int width, height;
int rgbBufStride;
ADM_byteBuffer * rgbBufRaw;
ADMColorScalerFull * convertYuvToRgb;
uint32_t * wrkVectorScope;
uint32_t * bufVectorScope;
uint32_t * scaleVectorScope;
QImage * imgVectorScope;
uint32_t * wrkYUVparade[3];
uint32_t * bufYUVparade;
QImage * imgYUVparade;
uint32_t * wrkRGBparade[3];
uint32_t * bufRGBparade;
QImage * imgRGBparade;
uint32_t * wrkHistograms[6];
uint32_t * bufHistograms;
QImage * imgHistograms;
int * paradeIndex;
int * paradeIndexHalf;
public:
flyDialogsAnalyzer(int width, int height);
virtual ~flyDialogsAnalyzer() ;
void analyze(ADMImage *in, QGraphicsScene * sceneVectorScope, QGraphicsScene * sceneYUVparade, QGraphicsScene * sceneRGBparade, QGraphicsScene * sceneHistograms);
};

//EOF
Loading