SGL
gdiffimage.h
1 /*
2  * File: gdiffimage.h
3  * ------------------
4  *
5  * @author Marty Stepp
6  * @version 2021/04/09
7  * - added sgl namespace
8  * @version 2018/10/12
9  * - added "highlight diffs in color" checkbox and functionality
10  * @version 2018/09/15
11  * - initial version, converted from Java back-end DiffImage class
12  */
13 
14 
15 #ifndef _gdiffimage_h
16 #define _gdiffimage_h
17 
18 #include <string>
19 #include <QWidget>
20 #include <QSplitter>
21 
22 #include "gbutton.h"
23 #include "gcanvas.h"
24 #include "gcheckbox.h"
25 #include "ginteractor.h"
26 #include "glabel.h"
27 #include "gslider.h"
28 #include "gwindow.h"
29 
30 namespace sgl {
31 
40 class GDiffImage {
41 public:
42  static const string HIGHLIGHT_COLOR_DEFAULT;
43 
44  static void showDialog(const string& name1,
45  GCanvas* image1,
46  const string& name2,
47  GCanvas* image2);
48 
49  static void showDialog(const string& name1,
50  const string& imageFile1,
51  const string& name2,
52  const string& imageFile2);
53 
54 private:
55  GDiffImage(const string& name1,
56  GCanvas* image1,
57  const string& name2,
58  GCanvas* image2); // forbid construction
59  virtual ~GDiffImage();
60 
61  Q_DISABLE_COPY(GDiffImage)
62 
63  void chooseHighlightColor();
64  void drawImages();
65  string getPixelString(GImage* image, int x, int y) const;
66 
67  GWindow* _window;
68  GSlider* _slider;
69  GCheckBox* _highlightDiffsBox;
70  GButton* _colorButton;
71  GLabel* _diffPixelsLabel;
72  GLabel* _imageLabel1;
73  GLabel* _imageLabel2;
74  GLabel* _southPixelLabel;
75  GImage* _image1;
76  GImage* _image2;
77  GImage* _imageDiffs;
78  string _highlightColor;
79 
80  friend class GImage;
81 };
82 
83 } // namespace sgl
84 
85 #endif // _gdiffimage_h
Definition: console.h:45