-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmywindow.h
71 lines (59 loc) · 1.44 KB
/
mywindow.h
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
#include <QtGui/QWidget>
#include <QPushButton>
#include <QPainter>
#include <QPaintEvent>
#include <QImage>
#include <QDebug>
#include <QElapsedTimer>
#include <QPixmap>
#include <QVector>
#include <QPoint>
#include <QMouseEvent>
#include <QPaintEvent>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <time.h>
#include <math.h>
#define img_name "grayimg.ppm"
#define NODE_LAYER_0 784
#define NODE_LAYER_1 16
#define NODE_LAYER_2 10
#define BUFFER_SIZE 2352
class MyWindow : public QWidget
{
Q_OBJECT
public:
explicit MyWindow(QWidget *parent = 0);
void Get754Value32(float v, int *sign, int *exp, float *mat);
void FIR_Accelerator(float A[], float &result);
void Set754Value32(float *f, int sign, int exp, float mat);
protected:
void paintEvent(QPaintEvent*);
private slots:
void ConfirmButton_clicked();
void ClearButton_clicked();
void SW_clicked();
private:
QElapsedTimer timer;
/* Handwriting */
QVector<QPoint> stroke;
QVector<QVector<QPoint> >lines;
bool painting;
/* Button */
QPushButton *clr_btn;
QPushButton *conf_btn;
QPushButton *sw_btn;
/* Mouse Event */
void mousePressEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
bool acc_flag;
float results[NODE_LAYER_2];
bool accuracy();
};