-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcropper.hpp
65 lines (53 loc) · 1.61 KB
/
cropper.hpp
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
#ifndef CROPPER_HPP
#define CROPPER_HPP
#include <QObject>
#include <qglobal.h>
#include <QGraphicsItem>
#include <QtGui>
#include <resizer.hpp>
#include <cmath>
#include <workarea.hpp>
#include <defines.hpp>
class WorkArea;
class Resizer;
Q_GUI_EXPORT void qt_blurImage( QImage &blurImage, qreal radius,
bool quality, int transposed = 0);
class Cropper : public QObject, public QGraphicsItem
{
Q_OBJECT
public:
explicit Cropper(WorkArea *wa);
bool anchored;
qreal width;
qreal height;
qreal RotateAngle;
qreal AnchoredAngle;
Resizer *RSide;
Resizer *LSide;
Resizer *USide;
Resizer *BSide;
WorkArea *WA;
virtual void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget);
virtual QRectF boundingRect() const;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
virtual void wheelEvent(QGraphicsSceneWheelEvent *event);
void updateItemsPos();
void setHighLumin();
void setLowLumin();
QPixmap convertToGray(QPixmap &pxmp);
void normalize(QPixmap src);
QPixmap adjustLuminance(QPixmap &pxm, qreal contrast, qreal bright);
public slots:
void changeSize(qreal dx, qreal dy, Position position);
void getSamples();
void changeLuminance(Luminance Lumin);
void blur(int KernelSize);
void addNoize(double mu);
void leftDark();
void rightDark();
};
#endif // CROPPER_HPP