SGL
gdiffimage.h
1 /*
2  * File: gdiffimage.h
3  * ------------------
4  *
5  * @author Marty Stepp
6  * @version 2018/10/12
7  * - added "highlight diffs in color" checkbox and functionality
8  * @version 2018/09/15
9  * - initial version, converted from Java back-end DiffImage class
10  */
11 
12 
13 #ifndef _gdiffimage_h
14 #define _gdiffimage_h
15 
16 #include <string>
17 #include <QWidget>
18 #include <QSplitter>
19 
20 #include "gbutton.h"
21 #include "gcanvas.h"
22 #include "gcheckbox.h"
23 #include "ginteractor.h"
24 #include "glabel.h"
25 #include "gslider.h"
26 #include "gwindow.h"
27 
36 class GDiffImage {
37 public:
38  static const string HIGHLIGHT_COLOR_DEFAULT;
39 
40  static void showDialog(const string& name1,
41  GCanvas* image1,
42  const string& name2,
43  GCanvas* image2);
44 
45  static void showDialog(const string& name1,
46  const string& imageFile1,
47  const string& name2,
48  const string& imageFile2);
49 
50 private:
51  GDiffImage(const string& name1,
52  GCanvas* image1,
53  const string& name2,
54  GCanvas* image2); // forbid construction
55  virtual ~GDiffImage();
56 
57  Q_DISABLE_COPY(GDiffImage)
58 
59  void chooseHighlightColor();
60  void drawImages();
61  string getPixelString(GImage* image, int x, int y) const;
62 
63  GWindow* _window;
64  GSlider* _slider;
65  GCheckBox* _highlightDiffsBox;
66  GButton* _colorButton;
67  GLabel* _diffPixelsLabel;
68  GLabel* _imageLabel1;
69  GLabel* _imageLabel2;
70  GLabel* _southPixelLabel;
71  GImage* _image1;
72  GImage* _image2;
73  GImage* _imageDiffs;
74  string _highlightColor;
75 
76  friend class GImage;
77 };
78 
79 #endif // _gdiffimage_h
This interactor subclass represents an onscreen slider.
Definition: gslider.h:31
A GCanvas is a graphical drawing surface on which you can draw shapes, lines, and colors...
Definition: gcanvas.h:70
This graphical object subclass represents an image from a file.
Definition: gobjects.h:953
This interactor subclass represents an onscreen button.
Definition: gbutton.h:36
This interactor subclass represents an onscreen check box.
Definition: gcheckbox.h:39
This class represents a graphics window that supports simple graphics.
Definition: gwindow.h:98
A GLabel represents a text string.
Definition: glabel.h:46