-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbqrcolorfactory.h
49 lines (36 loc) · 1003 Bytes
/
bqrcolorfactory.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
#ifndef BQRCOLORFACTORY_H
#define BQRCOLORFACTORY_H
#include "bqrimagefactory.h"
namespace BQREncode {
/*!
* This factory builds a QR image code using a specific color as active pixel's color.
*/
class BQRColorFactory : public BQRImageFactory
{
Q_OBJECT
public:
explicit BQRColorFactory(QObject *parent=0,QColor color=QColor(Qt::black));
/*!
* Get the active pixel's color (black by default)
* @return Active pixel's color
* @note Doesn't modifies the object
*/
QColor getColor() const {
return _color;
}
virtual QImage *buildImageFromCode(const BQRCode &code);
virtual QImage *buildImageFromCode(const BQRCode *code);
public slots:
/*!
* Set the active pixel's color (black by default)
* @param color Active pixel's color
* @note Modifies the object
*/
void setColor(QColor c) {
_color=c;
}
protected:
QColor _color; ///< Color of the image's pixels
};
}
#endif // BQRCOLORFACTORY_H