Commit 31c4f37b by 许梦竹

add SNCreator

parents
File added
1,05651788
1,05651788
2,05932812
3,05819308
4,05731020
5,05800172
6,05842204
7,05915884
8,05906556
9,05865036
10,05624412
11,05622124
12,05653244
13,05815612
14,05646796
15,05659804
16,05905484
17,05822076
18,05919468
19,05637388
20,05840124
21,05906492
22,05940156
23,05756268
24,05720604
25,05646380
26,05845644
27,05631628
28,05625148
29,05905484
30,05762780
31,05636860
32,05724284
33,05802604
34,05905484
35,05823084
36,05865020
37,05840908
38,05864892
39,05945404
40,05630956
41,05715420
42,05731820
43,05762844
44,05823452
45,05658764
46,05665468
47,05947036
48,05913228
49,05930188
50,05753356
51,05645660
52,05647996
53,05823932
54,05635884
55,05765004
56,05836908
57,05926476
58,05638492
59,05620284
60,05614124
61,05622204
62,05715100
63,05954316
64,05820236
65,05650556
66,05938300
67,05826252
68,05863820
69,05653132
70,05643756
71,05824044
72,05751740
73,05819708
74,05637516
75,05756732
76,05627052
77,05704604
78,05915580
79,05716940
80,05740124
81,05929580
82,05818044
83,05719644
84,05865324
85,05756892
86,05918380
87,05725116
88,05809692
89,05815644
90,05916460
91,05640556
92,05941404
93,05923292
94,05618332
95,05946508
96,05908508
97,05830492
98,05618796
99,05832780
100,05936108
101,05711868
102,05927420
103,05952972
104,05763628
105,05902556
106,05658588
107,05764156
108,05705372
109,05937500
110,05847932
111,05948012
112,05748412
113,05716668
114,05917468
115,05833916
116,05627916
117,05629740
118,05955724
119,05950028
120,05626380
121,05822044
122,05728204
123,05632668
124,05851660
125,05953612
126,05942940
127,05938588
128,05953868
129,05760620
130,05718780
131,05635388
132,05849660
133,05820284
134,05952428
135,05930780
136,05920892
137,05861468
138,05661020
139,05722460
140,05817884
141,05924988
142,05631036
143,05823068
144,05828652
145,05763756
146,05715756
147,05910108
148,05723676
149,05649196
150,05733372
151,05733484
152,05730796
153,05822796
154,05823532
155,05631100
156,05626460
157,05708460
158,05927116
159,05649516
160,05836092
161,05944204
162,05738236
163,05657292
164,05735228
165,05623804
166,05711580
167,05945212
168,05948332
169,05829884
170,05726940
171,05919660
172,05710988
173,05843084
174,05715404
175,05917788
176,05922188
177,05829580
178,05715532
179,05763724
180,05658812
181,05636092
182,05817084
183,05943388
184,05919788
185,05730572
186,05923804
187,05636300
188,05928444
189,05661036
190,05839852
191,05731340
192,05610940
193,05954364
194,05954012
195,05950860
196,05715324
197,05809660
198,05926908
199,05925564
200,05656908
201,05906524
202,05620620
203,05954908
204,05805276
205,05955276
206,05931788
207,05950812
208,05822748
209,05727132
210,05734604
211,05901004
212,05725948
213,05734588
214,05732380
215,05955004
216,05619980
217,05916636
218,05707980
219,05865500
220,05921964
221,05915948
222,05855260
223,05923036
224,05611276
225,05936092
226,05641484
227,05844908
228,05619036
229,05635532
230,05822156
231,05947868
232,05913292
233,06046252
234,05862956
235,05863100
236,05904028
237,05843596
238,05623676
239,05846748
240,05631308
241,05658284
242,05651564
243,05904556
244,05724300
245,05934220
246,05724220
247,05645676
248,05904044
249,05725932
250,06047372
251,05836924
252,05808732
253,05945852
254,05915164
255,05761052
256,05621212
257,05940684
258,05807084
259,05762012
260,05637260
261,05907516
262,05920268
263,05929388
264,05628876
265,05925740
266,05719340
267,05744620
268,05759740
269,05804396
270,05848412
271,05921228
272,05624524
273,05752860
274,05945500
275,05802220
276,05937548
277,05756956
278,05925516
279,05711244
280,05817516
281,05614444
282,06050204
283,05745948
284,05637884
285,05827548
286,05917244
287,05743564
288,05755788
289,05725596
290,05844604
291,05648316
292,05853612
293,05858396
294,05951116
295,05629468
296,05751836
297,05644908
298,05849084
299,05635100
300,05845628
301,05818892
302,05635212
303,05939836
304,05818748
305,05913132
306,05926508
307,05665324
308,05634892
309,05727564
310,05863036
311,05656348
312,05934892
313,05922140
314,05641740
315,05949100
316,05622652
317,05618988
318,05833036
319,05936252
320,05855196
321,05851804
322,05729084
323,05727116
324,05643244
325,05655004
326,05819468
327,05901404
328,05835036
329,05942188
330,05719996
331,05710092
332,05828684
333,05946812
334,05626028
335,05919900
336,05929404
337,05752108
338,05829612
339,05848492
340,05646268
341,05946252
342,05657340
343,05624044
344,05951948
345,05646092
346,05947260
347,05712572
348,05921852
349,05634284
350,05917420
351,05827308
352,05923580
353,05912988
354,05908172
355,05851628
356,05625132
357,05951772
358,05758924
359,05704956
360,05930220
361,05924524
362,05756284
363,05953516
364,05660684
365,05649372
366,05752428
367,05857500
368,05950316
369,05947292
370,05731484
371,05803244
372,05913244
373,05928156
374,05714316
375,05752476
376,05747036
377,05934716
378,05716684
379,05861564
380,05610876
381,05804364
382,05924172
383,05704860
384,05628860
385,05757932
386,05934044
387,05636364
388,05612188
389,05934092
390,05837132
391,05939548
392,05835020
393,05954972
394,05821244
395,05929724
396,05936524
397,05943852
398,05923260
399,05743308
400,05850780
401,05927548
402,05814396
403,05927724
404,05943180
405,05800188
406,05846972
407,05723180
408,05950172
409,05949404
410,05800108
411,05760636
412,05728572
413,05623036
414,05705612
415,05840812
416,05624588
417,05831836
418,05851244
419,05647916
420,05840364
421,05715964
422,05621164
423,05645356
424,05851740
425,05922524
426,05631132
427,05650828
428,05853404
429,05912924
430,05617148
431,05645164
432,05755436
433,05729596
434,05721516
435,05909132
436,05832700
437,05860876
438,05946892
439,05710124
440,05912396
441,05919292
442,05651004
443,05748684
444,05624076
445,05816444
446,05646236
447,05705996
448,05941052
449,05948812
450,06052348
451,05948892
452,05713340
453,05934284
454,05619020
455,05910412
456,05745708
457,05615852
458,05659676
459,05914268
460,05663228
461,05808796
462,05816972
463,05733452
464,05643628
465,05938220
466,05949228
467,05755388
468,05708924
469,05628668
470,05633740
471,05801548
472,05949644
473,05650060
474,05755628
475,05716108
476,05952812
477,05823756
478,05808780
479,05950700
480,06046316
481,05623276
482,05711884
483,05726508
484,05864812
485,05748572
486,05714140
487,05828492
488,05828876
489,05945132
490,05954188
491,05722652
492,05726540
493,05942332
494,05910988
495,05737212
496,05950332
497,05653884
498,05716252
499,05903996
500,05738332
1,05764781
2,05764782
3,05764783
4,05764784
5,05764785
6,05764786
7,05764787
8,05764788
9,05764789
0,05764780
\ No newline at end of file
1.c++工程是读取表格,生成卡号和二维码,固定文字
2.熟悉QT,需要知道怎么使用QT编译,运行工程
3.中继代码
\ No newline at end of file
#include "CImageCreater.h"
CImageCreater::CImageCreater()
{
}
bool CImageCreater::WriteBMP(std::string & savePath, unsigned char *rgbbuf, int w, int h, unsigned char * pQR, unsigned char * pQR1)
{
int size = w * h * 3;
BITMAPFILEHEADER bmpFileHeader;
memset(&bmpFileHeader, 0, sizeof(BITMAPFILEHEADER));
bmpFileHeader.bfSize = size + 54;
bmpFileHeader.bfOffBits = 54;
BITMAPINFOHEADER bmpInfoHeader;
memset(&bmpInfoHeader, 0, sizeof(BITMAPINFOHEADER));
bmpInfoHeader.biSize = 40;
bmpInfoHeader.biWidth = w;
bmpInfoHeader.biHeight = h;
bmpInfoHeader.biPlanes = 1;
bmpInfoHeader.biBitCount = 24;
FILE *bmpfile;
bmpfile = fopen(savePath.data(), "wb");
if (!bmpfile) {
return false;
}
fwrite("BM", 1, 2, bmpfile);
fwrite(&bmpFileHeader, sizeof(BITMAPFILEHEADER), 1, bmpfile);
fwrite(&bmpInfoHeader, sizeof(BITMAPINFOHEADER), 1, bmpfile);
int bytesPerLine = w * 3;
unsigned char * lineData = new unsigned char[bytesPerLine];
int c = 21;
int c1 = 33;
int pix = 10;
int pix1 = 5;
int offsetX = 20;
int offsetY = 20;
int offsetX1 = 445;
int offsetY1 = 65;
int tmpw, tmph, loc;
unsigned int tmp;
for(tmph = h - 1; tmph >= 0; tmph--)
{
memset(lineData, 0, bytesPerLine);
for(tmpw = 0; tmpw < w; tmpw++)
{
loc = tmph * bytesPerLine + tmpw * 3;
memcpy(&tmp, rgbbuf + loc, 3);
if((tmph >= offsetY && tmph < c * pix + offsetY) &&
(tmpw >= offsetX && tmpw < c * pix + offsetX))
{
int m = (tmph - offsetY) / pix;
int n = (tmpw - offsetX) / pix;
if(pQR[m * c + n] & 0x01)
{
tmp = 0;
}
else
{
tmp = 0xFFFFFF;
}
}
else if((tmph >= offsetY1 && tmph < c1 * pix1 + offsetY1) &&
(tmpw >= offsetX1 && tmpw < c1 * pix1 + offsetX1))
{
int m = (tmph - offsetY1) / pix1;
int n = (tmpw - offsetX1) / pix1;
if(pQR1[m * c1 + n] & 0x01)
{
tmp = 0;
}
else
{
tmp = 0xFFFFFF;
}
}
lineData[tmpw * 3 + 0] = tmp;
lineData[tmpw * 3 + 1] = tmp >> 8;
lineData[tmpw * 3 + 2] = tmp >> 16;
}
fwrite(lineData, bytesPerLine, 1, bmpfile);
}
fclose(bmpfile);
delete []lineData;
return true;
}
#ifndef CIMAGECREATER_H
#define CIMAGECREATER_H
#include <string>
typedef unsigned short WORD;
typedef unsigned int DWORD;
//文件信息头
typedef struct tagBITMAPFILEHEADER{
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
}BITMAPFILEHEADER;
//位图信息头
typedef struct tagBITMAPINFOHEADER{
DWORD biSize;
DWORD biWidth;
DWORD biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
DWORD biXPelsPerMeter;
DWORD biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
}BITMAPINFOHEADER;
class CImageCreater
{
public:
CImageCreater();
bool WriteBMP(std::string & savePath, unsigned char *rgbbuf, int w, int h, unsigned char * pQR, unsigned char * pQR1);
};
#endif // CIMAGECREATER_H
#include <QTextStream>
#include <QPainter>
#include <QThread>
#include <QFile>
#include <QCoreApplication>
#include "CWorkThread.h"
#include "QRLib/qrencode.h"
CWorkThread::CWorkThread(QString srcFile, QObject *parent) :
QThread(parent),
m_strSrcPath(srcFile),
m_bShowCompleted(true)
{
}
void CWorkThread::ShowCompleted()
{
m_bShowCompleted = true;
}
void CWorkThread::run()
{
QFile file(m_strSrcPath);
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
{
onError(tr("0"));
return ;
}
int w = 632;//要4的倍数
int h = 332;
unsigned char * pRGB = new unsigned char[w * h * 3];
std::string dir = QCoreApplication::applicationDirPath().toStdString();
QTextStream stream(&file);
QString line, sn, id;
QStringList list;
while(!stream.atEnd())
{
if(!m_bShowCompleted)
{
QThread::msleep(300);
continue;
}
line = stream.readLine();
//qDebug()<<line;
list.clear();
list = line.split(",");
if(list.size() >= 2)
{
sn = list.at(0);
id = list.at(1);
QRcode * pQR = QRcode_encodeString(id.toLatin1().data(), 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (pQR == NULL) {
onError(tr("1"));
return;
}
QRcode * pQR1 = QRcode_encodeString("http://a.app.qq.com/o/simple.jsp?pkgname=com.smart.gtstrvl", 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (pQR1 == NULL) {
onError(tr("2"));
return;
}
memset(pRGB, 0xFF, w * h * 3);
QString out_path1;
out_path1.sprintf("%s/%04d.bmp", dir.c_str(), sn.toInt());
qDebug()<<out_path1;
std::string out_path = out_path1.toStdString(); //QCoreApplication::applicationDirPath().toStdString() + "/" + sn.toStdString() + ".bmp";
onProcess("正在处理第 " + sn + " 张");
CImageCreater ic;
ic.WriteBMP(out_path, pRGB, w, h, pQR->data, pQR1->data);
//图片上各图片的位置设置
QImage * img = new QImage;
if(img->load(out_path.c_str()))
{
QPainter painter(img);
//设置画刷的组合模式CompositionMode_SoutceOut这个模式为目标图像在上
painter.setCompositionMode(QPainter::CompositionMode_SourceIn);
//设置画笔(颜色,线宽,样式为实线)
painter.setPen(QPen(QBrush(Qt::black), 1, Qt::SolidLine));
//设置线段为反锯齿
painter.setRenderHint(QPainter::TextAntialiasing, true);
QFont font = painter.font();
font.setFamily(tr("Symbol"));
font.setPixelSize(30);
font.setBold(false);
painter.setFont(font);
int offsetX = 240;
painter.drawText(offsetX, 90, tr("卡号 ") + id);
painter.drawText(offsetX, 160, tr("智慧皋亭山"));
QString tmp;
tmp.sprintf("SN%04d", sn.toInt());
painter.drawText(offsetX, 200, tmp);
painter.drawText(120, 290, tr("官方网站 www.517gts.com"));
font = painter.font();
font.setPixelSize(25);
painter.setFont(font);
painter.drawText(480, 45, tr("APP下载"));
img->save(out_path.c_str());
onCompleted(out_path.c_str());
m_bShowCompleted = false;
}
delete img;
QRcode_free(pQR);
QRcode_free(pQR1);
QThread::msleep(500);
}
}
file.close();
delete []pRGB;
return ;
}
#ifndef CWORKTHREAD_H
#define CWORKTHREAD_H
#include <QDebug>
#include <QThread>
#include <QString>
#include "CImageCreater.h"
class CWorkThread : public QThread
{
Q_OBJECT
public:
explicit CWorkThread(QString srcFile, QObject *parent = 0);
virtual void run();
void ShowCompleted();
signals:
void onProcess(QString);
void onCompleted(QString);
void onError(QString);
public slots:
private:
QString m_strSrcPath;
bool m_bShowCompleted;
};
#endif // CWORKTHREAD_H
//
// QRService.h
// QRCode
//
#import <Foundation/Foundation.h>
#import <AVFoundation/AVFoundation.h>
#import <UIKit/UIKit.h>
@interface QRService : NSObject
+ (instancetype)shared;
/**
* 生成二维码图片的方法
*
* @param aQRSourceString 生成的二维码包含的图片
* @param imageSize 生成图片的尺寸
* @param aCompletion 生成完成的回调
*/
- (void)createQRImage:(NSString *)aQRSourceString
size:(CGFloat)imageSize
completion:(void (^)(UIImage *result))aCompletion;
/**
* 扫描二维码的方法
*
* @param windowSize 显示位置
* @param viewSize 可以传递屏幕尺寸
* @param scanResult 扫描结果的字符串
*
* @return 返回扫描的layer 需要使用者添加到需要显示扫描效果的view上
*/
- (AVCaptureVideoPreviewLayer *)scanQRImage:(CGRect)windowSize
viewSize:(CGRect)viewSize
result:(void (^)(NSString *aQRCode))scanResult;
/**
* 识别图中的二维码
*
* @param aImage 图片
* @param aCompletion 识别完成的回调
*/
- (void)recognitionQRCodeFromImage:(UIImageView *)aImage
completion:(void (^)(NSString *result,NSError *error))aCompletion;
@end
//
// QRService.m
// QRCode
//
//
#import "QRService.h"
#import "UIImage+QRCode.h"
@interface QRService () <AVCaptureMetadataOutputObjectsDelegate,UIAlertViewDelegate>
//捕获设备,通常是前置摄像头,后置摄像头,麦克风(音频输入)
@property(nonatomic)AVCaptureDevice *device;
//AVCaptureDeviceInput 代表输入设备,他使用AVCaptureDevice 来初始化
@property(nonatomic)AVCaptureDeviceInput *input;
//设置输出类型为Metadata,因为这种输出类型中可以设置扫描的类型,譬如二维码
//当启动摄像头开始捕获输入时,如果输入中包含二维码,就会产生输出
@property(nonatomic)AVCaptureMetadataOutput *output;
//session:由他把输入输出结合在一起,并开始启动捕获设备(摄像头)
@property(nonatomic)AVCaptureSession *session;
//图像预览层,实时显示捕获的图像
@property(nonatomic) AVCaptureVideoPreviewLayer *previewLayer;
@property (nonatomic, copy) void (^scanResult)(NSString *aQRCode);
@end
@implementation QRService
+ (instancetype)shared {
static dispatch_once_t onceToken;
static id shared;
dispatch_once(&onceToken, ^{
shared = [[[self class] alloc] init];
});
return shared;
}
- (void)createQRImage:(NSString *)aQRSourceString size:(CGFloat)imageSize completion:(void (^)(UIImage *result))aCompletion
{
UIImage *img = [UIImage qrImageForString:aQRSourceString imageSize:imageSize withPointType:0 withPositionType:0 withColor:[UIColor clearColor]];
aCompletion(img);
}
- (AVCaptureVideoPreviewLayer *)scanQRImage:(CGRect)windowSize viewSize:(CGRect)viewSize result:(void (^)(NSString *aQRCode))scanResult
{
self.scanResult = scanResult;
return [self creatCaptureDevice:windowSize viewSize:viewSize];
}
- (AVCaptureVideoPreviewLayer *)creatCaptureDevice:(CGRect)windowSize viewSize:(CGRect)viewSize{
//获取摄像设备
AVCaptureDevice * device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
//创建输入流
AVCaptureDeviceInput * input = [AVCaptureDeviceInput deviceInputWithDevice:device error:nil];
if (!input) return nil;
//创建输出流
AVCaptureMetadataOutput * output = [[AVCaptureMetadataOutput alloc]init];
//设置代理 在主线程里刷新
[output setMetadataObjectsDelegate:self queue:dispatch_get_main_queue()];
//设置有效扫描区域
CGRect scanCrop=[self getScanCrop:windowSize readerViewBounds:viewSize];
output.rectOfInterest = scanCrop;
//初始化链接对象
_session = [[AVCaptureSession alloc]init];
//高质量采集率
[_session setSessionPreset:AVCaptureSessionPresetHigh];
[_session addInput:input];
[_session addOutput:output];
//设置扫码支持的编码格式(如下设置条形码和二维码兼容)
output.metadataObjectTypes=@[AVMetadataObjectTypeQRCode,AVMetadataObjectTypeEAN13Code, AVMetadataObjectTypeEAN8Code, AVMetadataObjectTypeCode128Code];
AVCaptureVideoPreviewLayer * layer = [AVCaptureVideoPreviewLayer layerWithSession:_session];
layer.videoGravity=AVLayerVideoGravityResizeAspectFill;
layer.frame=viewSize;
// [self.view.layer insertSublayer:layer atIndex:0];
//开始捕获
[_session startRunning];
return layer;
}
#pragma mark-> 获取扫描区域的比例关系
-(CGRect)getScanCrop:(CGRect)rect readerViewBounds:(CGRect)readerViewBounds
{
CGFloat x,y,width,height;
x = (CGRectGetHeight(readerViewBounds)-CGRectGetHeight(rect))/2/CGRectGetHeight(readerViewBounds);
y = (CGRectGetWidth(readerViewBounds)-CGRectGetWidth(rect))/2/CGRectGetWidth(readerViewBounds);
width = CGRectGetHeight(rect)/CGRectGetHeight(readerViewBounds);
height = CGRectGetWidth(rect)/CGRectGetWidth(readerViewBounds);
return CGRectMake(x, y, width, height);
}
#pragma mark 输出的代理
-(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputMetadataObjects:(NSArray *)metadataObjects fromConnection:(AVCaptureConnection *)connection{
if (metadataObjects.count>0) {
[_session stopRunning];
AVMetadataMachineReadableCodeObject * metadataObject = [metadataObjects objectAtIndex : 0 ];
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"扫描结果" message:metadataObject.stringValue delegate:self cancelButtonTitle:@"退出" otherButtonTitles:@"再次扫描", nil];
[alert show];
}
}
#pragma mark - 识别图中二维码的功能
- (void)recognitionQRCodeFromImage:(UIImageView *)aImage completion:(void (^)(NSString *result,NSError *error))aCompletion
{
CIDetector*detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{ CIDetectorAccuracy : CIDetectorAccuracyHigh }];
NSArray *features = [detector featuresInImage:[CIImage imageWithCGImage:aImage.image.CGImage]];
if (features.count >=1) {
/**结果对象 */
CIQRCodeFeature *feature = [features objectAtIndex:0];
NSString *scannedResult = feature.messageString;
aCompletion(scannedResult,nil);
}
else{
NSError *error = [NSError errorWithDomain:@"QRCodeNotFound" code:-1000 userInfo:@{NSLocalizedDescriptionKey:@"QRCodeNotFound"}];
aCompletion(nil,error);
}
}
#pragma mark UIAlertViewDelegate
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
[alertView dismissWithClickedButtonIndex:buttonIndex animated:YES];
}
@end
//
// UIImage+QRCode.h
// QRCode
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef enum {
QRPointRect = 0,
QRPointRound
}QRPointType;
typedef enum {
QRPositionNormal = 0,
QRPositionRound
}QRPositionType;
@interface UIImage (QRCode)
/**
* 生成二维码图片的方法
*
* @param string 二维码包含的内容
* @param size 图片的尺寸
* @param topimg 如果中间需要添加 头像可以传入此参数
*
* @return 包含要生成内容的二维码图片
*/
+ (UIImage *)qrImageForString:(NSString *)string
imageSize:(CGFloat)size
Topimg:(UIImage *)topimg;
/**
* 生成二维码图片的方法
*
* @param string 二维码包含的内容
* @param size 图片的尺寸
* @param pointType 点的类型(QRPointRect,QRPointRound)
* @param positionType 位置的类型 (QRPositionNormal,QRPositionRound)
* @param color 背景颜色
*
* @return 包含要生成内容的二维码图片
*/
+(UIImage *)qrImageForString:(NSString *)string
imageSize:(CGFloat)size
withPointType:(QRPointType)pointType
withPositionType:(QRPositionType)positionType
withColor:(UIColor *)color;
/**
* 生成二维码图片的方法
*
* @param string 二维码包含的内容
* @param size 图片的尺寸
* @param topimg 如果中间需要添加 头像可以传入此参数
* @param color 背景颜色
*
* @return 包含要生成内容的二维码图片
*/
+(UIImage*)qrImageForString:(NSString *)string
imageSize:(CGFloat)size
Topimg:(UIImage *)topimg
withColor:(UIColor*)color;
@end
//
// UIImage+QRCode.m
// QRCode
//
//
#import "UIImage+QRCode.h"
#import "qrencode.h"
enum {
qr_margin = 3
};
@implementation UIImage (QRCode)
+ (void)drawQRCode:(QRcode *)code context:(CGContextRef)ctx size:(CGFloat)size {
unsigned char *data = 0;
int width;
data = code->data;
width = code->width;
float zoom = (double)size / (code->width + 2.0 * qr_margin);
CGRect rectDraw = CGRectMake(0, 0, zoom, zoom);
// draw
CGContextSetFillColor(ctx, CGColorGetComponents([UIColor blackColor].CGColor));
for(int i = 0; i < width; ++i) {
for(int j = 0; j < width; ++j) {
if(*data & 1) {
rectDraw.origin = CGPointMake((j + qr_margin) * zoom,(i + qr_margin) * zoom);
CGContextAddRect(ctx, rectDraw);
}
++data;
}
}
CGContextFillPath(ctx);
}
+ (UIImage *)qrImageForString:(NSString *)string imageSize:(CGFloat)size Topimg:(UIImage *)topimg{
if (![string length]) {
return nil;
}
QRcode *code = QRcode_encodeString([string UTF8String], 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (!code) {
return nil;
}
// create context
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(0, size, size, 8, size * 4, colorSpace, kCGImageAlphaPremultipliedLast);
CGAffineTransform translateTransform = CGAffineTransformMakeTranslation(0, -size);
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(1, -1);
CGContextConcatCTM(ctx, CGAffineTransformConcat(translateTransform, scaleTransform));
// draw QR on this context
[UIImage drawQRCode:code context:ctx size:size];
// get image
CGImageRef qrCGImage = CGBitmapContextCreateImage(ctx);
UIImage * qrImage = [UIImage imageWithCGImage:qrCGImage];
if(topimg)
{
UIGraphicsBeginImageContext(qrImage.size);
//Draw image2
[qrImage drawInRect:CGRectMake(0, 0, qrImage.size.width, qrImage.size.height)];
//Draw image1
float r=qrImage.size.width*35/240;
[topimg drawInRect:CGRectMake((qrImage.size.width-r)/2, (qrImage.size.height-r)/2 ,r, r)];
qrImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
// some releases
CGContextRelease(ctx);
CGImageRelease(qrCGImage);
CGColorSpaceRelease(colorSpace);
QRcode_free(code);
return qrImage;
}
#pragma mark - custom method
// 自己添加的
+ (void)drawQRCode:(QRcode *)code context:(CGContextRef)ctx size:(CGFloat)size withPointType:(QRPointType)pointType withPositionType:(QRPositionType)positionType withColor:(UIColor *)color {
unsigned char *data = 0;
int width;
data = code->data;
width = code->width;
float zoom = (double)size / (code->width + 2.0 * qr_margin);
CGRect rectDraw = CGRectMake(0, 0, zoom, zoom);
// draw
const CGFloat *components;
if (color) {
components = CGColorGetComponents(color.CGColor);
}else {
components = CGColorGetComponents([UIColor blackColor].CGColor);
}
CGContextSetRGBFillColor(ctx, components[0], components[1], components[2], 1.0);
NSLog(@"aad :%f bbd :%f ccd:%f",components[0],components[1],components[2]);
for(int i = 0; i < width; ++i) {
for(int j = 0; j < width; ++j) {
if(*data & 1) {
rectDraw.origin = CGPointMake((j + qr_margin) * zoom,(i + qr_margin) * zoom);
if (positionType == QRPositionNormal) {
switch (pointType) {
case QRPointRect:
CGContextAddRect(ctx, rectDraw);
break;
case QRPointRound:
CGContextAddEllipseInRect(ctx, rectDraw);
break;
default:
break;
}
}else if(positionType == QRPositionRound) {
switch (pointType) {
case QRPointRect:
CGContextAddRect(ctx, rectDraw);
break;
case QRPointRound:
if ((i>=0 && i<=6 && j>=0 && j<=6) || (i>=0 && i<=6 && j>=width-7-1 && j<=width-1) || (i>=width-7-1 && i<=width-1 && j>=0 && j<=6)) {
CGContextAddRect(ctx, rectDraw);
}else {
CGContextAddEllipseInRect(ctx, rectDraw);
}
break;
default:
break;
}
}
}
++data;
}
}
CGContextFillPath(ctx);
}
+ (UIImage *)qrImageForString:(NSString *)string imageSize:(CGFloat)size withPointType:(QRPointType)pointType withPositionType:(QRPositionType)positionType withColor:(UIColor *)color {
if (![string length]) {
return nil;
}
QRcode *code = QRcode_encodeString([string UTF8String], 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (!code) {
return nil;
}
// create context
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(0, size, size, 8, size * 4, colorSpace, kCGImageAlphaPremultipliedLast);
CGAffineTransform translateTransform = CGAffineTransformMakeTranslation(0, -size);
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(1, -1);
CGContextConcatCTM(ctx, CGAffineTransformConcat(translateTransform, scaleTransform));
// draw QR on this context
[UIImage drawQRCode:code context:ctx size:size withPointType:pointType withPositionType:positionType withColor:color];
// get image
CGImageRef qrCGImage = CGBitmapContextCreateImage(ctx);
UIImage * qrImage = [UIImage imageWithCGImage:qrCGImage];
// some releases
CGContextRelease(ctx);
CGImageRelease(qrCGImage);
CGColorSpaceRelease(colorSpace);
QRcode_free(code);
return qrImage;
}
+(UIImage*)qrImageForString:(NSString *)string imageSize:(CGFloat)size Topimg:(UIImage *)topimg withColor:(UIColor*)color{
if (![string length]) {
return nil;
}
QRcode *code = QRcode_encodeString([string UTF8String], 0, QR_ECLEVEL_L, QR_MODE_8, 1);
if (!code) {
return nil;
}
// create context
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGContextRef ctx = CGBitmapContextCreate(0, size, size, 8, size * 4, colorSpace, kCGImageAlphaPremultipliedLast);
CGAffineTransform translateTransform = CGAffineTransformMakeTranslation(0, -size);
CGAffineTransform scaleTransform = CGAffineTransformMakeScale(1, -1);
CGContextConcatCTM(ctx, CGAffineTransformConcat(translateTransform, scaleTransform));
// draw QR on this context
[UIImage drawQRCode:code context:ctx size:size withPointType:0 withPositionType:0 withColor:color];
// get image
CGImageRef qrCGImage = CGBitmapContextCreateImage(ctx);
UIImage * qrImage = [UIImage imageWithCGImage:qrCGImage];
if(topimg)
{
UIGraphicsBeginImageContext(qrImage.size);
//Draw image2
[qrImage drawInRect:CGRectMake(0, 0, qrImage.size.width, qrImage.size.height)];
//Draw image1
float r=qrImage.size.width*35/240;
[topimg drawInRect:CGRectMake((qrImage.size.width-r)/2, (qrImage.size.height-r)/2 ,r, r)];
qrImage=UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
// some releases
CGContextRelease(ctx);
CGImageRelease(qrCGImage);
CGColorSpaceRelease(colorSpace);
QRcode_free(code);
return qrImage;
}
@end
/*
* qrencode - QR Code encoder
*
* Binary sequence class.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bitstream.h"
BitStream *BitStream_new(void)
{
BitStream *bstream;
bstream = (BitStream *)malloc(sizeof(BitStream));
if(bstream == NULL) return NULL;
bstream->length = 0;
bstream->data = NULL;
return bstream;
}
static int BitStream_allocate(BitStream *bstream, int length)
{
unsigned char *data;
if(bstream == NULL) {
return -1;
}
data = (unsigned char *)malloc(length);
if(data == NULL) {
return -1;
}
if(bstream->data) {
free(bstream->data);
}
bstream->length = length;
bstream->data = data;
return 0;
}
static BitStream *BitStream_newFromNum(int bits, unsigned int num)
{
unsigned int mask;
int i;
unsigned char *p;
BitStream *bstream;
bstream = BitStream_new();
if(bstream == NULL) return NULL;
if(BitStream_allocate(bstream, bits)) {
BitStream_free(bstream);
return NULL;
}
p = bstream->data;
mask = 1 << (bits - 1);
for(i=0; i<bits; i++) {
if(num & mask) {
*p = 1;
} else {
*p = 0;
}
p++;
mask = mask >> 1;
}
return bstream;
}
static BitStream *BitStream_newFromBytes(int size, unsigned char *data)
{
unsigned char mask;
int i, j;
unsigned char *p;
BitStream *bstream;
bstream = BitStream_new();
if(bstream == NULL) return NULL;
if(BitStream_allocate(bstream, size * 8)) {
BitStream_free(bstream);
return NULL;
}
p = bstream->data;
for(i=0; i<size; i++) {
mask = 0x80;
for(j=0; j<8; j++) {
if(data[i] & mask) {
*p = 1;
} else {
*p = 0;
}
p++;
mask = mask >> 1;
}
}
return bstream;
}
int BitStream_append(BitStream *bstream, BitStream *arg)
{
unsigned char *data;
if(arg == NULL) {
return -1;
}
if(arg->length == 0) {
return 0;
}
if(bstream->length == 0) {
if(BitStream_allocate(bstream, arg->length)) {
return -1;
}
memcpy(bstream->data, arg->data, arg->length);
return 0;
}
data = (unsigned char *)malloc(bstream->length + arg->length);
if(data == NULL) {
return -1;
}
memcpy(data, bstream->data, bstream->length);
memcpy(data + bstream->length, arg->data, arg->length);
free(bstream->data);
bstream->length += arg->length;
bstream->data = data;
return 0;
}
int BitStream_appendNum(BitStream *bstream, int bits, unsigned int num)
{
BitStream *b;
int ret;
if(bits == 0) return 0;
b = BitStream_newFromNum(bits, num);
if(b == NULL) return -1;
ret = BitStream_append(bstream, b);
BitStream_free(b);
return ret;
}
int BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data)
{
BitStream *b;
int ret;
if(size == 0) return 0;
b = BitStream_newFromBytes(size, data);
if(b == NULL) return -1;
ret = BitStream_append(bstream, b);
BitStream_free(b);
return ret;
}
unsigned char *BitStream_toByte(BitStream *bstream)
{
int i, j, size, bytes;
unsigned char *data, v;
unsigned char *p;
size = BitStream_size(bstream);
if(size == 0) {
return NULL;
}
data = (unsigned char *)malloc((size + 7) / 8);
if(data == NULL) {
return NULL;
}
bytes = size / 8;
p = bstream->data;
for(i=0; i<bytes; i++) {
v = 0;
for(j=0; j<8; j++) {
v = v << 1;
v |= *p;
p++;
}
data[i] = v;
}
if(size & 7) {
v = 0;
for(j=0; j<(size & 7); j++) {
v = v << 1;
v |= *p;
p++;
}
data[bytes] = v;
}
return data;
}
void BitStream_free(BitStream *bstream)
{
if(bstream != NULL) {
free(bstream->data);
free(bstream);
}
}
/*
* qrencode - QR Code encoder
*
* Binary sequence class.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __BITSTREAM_H__
#define __BITSTREAM_H__
typedef struct {
int length;
unsigned char *data;
} BitStream;
extern BitStream *BitStream_new(void);
extern int BitStream_append(BitStream *bstream, BitStream *arg);
extern int BitStream_appendNum(BitStream *bstream, int bits, unsigned int num);
extern int BitStream_appendBytes(BitStream *bstream, int size, unsigned char *data);
#define BitStream_size(__bstream__) (__bstream__->length)
extern unsigned char *BitStream_toByte(BitStream *bstream);
extern void BitStream_free(BitStream *bstream);
#endif /* __BITSTREAM_H__ */
/*
* qrencode - QR Code encoder
*
* Masking.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include <limits.h>
//#include "config.h"
#include "qrencode.h"
#include "qrspec.h"
#include "mask.h"
//__STATIC
static int Mask_writeFormatInformation(int width, unsigned char *frame, int mask, QRecLevel level)
{
unsigned int format;
unsigned char v;
int i;
int blacks = 0;
format = QRspec_getFormatInfo(mask, level);
for(i=0; i<8; i++) {
if(format & 1) {
blacks += 2;
v = 0x85;
} else {
v = 0x84;
}
frame[width * 8 + width - 1 - i] = v;
if(i < 6) {
frame[width * i + 8] = v;
} else {
frame[width * (i + 1) + 8] = v;
}
format= format >> 1;
}
for(i=0; i<7; i++) {
if(format & 1) {
blacks += 2;
v = 0x85;
} else {
v = 0x84;
}
frame[width * (width - 7 + i) + 8] = v;
if(i == 0) {
frame[width * 8 + 7] = v;
} else {
frame[width * 8 + 6 - i] = v;
}
format= format >> 1;
}
return blacks;
}
/**
* Demerit coefficients.
* See Section 8.8.2, pp.45, JIS X0510:2004.
*/
#define N1 (3)
#define N2 (3)
#define N3 (40)
#define N4 (10)
#define MASKMAKER(__exp__) \
int x, y;\
int b = 0;\
\
for(y=0; y<width; y++) {\
for(x=0; x<width; x++) {\
if(*s & 0x80) {\
*d = *s;\
} else {\
*d = *s ^ ((__exp__) == 0);\
}\
b += (int)(*d & 1);\
s++; d++;\
}\
}\
return b;
static int Mask_mask0(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER((x+y)&1)
}
static int Mask_mask1(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER(y&1)
}
static int Mask_mask2(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER(x%3)
}
static int Mask_mask3(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER((x+y)%3)
}
static int Mask_mask4(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER(((y/2)+(x/3))&1)
}
static int Mask_mask5(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER(((x*y)&1)+(x*y)%3)
}
static int Mask_mask6(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER((((x*y)&1)+(x*y)%3)&1)
}
static int Mask_mask7(int width, const unsigned char *s, unsigned char *d)
{
MASKMAKER((((x*y)%3)+((x+y)&1))&1)
}
typedef int MaskMaker(int, const unsigned char *, unsigned char *);
static MaskMaker *maskMakers[] = {
Mask_mask0, Mask_mask1, Mask_mask2, Mask_mask3,
Mask_mask4, Mask_mask5, Mask_mask6, Mask_mask7
};
unsigned char *Mask_makeMask(int width, unsigned char *frame, int mask, QRecLevel level)
{
unsigned char *masked;
masked = (unsigned char *)malloc(width * width);
if(masked == NULL) return NULL;
maskMakers[mask](width, frame, masked);
Mask_writeFormatInformation(width, masked, mask, level);
return masked;
}
static int runLength[QRSPEC_WIDTH_MAX + 1];
//static int n1;
//static int n2;
//static int n3;
//static int n4;
static int Mask_calcN1N3(int length, int *runLength)
{
int i;
int demerit = 0;
int fact;
for(i=0; i<length; i++) {
if(runLength[i] >= 5) {
demerit += N1 + (runLength[i] - 5);
//n1 += N1 + (runLength[i] - 5);
}
if((i & 1)) {
if(i >= 3 && i < length-2 && (runLength[i] % 3) == 0) {
fact = runLength[i] / 3;
if(runLength[i-2] == fact &&
runLength[i-1] == fact &&
runLength[i+1] == fact &&
runLength[i+2] == fact) {
if(runLength[i-3] < 0 || runLength[i-3] >= 4 * fact) {
demerit += N3;
//n3 += N3;
} else if(i+3 >= length || runLength[i+3] >= 4 * fact) {
demerit += N3;
//n3 += N3;
}
}
}
}
}
return demerit;
}
//__STATIC
static int Mask_evaluateSymbol(int width, unsigned char *frame)
{
int x, y;
unsigned char *p;
unsigned char b22, w22;
int head;
int demerit = 0;
p = frame;
for(y=0; y<width; y++) {
head = 0;
runLength[0] = 1;
for(x=0; x<width; x++) {
if(x > 0 && y > 0) {
b22 = p[0] & p[-1] & p[-width] & p [-width-1];
w22 = p[0] | p[-1] | p[-width] | p [-width-1];
if((b22 | (w22 ^ 1))&1) {
demerit += N2;
}
}
if(x == 0 && (p[0] & 1)) {
runLength[0] = -1;
head = 1;
runLength[head] = 1;
} else if(x > 0) {
if((p[0] ^ p[-1]) & 1) {
head++;
runLength[head] = 1;
} else {
runLength[head]++;
}
}
p++;
}
demerit += Mask_calcN1N3(head+1, runLength);
}
for(x=0; x<width; x++) {
head = 0;
runLength[0] = 1;
p = frame + x;
for(y=0; y<width; y++) {
if(y == 0 && (p[0] & 1)) {
runLength[0] = -1;
head = 1;
runLength[head] = 1;
} else if(y > 0) {
if((p[0] ^ p[-width]) & 1) {
head++;
runLength[head] = 1;
} else {
runLength[head]++;
}
}
p+=width;
}
demerit += Mask_calcN1N3(head+1, runLength);
}
return demerit;
}
unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level)
{
int i;
unsigned char *mask, *bestMask;
int minDemerit = INT_MAX;
int bestMaskNum = 0;
int blacks;
int demerit;
mask = (unsigned char *)malloc(width * width);
if(mask == NULL) return NULL;
bestMask = NULL;
for(i=0; i<8; i++) {
// n1 = n2 = n3 = n4 = 0;
demerit = 0;
blacks = maskMakers[i](width, frame, mask);
blacks += Mask_writeFormatInformation(width, mask, i, level);
blacks = 100 * blacks / (width * width);
demerit = (abs(blacks - 50) / 5) * N4;
// n4 = demerit;
demerit += Mask_evaluateSymbol(width, mask);
// printf("(%d,%d,%d,%d)=%d\n", n1, n2, n3 ,n4, demerit);
if(demerit < minDemerit) {
minDemerit = demerit;
bestMaskNum = i;
if(bestMask != NULL) {
free(bestMask);
}
bestMask = (unsigned char *)malloc(width * width);
if(bestMask == NULL) break;
memcpy(bestMask, mask, width * width);
}
}
free(mask);
return bestMask;
}
/*
* qrencode - QR Code encoder
*
* Masking.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __MASK_H__
#define __MASK_H__
#include "qrinput.h"
extern unsigned char *Mask_makeMask(int width, unsigned char *frame, int mask, QRecLevel level);
extern unsigned char *Mask_mask(int width, unsigned char *frame, QRecLevel level);
#endif /* __MASK_H__ */
/*
* qrencode - QR Code encoder
*
* Copyright (C) 2006-2010 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
//#include "config.h"
#include "qrencode.h"
#include "qrspec.h"
#include "bitstream.h"
#include "qrinput.h"
#include "rscode.h"
#include "split.h"
#include "mask.h"
/******************************************************************************
* Raw code
*****************************************************************************/
typedef struct {
int dataLength;
unsigned char *data;
int eccLength;
unsigned char *ecc;
} RSblock;
typedef struct {
int version;
unsigned char *datacode;
unsigned char *ecccode;
int blocks;
RSblock *rsblock;
int count;
int dataLength;
int eccLength;
int b1;
} QRRawCode;
static void RSblock_initBlock(RSblock *block, int dl, unsigned char *data, int el, unsigned char *ecc, RS *rs)
{
block->dataLength = dl;
block->data = data;
block->eccLength = el;
block->ecc = ecc;
encode_rs_char(rs, data, ecc);
}
static int RSblock_init(RSblock *blocks, int spec[5], unsigned char *data, unsigned char *ecc)
{
int i;
RSblock *block;
unsigned char *dp, *ep;
RS *rs;
int el, dl;
dl = QRspec_rsDataCodes1(spec);
el = QRspec_rsEccCodes1(spec);
rs = init_rs(8, 0x11d, 0, 1, el, 255 - dl - el);
if(rs == NULL) return -1;
block = blocks;
dp = data;
ep = ecc;
for(i=0; i<QRspec_rsBlockNum1(spec); i++) {
RSblock_initBlock(block, dl, dp, el, ep, rs);
dp += dl;
ep += el;
block++;
}
if(QRspec_rsBlockNum2(spec) == 0) return 0;
dl = QRspec_rsDataCodes2(spec);
el = QRspec_rsEccCodes2(spec);
rs = init_rs(8, 0x11d, 0, 1, el, 255 - dl - el);
if(rs == NULL) return -1;
for(i=0; i<QRspec_rsBlockNum2(spec); i++) {
RSblock_initBlock(block, dl, dp, el, ep, rs);
dp += dl;
ep += el;
block++;
}
return 0;
}
//__STATIC
static void QRraw_free(QRRawCode *raw);
//__STATIC
static QRRawCode *QRraw_new(QRinput *input)
{
QRRawCode *raw;
int spec[5], ret;
raw = (QRRawCode *)malloc(sizeof(QRRawCode));
if(raw == NULL) return NULL;
raw->datacode = QRinput_getByteStream(input);
if(raw->datacode == NULL) {
free(raw);
return NULL;
}
QRspec_getEccSpec(input->version, input->level, spec);
raw->version = input->version;
raw->b1 = QRspec_rsBlockNum1(spec);
raw->dataLength = QRspec_rsDataLength(spec);
raw->eccLength = QRspec_rsEccLength(spec);
raw->ecccode = (unsigned char *)malloc(raw->eccLength);
if(raw->ecccode == NULL) {
free(raw->datacode);
free(raw);
return NULL;
}
raw->blocks = QRspec_rsBlockNum(spec);
raw->rsblock = (RSblock *)calloc(sizeof(RSblock), raw->blocks);
if(raw->rsblock == NULL) {
QRraw_free(raw);
return NULL;
}
ret = RSblock_init(raw->rsblock, spec, raw->datacode, raw->ecccode);
if(ret < 0) {
QRraw_free(raw);
return NULL;
}
raw->count = 0;
return raw;
}
/**
* Return a code (byte).
* This function can be called iteratively.
* @param raw raw code.
* @return code
*/
//__STATIC
static unsigned char QRraw_getCode(QRRawCode *raw)
{
int col, row;
unsigned char ret;
if(raw->count < raw->dataLength) {
row = raw->count % raw->blocks;
col = raw->count / raw->blocks;
if(col >= raw->rsblock[0].dataLength) {
row += raw->b1;
}
ret = raw->rsblock[row].data[col];
} else if(raw->count < raw->dataLength + raw->eccLength) {
row = (raw->count - raw->dataLength) % raw->blocks;
col = (raw->count - raw->dataLength) / raw->blocks;
ret = raw->rsblock[row].ecc[col];
} else {
return 0;
}
raw->count++;
return ret;
}
//__STATIC
static void QRraw_free(QRRawCode *raw)
{
if(raw != NULL) {
free(raw->datacode);
free(raw->ecccode);
if(raw->rsblock != NULL) {
free(raw->rsblock);
}
free(raw);
}
}
/******************************************************************************
* Frame filling
*****************************************************************************/
typedef struct {
int width;
unsigned char *frame;
int x, y;
int dir;
int bit;
} FrameFiller;
static FrameFiller *FrameFiller_new(int width, unsigned char *frame)
{
FrameFiller *filler;
filler = (FrameFiller *)malloc(sizeof(FrameFiller));
if(filler == NULL) return NULL;
filler->width = width;
filler->frame = frame;
filler->x = width - 1;
filler->y = width - 1;
filler->dir = -1;
filler->bit = -1;
return filler;
}
static unsigned char *FrameFiller_next(FrameFiller *filler)
{
unsigned char *p;
int x, y, w;
if(filler->bit == -1) {
filler->bit = 0;
return filler->frame + filler->y * filler->width + filler->x;
}
x = filler->x;
y = filler->y;
p = filler->frame;
w = filler->width;
if(filler->bit == 0) {
x--;
filler->bit++;
} else {
x++;
y += filler->dir;
filler->bit--;
}
if(filler->dir < 0) {
if(y < 0) {
y = 0;
x -= 2;
filler->dir = 1;
if(x == 6) {
x--;
y = 9;
}
}
} else {
if(y == w) {
y = w - 1;
x -= 2;
filler->dir = -1;
if(x == 6) {
x--;
y -= 8;
}
}
}
if(x < 0 || y < 0) return NULL;
filler->x = x;
filler->y = y;
if(p[y * w + x] & 0x80) {
// This tail recursion could be optimized.
return FrameFiller_next(filler);
}
return &p[y * w + x];
}
#if 0
unsigned char *FrameFiller_fillerTest(int version)
{
int width, length;
unsigned char *frame, *p;
FrameFiller *filler;
int i, j;
unsigned char cl = 1;
unsigned char ch = 0;
width = QRspec_getWidth(version);
frame = QRspec_newFrame(version);
filler = FrameFiller_new(width, frame);
length = QRspec_getDataLength(version, QR_ECLEVEL_L)
+ QRspec_getECCLength(version, QR_ECLEVEL_L);
for(i=0; i<length; i++) {
for(j=0; j<8; j++) {
p = FrameFiller_next(filler);
*p = ch | cl;
cl++;
if(cl == 9) {
cl = 1;
ch += 0x10;
}
}
}
length = QRspec_getRemainder(version);
for(i=0; i<length; i++) {
p = FrameFiller_next(filler);
*p = 0xa0;
}
p = FrameFiller_next(filler);
free(filler);
if(p != NULL) {
return NULL;
}
return frame;
}
#endif
/******************************************************************************
* QR-code encoding
*****************************************************************************/
static QRcode *QRcode_new(int version, int width, unsigned char *data)
{
QRcode *qrcode;
qrcode = (QRcode *)malloc(sizeof(QRcode));
if(qrcode == NULL) return NULL;
qrcode->version = version;
qrcode->width = width;
qrcode->data = data;
return qrcode;
}
void QRcode_free(QRcode *qrcode)
{
if(qrcode != NULL) {
free(qrcode->data);
free(qrcode);
}
}
//__STATIC
static QRcode *QRcode_encodeMask(QRinput *input, int mask)
{
int width, version;
QRRawCode *raw;
unsigned char *frame, *masked, *p, code, bit;
FrameFiller *filler;
int i, j;
QRcode *qrcode;
if(input->version < 0 || input->version > QRSPEC_VERSION_MAX) {
errno = EINVAL;
return NULL;
}
if(input->level > QR_ECLEVEL_H) {
errno = EINVAL;
return NULL;
}
raw = QRraw_new(input);
if(raw == NULL) return NULL;
version = raw->version;
width = QRspec_getWidth(version);
frame = QRspec_newFrame(version);
if(frame == NULL) {
QRraw_free(raw);
return NULL;
}
filler = FrameFiller_new(width, frame);
if(filler == NULL) {
QRraw_free(raw);
free(frame);
return NULL;
}
/* inteleaved data and ecc codes */
for(i=0; i<raw->dataLength + raw->eccLength; i++) {
code = QRraw_getCode(raw);
bit = 0x80;
for(j=0; j<8; j++) {
p = FrameFiller_next(filler);
*p = 0x02 | ((bit & code) != 0);
bit = bit >> 1;
}
}
QRraw_free(raw);
/* remainder bits */
j = QRspec_getRemainder(version);
for(i=0; i<j; i++) {
p = FrameFiller_next(filler);
*p = 0x02;
}
free(filler);
/* masking */
if(mask < 0) {
masked = Mask_mask(width, frame, input->level);
} else {
masked = Mask_makeMask(width, frame, mask, input->level);
}
if(masked == NULL) {
free(frame);
return NULL;
}
qrcode = QRcode_new(version, width, masked);
free(frame);
return qrcode;
}
QRcode *QRcode_encodeInput(QRinput *input)
{
return QRcode_encodeMask(input, -1);
}
QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level)
{
QRinput *input;
QRcode *code;
int ret;
if(string == NULL) {
errno = EINVAL;
return NULL;
}
input = QRinput_new2(version, level);
if(input == NULL) return NULL;
ret = QRinput_append(input, QR_MODE_8, strlen(string), (unsigned char *)string);
if(ret < 0) {
QRinput_free(input);
return NULL;
}
code = QRcode_encodeInput(input);
QRinput_free(input);
return code;
}
QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive)
{
QRinput *input;
QRcode *code;
int ret;
if(hint != QR_MODE_8 && hint != QR_MODE_KANJI) {
errno = EINVAL;
return NULL;
}
input = QRinput_new2(version, level);
if(input == NULL) return NULL;
ret = Split_splitStringToQRinput(string, input, hint, casesensitive);
if(ret < 0) {
QRinput_free(input);
return NULL;
}
code = QRcode_encodeInput(input);
QRinput_free(input);
return code;
}
/******************************************************************************
* Structured QR-code encoding
*****************************************************************************/
static QRcode_List *QRcode_List_newEntry(void)
{
QRcode_List *entry;
entry = (QRcode_List *)malloc(sizeof(QRcode_List));
if(entry == NULL) return NULL;
entry->next = NULL;
entry->code = NULL;
return entry;
}
static void QRcode_List_freeEntry(QRcode_List *entry)
{
if(entry != NULL) {
QRcode_free(entry->code);
free(entry);
}
}
void QRcode_List_free(QRcode_List *qrlist)
{
QRcode_List *list = qrlist, *next;
while(list != NULL) {
next = list->next;
QRcode_List_freeEntry(list);
list = next;
}
}
int QRcode_List_size(QRcode_List *qrlist)
{
QRcode_List *list = qrlist;
int size = 0;
while(list != NULL) {
size++;
list = list->next;
}
return size;
}
#if 0
static unsigned char QRcode_parity(const char *str, int size)
{
unsigned char parity = 0;
int i;
for(i=0; i<size; i++) {
parity ^= str[i];
}
return parity;
}
#endif
QRcode_List *QRcode_encodeInputStructured(QRinput_Struct *s)
{
QRcode_List *head = NULL;
QRcode_List *tail = NULL;
QRcode_List *entry;
QRinput_InputList *list = s->head;
while(list != NULL) {
if(head == NULL) {
entry = QRcode_List_newEntry();
if(entry == NULL) goto ABORT;
head = entry;
tail = head;
} else {
entry = QRcode_List_newEntry();
if(entry == NULL) goto ABORT;
tail->next = entry;
tail = tail->next;
}
tail->code = QRcode_encodeInput(list->input);
if(tail->code == NULL) {
goto ABORT;
}
list = list->next;
}
return head;
ABORT:
QRcode_List_free(head);
return NULL;
}
static QRcode_List *QRcode_encodeInputToStructured(QRinput *input)
{
QRinput_Struct *s;
QRcode_List *codes;
s = QRinput_splitQRinputToStruct(input);
if(s == NULL) return NULL;
codes = QRcode_encodeInputStructured(s);
QRinput_Struct_free(s);
return codes;
}
QRcode_List *QRcode_encodeString8bitStructured(const char *string, int version, QRecLevel level)
{
QRinput *input;
QRcode_List *codes;
int ret;
if(version <= 0) {
errno = EINVAL;
return NULL;
}
input = QRinput_new2(version, level);
if(input == NULL) return NULL;
ret = QRinput_append(input, QR_MODE_8, strlen(string), (unsigned char *)string);
if(ret < 0) {
QRinput_free(input);
return NULL;
}
codes = QRcode_encodeInputToStructured(input);
QRinput_free(input);
return codes;
}
QRcode_List *QRcode_encodeStringStructured(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive)
{
QRinput *input;
QRcode_List *codes;
int ret;
if(version <= 0) {
errno = EINVAL;
return NULL;
}
if(hint != QR_MODE_8 && hint != QR_MODE_KANJI) {
errno = EINVAL;
return NULL;
}
input = QRinput_new2(version, level);
if(input == NULL) return NULL;
ret = Split_splitStringToQRinput(string, input, hint, casesensitive);
if(ret < 0) {
QRinput_free(input);
return NULL;
}
codes = QRcode_encodeInputToStructured(input);
QRinput_free(input);
return codes;
}
/**
* qrencode - QR Code encoder
*
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/** \mainpage
* Libqrencode is a library for encoding data in a QR Code symbol, a kind of 2D
* symbology.
*
* \section encoding Encoding
*
* There are two ways to encode data: <b>encoding a string</b> or
* <b>encoding a structured data</b>.
*
* \subsection encoding-string Encoding a string
* You can encode a string by calling QRcode_encodeString().
* The given string is parsed automatically and encoded. If you want to encode
* data that can be represented as a C string style (NUL terminated), you can
* simply use this way.
*
* If the input data contains Kanji (Shift-JIS) characters and you want to
* encode them as Kanji in QR Code, you should give QR_MODE_KANJI as a hint.
* Otherwise, all of non-alphanumeric characters are encoded as 8 bit data.
* If you want to encode a whole string in 8 bit mode, use
* QRcode_encodeString8bit() instead.
*
* Please note that a C string can not contain NUL character. If your data
* contains NUL, you should chose the second way.
*
* \subsection encoding-input Encoding a structured data
* You can construct a structured input data manually. If the structure of the
* input data is known, you can use this way.
* At first, create a ::QRinput object by QRinput_new(). Then add input data
* to the QRinput object by QRinput_append(). Finally call QRcode_encodeInput()
* to encode the QRinput data.
* You can reuse the QRinput data again to encode it in other symbols with
* different parameters.
*
* \section result Result
* The encoded symbol is resulted as a ::QRcode object. It will contain
* its version number, width of the symbol and an array represents the symbol.
* See ::QRcode for the details. You can free the object by QRcode_free().
*
* Please note that the version of the result may be larger than specified.
* In such cases, the input data would be too large to be encoded in a
* symbol of the specified version.
*
* \section structured Structured append
* Libqrencode can generate "Structured-appended" symbols that enables to split
* a large data set into mulitple QR codes. A QR code reader concatenates
* multiple QR code symbols into a string.
* Just like QRcode_encodeString(), you can use QRcode_encodeStringStructured()
* to generate structured-appended symbols. This functions returns an instance
* of ::QRcode_List. The returned list is a singly-linked list of QRcode: you
* can retrieve each QR code in this way:
*
* \code
* QRcode_List *qrcodes;
* QRcode_List *entry;
* QRcode *qrcode;
*
* qrcodes = QRcode_encodeStringStructured(...);
* entry = qrcodes;
* while(entry != NULL) {
* qrcode = entry->code;
* // do something
* entry = entry->next;
* }
* QRcode_List_free(entry);
* \endcode
*
* Instead of using auto-parsing functions, you can construct your own
* structured input. At first, instantiate an object of ::QRinput_Struct
* by calling QRinput_Struct_new(). This object can hold multiple ::QRinput,
* and one QR code is generated for a ::QRinput.
* QRinput_Struct_appendInput() appends a ::QRinput to a ::QRinput_Struct
* object. In order to generate structured-appended symbols, it is required to
* embed headers to each symbol. You can use
* QRinput_Struct_insertStructuredAppendHeaders() to insert appropriate
* headers to each symbol. You should call this function just once before
* encoding symbols.
*/
#ifndef __QRENCODE_H__
#define __QRENCODE_H__
#if defined(__cplusplus)
extern "C" {
#endif
/**
* Encoding mode.
*/
typedef enum {
QR_MODE_NUL = -1, ///< Terminator (NUL character). Internal use only
QR_MODE_NUM = 0, ///< Numeric mode
QR_MODE_AN, ///< Alphabet-numeric mode
QR_MODE_8, ///< 8-bit data mode
QR_MODE_KANJI, ///< Kanji (shift-jis) mode
QR_MODE_STRUCTURE, ///< Internal use only
} QRencodeMode;
/**
* Level of error correction.
*/
typedef enum {
QR_ECLEVEL_L = 0, ///< lowest
QR_ECLEVEL_M,
QR_ECLEVEL_Q,
QR_ECLEVEL_H ///< highest
} QRecLevel;
/******************************************************************************
* Input data (qrinput.c)
*****************************************************************************/
/**
* Singly linked list to contain input strings. An instance of this class
* contains its version and error correction level too. It is required to
* set them by QRinput_setVersion() and QRinput_setErrorCorrectionLevel(),
* or use QRinput_new2() to instantiate an object.
*/
typedef struct _QRinput QRinput;
/**
* Instantiate an input data object. The version is set to 0 (auto-select)
* and the error correction level is set to QR_ECLEVEL_L.
* @return an input object (initialized). On error, NULL is returned and errno
* is set to indicate the error.
* @throw ENOMEM unable to allocate memory.
*/
extern QRinput *QRinput_new(void);
/**
* Instantiate an input data object.
* @param version version number.
* @param level Error correction level.
* @return an input object (initialized). On error, NULL is returned and errno
* is set to indicate the error.
* @throw ENOMEM unable to allocate memory for input objects.
* @throw EINVAL invalid arguments.
*/
extern QRinput *QRinput_new2(int version, QRecLevel level);
/**
* Append data to an input object.
* The data is copied and appended to the input object.
* @param input input object.
* @param mode encoding mode.
* @param size size of data (byte).
* @param data a pointer to the memory area of the input data.
* @retval 0 success.
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
* @throw EINVAL input data is invalid.
*
*/
extern int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data);
/**
* Get current version.
* @param input input object.
* @return current version.
*/
extern int QRinput_getVersion(QRinput *input);
/**
* Set version of the QR-code that is to be encoded.
* @param input input object.
* @param version version number (0 = auto)
* @retval 0 success.
* @retval -1 invalid argument.
*/
extern int QRinput_setVersion(QRinput *input, int version);
/**
* Get current error correction level.
* @param input input object.
* @return Current error correcntion level.
*/
extern QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input);
/**
* Set error correction level of the QR-code that is to be encoded.
* @param input input object.
* @param level Error correction level.
* @retval 0 success.
* @retval -1 invalid argument.
*/
extern int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level);
/**
* Free the input object.
* All of data chunks in the input object are freed too.
* @param input input object.
*/
extern void QRinput_free(QRinput *input);
/**
* Validate the input data.
* @param mode encoding mode.
* @param size size of data (byte).
* @param data a pointer to the memory area of the input data.
* @retval 0 success.
* @retval -1 invalid arguments.
*/
extern int QRinput_check(QRencodeMode mode, int size, const unsigned char *data);
/**
* Set of QRinput for structured symbols.
*/
typedef struct _QRinput_Struct QRinput_Struct;
/**
* Instantiate a set of input data object.
* @return an instance of QRinput_Struct. On error, NULL is returned and errno
* is set to indicate the error.
* @throw ENOMEM unable to allocate memory.
*/
extern QRinput_Struct *QRinput_Struct_new(void);
/**
* Set parity of structured symbols.
* @param s structured input object.
* @param parity parity of s.
*/
extern void QRinput_Struct_setParity(QRinput_Struct *s, unsigned char parity);
/**
* Append a QRinput object to the set.
* @warning never append the same QRinput object twice or more.
* @param s structured input object.
* @param input an input object.
* @retval >0 number of input objects in the structure.
* @retval -1 an error occurred. See Exceptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
extern int QRinput_Struct_appendInput(QRinput_Struct *s, QRinput *input);
/**
* Free all of QRinput in the set.
* @param s a structured input object.
*/
extern void QRinput_Struct_free(QRinput_Struct *s);
/**
* Split a QRinput to QRinput_Struct. It calculates a parity, set it, then
* insert structured-append headers.
* @param input input object. Version number and error correction level must be
* set.
* @return a set of input data. On error, NULL is returned, and errno is set
* to indicate the error. See Exceptions for the details.
* @throw ERANGE input data is too large.
* @throw EINVAL invalid input data.
* @throw ENOMEM unable to allocate memory.
*/
extern QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input);
/**
* Insert structured-append headers to the input structure. It calculates
* a parity and set it if the parity is not set yet.
* @param s input structure
* @retval 0 success.
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw EINVAL invalid input object.
* @throw ENOMEM unable to allocate memory.
*/
extern int QRinput_Struct_insertStructuredAppendHeaders(QRinput_Struct *s);
/******************************************************************************
* QRcode output (qrencode.c)
*****************************************************************************/
/**
* QRcode class.
* Symbol data is represented as an array contains width*width uchars.
* Each uchar represents a module (dot). If the less significant bit of
* the uchar is 1, the corresponding module is black. The other bits are
* meaningless for usual applications, but here its specification is described.
*
* <pre>
* MSB 76543210 LSB
* |||||||`- 1=black/0=white
* ||||||`-- data and ecc code area
* |||||`--- format information
* ||||`---- version information
* |||`----- timing pattern
* ||`------ alignment pattern
* |`------- finder pattern and separator
* `-------- non-data modules (format, timing, etc.)
* </pre>
*/
typedef struct {
int version; ///< version of the symbol
int width; ///< width of the symbol
unsigned char *data; ///< symbol data
} QRcode;
/**
* Singly-linked list of QRcode. Used to represent a structured symbols.
* A list is terminated with NULL.
*/
typedef struct _QRcode_List QRcode_List;
struct _QRcode_List {
QRcode *code;
QRcode_List *next;
};
/**
* Create a symbol from the input data.
* @warning This function is THREAD UNSAFE.
* @param input input data.
* @return an instance of QRcode class. The version of the result QRcode may
* be larger than the designated version. On error, NULL is returned,
* and errno is set to indicate the error. See Exceptions for the
* details.
* @throw EINVAL invalid input object.
* @throw ENOMEM unable to allocate memory for input objects.
*/
extern QRcode *QRcode_encodeInput(QRinput *input);
/**
* Create a symbol from the string. The library automatically parses the input
* string and encodes in a QR Code symbol.
* @warning This function is THREAD UNSAFE.
* @param string input string. It must be NULL terminated.
* @param version version of the symbol. If 0, the library chooses the minimum
* version for the given input data.
* @param level error correction level.
* @param hint tell the library how non-alphanumerical characters should be
* encoded. If QR_MODE_KANJI is given, kanji characters will be
* encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
* non-alphanumerical characters will be encoded as is. If you want
* to embed UTF-8 string, choose this.
* @param casesensitive case-sensitive(1) or not(0).
* @return an instance of QRcode class. The version of the result QRcode may
* be larger than the designated version. On error, NULL is returned,
* and errno is set to indicate the error. See Exceptions for the
* details.
* @throw EINVAL invalid input object.
* @throw ENOMEM unable to allocate memory for input objects.
*/
extern QRcode *QRcode_encodeString(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);
/**
* Same to QRcode_encodeString(), but encode whole data in 8-bit mode.
* @warning This function is THREAD UNSAFE.
*/
extern QRcode *QRcode_encodeString8bit(const char *string, int version, QRecLevel level);
/**
* Free the instance of QRcode class.
* @param qrcode an instance of QRcode class.
*/
extern void QRcode_free(QRcode *qrcode);
/**
* Create structured symbols from the input data.
* @warning This function is THREAD UNSAFE.
* @param s
* @return a singly-linked list of QRcode.
*/
extern QRcode_List *QRcode_encodeInputStructured(QRinput_Struct *s);
/**
* Create structured symbols from the string. The library automatically parses
* the input string and encodes in a QR Code symbol.
* @warning This function is THREAD UNSAFE.
* @param string input string. It should be NULL terminated.
* @param version version of the symbol.
* @param level error correction level.
* @param hint tell the library how non-alphanumerical characters should be
* encoded. If QR_MODE_KANJI is given, kanji characters will be
* encoded as Shif-JIS characters. If QR_MODE_8 is given, all of
* non-alphanumerical characters will be encoded as is. If you want
* to embed UTF-8 string, choose this.
* @param casesensitive case-sensitive(1) or not(0).
* @return a singly-linked list of QRcode. On error, NULL is returned, and
* errno is set to indicate the error. See Exceptions for the details.
* @throw EINVAL invalid input object.
* @throw ENOMEM unable to allocate memory for input objects.
*/
extern QRcode_List *QRcode_encodeStringStructured(const char *string, int version, QRecLevel level, QRencodeMode hint, int casesensitive);
/**
* Same to QRcode_encodeStringStructured(), but encode whole data in 8-bit mode.
* @warning This function is THREAD UNSAFE.
*/
extern QRcode_List *QRcode_encodeString8bitStructured(const char *string, int version, QRecLevel level);
/**
* Return the number of symbols included in a QRcode_List.
* @param qrlist a head entry of a QRcode_List.
* @return number of symbols in the list.
*/
extern int QRcode_List_size(QRcode_List *qrlist);
/**
* Free the QRcode_List.
* @param qrlist a head entry of a QRcode_List.
*/
extern void QRcode_List_free(QRcode_List *qrlist);
#if defined(__cplusplus)
}
#endif
#endif /* __QRENCODE_H__ */
/*
* qrencode - QR Code encoder
*
* Input data chunk class
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
//#include "config.h"
#include "qrencode.h"
#include "qrspec.h"
#include "bitstream.h"
#include "qrinput.h"
/******************************************************************************
* Entry of input data
*****************************************************************************/
static QRinput_List *QRinput_List_newEntry(QRencodeMode mode, int size, const unsigned char *data)
{
QRinput_List *entry;
if(QRinput_check(mode, size, data)) {
errno = EINVAL;
return NULL;
}
entry = (QRinput_List *)malloc(sizeof(QRinput_List));
if(entry == NULL) return NULL;
entry->mode = mode;
entry->size = size;
entry->data = (unsigned char *)malloc(size);
if(entry->data == NULL) {
free(entry);
return NULL;
}
memcpy(entry->data, data, size);
entry->bstream = NULL;
entry->next = NULL;
return entry;
}
static void QRinput_List_freeEntry(QRinput_List *entry)
{
if(entry != NULL) {
free(entry->data);
BitStream_free(entry->bstream);
free(entry);
}
}
static QRinput_List *QRinput_List_dup(QRinput_List *entry)
{
QRinput_List *n;
n = (QRinput_List *)malloc(sizeof(QRinput_List));
if(n == NULL) return NULL;
n->mode = entry->mode;
n->size = entry->size;
n->data = (unsigned char *)malloc(n->size);
if(n->data == NULL) {
free(n);
return NULL;
}
memcpy(n->data, entry->data, entry->size);
n->bstream = NULL;
n->next = NULL;
return n;
}
/******************************************************************************
* Input Data
*****************************************************************************/
QRinput *QRinput_new(void)
{
return QRinput_new2(0, QR_ECLEVEL_L);
}
QRinput *QRinput_new2(int version, QRecLevel level)
{
QRinput *input;
if(version < 0 || version > QRSPEC_VERSION_MAX || level > QR_ECLEVEL_H) {
errno = EINVAL;
return NULL;
}
input = (QRinput *)malloc(sizeof(QRinput));
if(input == NULL) return NULL;
input->head = NULL;
input->tail = NULL;
input->version = version;
input->level = level;
return input;
}
int QRinput_getVersion(QRinput *input)
{
return input->version;
}
int QRinput_setVersion(QRinput *input, int version)
{
if(version < 0 || version > QRSPEC_VERSION_MAX) {
errno = EINVAL;
return -1;
}
input->version = version;
return 0;
}
QRecLevel QRinput_getErrorCorrectionLevel(QRinput *input)
{
return input->level;
}
int QRinput_setErrorCorrectionLevel(QRinput *input, QRecLevel level)
{
if(level > QR_ECLEVEL_H) {
errno = EINVAL;
return -1;
}
input->level = level;
return 0;
}
static void QRinput_appendEntry(QRinput *input, QRinput_List *entry)
{
if(input->tail == NULL) {
input->head = entry;
input->tail = entry;
} else {
input->tail->next = entry;
input->tail = entry;
}
entry->next = NULL;
}
int QRinput_append(QRinput *input, QRencodeMode mode, int size, const unsigned char *data)
{
QRinput_List *entry;
entry = QRinput_List_newEntry(mode, size, data);
if(entry == NULL) {
return -1;
}
QRinput_appendEntry(input, entry);
return 0;
}
/**
* Insert a structured-append header to the head of the input data.
* @param input input data.
* @param size number of structured symbols.
* @param index index number of the symbol. (1 <= index <= size)
* @param parity parity among input data. (NOTE: each symbol of a set of structured symbols has the same parity data)
* @retval 0 success.
* @retval -1 error occurred and errno is set to indeicate the error. See Execptions for the details.
* @throw EINVAL invalid parameter.
* @throw ENOMEM unable to allocate memory.
*/
//__STATIC
static int QRinput_insertStructuredAppendHeader(QRinput *input, int size, int index, unsigned char parity)
{
QRinput_List *entry;
unsigned char buf[3];
if(size > MAX_STRUCTURED_SYMBOLS) {
errno = EINVAL;
return -1;
}
if(index <= 0 || index > MAX_STRUCTURED_SYMBOLS) {
errno = EINVAL;
return -1;
}
buf[0] = (unsigned char)size;
buf[1] = (unsigned char)index;
buf[2] = parity;
entry = QRinput_List_newEntry(QR_MODE_STRUCTURE, 3, buf);
if(entry == NULL) {
return -1;
}
entry->next = input->head;
input->head = entry;
return 0;
}
void QRinput_free(QRinput *input)
{
QRinput_List *list, *next;
if(input != NULL) {
list = input->head;
while(list != NULL) {
next = list->next;
QRinput_List_freeEntry(list);
list = next;
}
free(input);
}
}
static unsigned char QRinput_calcParity(QRinput *input)
{
unsigned char parity = 0;
QRinput_List *list;
int i;
list = input->head;
while(list != NULL) {
if(list->mode != QR_MODE_STRUCTURE) {
for(i=list->size-1; i>=0; i--) {
parity ^= list->data[i];
}
}
list = list->next;
}
return parity;
}
QRinput *QRinput_dup(QRinput *input)
{
QRinput *n;
QRinput_List *list, *e;
n = QRinput_new2(input->version, input->level);
if(n == NULL) return NULL;
list = input->head;
while(list != NULL) {
e = QRinput_List_dup(list);
if(e == NULL) {
QRinput_free(n);
return NULL;
}
QRinput_appendEntry(n, e);
list = list->next;
}
return n;
}
/******************************************************************************
* Numeric data
*****************************************************************************/
/**
* Check the input data.
* @param size
* @param data
* @return result
*/
static int QRinput_checkModeNum(int size, const char *data)
{
int i;
for(i=0; i<size; i++) {
if(data[i] < '0' || data[i] > '9')
return -1;
}
return 0;
}
/**
* Estimates the length of the encoded bit stream of numeric data.
* @param size
* @return number of bits
*/
int QRinput_estimateBitsModeNum(int size)
{
int w;
int bits;
w = size / 3;
bits = w * 10;
switch(size - w * 3) {
case 1:
bits += 4;
break;
case 2:
bits += 7;
break;
default:
break;
}
return bits;
}
/**
* Convert the number data to a bit stream.
* @param entry
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_encodeModeNum(QRinput_List *entry, int version)
{
int words, i, ret;
unsigned int val;
words = entry->size / 3;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
val = 0x1;
ret = BitStream_appendNum(entry->bstream, 4, val);
if(ret < 0) goto ABORT;
val = entry->size;
ret = BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_NUM, version), val);
if(ret < 0) goto ABORT;
for(i=0; i<words; i++) {
val = (entry->data[i*3 ] - '0') * 100;
val += (entry->data[i*3+1] - '0') * 10;
val += (entry->data[i*3+2] - '0');
ret = BitStream_appendNum(entry->bstream, 10, val);
if(ret < 0) goto ABORT;
}
if(entry->size - words * 3 == 1) {
val = entry->data[words*3] - '0';
ret = BitStream_appendNum(entry->bstream, 4, val);
if(ret < 0) goto ABORT;
} else if(entry->size - words * 3 == 2) {
val = (entry->data[words*3 ] - '0') * 10;
val += (entry->data[words*3+1] - '0');
BitStream_appendNum(entry->bstream, 7, val);
if(ret < 0) goto ABORT;
}
return 0;
ABORT:
BitStream_free(entry->bstream);
entry->bstream = NULL;
return -1;
}
/******************************************************************************
* Alphabet-numeric data
*****************************************************************************/
const signed char QRinput_anTable[128] = {
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1,
-1, 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, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1
};
/**
* Check the input data.
* @param size
* @param data
* @return result
*/
static int QRinput_checkModeAn(int size, const char *data)
{
int i;
for(i=0; i<size; i++) {
if(QRinput_lookAnTable(data[i]) < 0)
return -1;
}
return 0;
}
/**
* Estimates the length of the encoded bit stream of alphabet-numeric data.
* @param size
* @return number of bits
*/
int QRinput_estimateBitsModeAn(int size)
{
int w;
int bits;
w = size / 2;
bits = w * 11;
if(size & 1) {
bits += 6;
}
return bits;
}
/**
* Convert the alphabet-numeric data to a bit stream.
* @param entry
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_encodeModeAn(QRinput_List *entry, int version)
{
int words, i, ret;
unsigned int val;
words = entry->size / 2;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
val = 0x2;
ret = BitStream_appendNum(entry->bstream, 4, val);
if(ret < 0) goto ABORT;
val = entry->size;
ret = BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_AN, version), val);
if(ret < 0) goto ABORT;
for(i=0; i<words; i++) {
val = (unsigned int)QRinput_lookAnTable(entry->data[i*2 ]) * 45;
val += (unsigned int)QRinput_lookAnTable(entry->data[i*2+1]);
ret = BitStream_appendNum(entry->bstream, 11, val);
if(ret < 0) goto ABORT;
}
if(entry->size & 1) {
val = (unsigned int)QRinput_lookAnTable(entry->data[words * 2]);
ret = BitStream_appendNum(entry->bstream, 6, val);
if(ret < 0) goto ABORT;
}
return 0;
ABORT:
BitStream_free(entry->bstream);
entry->bstream = NULL;
return -1;
}
/******************************************************************************
* 8 bit data
*****************************************************************************/
/**
* Estimates the length of the encoded bit stream of 8 bit data.
* @param size
* @return number of bits
*/
int QRinput_estimateBitsMode8(int size)
{
return size * 8;
}
/**
* Convert the 8bits data to a bit stream.
* @param entry
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_encodeMode8(QRinput_List *entry, int version)
{
int ret, i;
unsigned int val;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
val = 0x4;
ret = BitStream_appendNum(entry->bstream, 4, val);
if(ret < 0) goto ABORT;
val = entry->size;
ret = BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_8, version), val);
if(ret < 0) goto ABORT;
for(i=0; i<entry->size; i++) {
ret = BitStream_appendNum(entry->bstream, 8, entry->data[i]);
if(ret < 0) goto ABORT;
}
return 0;
ABORT:
BitStream_free(entry->bstream);
entry->bstream = NULL;
return -1;
}
/******************************************************************************
* Kanji data
*****************************************************************************/
/**
* Estimates the length of the encoded bit stream of kanji data.
* @param size
* @return number of bits
*/
int QRinput_estimateBitsModeKanji(int size)
{
return (size / 2) * 13;
}
/**
* Check the input data.
* @param size
* @param data
* @return result
*/
static int QRinput_checkModeKanji(int size, const unsigned char *data)
{
int i;
unsigned int val;
if(size & 1)
return -1;
for(i=0; i<size; i+=2) {
val = ((unsigned int)data[i] << 8) | data[i+1];
if(val < 0x8140 || (val > 0x9ffc && val < 0xe040) || val > 0xebbf) {
return -1;
}
}
return 0;
}
/**
* Convert the kanji data to a bit stream.
* @param entry
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_encodeModeKanji(QRinput_List *entry, int version)
{
int ret, i;
unsigned int val, h;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
val = 0x8;
ret = BitStream_appendNum(entry->bstream, 4, val);
if(ret < 0) goto ABORT;
val = entry->size / 2;
ret = BitStream_appendNum(entry->bstream, QRspec_lengthIndicator(QR_MODE_KANJI, version), val);
if(ret < 0) goto ABORT;
for(i=0; i<entry->size; i+=2) {
val = ((unsigned int)entry->data[i] << 8) | entry->data[i+1];
if(val <= 0x9ffc) {
val -= 0x8140;
} else {
val -= 0xc140;
}
h = (val >> 8) * 0xc0;
val = (val & 0xff) + h;
ret = BitStream_appendNum(entry->bstream, 13, val);
if(ret < 0) goto ABORT;
}
return 0;
ABORT:
BitStream_free(entry->bstream);
entry->bstream = NULL;
return -1;
}
/******************************************************************************
* Structured Symbol
*****************************************************************************/
/**
* Convert a structure symbol code to a bit stream.
* @param entry
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_encodeModeStructure(QRinput_List *entry)
{
int ret;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) return -1;
ret = BitStream_appendNum(entry->bstream, 4, 0x03);
if(ret < 0) goto ABORT;
ret = BitStream_appendNum(entry->bstream, 4, entry->data[1] - 1);
if(ret < 0) goto ABORT;
ret = BitStream_appendNum(entry->bstream, 4, entry->data[0] - 1);
if(ret < 0) goto ABORT;
ret = BitStream_appendNum(entry->bstream, 8, entry->data[2]);
if(ret < 0) goto ABORT;
return 0;
ABORT:
BitStream_free(entry->bstream);
entry->bstream = NULL;
return -1;
}
/******************************************************************************
* Validation
*****************************************************************************/
int QRinput_check(QRencodeMode mode, int size, const unsigned char *data)
{
if(size <= 0) return -1;
switch(mode) {
case QR_MODE_NUM:
return QRinput_checkModeNum(size, (const char *)data);
break;
case QR_MODE_AN:
return QRinput_checkModeAn(size, (const char *)data);
break;
case QR_MODE_KANJI:
return QRinput_checkModeKanji(size, data);
break;
case QR_MODE_8:
return 0;
break;
case QR_MODE_STRUCTURE:
return 0;
break;
default:
break;
}
return -1;
}
/******************************************************************************
* Estimation of the bit length
*****************************************************************************/
/**
* Estimates the length of the encoded bit stream on the current version.
* @param entry
* @param version version of the symbol
* @return number of bits
*/
static int QRinput_estimateBitStreamSizeOfEntry(QRinput_List *entry, int version)
{
int bits = 0;
int l, m;
int num;
if(version == 0) version = 1;
switch(entry->mode) {
case QR_MODE_NUM:
bits = QRinput_estimateBitsModeNum(entry->size);
break;
case QR_MODE_AN:
bits = QRinput_estimateBitsModeAn(entry->size);
break;
case QR_MODE_8:
bits = QRinput_estimateBitsMode8(entry->size);
break;
case QR_MODE_KANJI:
bits = QRinput_estimateBitsModeKanji(entry->size);
break;
case QR_MODE_STRUCTURE:
return STRUCTURE_HEADER_BITS;
default:
return 0;
}
l = QRspec_lengthIndicator(entry->mode, version);
m = 1 << l;
num = (entry->size + m - 1) / m;
bits += num * (4 + l); // mode indicator (4bits) + length indicator
return bits;
}
/**
* Estimates the length of the encoded bit stream of the data.
* @param input input data
* @param version version of the symbol
* @return number of bits
*/
//__STATIC
static int QRinput_estimateBitStreamSize(QRinput *input, int version)
{
QRinput_List *list;
int bits = 0;
list = input->head;
while(list != NULL) {
bits += QRinput_estimateBitStreamSizeOfEntry(list, version);
list = list->next;
}
return bits;
}
/**
* Estimates the required version number of the symbol.
* @param input input data
* @return required version number
*/
static int QRinput_estimateVersion(QRinput *input)
{
int bits;
int version, prev;
version = 0;
do {
prev = version;
bits = QRinput_estimateBitStreamSize(input, prev);
version = QRspec_getMinimumVersion((bits + 7) / 8, input->level);
if (version < 0) {
return -1;
}
} while (version > prev);
return version;
}
/**
* Returns required length in bytes for specified mode, version and bits.
* @param mode
* @param version
* @param bits
* @return required length of code words in bytes.
*/
//__STATIC
static int QRinput_lengthOfCode(QRencodeMode mode, int version, int bits)
{
int payload, size, chunks, remain, maxsize;
payload = bits - 4 - QRspec_lengthIndicator(mode, version);
switch(mode) {
case QR_MODE_NUM:
chunks = payload / 10;
remain = payload - chunks * 10;
size = chunks * 3;
if(remain >= 7) {
size += 2;
} else if(remain >= 4) {
size += 1;
}
break;
case QR_MODE_AN:
chunks = payload / 11;
remain = payload - chunks * 11;
size = chunks * 2;
if(remain >= 6) size++;
break;
case QR_MODE_8:
size = payload / 8;
break;
case QR_MODE_KANJI:
size = (payload / 13) * 2;
break;
case QR_MODE_STRUCTURE:
size = payload / 8;
break;
default:
size = 0;
break;
}
maxsize = QRspec_maximumWords(mode, version);
if(size < 0) size = 0;
if(size > maxsize) size = maxsize;
return size;
}
/******************************************************************************
* Data conversion
*****************************************************************************/
/**
* Convert the input data in the data chunk to a bit stream.
* @param entry
* @return number of bits (>0) or -1 for failure.
*/
static int QRinput_encodeBitStream(QRinput_List *entry, int version)
{
int words, ret;
QRinput_List *st1 = NULL, *st2 = NULL;
if(entry->bstream != NULL) {
BitStream_free(entry->bstream);
entry->bstream = NULL;
}
words = QRspec_maximumWords(entry->mode, version);
if(entry->size > words) {
st1 = QRinput_List_newEntry(entry->mode, words, entry->data);
if(st1 == NULL) goto ABORT;
st2 = QRinput_List_newEntry(entry->mode, entry->size - words, &entry->data[words]);
if(st2 == NULL) goto ABORT;
ret = QRinput_encodeBitStream(st1, version);
if(ret < 0) goto ABORT;
ret = QRinput_encodeBitStream(st2, version);
if(ret < 0) goto ABORT;
entry->bstream = BitStream_new();
if(entry->bstream == NULL) goto ABORT;
ret = BitStream_append(entry->bstream, st1->bstream);
if(ret < 0) goto ABORT;
ret = BitStream_append(entry->bstream, st2->bstream);
if(ret < 0) goto ABORT;
QRinput_List_freeEntry(st1);
QRinput_List_freeEntry(st2);
} else {
ret = 0;
switch(entry->mode) {
case QR_MODE_NUM:
ret = QRinput_encodeModeNum(entry, version);
break;
case QR_MODE_AN:
ret = QRinput_encodeModeAn(entry, version);
break;
case QR_MODE_8:
ret = QRinput_encodeMode8(entry, version);
break;
case QR_MODE_KANJI:
ret = QRinput_encodeModeKanji(entry, version);
break;
case QR_MODE_STRUCTURE:
ret = QRinput_encodeModeStructure(entry);
break;
default:
break;
}
if(ret < 0) return -1;
}
return BitStream_size(entry->bstream);
ABORT:
QRinput_List_freeEntry(st1);
QRinput_List_freeEntry(st2);
return -1;
}
/**
* Convert the input data to a bit stream.
* @param input input data.
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_createBitStream(QRinput *input)
{
QRinput_List *list;
int bits, total = 0;
list = input->head;
while(list != NULL) {
bits = QRinput_encodeBitStream(list, input->version);
if(bits < 0) return -1;
total += bits;
list = list->next;
}
return total;
}
/**
* Convert the input data to a bit stream.
* When the version number is given and that is not sufficient, it is increased
* automatically.
* @param input input data.
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
* @throw EINVAL input is too large.
*/
static int QRinput_convertData(QRinput *input)
{
int bits;
int ver;
ver = QRinput_estimateVersion(input);
if(ver > QRinput_getVersion(input)) {
QRinput_setVersion(input, ver);
}
for(;;) {
bits = QRinput_createBitStream(input);
if(bits < 0) return -1;
ver = QRspec_getMinimumVersion((bits + 7) / 8, input->level);
if(ver < 0) {
errno = EINVAL;
return -1;
} else if(ver > QRinput_getVersion(input)) {
QRinput_setVersion(input, ver);
} else {
break;
}
}
return 0;
}
/**
* Append padding bits for the input data.
* @param bstream Bitstream to be appended.
* @param input input data.
* @retval 0 success
* @retval -1 an error occurred and errno is set to indeicate the error.
* See Execptions for the details.
* @throw ENOMEM unable to allocate memory.
*/
static int QRinput_appendPaddingBit(BitStream *bstream, QRinput *input)
{
int bits, maxbits, words, maxwords, i, ret;
BitStream *padding = NULL;
unsigned char *padbuf;
int padlen;
bits = BitStream_size(bstream);
maxwords = QRspec_getDataLength(input->version, input->level);
maxbits = maxwords * 8;
if(maxbits == bits) {
return 0;
}
if(maxbits - bits < 5) {
ret = BitStream_appendNum(bstream, maxbits - bits, 0);
goto DONE;
}
bits += 4;
words = (bits + 7) / 8;
padding = BitStream_new();
if(padding == NULL) return -1;
ret = BitStream_appendNum(padding, words * 8 - bits + 4, 0);
if(ret < 0) goto DONE;
padlen = maxwords - words;
if(padlen > 0) {
padbuf = (unsigned char *)malloc(padlen);
if(padbuf == NULL) {
ret = -1;
goto DONE;
}
for(i=0; i<padlen; i++) {
padbuf[i] = (i&1)?0x11:0xec;
}
ret = BitStream_appendBytes(padding, padlen, padbuf);
free(padbuf);
if(ret < 0) {
goto DONE;
}
}
ret = BitStream_append(bstream, padding);
DONE:
BitStream_free(padding);
return ret;
}
/**
* Merge all bit streams in the input data.
* @param input input data.
* @return merged bit stream
*/
//__STATIC
static BitStream *QRinput_mergeBitStream(QRinput *input)
{
BitStream *bstream;
QRinput_List *list;
int ret;
if(QRinput_convertData(input) < 0) {
return NULL;
}
bstream = BitStream_new();
if(bstream == NULL) return NULL;
list = input->head;
while(list != NULL) {
ret = BitStream_append(bstream, list->bstream);
if(ret < 0) {
BitStream_free(bstream);
return NULL;
}
list = list->next;
}
return bstream;
}
/**
* Merge all bit streams in the input data and append padding bits
* @param input input data.
* @return padded merged bit stream
*/
//__STATIC
static BitStream *QRinput_getBitStream(QRinput *input)
{
BitStream *bstream;
int ret;
bstream = QRinput_mergeBitStream(input);
if(bstream == NULL) {
return NULL;
}
ret = QRinput_appendPaddingBit(bstream, input);
if(ret < 0) {
BitStream_free(bstream);
return NULL;
}
return bstream;
}
/**
* Pack all bit streams padding bits into a byte array.
* @param input input data.
* @return padded merged byte stream
*/
unsigned char *QRinput_getByteStream(QRinput *input)
{
BitStream *bstream;
unsigned char *array;
bstream = QRinput_getBitStream(input);
if(bstream == NULL) {
return NULL;
}
array = BitStream_toByte(bstream);
BitStream_free(bstream);
return array;
}
/******************************************************************************
* Structured input data
*****************************************************************************/
static QRinput_InputList *QRinput_InputList_newEntry(QRinput *input)
{
QRinput_InputList *entry;
entry = (QRinput_InputList *)malloc(sizeof(QRinput_InputList));
if(entry == NULL) return NULL;
entry->input = input;
entry->next = NULL;
return entry;
}
static void QRinput_InputList_freeEntry(QRinput_InputList *entry)
{
if(entry != NULL) {
QRinput_free(entry->input);
free(entry);
}
}
QRinput_Struct *QRinput_Struct_new(void)
{
QRinput_Struct *s;
s = (QRinput_Struct *)malloc(sizeof(QRinput_Struct));
if(s == NULL) return NULL;
s->size = 0;
s->parity = -1;
s->head = NULL;
s->tail = NULL;
return s;
}
void QRinput_Struct_setParity(QRinput_Struct *s, unsigned char parity)
{
s->parity = (int)parity;
}
int QRinput_Struct_appendInput(QRinput_Struct *s, QRinput *input)
{
QRinput_InputList *e;
e = QRinput_InputList_newEntry(input);
if(e == NULL) return -1;
s->size++;
if(s->tail == NULL) {
s->head = e;
s->tail = e;
} else {
s->tail->next = e;
s->tail = e;
}
return s->size;
}
void QRinput_Struct_free(QRinput_Struct *s)
{
QRinput_InputList *list, *next;
if(s != NULL) {
list = s->head;
while(list != NULL) {
next = list->next;
QRinput_InputList_freeEntry(list);
list = next;
}
free(s);
}
}
static unsigned char QRinput_Struct_calcParity(QRinput_Struct *s)
{
QRinput_InputList *list;
unsigned char parity = 0;
list = s->head;
while(list != NULL) {
parity ^= QRinput_calcParity(list->input);
list = list->next;
}
QRinput_Struct_setParity(s, parity);
return parity;
}
static int QRinput_List_shrinkEntry(QRinput_List *entry, int bytes)
{
unsigned char *data;
data = (unsigned char *)malloc(bytes);
if(data == NULL) return -1;
memcpy(data, entry->data, bytes);
free(entry->data);
entry->data = data;
entry->size = bytes;
return 0;
}
//__STATIC
static int QRinput_splitEntry(QRinput_List *entry, int bytes)
{
QRinput_List *e;
int ret;
e = QRinput_List_newEntry(entry->mode, entry->size - bytes, entry->data + bytes);
if(e == NULL) {
return -1;
}
ret = QRinput_List_shrinkEntry(entry, bytes);
if(ret < 0) {
QRinput_List_freeEntry(e);
return -1;
}
e->next = entry->next;
entry->next = e;
return 0;
}
QRinput_Struct *QRinput_splitQRinputToStruct(QRinput *input)
{
QRinput *p;
QRinput_Struct *s;
int bits, maxbits, nextbits, bytes, ret;
QRinput_List *list, *next, *prev;
s = QRinput_Struct_new();
if(s == NULL) return NULL;
input = QRinput_dup(input);
if(input == NULL) {
QRinput_Struct_free(s);
return NULL;
}
QRinput_Struct_setParity(s, QRinput_calcParity(input));
maxbits = QRspec_getDataLength(input->version, input->level) * 8 - STRUCTURE_HEADER_BITS;
if(maxbits <= 0) {
QRinput_Struct_free(s);
QRinput_free(input);
return NULL;
}
bits = 0;
list = input->head;
prev = NULL;
while(list != NULL) {
nextbits = QRinput_estimateBitStreamSizeOfEntry(list, input->version);
if(bits + nextbits <= maxbits) {
ret = QRinput_encodeBitStream(list, input->version);
if(ret < 0) goto ABORT;
bits += ret;
prev = list;
list = list->next;
} else {
bytes = QRinput_lengthOfCode(list->mode, input->version, maxbits - bits);
if(bytes > 0) {
/* Splits this entry into 2 entries. */
ret = QRinput_splitEntry(list, bytes);
if(ret < 0) goto ABORT;
/* First half is the tail of the current input. */
next = list->next;
list->next = NULL;
/* Second half is the head of the next input, p.*/
p = QRinput_new2(input->version, input->level);
if(p == NULL) goto ABORT;
p->head = next;
/* Renew QRinput.tail. */
p->tail = input->tail;
input->tail = list;
/* Point to the next entry. */
prev = list;
list = next;
} else {
/* Current entry will go to the next input. */
prev->next = NULL;
p = QRinput_new2(input->version, input->level);
if(p == NULL) goto ABORT;
p->head = list;
p->tail = input->tail;
input->tail = prev;
}
ret = QRinput_Struct_appendInput(s, input);
if(ret < 0) goto ABORT;
input = p;
bits = 0;
}
}
QRinput_Struct_appendInput(s, input);
if(s->size > MAX_STRUCTURED_SYMBOLS) {
QRinput_Struct_free(s);
errno = ERANGE;
return NULL;
}
ret = QRinput_Struct_insertStructuredAppendHeaders(s);
if(ret < 0) {
QRinput_Struct_free(s);
return NULL;
}
return s;
ABORT:
QRinput_free(input);
QRinput_Struct_free(s);
return NULL;
}
int QRinput_Struct_insertStructuredAppendHeaders(QRinput_Struct *s)
{
int num, i;
QRinput_InputList *list;
if(s->parity < 0) {
QRinput_Struct_calcParity(s);
}
num = 0;
list = s->head;
while(list != NULL) {
num++;
list = list->next;
}
i = 1;
list = s->head;
while(list != NULL) {
if(QRinput_insertStructuredAppendHeader(list->input, num, i, s->parity))
return -1;
i++;
list = list->next;
}
return 0;
}
/*
* qrencode - QR Code encoder
*
* Input data chunk class
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __QRINPUT_H__
#define __QRINPUT_H__
#include "qrencode.h"
#include "bitstream.h"
/******************************************************************************
* Entry of input data
*****************************************************************************/
typedef struct _QRinput_List QRinput_List;
struct _QRinput_List {
QRencodeMode mode;
int size; ///< Size of data chunk (byte).
unsigned char *data; ///< Data chunk.
BitStream *bstream;
QRinput_List *next;
};
/******************************************************************************
* Input Data
*****************************************************************************/
struct _QRinput {
int version;
QRecLevel level;
QRinput_List *head;
QRinput_List *tail;
};
/******************************************************************************
* Structured append input data
*****************************************************************************/
typedef struct _QRinput_InputList QRinput_InputList;
struct _QRinput_InputList {
QRinput *input;
QRinput_InputList *next;
};
struct _QRinput_Struct {
int size; ///< number of structured symbols
int parity;
QRinput_InputList *head;
QRinput_InputList *tail;
};
/**
* Pack all bit streams padding bits into a byte array.
* @param input input data.
* @return padded merged byte stream
*/
extern unsigned char *QRinput_getByteStream(QRinput *input);
extern int QRinput_estimateBitsModeNum(int size);
extern int QRinput_estimateBitsModeAn(int size);
extern int QRinput_estimateBitsMode8(int size);
extern int QRinput_estimateBitsModeKanji(int size);
extern QRinput *QRinput_dup(QRinput *input);
extern const signed char QRinput_anTable[128];
/**
* Look up the alphabet-numeric convesion table (see JIS X0510:2004, pp.19).
* @param __c__ character
* @return value
*/
#define QRinput_lookAnTable(__c__) \
((__c__ & 0x80)?-1:QRinput_anTable[(int)__c__])
/**
* Length of a segment of structured-append header.
*/
#define STRUCTURE_HEADER_BITS 20
/**
* Maximum number of symbols in a set of structured-appended symbols.
*/
#define MAX_STRUCTURED_SYMBOLS 16
#endif /* __QRINPUT_H__ */
/*
* qrencode - QR Code encoder
*
* QR Code specification in convenient format.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* The following data / specifications are taken from
* "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004)
* or
* "Automatic identification and data capture techniques --
* QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
//#include "config.h"
#include "qrspec.h"
/******************************************************************************
* Version and capacity
*****************************************************************************/
typedef struct {
int width; //< Edge length of the symbol
int words; //< Data capacity (bytes)
int remainder; //< Remainder bit (bits)
int ec[4]; //< Number of ECC code (bytes)
} QRspec_Capacity;
/**
* Table of the capacity of symbols
* See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004.
*/
static const QRspec_Capacity qrspecCapacity[QRSPEC_VERSION_MAX + 1] = {
{ 0, 0, 0, { 0, 0, 0, 0}},
{ 21, 26, 0, { 7, 10, 13, 17}}, // 1
{ 25, 44, 7, { 10, 16, 22, 28}},
{ 29, 70, 7, { 15, 26, 36, 44}},
{ 33, 100, 7, { 20, 36, 52, 64}},
{ 37, 134, 7, { 26, 48, 72, 88}}, // 5
{ 41, 172, 7, { 36, 64, 96, 112}},
{ 45, 196, 0, { 40, 72, 108, 130}},
{ 49, 242, 0, { 48, 88, 132, 156}},
{ 53, 292, 0, { 60, 110, 160, 192}},
{ 57, 346, 0, { 72, 130, 192, 224}}, //10
{ 61, 404, 0, { 80, 150, 224, 264}},
{ 65, 466, 0, { 96, 176, 260, 308}},
{ 69, 532, 0, { 104, 198, 288, 352}},
{ 73, 581, 3, { 120, 216, 320, 384}},
{ 77, 655, 3, { 132, 240, 360, 432}}, //15
{ 81, 733, 3, { 144, 280, 408, 480}},
{ 85, 815, 3, { 168, 308, 448, 532}},
{ 89, 901, 3, { 180, 338, 504, 588}},
{ 93, 991, 3, { 196, 364, 546, 650}},
{ 97, 1085, 3, { 224, 416, 600, 700}}, //20
{101, 1156, 4, { 224, 442, 644, 750}},
{105, 1258, 4, { 252, 476, 690, 816}},
{109, 1364, 4, { 270, 504, 750, 900}},
{113, 1474, 4, { 300, 560, 810, 960}},
{117, 1588, 4, { 312, 588, 870, 1050}}, //25
{121, 1706, 4, { 336, 644, 952, 1110}},
{125, 1828, 4, { 360, 700, 1020, 1200}},
{129, 1921, 3, { 390, 728, 1050, 1260}},
{133, 2051, 3, { 420, 784, 1140, 1350}},
{137, 2185, 3, { 450, 812, 1200, 1440}}, //30
{141, 2323, 3, { 480, 868, 1290, 1530}},
{145, 2465, 3, { 510, 924, 1350, 1620}},
{149, 2611, 3, { 540, 980, 1440, 1710}},
{153, 2761, 3, { 570, 1036, 1530, 1800}},
{157, 2876, 0, { 570, 1064, 1590, 1890}}, //35
{161, 3034, 0, { 600, 1120, 1680, 1980}},
{165, 3196, 0, { 630, 1204, 1770, 2100}},
{169, 3362, 0, { 660, 1260, 1860, 2220}},
{173, 3532, 0, { 720, 1316, 1950, 2310}},
{177, 3706, 0, { 750, 1372, 2040, 2430}} //40
};
int QRspec_getDataLength(int version, QRecLevel level)
{
return qrspecCapacity[version].words - qrspecCapacity[version].ec[level];
}
int QRspec_getECCLength(int version, QRecLevel level)
{
return qrspecCapacity[version].ec[level];
}
int QRspec_getMinimumVersion(int size, QRecLevel level)
{
int i;
int words;
for(i=1; i<= QRSPEC_VERSION_MAX; i++) {
words = qrspecCapacity[i].words - qrspecCapacity[i].ec[level];
if(words >= size) return i;
}
return -1;
}
int QRspec_getWidth(int version)
{
return qrspecCapacity[version].width;
}
int QRspec_getRemainder(int version)
{
return qrspecCapacity[version].remainder;
}
/******************************************************************************
* Length indicator
*****************************************************************************/
static const int lengthTableBits[4][3] = {
{10, 12, 14},
{ 9, 11, 13},
{ 8, 16, 16},
{ 8, 10, 12}
};
int QRspec_lengthIndicator(QRencodeMode mode, int version)
{
int l;
if(mode == QR_MODE_STRUCTURE) return 0;
if(version <= 9) {
l = 0;
} else if(version <= 26) {
l = 1;
} else {
l = 2;
}
return lengthTableBits[mode][l];
}
int QRspec_maximumWords(QRencodeMode mode, int version)
{
int l;
int bits;
int words;
if(mode == QR_MODE_STRUCTURE) return 3;
if(version <= 9) {
l = 0;
} else if(version <= 26) {
l = 1;
} else {
l = 2;
}
bits = lengthTableBits[mode][l];
words = (1 << bits) - 1;
if(mode == QR_MODE_KANJI) {
words *= 2; // the number of bytes is required
}
return words;
}
/******************************************************************************
* Error correction code
*****************************************************************************/
/**
* Table of the error correction code (Reed-Solomon block)
* See Table 12-16 (pp.30-36), JIS X0510:2004.
*/
static const int eccTable[QRSPEC_VERSION_MAX+1][4][2] = {
{{ 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}},
{{ 1, 0}, { 1, 0}, { 1, 0}, { 1, 0}}, // 1
{{ 1, 0}, { 1, 0}, { 1, 0}, { 1, 0}},
{{ 1, 0}, { 1, 0}, { 2, 0}, { 2, 0}},
{{ 1, 0}, { 2, 0}, { 2, 0}, { 4, 0}},
{{ 1, 0}, { 2, 0}, { 2, 2}, { 2, 2}}, // 5
{{ 2, 0}, { 4, 0}, { 4, 0}, { 4, 0}},
{{ 2, 0}, { 4, 0}, { 2, 4}, { 4, 1}},
{{ 2, 0}, { 2, 2}, { 4, 2}, { 4, 2}},
{{ 2, 0}, { 3, 2}, { 4, 4}, { 4, 4}},
{{ 2, 2}, { 4, 1}, { 6, 2}, { 6, 2}}, //10
{{ 4, 0}, { 1, 4}, { 4, 4}, { 3, 8}},
{{ 2, 2}, { 6, 2}, { 4, 6}, { 7, 4}},
{{ 4, 0}, { 8, 1}, { 8, 4}, {12, 4}},
{{ 3, 1}, { 4, 5}, {11, 5}, {11, 5}},
{{ 5, 1}, { 5, 5}, { 5, 7}, {11, 7}}, //15
{{ 5, 1}, { 7, 3}, {15, 2}, { 3, 13}},
{{ 1, 5}, {10, 1}, { 1, 15}, { 2, 17}},
{{ 5, 1}, { 9, 4}, {17, 1}, { 2, 19}},
{{ 3, 4}, { 3, 11}, {17, 4}, { 9, 16}},
{{ 3, 5}, { 3, 13}, {15, 5}, {15, 10}}, //20
{{ 4, 4}, {17, 0}, {17, 6}, {19, 6}},
{{ 2, 7}, {17, 0}, { 7, 16}, {34, 0}},
{{ 4, 5}, { 4, 14}, {11, 14}, {16, 14}},
{{ 6, 4}, { 6, 14}, {11, 16}, {30, 2}},
{{ 8, 4}, { 8, 13}, { 7, 22}, {22, 13}}, //25
{{10, 2}, {19, 4}, {28, 6}, {33, 4}},
{{ 8, 4}, {22, 3}, { 8, 26}, {12, 28}},
{{ 3, 10}, { 3, 23}, { 4, 31}, {11, 31}},
{{ 7, 7}, {21, 7}, { 1, 37}, {19, 26}},
{{ 5, 10}, {19, 10}, {15, 25}, {23, 25}}, //30
{{13, 3}, { 2, 29}, {42, 1}, {23, 28}},
{{17, 0}, {10, 23}, {10, 35}, {19, 35}},
{{17, 1}, {14, 21}, {29, 19}, {11, 46}},
{{13, 6}, {14, 23}, {44, 7}, {59, 1}},
{{12, 7}, {12, 26}, {39, 14}, {22, 41}}, //35
{{ 6, 14}, { 6, 34}, {46, 10}, { 2, 64}},
{{17, 4}, {29, 14}, {49, 10}, {24, 46}},
{{ 4, 18}, {13, 32}, {48, 14}, {42, 32}},
{{20, 4}, {40, 7}, {43, 22}, {10, 67}},
{{19, 6}, {18, 31}, {34, 34}, {20, 61}},//40
};
void QRspec_getEccSpec(int version, QRecLevel level, int spec[5])
{
int b1, b2;
int data, ecc;
b1 = eccTable[version][level][0];
b2 = eccTable[version][level][1];
data = QRspec_getDataLength(version, level);
ecc = QRspec_getECCLength(version, level);
if(b2 == 0) {
spec[0] = b1;
spec[1] = data / b1;
spec[2] = ecc / b1;
spec[3] = spec[4] = 0;
} else {
spec[0] = b1;
spec[1] = data / (b1 + b2);
spec[2] = ecc / (b1 + b2);
spec[3] = b2;
spec[4] = spec[1] + 1;
}
}
/******************************************************************************
* Alignment pattern
*****************************************************************************/
/**
* Positions of alignment patterns.
* This array includes only the second and the third position of the alignment
* patterns. Rest of them can be calculated from the distance between them.
*
* See Table 1 in Appendix E (pp.71) of JIS X0510:2004.
*/
static const int alignmentPattern[QRSPEC_VERSION_MAX+1][2] = {
{ 0, 0},
{ 0, 0}, {18, 0}, {22, 0}, {26, 0}, {30, 0}, // 1- 5
{34, 0}, {22, 38}, {24, 42}, {26, 46}, {28, 50}, // 6-10
{30, 54}, {32, 58}, {34, 62}, {26, 46}, {26, 48}, //11-15
{26, 50}, {30, 54}, {30, 56}, {30, 58}, {34, 62}, //16-20
{28, 50}, {26, 50}, {30, 54}, {28, 54}, {32, 58}, //21-25
{30, 58}, {34, 62}, {26, 50}, {30, 54}, {26, 52}, //26-30
{30, 56}, {34, 60}, {30, 58}, {34, 62}, {30, 54}, //31-35
{24, 50}, {28, 54}, {32, 58}, {26, 54}, {30, 58}, //35-40
};
/**
* Put an alignment marker.
* @param frame
* @param width
* @param ox,oy center coordinate of the pattern
*/
static void QRspec_putAlignmentMarker(unsigned char *frame, int width, int ox, int oy)
{
static const unsigned char finder[] = {
0xa1, 0xa1, 0xa1, 0xa1, 0xa1,
0xa1, 0xa0, 0xa0, 0xa0, 0xa1,
0xa1, 0xa0, 0xa1, 0xa0, 0xa1,
0xa1, 0xa0, 0xa0, 0xa0, 0xa1,
0xa1, 0xa1, 0xa1, 0xa1, 0xa1,
};
int x, y;
const unsigned char *s;
frame += (oy - 2) * width + ox - 2;
s = finder;
for(y=0; y<5; y++) {
for(x=0; x<5; x++) {
frame[x] = s[x];
}
frame += width;
s += 5;
}
}
//__STATIC
static void QRspec_putAlignmentPattern(int version, unsigned char *frame, int width)
{
int d, w, x, y, cx, cy;
if(version < 2) return;
d = alignmentPattern[version][1] - alignmentPattern[version][0];
if(d < 0) {
w = 2;
} else {
w = (width - alignmentPattern[version][0]) / d + 2;
}
if(w * w - 3 == 1) {
x = alignmentPattern[version][0];
y = alignmentPattern[version][0];
QRspec_putAlignmentMarker(frame, width, x, y);
return;
}
cx = alignmentPattern[version][0];
for(x=1; x<w - 1; x++) {
QRspec_putAlignmentMarker(frame, width, 6, cx);
QRspec_putAlignmentMarker(frame, width, cx, 6);
cx += d;
}
cy = alignmentPattern[version][0];
for(y=0; y<w-1; y++) {
cx = alignmentPattern[version][0];
for(x=0; x<w-1; x++) {
QRspec_putAlignmentMarker(frame, width, cx, cy);
cx += d;
}
cy += d;
}
}
/******************************************************************************
* Version information pattern
*****************************************************************************/
/**
* Version information pattern (BCH coded).
* See Table 1 in Appendix D (pp.68) of JIS X0510:2004.
*/
static const unsigned int versionPattern[QRSPEC_VERSION_MAX - 6] = {
0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d,
0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9,
0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75,
0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64,
0x27541, 0x28c69
};
unsigned int QRspec_getVersionPattern(int version)
{
if(version < 7 || version > QRSPEC_VERSION_MAX) return 0;
return versionPattern[version -7];
}
/******************************************************************************
* Format information
*****************************************************************************/
/* See calcFormatInfo in tests/test_qrspec.c */
static const unsigned int formatInfo[4][8] = {
{0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976},
{0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0},
{0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed},
{0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b}
};
unsigned int QRspec_getFormatInfo(int mask, QRecLevel level)
{
if(mask < 0 || mask > 7) return 0;
return formatInfo[level][mask];
}
/******************************************************************************
* Frame
*****************************************************************************/
/**
* Cache of initial frames.
*/
/* C99 says that static storage shall be initialized to a null pointer
* by compiler. */
static unsigned char *frames[QRSPEC_VERSION_MAX + 1];
/**
* Put a finder pattern.
* @param frame
* @param width
* @param ox,oy upper-left coordinate of the pattern
*/
static void putFinderPattern(unsigned char *frame, int width, int ox, int oy)
{
static const unsigned char finder[] = {
0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1,
0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1,
0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
0xc1, 0xc0, 0xc1, 0xc1, 0xc1, 0xc0, 0xc1,
0xc1, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc1,
0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1, 0xc1,
};
int x, y;
const unsigned char *s;
frame += oy * width + ox;
s = finder;
for(y=0; y<7; y++) {
for(x=0; x<7; x++) {
frame[x] = s[x];
}
frame += width;
s += 7;
}
}
static unsigned char *QRspec_createFrame(int version)
{
unsigned char *frame, *p, *q;
int width;
int x, y;
unsigned int verinfo, v;
width = qrspecCapacity[version].width;
frame = (unsigned char *)malloc(width * width);
if(frame == NULL) return NULL;
memset(frame, 0, width * width);
/* Finder pattern */
putFinderPattern(frame, width, 0, 0);
putFinderPattern(frame, width, width - 7, 0);
putFinderPattern(frame, width, 0, width - 7);
/* Separator */
p = frame;
q = frame + width * (width - 7);
for(y=0; y<7; y++) {
p[7] = 0xc0;
p[width - 8] = 0xc0;
q[7] = 0xc0;
p += width;
q += width;
}
memset(frame + width * 7, 0xc0, 8);
memset(frame + width * 8 - 8, 0xc0, 8);
memset(frame + width * (width - 8), 0xc0, 8);
/* Mask format information area */
memset(frame + width * 8, 0x84, 9);
memset(frame + width * 9 - 8, 0x84, 8);
p = frame + 8;
for(y=0; y<8; y++) {
*p = 0x84;
p += width;
}
p = frame + width * (width - 7) + 8;
for(y=0; y<7; y++) {
*p = 0x84;
p += width;
}
/* Timing pattern */
p = frame + width * 6 + 8;
q = frame + width * 8 + 6;
for(x=1; x<width-15; x++) {
*p = 0x90 | (x & 1);
*q = 0x90 | (x & 1);
p++;
q += width;
}
/* Alignment pattern */
QRspec_putAlignmentPattern(version, frame, width);
/* Version information */
if(version >= 7) {
verinfo = QRspec_getVersionPattern(version);
p = frame + width * (width - 11);
v = verinfo;
for(x=0; x<6; x++) {
for(y=0; y<3; y++) {
p[width * y + x] = 0x88 | (v & 1);
v = v >> 1;
}
}
p = frame + width - 11;
v = verinfo;
for(y=0; y<6; y++) {
for(x=0; x<3; x++) {
p[x] = 0x88 | (v & 1);
v = v >> 1;
}
p += width;
}
}
/* and a little bit... */
frame[width * (width - 8) + 8] = 0x81;
return frame;
}
unsigned char *QRspec_newFrame(int version)
{
unsigned char *frame;
int width;
if(version < 1 || version > QRSPEC_VERSION_MAX) return NULL;
if(frames[version] == NULL) {
frames[version] = QRspec_createFrame(version);
}
if(frames[version] == NULL) return NULL;
width = qrspecCapacity[version].width;
frame = (unsigned char *)malloc(width * width);
if(frame == NULL) return NULL;
memcpy(frame, frames[version], width * width);
return frame;
}
void QRspec_clearCache(void)
{
int i;
for(i=1; i<=QRSPEC_VERSION_MAX; i++) {
free(frames[i]);
}
}
/*
* qrencode - QR Code encoder
*
* QR Code specification in convenient format.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __QRSPEC_H__
#define __QRSPEC_H__
#include "qrencode.h"
/******************************************************************************
* Version and capacity
*****************************************************************************/
/**
* Maximum version (size) of QR-code symbol.
*/
#define QRSPEC_VERSION_MAX 40
/**
* Maximum width of a symbol
*/
#define QRSPEC_WIDTH_MAX 177
/**
* Return maximum data code length (bytes) for the version.
* @param version
* @param level
* @return maximum size (bytes)
*/
extern int QRspec_getDataLength(int version, QRecLevel level);
/**
* Return maximum error correction code length (bytes) for the version.
* @param version
* @param level
* @return ECC size (bytes)
*/
extern int QRspec_getECCLength(int version, QRecLevel level);
/**
* Return a version number that satisfies the input code length.
* @param size input code length (byte)
* @param level
* @return version number
*/
extern int QRspec_getMinimumVersion(int size, QRecLevel level);
/**
* Return the width of the symbol for the version.
* @param version
* @return width
*/
extern int QRspec_getWidth(int version);
/**
* Return the numer of remainder bits.
* @param version
* @return number of remainder bits
*/
extern int QRspec_getRemainder(int version);
/******************************************************************************
* Length indicator
*****************************************************************************/
/**
* Return the size of lenght indicator for the mode and version.
* @param mode
* @param version
* @return the size of the appropriate length indicator (bits).
*/
extern int QRspec_lengthIndicator(QRencodeMode mode, int version);
/**
* Return the maximum length for the mode and version.
* @param mode
* @param version
* @return the maximum length (bytes)
*/
extern int QRspec_maximumWords(QRencodeMode mode, int version);
/******************************************************************************
* Error correction code
*****************************************************************************/
/**
* Return an array of ECC specification.
* @param version
* @param level
* @param spec an array of ECC specification contains as following:
* {# of type1 blocks, # of data code, # of ecc code,
* # of type2 blocks, # of data code}
*/
void QRspec_getEccSpec(int version, QRecLevel level, int spec[5]);
#define QRspec_rsBlockNum(__spec__) (__spec__[0] + __spec__[3])
#define QRspec_rsBlockNum1(__spec__) (__spec__[0])
#define QRspec_rsDataCodes1(__spec__) (__spec__[1])
#define QRspec_rsEccCodes1(__spec__) (__spec__[2])
#define QRspec_rsBlockNum2(__spec__) (__spec__[3])
#define QRspec_rsDataCodes2(__spec__) (__spec__[4])
#define QRspec_rsEccCodes2(__spec__) (__spec__[2])
#define QRspec_rsDataLength(__spec__) \
((QRspec_rsBlockNum1(__spec__) * QRspec_rsDataCodes1(__spec__)) + \
(QRspec_rsBlockNum2(__spec__) * QRspec_rsDataCodes2(__spec__)))
#define QRspec_rsEccLength(__spec__) \
(QRspec_rsBlockNum(__spec__) * QRspec_rsEccCodes1(__spec__))
/******************************************************************************
* Version information pattern
*****************************************************************************/
/**
* Return BCH encoded version information pattern that is used for the symbol
* of version 7 or greater. Use lower 18 bits.
* @param version
* @return BCH encoded version information pattern
*/
extern unsigned int QRspec_getVersionPattern(int version);
/******************************************************************************
* Format information
*****************************************************************************/
/**
* Return BCH encoded format information pattern.
* @param mask
* @param level
* @return BCH encoded format information pattern
*/
extern unsigned int QRspec_getFormatInfo(int mask, QRecLevel level);
/******************************************************************************
* Frame
*****************************************************************************/
/**
* Return a copy of initialized frame.
* When the same version is requested twice or more, a copy of cached frame
* is returned.
* WARNING: Thread unsafe!!!
* @param version
* @return Array of unsigned char. You can free it by free().
*/
extern unsigned char *QRspec_newFrame(int version);
/**
* Clear the frame cache. Typically for debug.
* WARNING: Thread unsafe!!!
*/
extern void QRspec_clearCache(void);
#endif /* __QRSPEC_H__ */
/*
* qrencode - QR Code encoder
*
* Reed solomon encoder. This code is taken from Phil Karn's libfec then
* editted and packed into a pair of .c and .h files.
*
* Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q
* (libfec is released under the GNU Lesser General Public License.)
*
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include "rscode.h"
/* Stuff specific to the 8-bit symbol version of the general purpose RS codecs
*
*/
typedef unsigned char data_t;
/**
* Reed-Solomon codec control block
*/
struct _RS {
int mm; /* Bits per symbol */
int nn; /* Symbols per block (= (1<<mm)-1) */
data_t *alpha_to; /* log lookup table */
data_t *index_of; /* Antilog lookup table */
data_t *genpoly; /* Generator polynomial */
int nroots; /* Number of generator roots = number of parity symbols */
int fcr; /* First consecutive root, index form */
int prim; /* Primitive element, index form */
int iprim; /* prim-th root of 1, index form */
int pad; /* Padding bytes in shortened block */
int gfpoly;
struct _RS *next;
};
static RS *rslist = NULL;
static inline int modnn(RS *rs, int x){
while (x >= rs->nn) {
x -= rs->nn;
x = (x >> rs->mm) + (x & rs->nn);
}
return x;
}
#define MODNN(x) modnn(rs,x)
#define MM (rs->mm)
#define NN (rs->nn)
#define ALPHA_TO (rs->alpha_to)
#define INDEX_OF (rs->index_of)
#define GENPOLY (rs->genpoly)
#define NROOTS (rs->nroots)
#define FCR (rs->fcr)
#define PRIM (rs->prim)
#define IPRIM (rs->iprim)
#define PAD (rs->pad)
#define A0 (NN)
/* Initialize a Reed-Solomon codec
* symsize = symbol size, bits
* gfpoly = Field generator polynomial coefficients
* fcr = first root of RS code generator polynomial, index form
* prim = primitive element to generate polynomial roots
* nroots = RS code generator polynomial degree (number of roots)
* pad = padding bytes at front of shortened block
*/
static RS *init_rs_char(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad)
{
RS *rs;
/* Common code for intializing a Reed-Solomon control block (char or int symbols)
* Copyright 2004 Phil Karn, KA9Q
* May be used under the terms of the GNU Lesser General Public License (LGPL)
*/
//#undef NULL
//#define NULL ((void *)0)
int i, j, sr,root,iprim;
rs = NULL;
/* Check parameter ranges */
if(symsize < 0 || symsize > (int)(8*sizeof(data_t))){
goto done;
}
if(fcr < 0 || fcr >= (1<<symsize))
goto done;
if(prim <= 0 || prim >= (1<<symsize))
goto done;
if(nroots < 0 || nroots >= (1<<symsize))
goto done; /* Can't have more roots than symbol values! */
if(pad < 0 || pad >= ((1<<symsize) -1 - nroots))
goto done; /* Too much padding */
rs = (RS *)calloc(1,sizeof(RS));
if(rs == NULL)
goto done;
rs->mm = symsize;
rs->nn = (1<<symsize)-1;
rs->pad = pad;
rs->alpha_to = (data_t *)malloc(sizeof(data_t)*(rs->nn+1));
if(rs->alpha_to == NULL){
free(rs);
rs = NULL;
goto done;
}
rs->index_of = (data_t *)malloc(sizeof(data_t)*(rs->nn+1));
if(rs->index_of == NULL){
free(rs->alpha_to);
free(rs);
rs = NULL;
goto done;
}
/* Generate Galois field lookup tables */
rs->index_of[0] = A0; /* log(zero) = -inf */
rs->alpha_to[A0] = 0; /* alpha**-inf = 0 */
sr = 1;
for(i=0;i<rs->nn;i++){
rs->index_of[sr] = i;
rs->alpha_to[i] = sr;
sr <<= 1;
if(sr & (1<<symsize))
sr ^= gfpoly;
sr &= rs->nn;
}
if(sr != 1){
/* field generator polynomial is not primitive! */
free(rs->alpha_to);
free(rs->index_of);
free(rs);
rs = NULL;
goto done;
}
/* Form RS code generator polynomial from its roots */
rs->genpoly = (data_t *)malloc(sizeof(data_t)*(nroots+1));
if(rs->genpoly == NULL){
free(rs->alpha_to);
free(rs->index_of);
free(rs);
rs = NULL;
goto done;
}
rs->fcr = fcr;
rs->prim = prim;
rs->nroots = nroots;
rs->gfpoly = gfpoly;
/* Find prim-th root of 1, used in decoding */
for(iprim=1;(iprim % prim) != 0;iprim += rs->nn)
;
rs->iprim = iprim / prim;
rs->genpoly[0] = 1;
for (i = 0,root=fcr*prim; i < nroots; i++,root += prim) {
rs->genpoly[i+1] = 1;
/* Multiply rs->genpoly[] by @**(root + x) */
for (j = i; j > 0; j--){
if (rs->genpoly[j] != 0)
rs->genpoly[j] = rs->genpoly[j-1] ^ rs->alpha_to[modnn(rs,rs->index_of[rs->genpoly[j]] + root)];
else
rs->genpoly[j] = rs->genpoly[j-1];
}
/* rs->genpoly[0] can never be zero */
rs->genpoly[0] = rs->alpha_to[modnn(rs,rs->index_of[rs->genpoly[0]] + root)];
}
/* convert rs->genpoly[] to index form for quicker encoding */
for (i = 0; i <= nroots; i++)
rs->genpoly[i] = rs->index_of[rs->genpoly[i]];
done:;
return rs;
}
RS *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad)
{
RS *rs;
for(rs = rslist; rs != NULL; rs = rs->next) {
if(rs->pad != pad) continue;
if(rs->nroots != nroots) continue;
if(rs->mm != symsize) continue;
if(rs->gfpoly != gfpoly) continue;
if(rs->fcr != fcr) continue;
if(rs->prim != prim) continue;
goto DONE;
}
rs = init_rs_char(symsize, gfpoly, fcr, prim, nroots, pad);
if(rs == NULL) goto DONE;
rs->next = rslist;
rslist = rs;
DONE:
return rs;
}
void free_rs_char(RS *rs)
{
free(rs->alpha_to);
free(rs->index_of);
free(rs->genpoly);
free(rs);
}
void free_rs_cache(void)
{
RS *rs, *next;
rs = rslist;
while(rs != NULL) {
next = rs->next;
free_rs_char(rs);
rs = next;
}
}
/* The guts of the Reed-Solomon encoder, meant to be #included
* into a function body with the following typedefs, macros and variables supplied
* according to the code parameters:
* data_t - a typedef for the data symbol
* data_t data[] - array of NN-NROOTS-PAD and type data_t to be encoded
* data_t parity[] - an array of NROOTS and type data_t to be written with parity symbols
* NROOTS - the number of roots in the RS code generator polynomial,
* which is the same as the number of parity symbols in a block.
Integer variable or literal.
*
* NN - the total number of symbols in a RS block. Integer variable or literal.
* PAD - the number of pad symbols in a block. Integer variable or literal.
* ALPHA_TO - The address of an array of NN elements to convert Galois field
* elements in index (log) form to polynomial form. Read only.
* INDEX_OF - The address of an array of NN elements to convert Galois field
* elements in polynomial form to index (log) form. Read only.
* MODNN - a function to reduce its argument modulo NN. May be inline or a macro.
* GENPOLY - an array of NROOTS+1 elements containing the generator polynomial in index form
* The memset() and memmove() functions are used. The appropriate header
* file declaring these functions (usually <string.h>) must be included by the calling
* program.
* Copyright 2004, Phil Karn, KA9Q
* May be used under the terms of the GNU Lesser General Public License (LGPL)
*/
#undef A0
#define A0 (NN) /* Special reserved value encoding zero in index form */
void encode_rs_char(RS *rs, const data_t *data, data_t *parity)
{
int i, j;
data_t feedback;
memset(parity,0,NROOTS*sizeof(data_t));
for(i=0;i<NN-NROOTS-PAD;i++){
feedback = INDEX_OF[data[i] ^ parity[0]];
if(feedback != A0){ /* feedback term is non-zero */
#ifdef UNNORMALIZED
/* This line is unnecessary when GENPOLY[NROOTS] is unity, as it must
* always be for the polynomials constructed by init_rs()
*/
feedback = MODNN(NN - GENPOLY[NROOTS] + feedback);
#endif
for(j=1;j<NROOTS;j++)
parity[j] ^= ALPHA_TO[MODNN(feedback + GENPOLY[NROOTS-j])];
}
/* Shift */
memmove(&parity[0],&parity[1],sizeof(data_t)*(NROOTS-1));
if(feedback != A0)
parity[NROOTS-1] = ALPHA_TO[MODNN(feedback + GENPOLY[0])];
else
parity[NROOTS-1] = 0;
}
}
/*
* qrencode - QR Code encoder
*
* Reed solomon encoder. This code is taken from Phil Karn's libfec then
* editted and packed into a pair of .c and .h files.
*
* Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q
* (libfec is released under the GNU Lesser General Public License.)
*
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __RSCODE_H__
#define __RSCODE_H__
/*
* General purpose RS codec, 8-bit symbols.
*/
typedef struct _RS RS;
/* WARNING: Thread unsafe!!! */
extern RS *init_rs(int symsize, int gfpoly, int fcr, int prim, int nroots, int pad);
extern void encode_rs_char(RS *rs, const unsigned char *data, unsigned char *parity);
extern void free_rs_char(RS *rs);
extern void free_rs_cache(void);
#endif /* __RSCODE_H__ */
/*
* qrencode - QR Code encoder
*
* Input data splitter.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* The following data / specifications are taken from
* "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004)
* or
* "Automatic identification and data capture techniques --
* QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "qrencode.h"
#include "qrinput.h"
#include "qrspec.h"
#include "split.h"
#define isdigit(__c__) ((unsigned char)((signed char)(__c__) - '0') < 10)
#define isalnum(__c__) (QRinput_lookAnTable(__c__) >= 0)
static QRencodeMode Split_identifyMode(const char *string, QRencodeMode hint)
{
unsigned char c, d;
unsigned int word;
c = string[0];
if(c == '\0') return QR_MODE_NUL;
if(isdigit(c)) {
return QR_MODE_NUM;
} else if(isalnum(c)) {
return QR_MODE_AN;
} else if(hint == QR_MODE_KANJI) {
d = string[1];
if(d != '\0') {
word = ((unsigned int)c << 8) | d;
if((word >= 0x8140 && word <= 0x9ffc) || (word >= 0xe040 && word <= 0xebbf)) {
return QR_MODE_KANJI;
}
}
}
return QR_MODE_8;
}
static int Split_eatNum(const char *string, QRinput *input, QRencodeMode hint);
static int Split_eatAn(const char *string, QRinput *input, QRencodeMode hint);
static int Split_eat8(const char *string, QRinput *input, QRencodeMode hint);
static int Split_eatKanji(const char *string, QRinput *input, QRencodeMode hint);
static int Split_eatNum(const char *string, QRinput *input,QRencodeMode hint)
{
const char *p;
int ret;
int run;
int dif;
int ln;
QRencodeMode mode;
ln = QRspec_lengthIndicator(QR_MODE_NUM, input->version);
p = string;
while(isdigit(*p)) {
p++;
}
run = (int)(p - string);
mode = Split_identifyMode(p, hint);
if(mode == QR_MODE_8) {
dif = QRinput_estimateBitsModeNum(run) + 4 + ln
+ QRinput_estimateBitsMode8(1) /* + 4 + l8 */
- QRinput_estimateBitsMode8(run + 1) /* - 4 - l8 */;
if(dif > 0) {
return Split_eat8(string, input, hint);
}
}
if(mode == QR_MODE_AN) {
dif = QRinput_estimateBitsModeNum(run) + 4 + ln
+ QRinput_estimateBitsModeAn(1) /* + 4 + la */
- QRinput_estimateBitsModeAn(run + 1) /* - 4 - la */;
if(dif > 0) {
return Split_eatAn(string, input, hint);
}
}
ret = QRinput_append(input, QR_MODE_NUM, run, (unsigned char *)string);
if(ret < 0) return -1;
return run;
}
static int Split_eatAn(const char *string, QRinput *input, QRencodeMode hint)
{
const char *p, *q;
int ret;
int run;
int dif;
int la, ln;
la = QRspec_lengthIndicator(QR_MODE_AN, input->version);
ln = QRspec_lengthIndicator(QR_MODE_NUM, input->version);
p = string;
while(isalnum(*p)) {
if(isdigit(*p)) {
q = p;
while(isdigit(*q)) {
q++;
}
dif = QRinput_estimateBitsModeAn((int)(p - string)) /* + 4 + la */
+ QRinput_estimateBitsModeNum((int)(q - p)) + 4 + ln
- QRinput_estimateBitsModeAn((int)(q - string)) /* - 4 - la */;
if(dif < 0) {
break;
} else {
p = q;
}
} else {
p++;
}
}
run = (int)(p - string);
if(*p && !isalnum(*p)) {
dif = QRinput_estimateBitsModeAn(run) + 4 + la
+ QRinput_estimateBitsMode8(1) /* + 4 + l8 */
- QRinput_estimateBitsMode8(run + 1) /* - 4 - l8 */;
if(dif > 0) {
return Split_eat8(string, input, hint);
}
}
ret = QRinput_append(input, QR_MODE_AN, run, (unsigned char *)string);
if(ret < 0) return -1;
return run;
}
static int Split_eatKanji(const char *string, QRinput *input, QRencodeMode hint)
{
const char *p;
int ret;
int run;
p = string;
while(Split_identifyMode(p, hint) == QR_MODE_KANJI) {
p += 2;
}
run = (int)(p - string);
ret = QRinput_append(input, QR_MODE_KANJI, run, (unsigned char *)string);
if(ret < 0) return -1;
return run;
}
static int Split_eat8(const char *string, QRinput *input, QRencodeMode hint)
{
const char *p, *q;
QRencodeMode mode;
int ret;
int run;
int dif;
int la, ln;
la = QRspec_lengthIndicator(QR_MODE_AN, input->version);
ln = QRspec_lengthIndicator(QR_MODE_NUM, input->version);
p = string + 1;
while(*p != '\0') {
mode = Split_identifyMode(p, hint);
if(mode == QR_MODE_KANJI) {
break;
}
if(mode == QR_MODE_NUM) {
q = p;
while(isdigit(*q)) {
q++;
}
dif = QRinput_estimateBitsMode8((int)(p - string)) /* + 4 + l8 */
+ QRinput_estimateBitsModeNum((int)(q - p)) + 4 + ln
- QRinput_estimateBitsMode8((int)(q - string)) /* - 4 - l8 */;
if(dif < 0) {
break;
} else {
p = q;
}
} else if(mode == QR_MODE_AN) {
q = p;
while(isalnum(*q)) {
q++;
}
dif = QRinput_estimateBitsMode8((int)(p - string)) /* + 4 + l8 */
+ QRinput_estimateBitsModeAn((int)(q - p)) + 4 + la
- QRinput_estimateBitsMode8((int)(q - string)) /* - 4 - l8 */;
if(dif < 0) {
break;
} else {
p = q;
}
} else {
p++;
}
}
run = (int)(p - string);
ret = QRinput_append(input, QR_MODE_8, run, (unsigned char *)string);
if(ret < 0) return -1;
return run;
}
static int Split_splitString(const char *string, QRinput *input,
QRencodeMode hint)
{
int length;
QRencodeMode mode;
if(*string == '\0') return 0;
mode = Split_identifyMode(string, hint);
if(mode == QR_MODE_NUM) {
length = Split_eatNum(string, input, hint);
} else if(mode == QR_MODE_AN) {
length = Split_eatAn(string, input, hint);
} else if(mode == QR_MODE_KANJI && hint == QR_MODE_KANJI) {
length = Split_eatKanji(string, input, hint);
} else {
length = Split_eat8(string, input, hint);
}
if(length == 0) return 0;
if(length < 0) return -1;
return Split_splitString(&string[length], input, hint);
}
static char *dupAndToUpper(const char *str, QRencodeMode hint)
{
char *newstr, *p;
QRencodeMode mode;
newstr = strdup(str);
if(newstr == NULL) return NULL;
p = newstr;
while(*p != '\0') {
mode = Split_identifyMode(p, hint);
if(mode == QR_MODE_KANJI) {
p += 2;
} else {
if (*p >= 'a' && *p <= 'z') {
*p = (char)((int)*p - 32);
}
p++;
}
}
return newstr;
}
int Split_splitStringToQRinput(const char *string, QRinput *input,
QRencodeMode hint, int casesensitive)
{
char *newstr;
int ret;
if(string == NULL || *string == '\0') {
errno = EINVAL;
return -1;
}
if(!casesensitive) {
newstr = dupAndToUpper(string, hint);
if(newstr == NULL) return -1;
ret = Split_splitString(newstr, input, hint);
free(newstr);
} else {
ret = Split_splitString(string, input, hint);
}
return ret;
}
/*
* qrencode - QR Code encoder
*
* Input data splitter.
* Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi <fukuchi@megaui.net>
*
* The following data / specifications are taken from
* "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004)
* or
* "Automatic identification and data capture techniques --
* QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __SPLIT_H__
#define __SPLIT_H__
#include "qrencode.h"
/**
* Split the input string (null terminated) into QRinput.
* @param string input string
* @param hint give QR_MODE_KANJI if the input string contains Kanji character encoded in Shift-JIS. If not, give QR_MODE_8.
* @param casesensitive 0 for case-insensitive encoding (all alphabet characters are replaced to UPPER-CASE CHARACTERS.
* @retval 0 success.
* @retval -1 an error occurred. errno is set to indicate the error. See
* Exceptions for the details.
* @throw EINVAL invalid input object.
* @throw ENOMEM unable to allocate memory for input objects.
*/
extern int Split_splitStringToQRinput(const char *string, QRinput *input,
QRencodeMode hint, int casesensitive);
#endif /* __SPLIT_H__ */
#-------------------------------------------------
#
# Project created by QtCreator 2016-09-25T18:07:18
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = SNCreater
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp \
CImageCreater.cpp \
QRLib/bitstream.c \
QRLib/mask.c \
QRLib/qrencode.c \
QRLib/qrinput.c \
QRLib/qrspec.c \
QRLib/rscode.c \
QRLib/split.c \
CWorkThread.cpp
HEADERS += mainwindow.h \
CImageCreater.h \
QRLib/bitstream.h \
QRLib/mask.h \
QRLib/qrencode.h \
QRLib/qrinput.h \
QRLib/QRService.h \
QRLib/qrspec.h \
QRLib/rscode.h \
QRLib/split.h \
QRLib/UIImage+QRCode.h \
CWorkThread.h
FORMS += mainwindow.ui
DISTFILES += \
QRLib/QRService.m \
QRLib/UIImage+QRCode.m
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.0.2, 2017-06-20T16:43:55. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{14e33104-6466-4286-b42e-75341ff76d7e}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.0 clang 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.0 clang 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.clang_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/macdq02/Downloads/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/macdq02/Downloads/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/macdq02/Downloads/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">在本地部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">SNCreater</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">SNCreater2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/Users/macdq02/Qt5.7.0/SNCreater/SNCreater/SNCreater.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">SNCreater.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/Users/macdq02/Downloads/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Debug/SNCreater.app/Contents/MacOS</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.0.2, 2017-05-31T14:40:08. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{6c780dc4-b204-4439-8e32-2fe228cafb0d}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="int">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap"/>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.7.0 clang 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.7.0 clang 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.57.clang_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/emA/QtProjects/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/emA/QtProjects/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">false</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/Users/emA/QtProjects/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">qmake</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.LinkQmlDebuggingLibrary">true</value>
<value type="QString" key="QtProjectManager.QMakeBuildStep.QMakeArguments"></value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.SeparateDebugInfo">true</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.UseQtQuickCompiler">false</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">false</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments"></value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Make</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<valuelist type="QVariantList" key="Qt4ProjectManager.MakeStep.AutomaticallyAddedMakeArguments">
<value type="QString">-w</value>
<value type="QString">-r</value>
</valuelist>
<value type="bool" key="Qt4ProjectManager.MakeStep.Clean">true</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">在本地部署</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">SNCreater</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/Users/emA/QtProjects/SNCreater/SNCreater/SNCreater.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">SNCreater.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">/Users/emA/QtProjects/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Debug/SNCreater.app/Contents/MacOS</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="int">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">18</value>
</data>
<data>
<variable>Version</variable>
<value type="int">18</value>
</data>
</qtcreator>
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QString>
#include <QFileDialog>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::onSetImageView(QString path)
{
QImage * img = new QImage;
if(img->load(path))
{
QPixmap pm = QPixmap::fromImage(*img);
ui->imgView->setPixmap(pm);
m_pThread->ShowCompleted();
}
delete img;
}
void MainWindow::on_BTSelectFile_clicked()
{
QString filePath = QFileDialog::getOpenFileName(0, tr("选择数据源"));
//std::string srcFile = filePath.toLocal8Bit().data();
ui->EDT_SrcPath->setText(filePath);
//QString outFilePath = QString::fromLocal8Bit(srcFile.c_str());
m_pThread = new CWorkThread(filePath);
connect(m_pThread, SIGNAL(onProcess(QString)), ui->TL_outInfo, SLOT(setText(QString)));
connect(m_pThread, SIGNAL(onCompleted(QString)), this, SLOT(onSetImageView(QString)));
connect(m_pThread, SIGNAL(onError(QString)), this, SLOT(onError(QString)));
m_pThread->start();
}
void MainWindow::onError(QString err)
{
QMessageBox msgBox(QMessageBox::Warning, tr("提示"), err, 0, this);
msgBox.addButton(QMessageBox::Ok);
msgBox.exec();
}
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QMessageBox>
#include <CWorkThread.h>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private slots:
void on_BTSelectFile_clicked();
void onSetImageView(QString path);
void onError(QString);
private:
Ui::MainWindow *ui;
CWorkThread * m_pThread;
};
#endif // MAINWINDOW_H
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>483</width>
<height>269</height>
</rect>
</property>
<property name="windowTitle">
<string>SNCreater</string>
</property>
<widget class="QWidget" name="centralWidget">
<widget class="QPushButton" name="BTSelectFile">
<property name="enabled">
<bool>true</bool>
</property>
<property name="geometry">
<rect>
<x>390</x>
<y>7</y>
<width>80</width>
<height>35</height>
</rect>
</property>
<property name="text">
<string>浏览</string>
</property>
</widget>
<widget class="QLabel" name="label">
<property name="geometry">
<rect>
<x>20</x>
<y>10</y>
<width>41</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string>数据源</string>
</property>
</widget>
<widget class="QLineEdit" name="EDT_SrcPath">
<property name="geometry">
<rect>
<x>70</x>
<y>10</y>
<width>316</width>
<height>24</height>
</rect>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
<widget class="QScrollArea" name="scrollArea">
<property name="geometry">
<rect>
<x>70</x>
<y>50</y>
<width>316</width>
<height>166</height>
</rect>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="lineWidth">
<number>1</number>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>314</width>
<height>164</height>
</rect>
</property>
<widget class="QSplitter" name="splitter_2">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>315</width>
<height>165</height>
</rect>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<widget class="QSplitter" name="splitter">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<widget class="QLabel" name="imgView">
<property name="text">
<string/>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</widget>
</widget>
</widget>
</widget>
<widget class="QLabel" name="TL_outInfo">
<property name="geometry">
<rect>
<x>20</x>
<y>230</y>
<width>441</width>
<height>24</height>
</rect>
</property>
<property name="text">
<string/>
</property>
</widget>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>483</width>
<height>25</height>
</rect>
</property>
</widget>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
QMAKE_DEFAULT_INCDIRS = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include \
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include \
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)"
QMAKE_DEFAULT_LIBDIRS = \
/lib \
/usr/lib
QMAKE_XCODE_DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer
QMAKE_XCODE_VERSION = 8.3.2
QMAKE_MAC_SDK.macosx.Path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
QMAKE_MAC_SDK.macosx.PlatformPath = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
QMAKE_MAC_SDK.macosx.SDKVersion = 10.12
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_FIX_RPATH = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool \
-id
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_AR = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar \
cq
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_RANLIB = \
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib \
-s
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK_SHLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
#############################################################################
# Makefile for building: SNCreater.app/Contents/MacOS/SNCreater
# Generated by qmake (3.0) (Qt 5.7.0)
# Project: ../SNCreater/SNCreater.pro
# Template: app
# Command: /Users/macdq02/Qt5.7.0/5.7/clang_64/bin/qmake -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ../SNCreater/SNCreater.pro
#############################################################################
MAKEFILE = Makefile
####### Compiler, tools and options
CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
DEFINES = -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB
CFLAGS = -pipe -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -Wall -W -fPIC $(DEFINES)
CXXFLAGS = -pipe -stdlib=libc++ -g -std=gnu++11 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -Wall -W -fPIC $(DEFINES)
INCPATH = -I../SNCreater -I. -I../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers -I../../../Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers -I../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang -F/Users/macdq02/Qt5.7.0/5.7/clang_64/lib
QMAKE = /Users/macdq02/Qt5.7.0/5.7/clang_64/bin/qmake
DEL_FILE = rm -f
CHK_DIR_EXISTS= test -d
MKDIR = mkdir -p
COPY = cp -f
COPY_FILE = cp -f
COPY_DIR = cp -f -R
INSTALL_FILE = install -m 644 -p
INSTALL_PROGRAM = install -m 755 -p
INSTALL_DIR = cp -f -R
DEL_FILE = rm -f
SYMLINK = ln -f -s
DEL_DIR = rmdir
MOVE = mv -f
TAR = tar -cf
COMPRESS = gzip -9f
DISTNAME = SNCreater1.0.0
DISTDIR = /Users/macdq02/Downloads/SNCreater/build-SNCreater-Desktop_Qt_5_7_0_clang_64bit-Debug/.tmp/SNCreater1.0.0
LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
LFLAGS = -headerpad_max_install_names -stdlib=libc++ -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.8 -Wl,-rpath,/Users/macdq02/Qt5.7.0/5.7/clang_64/lib
LIBS = $(SUBLIBS) -F/Users/macdq02/Qt5.7.0/5.7/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
AR = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cq
RANLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib -s
SED = sed
STRIP = strip
####### Output directory
OBJECTS_DIR = ./
####### Files
SOURCES = ../SNCreater/main.cpp \
../SNCreater/mainwindow.cpp \
../SNCreater/CImageCreater.cpp \
../SNCreater/QRLib/bitstream.c \
../SNCreater/QRLib/mask.c \
../SNCreater/QRLib/qrencode.c \
../SNCreater/QRLib/qrinput.c \
../SNCreater/QRLib/qrspec.c \
../SNCreater/QRLib/rscode.c \
../SNCreater/QRLib/split.c \
../SNCreater/CWorkThread.cpp moc_mainwindow.cpp \
moc_CWorkThread.cpp
OBJECTS = main.o \
mainwindow.o \
CImageCreater.o \
bitstream.o \
mask.o \
qrencode.o \
qrinput.o \
qrspec.o \
rscode.o \
split.o \
CWorkThread.o \
moc_mainwindow.o \
moc_CWorkThread.o
DIST = ../SNCreater/QRLib/QRService.m \
../SNCreater/QRLib/UIImage+QRCode.m \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/qdevice.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/device_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/unix.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/macx.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/sanitize.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base-mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang-mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/qconfig.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_clucene_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_packetprotocol_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldebug_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quicktemplates2_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uiplugin.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_functions.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang/qmake.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_post.prf \
../SNCreater/.qmake.stash \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exclusive_builds.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resolve_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_post.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/sdk.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_post.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/objective_c.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qml_debug.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/warn_on.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resources.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/moc.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/opengl.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/uic.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/thread.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/file_copies.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/rez.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/testcase_targets.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exceptions.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/yacc.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/lex.prf \
../SNCreater/SNCreater.pro ../SNCreater/mainwindow.h \
../SNCreater/CImageCreater.h \
../SNCreater/QRLib/bitstream.h \
../SNCreater/QRLib/mask.h \
../SNCreater/QRLib/qrencode.h \
../SNCreater/QRLib/qrinput.h \
../SNCreater/QRLib/QRService.h \
../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/rscode.h \
../SNCreater/QRLib/split.h \
../SNCreater/QRLib/UIImage+QRCode.h \
../SNCreater/CWorkThread.h ../SNCreater/main.cpp \
../SNCreater/mainwindow.cpp \
../SNCreater/CImageCreater.cpp \
../SNCreater/QRLib/bitstream.c \
../SNCreater/QRLib/mask.c \
../SNCreater/QRLib/qrencode.c \
../SNCreater/QRLib/qrinput.c \
../SNCreater/QRLib/qrspec.c \
../SNCreater/QRLib/rscode.c \
../SNCreater/QRLib/split.c \
../SNCreater/CWorkThread.cpp
QMAKE_TARGET = SNCreater
DESTDIR =
TARGET = SNCreater.app/Contents/MacOS/SNCreater
first: all
####### Build rules
$(TARGET): ui_mainwindow.h $(OBJECTS)
@test -d SNCreater.app/Contents/MacOS/ || mkdir -p SNCreater.app/Contents/MacOS/
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: ../SNCreater/SNCreater.pro ../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang/qmake.conf ../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/qdevice.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/device_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/unix.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/macx.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/sanitize.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base-mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang-mac.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/qconfig.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_clucene_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_packetprotocol_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldebug_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quicktemplates2_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uiplugin.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_functions.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang/qmake.conf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_post.prf \
.qmake.stash \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exclusive_builds.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_pre.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resolve_config.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_post.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/sdk.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_post.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/objective_c.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qml_debug.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/warn_on.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resources.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/moc.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/opengl.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/uic.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/thread.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/file_copies.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/rez.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/testcase_targets.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exceptions.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/yacc.prf \
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/lex.prf \
../SNCreater/SNCreater.pro \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/QtWidgets.prl \
../../../Qt5.7.0/5.7/clang_64/lib/QtGui.framework/QtGui.prl \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/QtCore.prl
$(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ../SNCreater/SNCreater.pro
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_pre.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/qdevice.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/device_config.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/unix.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/mac.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/macx.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/sanitize.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/gcc-base-mac.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/common/clang-mac.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/qconfig.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dcore_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dextras_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dinput_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dlogic_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquick_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickextras_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickinput_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3dquickrender_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_3drender_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bluetooth_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_bootstrap_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_charts_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_clucene_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_concurrent_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_core_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_datavisualization_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_dbus_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designer_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_designercomponents_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gamepad_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_gui_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_help_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_location_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_macextras_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimedia_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_multimediawidgets_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_network_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_nfc_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_opengl_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_openglextensions_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_packetprotocol_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_platformsupport_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_positioning_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_printsupport_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_purchasing_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qml_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldebug_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmldevtools_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qmltest_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quick_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickcontrols2_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickparticles_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quicktemplates2_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_quickwidgets_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_script_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scripttools_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_scxml_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sensors_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialbus_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_serialport_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_sql_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_svg_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_testlib_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uiplugin.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_uitools_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webchannel_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webengine_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecore_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginecoreheaders_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webenginewidgets_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_websockets_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_webview_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_widgets_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xml_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/modules/qt_lib_xmlpatterns_private.pri:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_functions.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt_config.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang/qmake.conf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/spec_post.prf:
.qmake.stash:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exclusive_builds.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_pre.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_pre.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resolve_config.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/default_post.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/sdk.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/default_post.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/objective_c.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qml_debug.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/warn_on.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/qt.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/resources.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/moc.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/opengl.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/uic.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/unix/thread.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/file_copies.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/mac/rez.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/testcase_targets.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/exceptions.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/yacc.prf:
../../../Qt5.7.0/5.7/clang_64/mkspecs/features/lex.prf:
../SNCreater/SNCreater.pro:
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/QtWidgets.prl:
../../../Qt5.7.0/5.7/clang_64/lib/QtGui.framework/QtGui.prl:
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/QtCore.prl:
qmake: FORCE
@$(QMAKE) -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug -o Makefile ../SNCreater/SNCreater.pro
qmake_all: FORCE
SNCreater.app/Contents/PkgInfo:
@test -d SNCreater.app/Contents || mkdir -p SNCreater.app/Contents
@$(DEL_FILE) SNCreater.app/Contents/PkgInfo
@echo "APPL????" > SNCreater.app/Contents/PkgInfo
SNCreater.app/Contents/Resources/empty.lproj:
@test -d SNCreater.app/Contents/Resources || mkdir -p SNCreater.app/Contents/Resources
@touch SNCreater.app/Contents/Resources/empty.lproj
SNCreater.app/Contents/Info.plist:
@test -d SNCreater.app/Contents || mkdir -p SNCreater.app/Contents
@$(DEL_FILE) SNCreater.app/Contents/Info.plist
@sed -e "s,@SHORT_VERSION@,1.0,g" -e "s,@FULL_VERSION@,1.0.0,g" -e "s,@TYPEINFO@,????,g" -e "s,@BUNDLEIDENTIFIER@,com.duqian.SNCreater,g" -e "s,@ICON@,,g" -e "s,@EXECUTABLE@,SNCreater,g" -e "s,@LIBRARY@,SNCreater,g" -e "s,@TYPEINFO@,????,g" ../../../Qt5.7.0/5.7/clang_64/mkspecs/macx-clang/Info.plist.app >SNCreater.app/Contents/Info.plist
all: Makefile \
SNCreater.app/Contents/PkgInfo \
SNCreater.app/Contents/Resources/empty.lproj \
SNCreater.app/Contents/Info.plist $(TARGET)
dist: distdir FORCE
(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar) && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)
distdir: FORCE
@test -d $(DISTDIR) || mkdir -p $(DISTDIR)
$(COPY_FILE) --parents $(DIST) $(DISTDIR)/
$(COPY_FILE) --parents ../SNCreater/mainwindow.h ../SNCreater/CImageCreater.h ../SNCreater/QRLib/bitstream.h ../SNCreater/QRLib/mask.h ../SNCreater/QRLib/qrencode.h ../SNCreater/QRLib/qrinput.h ../SNCreater/QRLib/QRService.h ../SNCreater/QRLib/qrspec.h ../SNCreater/QRLib/rscode.h ../SNCreater/QRLib/split.h ../SNCreater/QRLib/UIImage+QRCode.h ../SNCreater/CWorkThread.h $(DISTDIR)/
$(COPY_FILE) --parents ../SNCreater/main.cpp ../SNCreater/mainwindow.cpp ../SNCreater/CImageCreater.cpp ../SNCreater/QRLib/bitstream.c ../SNCreater/QRLib/mask.c ../SNCreater/QRLib/qrencode.c ../SNCreater/QRLib/qrinput.c ../SNCreater/QRLib/qrspec.c ../SNCreater/QRLib/rscode.c ../SNCreater/QRLib/split.c ../SNCreater/CWorkThread.cpp $(DISTDIR)/
$(COPY_FILE) --parents ../SNCreater/mainwindow.ui $(DISTDIR)/
clean: compiler_clean
-$(DEL_FILE) $(OBJECTS)
-$(DEL_FILE) *~ core *.core
distclean: clean
-$(DEL_FILE) -r SNCreater.app
-$(DEL_FILE) .qmake.stash
-$(DEL_FILE) Makefile
####### Sub-libraries
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
check: first
benchmark: first
compiler_rcc_make_all:
compiler_rcc_clean:
compiler_moc_header_make_all: moc_mainwindow.cpp moc_CWorkThread.cpp
compiler_moc_header_clean:
-$(DEL_FILE) moc_mainwindow.cpp moc_CWorkThread.cpp
moc_mainwindow.cpp: ../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMessageBox \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmessagebox.h \
../SNCreater/CWorkThread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QDebug \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qdebug.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QThread \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qthread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QString \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qstring.h \
../SNCreater/CImageCreater.h \
../SNCreater/mainwindow.h \
../../../Qt5.7.0/5.7/clang_64/bin/moc
/Users/macdq02/Qt5.7.0/5.7/clang_64/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/Users/macdq02/Qt5.7.0/5.7/clang_64/mkspecs/macx-clang -I/Users/macdq02/Downloads/SNCreater/SNCreater -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -I'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)' -F/Users/macdq02/Qt5.7.0/5.7/clang_64/lib ../SNCreater/mainwindow.h -o moc_mainwindow.cpp
moc_CWorkThread.cpp: ../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QDebug \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qdebug.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QThread \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qthread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QString \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qstring.h \
../SNCreater/CImageCreater.h \
../SNCreater/CWorkThread.h \
../../../Qt5.7.0/5.7/clang_64/bin/moc
/Users/macdq02/Qt5.7.0/5.7/clang_64/bin/moc $(DEFINES) -D__APPLE__ -D__GNUC__=4 -D__APPLE_CC__ -I/Users/macdq02/Qt5.7.0/5.7/clang_64/mkspecs/macx-clang -I/Users/macdq02/Downloads/SNCreater/SNCreater -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers -I/Users/macdq02/Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -I'/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks (framework directory)' -F/Users/macdq02/Qt5.7.0/5.7/clang_64/lib ../SNCreater/CWorkThread.h -o moc_CWorkThread.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
compiler_uic_make_all: ui_mainwindow.h
compiler_uic_clean:
-$(DEL_FILE) ui_mainwindow.h
ui_mainwindow.h: ../SNCreater/mainwindow.ui \
../../../Qt5.7.0/5.7/clang_64/bin/uic
/Users/macdq02/Qt5.7.0/5.7/clang_64/bin/uic ../SNCreater/mainwindow.ui -o ui_mainwindow.h
compiler_rez_source_make_all:
compiler_rez_source_clean:
compiler_yacc_decl_make_all:
compiler_yacc_decl_clean:
compiler_yacc_impl_make_all:
compiler_yacc_impl_clean:
compiler_lex_make_all:
compiler_lex_clean:
compiler_clean: compiler_moc_header_clean compiler_uic_clean
####### Compile
main.o: ../SNCreater/main.cpp ../SNCreater/mainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMessageBox \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmessagebox.h \
../SNCreater/CWorkThread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QDebug \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qdebug.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QThread \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qthread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QString \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qstring.h \
../SNCreater/CImageCreater.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QApplication \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qapplication.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../SNCreater/main.cpp
mainwindow.o: ../SNCreater/mainwindow.cpp ../SNCreater/mainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMainWindow \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QMessageBox \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qmessagebox.h \
../SNCreater/CWorkThread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QDebug \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qdebug.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QThread \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qthread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QString \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qstring.h \
../SNCreater/CImageCreater.h \
ui_mainwindow.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/QFileDialog \
../../../Qt5.7.0/5.7/clang_64/lib/QtWidgets.framework/Headers/qfiledialog.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o ../SNCreater/mainwindow.cpp
CImageCreater.o: ../SNCreater/CImageCreater.cpp ../SNCreater/CImageCreater.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o CImageCreater.o ../SNCreater/CImageCreater.cpp
bitstream.o: ../SNCreater/QRLib/bitstream.c ../SNCreater/QRLib/bitstream.h
$(CC) -c $(CFLAGS) $(INCPATH) -o bitstream.o ../SNCreater/QRLib/bitstream.c
mask.o: ../SNCreater/QRLib/mask.c ../SNCreater/QRLib/qrencode.h \
../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/mask.h \
../SNCreater/QRLib/qrinput.h \
../SNCreater/QRLib/bitstream.h
$(CC) -c $(CFLAGS) $(INCPATH) -o mask.o ../SNCreater/QRLib/mask.c
qrencode.o: ../SNCreater/QRLib/qrencode.c ../SNCreater/QRLib/qrencode.h \
../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/bitstream.h \
../SNCreater/QRLib/qrinput.h \
../SNCreater/QRLib/rscode.h \
../SNCreater/QRLib/split.h \
../SNCreater/QRLib/mask.h
$(CC) -c $(CFLAGS) $(INCPATH) -o qrencode.o ../SNCreater/QRLib/qrencode.c
qrinput.o: ../SNCreater/QRLib/qrinput.c ../SNCreater/QRLib/qrencode.h \
../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/bitstream.h \
../SNCreater/QRLib/qrinput.h
$(CC) -c $(CFLAGS) $(INCPATH) -o qrinput.o ../SNCreater/QRLib/qrinput.c
qrspec.o: ../SNCreater/QRLib/qrspec.c ../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/qrencode.h
$(CC) -c $(CFLAGS) $(INCPATH) -o qrspec.o ../SNCreater/QRLib/qrspec.c
rscode.o: ../SNCreater/QRLib/rscode.c ../SNCreater/QRLib/rscode.h
$(CC) -c $(CFLAGS) $(INCPATH) -o rscode.o ../SNCreater/QRLib/rscode.c
split.o: ../SNCreater/QRLib/split.c ../SNCreater/QRLib/qrencode.h \
../SNCreater/QRLib/qrinput.h \
../SNCreater/QRLib/bitstream.h \
../SNCreater/QRLib/qrspec.h \
../SNCreater/QRLib/split.h
$(CC) -c $(CFLAGS) $(INCPATH) -o split.o ../SNCreater/QRLib/split.c
CWorkThread.o: ../SNCreater/CWorkThread.cpp ../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QTextStream \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qtextstream.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers/QPainter \
../../../Qt5.7.0/5.7/clang_64/lib/QtGui.framework/Headers/qpainter.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QThread \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qthread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QFile \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qfile.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QCoreApplication \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qcoreapplication.h \
../SNCreater/CWorkThread.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QDebug \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qdebug.h \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/QString \
../../../Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qstring.h \
../SNCreater/CImageCreater.h \
../SNCreater/QRLib/qrencode.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o CWorkThread.o ../SNCreater/CWorkThread.cpp
moc_mainwindow.o: moc_mainwindow.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwindow.o moc_mainwindow.cpp
moc_CWorkThread.o: moc_CWorkThread.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_CWorkThread.o moc_CWorkThread.cpp
####### Install
install: FORCE
uninstall: FORCE
FORCE:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>Created by Qt/QMake</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>SNCreater</string>
<key>CFBundleIdentifier</key>
<string>com.duqian.SNCreater</string>
<key>NOTE</key>
<string>This file was generated by Qt/QMake.</string>
</dict>
</plist>
/****************************************************************************
** Meta object code from reading C++ file 'CWorkThread.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.7.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../SNCreater/CWorkThread.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'CWorkThread.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.7.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_CWorkThread_t {
QByteArrayData data[5];
char stringdata0[43];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_CWorkThread_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_CWorkThread_t qt_meta_stringdata_CWorkThread = {
{
QT_MOC_LITERAL(0, 0, 11), // "CWorkThread"
QT_MOC_LITERAL(1, 12, 9), // "onProcess"
QT_MOC_LITERAL(2, 22, 0), // ""
QT_MOC_LITERAL(3, 23, 11), // "onCompleted"
QT_MOC_LITERAL(4, 35, 7) // "onError"
},
"CWorkThread\0onProcess\0\0onCompleted\0"
"onError"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_CWorkThread[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
3, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
3, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 29, 2, 0x06 /* Public */,
3, 1, 32, 2, 0x06 /* Public */,
4, 1, 35, 2, 0x06 /* Public */,
// signals: parameters
QMetaType::Void, QMetaType::QString, 2,
QMetaType::Void, QMetaType::QString, 2,
QMetaType::Void, QMetaType::QString, 2,
0 // eod
};
void CWorkThread::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
CWorkThread *_t = static_cast<CWorkThread *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->onProcess((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 1: _t->onCompleted((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 2: _t->onError((*reinterpret_cast< QString(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (CWorkThread::*_t)(QString );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&CWorkThread::onProcess)) {
*result = 0;
return;
}
}
{
typedef void (CWorkThread::*_t)(QString );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&CWorkThread::onCompleted)) {
*result = 1;
return;
}
}
{
typedef void (CWorkThread::*_t)(QString );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&CWorkThread::onError)) {
*result = 2;
return;
}
}
}
}
const QMetaObject CWorkThread::staticMetaObject = {
{ &QThread::staticMetaObject, qt_meta_stringdata_CWorkThread.data,
qt_meta_data_CWorkThread, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
};
const QMetaObject *CWorkThread::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *CWorkThread::qt_metacast(const char *_clname)
{
if (!_clname) return Q_NULLPTR;
if (!strcmp(_clname, qt_meta_stringdata_CWorkThread.stringdata0))
return static_cast<void*>(const_cast< CWorkThread*>(this));
return QThread::qt_metacast(_clname);
}
int CWorkThread::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QThread::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 3)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 3;
}
return _id;
}
// SIGNAL 0
void CWorkThread::onProcess(QString _t1)
{
void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
// SIGNAL 1
void CWorkThread::onCompleted(QString _t1)
{
void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 1, _a);
}
// SIGNAL 2
void CWorkThread::onError(QString _t1)
{
void *_a[] = { Q_NULLPTR, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 2, _a);
}
QT_END_MOC_NAMESPACE
/****************************************************************************
** Meta object code from reading C++ file 'mainwindow.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.7.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../SNCreater/mainwindow.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'mainwindow.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.7.0. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_MainWindow_t {
QByteArrayData data[6];
char stringdata0[64];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
qptrdiff(offsetof(qt_meta_stringdata_MainWindow_t, stringdata0) + ofs \
- idx * sizeof(QByteArrayData)) \
)
static const qt_meta_stringdata_MainWindow_t qt_meta_stringdata_MainWindow = {
{
QT_MOC_LITERAL(0, 0, 10), // "MainWindow"
QT_MOC_LITERAL(1, 11, 23), // "on_BTSelectFile_clicked"
QT_MOC_LITERAL(2, 35, 0), // ""
QT_MOC_LITERAL(3, 36, 14), // "onSetImageView"
QT_MOC_LITERAL(4, 51, 4), // "path"
QT_MOC_LITERAL(5, 56, 7) // "onError"
},
"MainWindow\0on_BTSelectFile_clicked\0\0"
"onSetImageView\0path\0onError"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_MainWindow[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
3, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
0, // signalCount
// slots: name, argc, parameters, tag, flags
1, 0, 29, 2, 0x08 /* Private */,
3, 1, 30, 2, 0x08 /* Private */,
5, 1, 33, 2, 0x08 /* Private */,
// slots: parameters
QMetaType::Void,
QMetaType::Void, QMetaType::QString, 4,
QMetaType::Void, QMetaType::QString, 2,
0 // eod
};
void MainWindow::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
MainWindow *_t = static_cast<MainWindow *>(_o);
Q_UNUSED(_t)
switch (_id) {
case 0: _t->on_BTSelectFile_clicked(); break;
case 1: _t->onSetImageView((*reinterpret_cast< QString(*)>(_a[1]))); break;
case 2: _t->onError((*reinterpret_cast< QString(*)>(_a[1]))); break;
default: ;
}
}
}
const QMetaObject MainWindow::staticMetaObject = {
{ &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow.data,
qt_meta_data_MainWindow, qt_static_metacall, Q_NULLPTR, Q_NULLPTR}
};
const QMetaObject *MainWindow::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *MainWindow::qt_metacast(const char *_clname)
{
if (!_clname) return Q_NULLPTR;
if (!strcmp(_clname, qt_meta_stringdata_MainWindow.stringdata0))
return static_cast<void*>(const_cast< MainWindow*>(this));
return QMainWindow::qt_metacast(_clname);
}
int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QMainWindow::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 3)
qt_static_metacall(this, _c, _id, _a);
_id -= 3;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 3)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 3;
}
return _id;
}
QT_END_MOC_NAMESPACE
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
** Created by: Qt User Interface Compiler version 5.7.0
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
********************************************************************************/
#ifndef UI_MAINWINDOW_H
#define UI_MAINWINDOW_H
#include <QtCore/QVariant>
#include <QtWidgets/QAction>
#include <QtWidgets/QApplication>
#include <QtWidgets/QButtonGroup>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QLabel>
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QMainWindow>
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QScrollArea>
#include <QtWidgets/QSplitter>
#include <QtWidgets/QWidget>
QT_BEGIN_NAMESPACE
class Ui_MainWindow
{
public:
QWidget *centralWidget;
QPushButton *BTSelectFile;
QLabel *label;
QLineEdit *EDT_SrcPath;
QScrollArea *scrollArea;
QWidget *scrollAreaWidgetContents;
QSplitter *splitter_2;
QSplitter *splitter;
QLabel *imgView;
QLabel *TL_outInfo;
QMenuBar *menuBar;
void setupUi(QMainWindow *MainWindow)
{
if (MainWindow->objectName().isEmpty())
MainWindow->setObjectName(QStringLiteral("MainWindow"));
MainWindow->resize(483, 269);
centralWidget = new QWidget(MainWindow);
centralWidget->setObjectName(QStringLiteral("centralWidget"));
BTSelectFile = new QPushButton(centralWidget);
BTSelectFile->setObjectName(QStringLiteral("BTSelectFile"));
BTSelectFile->setEnabled(true);
BTSelectFile->setGeometry(QRect(390, 7, 80, 35));
label = new QLabel(centralWidget);
label->setObjectName(QStringLiteral("label"));
label->setGeometry(QRect(20, 10, 41, 24));
EDT_SrcPath = new QLineEdit(centralWidget);
EDT_SrcPath->setObjectName(QStringLiteral("EDT_SrcPath"));
EDT_SrcPath->setGeometry(QRect(70, 10, 316, 24));
EDT_SrcPath->setReadOnly(true);
scrollArea = new QScrollArea(centralWidget);
scrollArea->setObjectName(QStringLiteral("scrollArea"));
scrollArea->setGeometry(QRect(70, 50, 316, 166));
scrollArea->setFrameShape(QFrame::StyledPanel);
scrollArea->setLineWidth(1);
scrollArea->setWidgetResizable(true);
scrollArea->setAlignment(Qt::AlignCenter);
scrollAreaWidgetContents = new QWidget();
scrollAreaWidgetContents->setObjectName(QStringLiteral("scrollAreaWidgetContents"));
scrollAreaWidgetContents->setGeometry(QRect(0, 0, 314, 164));
splitter_2 = new QSplitter(scrollAreaWidgetContents);
splitter_2->setObjectName(QStringLiteral("splitter_2"));
splitter_2->setGeometry(QRect(0, 0, 315, 165));
splitter_2->setOrientation(Qt::Horizontal);
splitter = new QSplitter(splitter_2);
splitter->setObjectName(QStringLiteral("splitter"));
splitter->setOrientation(Qt::Vertical);
imgView = new QLabel(splitter);
imgView->setObjectName(QStringLiteral("imgView"));
imgView->setScaledContents(true);
imgView->setAlignment(Qt::AlignCenter);
splitter->addWidget(imgView);
splitter_2->addWidget(splitter);
scrollArea->setWidget(scrollAreaWidgetContents);
TL_outInfo = new QLabel(centralWidget);
TL_outInfo->setObjectName(QStringLiteral("TL_outInfo"));
TL_outInfo->setGeometry(QRect(20, 230, 441, 24));
MainWindow->setCentralWidget(centralWidget);
menuBar = new QMenuBar(MainWindow);
menuBar->setObjectName(QStringLiteral("menuBar"));
menuBar->setGeometry(QRect(0, 0, 483, 25));
MainWindow->setMenuBar(menuBar);
retranslateUi(MainWindow);
QMetaObject::connectSlotsByName(MainWindow);
} // setupUi
void retranslateUi(QMainWindow *MainWindow)
{
MainWindow->setWindowTitle(QApplication::translate("MainWindow", "SNCreater", 0));
BTSelectFile->setText(QApplication::translate("MainWindow", "\346\265\217\350\247\210", 0));
label->setText(QApplication::translate("MainWindow", "\346\225\260\346\215\256\346\272\220", 0));
imgView->setText(QString());
TL_outInfo->setText(QString());
} // retranslateUi
};
namespace Ui {
class MainWindow: public Ui_MainWindow {};
} // namespace Ui
QT_END_NAMESPACE
#endif // UI_MAINWINDOW_H
123,05742856
124,05742857
125,05742858
126,05742859
127,05742860
128,05742861
129,05742862
130,05742863
131,05742864
132,05742865
133,05742866
134,05742867
135,05742868
136,05742869
137,05742870
138,05742871
139,05742872
140,05742873
141,05742874
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment