-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmainwin.h
More file actions
112 lines (96 loc) · 1.79 KB
/
mainwin.h
File metadata and controls
112 lines (96 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifndef MAINWIN_H
#define MAINWIN_H
#include <ui_mainwin.h>
#include <QtGui>
#include <QMimeData>
#include <QClipboard>
#include <QNetworkReply>
#include <QNetworkAccessManager>
enum {
CONV_REAL=0,
CONV_WIDTH,
CONV_HEIGHT,
CONV_SCALE,
CONV_ZOOM
};
enum {
CONV_SEPARATOR = -1,
CONV_SOLID = 0,
CONV_TRITONE,
CONV_TEXTURE,
CONV_CHUNK4,
CONV_SOLID_COL,
CONV_HWMC,
CONV_3LMC,
CONV_TRICOLOR,
CONV_END
};
enum {
TRI_GRID=0,
TRI_HLINE,
TRI_VLINE
};
struct GIFrame {
int delay;
QImage img;
};
class MWin : public QMainWindow {
Q_OBJECT
public:
MWin(QWidget* = NULL);
private:
Ui::MainWindow ui;
QImage img; // original
QImage src; // piece for convert
QImage dst; // result
QList<GIFrame> gif;
int curFrame;
int convType;
int scw, sch;
bool isGif;
bool isPlaying;
QImage getSource();
QByteArray scr;
QClipboard* cbrd;
QNetworkAccessManager mng;
QNetworkReply* rply;
private slots:
void openFile(QString p = QString());
void pasteImage();
void pasteMime(const QMimeData*);
void openUrl();
void downloaded(QNetworkReply*);
int loadImage(QImageReader&);
int parseImage(QByteArray&);
void saveAni();
void saveScr();
void savePng();
void saveBatch();
void saveScreen(QString,bool);
void saveHWMC(QString);
void saveChunk(QString);
void setFrame(int);
void playGif();
void playFrame();
void setZoom(QAction*);
void resetB();
void resetR();
void resetG();
void resetBrg();
void resetCon();
void resetTMax();
void resetTMin();
void convert();
void chaZoom();
void chaZoomH();
void chaZoomW();
void chaZoomHW();
void chaZoomOrig();
void chaZoomFit();
void chaMode();
protected:
void keyPressEvent(QKeyEvent*);
void dragEnterEvent(QDragEnterEvent*);
void dropEvent(QDropEvent*);
};
#endif // MAINWIN_H