Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef IMAGEVIEWER_H
- #define IMAGEVIEWER_H
- #include <QMainWindow>
- #ifndef QT_NO_PRINTER
- #include <QPrinter>
- #include <QMap>
- #include <QSlider>
- #include <QVector>
- #include <QColor>
- #include <QTableWidget>
- #include <QtMath>
- #include <math.h>
- #endif
- #include "fstream"
- class QAction;
- class QLabel;
- class QMenu;
- class QScrollArea;
- class QScrollBar;
- class QTextEdit;
- class QVBoxLayout;
- class QTabWidget;
- class QPushButton;
- class QSpinBox;
- class ImageViewer : public QMainWindow
- {
- Q_OBJECT
- private:
- // Beispiel für GUI Elemente
- QWidget* m_option_panel1;
- QVBoxLayout* m_option_layout1;
- QWidget* m_option_panel2;
- QVBoxLayout* m_option_layout2;
- QWidget* m_option_panel3;
- QVBoxLayout* m_option_layout3;
- QWidget* m_option_panel4;
- QVBoxLayout* m_option_layout4;
- QPushButton* button1;
- QPushButton* button2;
- QPushButton* button3;
- QPushButton* button4;
- QPushButton* button5;
- QPushButton* button6;
- QPushButton* button7;
- QPushButton* button8;
- QPushButton* button9;
- QPushButton* button10;
- QPushButton* button11;
- QPushButton* button12;
- QSpinBox* spinbox1;
- QSpinBox* spinbox2;
- QSpinBox* spinbox3;
- QSpinBox* spinbox4;
- QSpinBox* spinbox5;
- QSpinBox* spinbox6;
- QSpinBox* spinbox7;
- QTableWidget* table;
- QLabel* mittlereHelligkeit;
- QLabel* varianz;
- QLabel* filterSize;
- QLabel* gausFilter;
- QSlider* slider1;
- QSlider* slider2;
- QLabel* helligkeitSlider;
- QLabel* kontrastSlider;
- // hier können weitere GUI Objekte hin wie Buttons Slider etc.
- private slots:
- // Beispiel für einen Algorithmus
- void applyExampleAlgorithm();
- void doSmth();
- void resetImage();
- void inkWidthX(int i);
- void erstelleHistogramm();
- void kontrastAnpassen(int h);
- void helligkeitAnpassen(int h);
- void AktualesiereKontrast(int i);
- void AktualesiereHell(int i);
- void autoKontrast();
- void getMittlereHelligkeit();
- void getVarianz();
- void restoreImage();
- void filterAnwenden();
- void gausFilterAnwenden();
- void kantDetSobel();
- void kantDetSobel2();
- void updateColomn(int i);
- void updateRow(int i);
- // hier können weitere als SLOTS definierte Funktionen hin, die auf Knopfdruck etc. aufgerufen werden.
- void open();
- void print();
- void zoomIn();
- void zoomOut();
- void normalSize();
- void fitToWindow();
- void about();
- // eigene methoden
- public:
- ImageViewer();
- bool loadFile(const QString &);
- bool loadFileExt(const QString &);
- void updateImageDisplay();
- protected:
- void resizeEvent(QResizeEvent * event);
- private:
- // in diesen Beiden Methoden sind Änderungen nötig bzw. sie dienen als
- // Vorlage für eigene Methoden.
- void generateControlPanels();
- // Ab hier technische Details die nicht für das Verständnis notwendig sind.
- void startLogging();
- void generateMainGui();
- void createActions();
- void createMenus();
- void updateActions();
- void scaleImage(double factor);
- void adjustScrollBar(QScrollBar *scrollBar, double factor);
- void renewLogging();
- QTabWidget* tabWidget;
- QTextEdit* logBrowser;
- QWidget* centralwidget;
- QLabel* imageLabel;
- QScrollArea* scrollArea;
- double scaleFactor;
- QImage* image;
- QImage* tempImage2;
- QImage tempImage;
- QImage filteredImage;
- QImage* PfilteredImage;
- QImage sobelXImage;
- QImage sobelYImage;
- QRgb tempXSobelPixel;
- QRgb tempYSobelPixel;
- QString imageOld;
- QRgb value;
- QRgb tempPixel;
- QTableWidgetItem* pTableItem;
- int tRed;
- int tGreen;
- int tBlue;
- int y;
- int Cb;
- int Cr;
- double mult;
- int aLow;
- int aHigh;
- int sigma;
- double sigma2;
- int center;
- double faktor;
- std::vector<float> ho;
- int hSize;
- double expVar;
- double sumFaktor;
- int tempMaxX;
- int tempMaxY;
- int sobelFakt;
- int sobelWidth;
- int tableItem;
- int widthX;
- int tempLightness;
- int tempVarianz;
- QMap<int, int> histogramm;
- QString tempstr;
- QString origImage;
- std::fstream logFile;
- #ifndef QT_NO_PRINTER
- QPrinter printer;
- #endif
- QAction *openAct;
- QAction *printAct;
- QAction *exitAct;
- QAction *zoomInAct;
- QAction *zoomOutAct;
- QAction *normalSizeAct;
- QAction *fitToWindowAct;
- QAction *aboutAct;
- QAction *aboutQtAct;
- QMenu *fileMenu;
- QMenu *viewMenu;
- QMenu *helpMenu;
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement