-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheffect.h
More file actions
59 lines (43 loc) · 991 Bytes
/
effect.h
File metadata and controls
59 lines (43 loc) · 991 Bytes
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
#ifndef EFFECT_H
#define EFFECT_H
#include <qglobal.h>
#include <QVector>
#include <QRgb>
#include <QPainter>
typedef enum {
KEY_MINUS,
KEY_PLUS,
KEY_LEFT,
KEY_RIGHT,
KEY_UP,
KEY_DOWN
} FxKey;
class Effect
{
public:
Effect(int w, int h);
virtual ~Effect();
int width();
int height();
void reset();
uchar getValue(int i, int j) const;
void setValue(int i, int j, uchar value);
virtual void create() = 0;
virtual void destroy() = 0;
virtual void update() = 0;
virtual int defaultRefreshRate() = 0;
virtual const QVector<QRgb>& palette() const = 0;
virtual bool paint(QPainter *painter) const;
virtual QPair<int, QVector<QString>> fxKindList() const;
virtual void setFxKind(int kind);
virtual bool keyPressed(FxKey key);
protected:
int w;
int h;
uchar* bufferValue;
private:
int aligned_w;
int vector_len;
int getVectorIdx(int i, int j) const;
};
#endif // EFFECT_H