rqr 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +1 -0
- data/README.txt +6 -0
- data/Rakefile +1 -0
- data/config/hoe.rb +18 -2
- data/ext/rqr/QR_Encode.cpp +199 -199
- data/ext/rqr/QR_Encode.h +47 -47
- data/ext/rqr/extconf.rb +8 -1
- data/ext/rqr/qr_draw.h +23 -9
- data/ext/rqr/qr_draw_jpeg.cpp +6 -33
- data/ext/rqr/qr_draw_jpeg.h +3 -3
- data/ext/rqr/qr_draw_png.cpp +13 -40
- data/ext/rqr/qr_draw_png.h +3 -3
- data/ext/rqr/qr_draw_ps.cpp +17 -24
- data/ext/rqr/qr_draw_ps.h +3 -2
- data/ext/rqr/qr_draw_tiff.cpp +19 -46
- data/ext/rqr/qr_draw_tiff.h +3 -3
- data/ext/rqr/qr_wrap.cxx +60 -71
- data/lib/rqr/qrcode.rb +1 -0
- data/lib/rqr/version.rb +2 -2
- metadata +2 -2
data/ext/rqr/qr_draw_ps.cpp
CHANGED
@@ -1,12 +1,5 @@
|
|
1
1
|
#include "qr_draw_ps.h"
|
2
2
|
|
3
|
-
//=================================================================================
|
4
|
-
// QRDrawPS::QRDrawPS
|
5
|
-
//=================================================================================
|
6
|
-
QRDrawPS::QRDrawPS()
|
7
|
-
{
|
8
|
-
}
|
9
|
-
|
10
3
|
//=============================================================================
|
11
4
|
// QRDrawPS::draw
|
12
5
|
//=============================================================================
|
@@ -46,34 +39,34 @@ int QRDrawPS::write2(unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE])
|
|
46
39
|
|
47
40
|
if((stream=fopen(this->filename, "wb")) == NULL) return(1);
|
48
41
|
|
49
|
-
/*
|
42
|
+
/* �_�~�[�w�b�_�[�������� */
|
50
43
|
this->write_header(stream);
|
51
44
|
|
52
|
-
/* TIFF
|
45
|
+
/* TIFF�������� */
|
53
46
|
this->write_preview(stream, data);
|
54
47
|
fclose(stream);
|
55
48
|
|
56
|
-
/* EPS
|
49
|
+
/* EPS�������� */
|
57
50
|
this->write(data, "a");
|
58
51
|
|
59
|
-
/* EPS
|
52
|
+
/* EPS�T�C�Y�Z�o */
|
60
53
|
stat(this->filename, &st);
|
61
54
|
unsigned int esize = st.st_size - (this->tsize+30);
|
62
55
|
|
63
|
-
/*
|
56
|
+
/* �w�b�_�[�������� */
|
64
57
|
if((stream=fopen(this->filename, "rb+")) == NULL) return(1);
|
65
58
|
|
66
|
-
/* PS
|
59
|
+
/* PS�J�n�ʒu */
|
67
60
|
fseek(stream, 4, SEEK_SET);
|
68
61
|
this->littleEndian(30+this->tsize, lt);
|
69
62
|
fprintf(stream, "%c%c%c%c", lt[0], lt[1], lt[2], lt[3]);
|
70
63
|
|
71
|
-
/* PS
|
64
|
+
/* PS�� */
|
72
65
|
fseek(stream, 8, SEEK_SET);
|
73
66
|
this->littleEndian(esize, lt);
|
74
67
|
fprintf(stream, "%c%c%c%c", lt[0], lt[1], lt[2], lt[3]);
|
75
68
|
|
76
|
-
/* TIFF
|
69
|
+
/* TIFF�v���r���[�� */
|
77
70
|
fseek(stream, 24, SEEK_SET);
|
78
71
|
this->littleEndian(this->tsize, lt);
|
79
72
|
fprintf(stream, "%c%c%c%c", lt[0], lt[1], lt[2], lt[3]);
|
@@ -93,27 +86,27 @@ void QRDrawPS::write_header(FILE *stream)
|
|
93
86
|
{
|
94
87
|
unsigned char lt[4];
|
95
88
|
|
96
|
-
/*
|
89
|
+
/* �i�~���j */
|
97
90
|
fprintf(stream, "%c%c%c%c", 0xC5, 0xD0, 0xD3, 0xC6);
|
98
91
|
|
99
|
-
/* PostScript
|
92
|
+
/* PostScript�J�n�ʒu */
|
100
93
|
fprintf(stream, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
|
101
94
|
|
102
|
-
/* PostScript
|
95
|
+
/* PostScript���� */
|
103
96
|
fprintf(stream, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
|
104
97
|
|
105
98
|
/* MetaFile */
|
106
99
|
fprintf(stream, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
|
107
100
|
fprintf(stream, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
|
108
101
|
|
109
|
-
/* TIFF
|
102
|
+
/* TIFF�v���r���[�J�n�ʒu */
|
110
103
|
littleEndian(30, lt);
|
111
104
|
fprintf(stream, "%c%c%c%c", lt[0], lt[1], lt[2], lt[3]);
|
112
105
|
|
113
|
-
/* TIFF
|
106
|
+
/* TIFF�v���r���[�� */
|
114
107
|
fprintf(stream, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00);
|
115
108
|
|
116
|
-
/*
|
109
|
+
/* �`�F�b�N�T�� */
|
117
110
|
fprintf(stream, "%c%c", 0xff, 0xff);
|
118
111
|
}
|
119
112
|
|
@@ -142,7 +135,7 @@ int QRDrawPS::write_preview(FILE *stream, unsigned char data[MAX_MODULESIZE][MAX
|
|
142
135
|
tmpnam(tmp);
|
143
136
|
if( tif.draw(tmp, this->msize, this->ssize, data, NULL) ) return(1);
|
144
137
|
|
145
|
-
/* TIFF
|
138
|
+
/* TIFF���I�[�v�����ăt�@�C���T�C�Y���擾���� */
|
146
139
|
if((t=fopen(tmp, "rb")) == NULL){
|
147
140
|
remove(tmp);
|
148
141
|
return(1);
|
@@ -151,7 +144,7 @@ int QRDrawPS::write_preview(FILE *stream, unsigned char data[MAX_MODULESIZE][MAX
|
|
151
144
|
this->tsize = ftell(t);
|
152
145
|
fseek(t, 0, SEEK_SET);
|
153
146
|
|
154
|
-
/* TIFF
|
147
|
+
/* TIFF�{�̂̏������� */
|
155
148
|
p = (unsigned char *)malloc(this->tsize);
|
156
149
|
fread(p, 1, this->tsize, t);
|
157
150
|
fwrite(p, 1, this->tsize, stream);
|
@@ -209,7 +202,7 @@ int QRDrawPS::write(unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE], char *mo
|
|
209
202
|
fprintf(stream, "1 setgray\n");
|
210
203
|
fprintf(stream, "fill\n");
|
211
204
|
|
212
|
-
//
|
205
|
+
// �h�b�g�`��
|
213
206
|
for(i=0; i<this->ssize; i++){
|
214
207
|
for(j=0; j<this->ssize; j++) fprintf(stream, "%d ", data[j][i]);
|
215
208
|
fprintf(stream, "\n");
|
data/ext/rqr/qr_draw_ps.h
CHANGED
@@ -13,7 +13,7 @@
|
|
13
13
|
#endif
|
14
14
|
|
15
15
|
//=============================================================================
|
16
|
-
// QRDrawPS
|
16
|
+
// QRDrawPS �N���X
|
17
17
|
//=============================================================================
|
18
18
|
class QRDrawPS : public QRDraw
|
19
19
|
{
|
@@ -28,7 +28,8 @@ class QRDrawPS : public QRDraw
|
|
28
28
|
void littleEndian(int data, unsigned char *lt);
|
29
29
|
|
30
30
|
public:
|
31
|
-
QRDrawPS()
|
31
|
+
QRDrawPS(){}
|
32
|
+
~QRDrawPS(){}
|
32
33
|
int draw(char *filename, int modulesize, int symbolsize,
|
33
34
|
unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE], void *opt);
|
34
35
|
};
|
data/ext/rqr/qr_draw_tiff.cpp
CHANGED
@@ -1,32 +1,5 @@
|
|
1
1
|
#include "qr_draw_tiff.h"
|
2
2
|
|
3
|
-
//=================================================================================
|
4
|
-
// QRDrawPNG::QRDrawPNG
|
5
|
-
//=================================================================================
|
6
|
-
QRDrawTIFF::QRDrawTIFF()
|
7
|
-
{
|
8
|
-
#ifdef USE_TIFF
|
9
|
-
bit_image = NULL;
|
10
|
-
#endif
|
11
|
-
}
|
12
|
-
|
13
|
-
//=================================================================================
|
14
|
-
// QRDrawTIFF::~QRDrawTIFF
|
15
|
-
//=================================================================================
|
16
|
-
QRDrawTIFF::~QRDrawTIFF()
|
17
|
-
{
|
18
|
-
#ifdef USE_TIFF
|
19
|
-
int i;
|
20
|
-
|
21
|
-
if(bit_image){
|
22
|
-
for(i=0; i<this->rsize; i++){
|
23
|
-
free(bit_image[i]);
|
24
|
-
}
|
25
|
-
free(bit_image);
|
26
|
-
}
|
27
|
-
#endif
|
28
|
-
}
|
29
|
-
|
30
3
|
//=============================================================================
|
31
4
|
// QRDrawPNG::draw
|
32
5
|
//=============================================================================
|
@@ -53,7 +26,7 @@ int QRDrawTIFF::raster(unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE])
|
|
53
26
|
#ifdef USE_TIFF
|
54
27
|
int bitw = (int)ceil(this->rsize/8) + 1;
|
55
28
|
|
56
|
-
/*
|
29
|
+
/* ���ۂɃf�[�^��u���̈���m�� */
|
57
30
|
bit_image = (unsigned char **)malloc(sizeof(unsigned char *) * this->rsize);
|
58
31
|
for(int i=0; i<this->rsize; i++){
|
59
32
|
bit_image[i] = (unsigned char *)malloc(bitw);
|
@@ -61,12 +34,12 @@ int QRDrawTIFF::raster(unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE])
|
|
61
34
|
}
|
62
35
|
|
63
36
|
for(int i=0; i<this->ssize; i++){
|
64
|
-
int dp = MARGIN_SIZE*this->msize / 8;
|
65
|
-
int sht =(MARGIN_SIZE*this->msize % 8) ? 3 : 7;
|
66
|
-
unsigned char c = 0; //1
|
37
|
+
int dp = MARGIN_SIZE*this->msize / 8; //�������̃o�C�g�ʒu
|
38
|
+
int sht =(MARGIN_SIZE*this->msize % 8) ? 3 : 7; //�r�b�g�V�t�g
|
39
|
+
unsigned char c = 0; //1�o�C�g�̍\����ۑ�
|
67
40
|
|
68
41
|
for(int j=0; j<this->ssize; j++){
|
69
|
-
/* 1
|
42
|
+
/* 1�s������ */
|
70
43
|
for(int k=0; k<this->msize; k++){
|
71
44
|
c += (data[j][i] << sht);
|
72
45
|
sht--;
|
@@ -80,7 +53,7 @@ int QRDrawTIFF::raster(unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE])
|
|
80
53
|
}
|
81
54
|
}
|
82
55
|
}
|
83
|
-
/*
|
56
|
+
/* ���W���[���T�C�Y���c�����ɑ��₷ */
|
84
57
|
for(int k=1; k<this->msize; k++){
|
85
58
|
memcpy(bit_image[(i+MARGIN_SIZE)*this->msize+k], bit_image[(i+MARGIN_SIZE)*this->msize], bitw);
|
86
59
|
}
|
@@ -104,21 +77,21 @@ int QRDrawTIFF::write()
|
|
104
77
|
/* Open the TIFF file */
|
105
78
|
if( (tiff=TIFFOpen(this->filename, "w")) == NULL ) return(1);
|
106
79
|
|
107
|
-
/*
|
108
|
-
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, this->rsize); /*
|
109
|
-
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, this->rsize); /*
|
110
|
-
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); /*
|
111
|
-
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 1); /*
|
112
|
-
TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); /*
|
113
|
-
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 1); /*
|
114
|
-
TIFFSetField(tiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); /*
|
80
|
+
/* �^�O */
|
81
|
+
TIFFSetField(tiff, TIFFTAG_IMAGEWIDTH, this->rsize); /* ��(�s�N�Z����) */
|
82
|
+
TIFFSetField(tiff, TIFFTAG_IMAGELENGTH, this->rsize); /* ��(�X�L�������C����) */
|
83
|
+
TIFFSetField(tiff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); /* ���k���[�h */
|
84
|
+
TIFFSetField(tiff, TIFFTAG_BITSPERSAMPLE, 1); /* �s�N�Z���̐[�� */
|
85
|
+
TIFFSetField(tiff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); /* �J���[�^�C�v */
|
86
|
+
TIFFSetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 1); /* �J���[�v���[���� */
|
87
|
+
TIFFSetField(tiff, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); /* �X�L�������� */
|
115
88
|
TIFFSetField(tiff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); /* ? */
|
116
|
-
TIFFSetField(tiff, TIFFTAG_XRESOLUTION, 72.0); /*
|
117
|
-
TIFFSetField(tiff, TIFFTAG_YRESOLUTION, 72.0); /*
|
118
|
-
TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); /*
|
119
|
-
TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, this->rsize); /* 1
|
89
|
+
TIFFSetField(tiff, TIFFTAG_XRESOLUTION, 72.0); /* �𑜓x */
|
90
|
+
TIFFSetField(tiff, TIFFTAG_YRESOLUTION, 72.0); /* �𑜓x */
|
91
|
+
TIFFSetField(tiff, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); /* �𑜓x�̒P��(RESUNIT_INCH:�C���`) */
|
92
|
+
TIFFSetField(tiff, TIFFTAG_ROWSPERSTRIP, this->rsize); /* 1�X�g���b�v�ɉ��s�i�[����邩 */
|
120
93
|
|
121
|
-
/* 1
|
94
|
+
/* 1�s���������� */
|
122
95
|
for(i=0 ; i<this->rsize ; i++){
|
123
96
|
if( TIFFWriteScanline(tiff, bit_image[i], i, 0) < 0 ){
|
124
97
|
TIFFClose(tiff);
|
data/ext/rqr/qr_draw_tiff.h
CHANGED
@@ -11,7 +11,7 @@
|
|
11
11
|
#endif
|
12
12
|
|
13
13
|
//=============================================================================
|
14
|
-
// QRDrawTIFF
|
14
|
+
// QRDrawTIFF �N���X
|
15
15
|
//=============================================================================
|
16
16
|
class QRDrawTIFF : public QRDraw
|
17
17
|
{
|
@@ -20,8 +20,8 @@ class QRDrawTIFF : public QRDraw
|
|
20
20
|
int write();
|
21
21
|
|
22
22
|
public:
|
23
|
-
QRDrawTIFF()
|
24
|
-
~QRDrawTIFF()
|
23
|
+
QRDrawTIFF(){}
|
24
|
+
~QRDrawTIFF(){}
|
25
25
|
int draw(char *filename, int modulesize, int symbolsize,
|
26
26
|
unsigned char data[MAX_MODULESIZE][MAX_MODULESIZE], void *opt);
|
27
27
|
};
|
data/ext/rqr/qr_wrap.cxx
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version 1.3.
|
3
|
+
* Version 1.3.29
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
@@ -119,7 +119,7 @@ private:
|
|
119
119
|
#endif
|
120
120
|
|
121
121
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
122
|
-
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
|
122
|
+
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
|
123
123
|
# define _CRT_SECURE_NO_DEPRECATE
|
124
124
|
#endif
|
125
125
|
|
@@ -216,7 +216,7 @@ private:
|
|
216
216
|
#endif
|
217
217
|
|
218
218
|
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
|
219
|
-
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
|
219
|
+
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER)
|
220
220
|
# define _CRT_SECURE_NO_DEPRECATE
|
221
221
|
#endif
|
222
222
|
|
@@ -229,7 +229,7 @@ private:
|
|
229
229
|
|
230
230
|
/* This should only be incremented when either the layout of swig_type_info changes,
|
231
231
|
or for whatever reason, the runtime changes incompatibly */
|
232
|
-
#define SWIG_RUNTIME_VERSION "
|
232
|
+
#define SWIG_RUNTIME_VERSION "2"
|
233
233
|
|
234
234
|
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
|
235
235
|
#ifdef SWIG_TYPE_TABLE
|
@@ -828,21 +828,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
828
828
|
#endif
|
829
829
|
#endif
|
830
830
|
|
831
|
-
/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
|
832
|
-
/* Define these for older versions so we can just write code the new way */
|
833
|
-
#ifndef RSTRING_LEN
|
834
|
-
# define RSTRING_LEN(x) RSTRING(x)->len
|
835
|
-
#endif
|
836
|
-
#ifndef RSTRING_PTR
|
837
|
-
# define RSTRING_PTR(x) RSTRING(x)->ptr
|
838
|
-
#endif
|
839
|
-
#ifndef RARRAY_LEN
|
840
|
-
# define RARRAY_LEN(x) RARRAY(x)->len
|
841
|
-
#endif
|
842
|
-
#ifndef RARRAY_PTR
|
843
|
-
# define RARRAY_PTR(x) RARRAY(x)->ptr
|
844
|
-
#endif
|
845
|
-
|
846
831
|
/*
|
847
832
|
* Need to be very careful about how these macros are defined, especially
|
848
833
|
* when compiling C++ code or C code with an ANSI C compiler.
|
@@ -886,10 +871,10 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
|
|
886
871
|
#define StringValue(s) RB_STRING_VALUE(s)
|
887
872
|
#endif
|
888
873
|
#ifndef StringValuePtr
|
889
|
-
#define StringValuePtr(s)
|
874
|
+
#define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
|
890
875
|
#endif
|
891
876
|
#ifndef StringValueLen
|
892
|
-
#define StringValueLen(s)
|
877
|
+
#define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
|
893
878
|
#endif
|
894
879
|
#ifndef SafeStringValue
|
895
880
|
#define SafeStringValue(v) do {\
|
@@ -1318,7 +1303,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
|
|
1318
1303
|
downcast methods. */
|
1319
1304
|
if (obj != Qnil) {
|
1320
1305
|
VALUE value = rb_iv_get(obj, "__swigtype__");
|
1321
|
-
char* type_name =
|
1306
|
+
char* type_name = RSTRING(value)->ptr;
|
1322
1307
|
|
1323
1308
|
if (strcmp(type->name, type_name) == 0) {
|
1324
1309
|
return obj;
|
@@ -1567,8 +1552,7 @@ static swig_module_info swig_module = {swig_types, 14, 0, 0, 0, 0};
|
|
1567
1552
|
|
1568
1553
|
static VALUE mQR;
|
1569
1554
|
|
1570
|
-
#define SWIGVERSION
|
1571
|
-
#define SWIG_VERSION SWIGVERSION
|
1555
|
+
#define SWIGVERSION 0x010329
|
1572
1556
|
|
1573
1557
|
|
1574
1558
|
#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a))
|
@@ -1610,7 +1594,7 @@ SWIG_From_int (int value)
|
|
1610
1594
|
|
1611
1595
|
|
1612
1596
|
SWIGINTERN swig_type_info*
|
1613
|
-
SWIG_pchar_descriptor(
|
1597
|
+
SWIG_pchar_descriptor()
|
1614
1598
|
{
|
1615
1599
|
static int init = 0;
|
1616
1600
|
static swig_type_info* info = 0;
|
@@ -1631,7 +1615,7 @@ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
|
|
1631
1615
|
|
1632
1616
|
char *cstr = STR2CSTR(obj);
|
1633
1617
|
|
1634
|
-
size_t size =
|
1618
|
+
size_t size = RSTRING(obj)->len + 1;
|
1635
1619
|
if (cptr) {
|
1636
1620
|
if (alloc) {
|
1637
1621
|
if (*alloc == SWIG_NEWOBJ) {
|
@@ -1776,7 +1760,7 @@ _wrap_QRDraw_setup(int argc, VALUE *argv, VALUE self) {
|
|
1776
1760
|
if (!SWIG_IsOK(res2)) {
|
1777
1761
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "setup" "', argument " "2"" of type '" "char *""'");
|
1778
1762
|
}
|
1779
|
-
arg2 =
|
1763
|
+
arg2 = buf2;
|
1780
1764
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
1781
1765
|
if (!SWIG_IsOK(ecode3)) {
|
1782
1766
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "setup" "', argument " "3"" of type '" "int""'");
|
@@ -1831,7 +1815,7 @@ _wrap_QRDraw_draw(int argc, VALUE *argv, VALUE self) {
|
|
1831
1815
|
if (!SWIG_IsOK(res2)) {
|
1832
1816
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "draw" "', argument " "2"" of type '" "char *""'");
|
1833
1817
|
}
|
1834
|
-
arg2 =
|
1818
|
+
arg2 = buf2;
|
1835
1819
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
1836
1820
|
if (!SWIG_IsOK(ecode3)) {
|
1837
1821
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "int""'");
|
@@ -1861,6 +1845,27 @@ fail:
|
|
1861
1845
|
}
|
1862
1846
|
|
1863
1847
|
|
1848
|
+
SWIGINTERN VALUE
|
1849
|
+
_wrap_QRDraw_close(int argc, VALUE *argv, VALUE self) {
|
1850
|
+
QRDraw *arg1 = (QRDraw *) 0 ;
|
1851
|
+
void *argp1 = 0 ;
|
1852
|
+
int res1 = 0 ;
|
1853
|
+
|
1854
|
+
if ((argc < 0) || (argc > 0)) {
|
1855
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
|
1856
|
+
}
|
1857
|
+
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_QRDraw, 0 | 0 );
|
1858
|
+
if (!SWIG_IsOK(res1)) {
|
1859
|
+
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "close" "', argument " "1"" of type '" "QRDraw *""'");
|
1860
|
+
}
|
1861
|
+
arg1 = reinterpret_cast< QRDraw * >(argp1);
|
1862
|
+
(arg1)->close();
|
1863
|
+
return Qnil;
|
1864
|
+
fail:
|
1865
|
+
return Qnil;
|
1866
|
+
}
|
1867
|
+
|
1868
|
+
|
1864
1869
|
swig_class cQRDrawJPEG;
|
1865
1870
|
|
1866
1871
|
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
@@ -1935,7 +1940,7 @@ _wrap_QRDrawJPEG_draw(int argc, VALUE *argv, VALUE self) {
|
|
1935
1940
|
if (!SWIG_IsOK(res2)) {
|
1936
1941
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "draw" "', argument " "2"" of type '" "char *""'");
|
1937
1942
|
}
|
1938
|
-
arg2 =
|
1943
|
+
arg2 = buf2;
|
1939
1944
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
1940
1945
|
if (!SWIG_IsOK(ecode3)) {
|
1941
1946
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "int""'");
|
@@ -2039,7 +2044,7 @@ _wrap_QRDrawPNG_draw(int argc, VALUE *argv, VALUE self) {
|
|
2039
2044
|
if (!SWIG_IsOK(res2)) {
|
2040
2045
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "draw" "', argument " "2"" of type '" "char *""'");
|
2041
2046
|
}
|
2042
|
-
arg2 =
|
2047
|
+
arg2 = buf2;
|
2043
2048
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
2044
2049
|
if (!SWIG_IsOK(ecode3)) {
|
2045
2050
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "int""'");
|
@@ -2103,6 +2108,11 @@ fail:
|
|
2103
2108
|
}
|
2104
2109
|
|
2105
2110
|
|
2111
|
+
SWIGINTERN void
|
2112
|
+
free_QRDrawPS(QRDrawPS *arg1) {
|
2113
|
+
delete arg1;
|
2114
|
+
}
|
2115
|
+
|
2106
2116
|
SWIGINTERN VALUE
|
2107
2117
|
_wrap_QRDrawPS_draw(int argc, VALUE *argv, VALUE self) {
|
2108
2118
|
QRDrawPS *arg1 = (QRDrawPS *) 0 ;
|
@@ -2138,7 +2148,7 @@ _wrap_QRDrawPS_draw(int argc, VALUE *argv, VALUE self) {
|
|
2138
2148
|
if (!SWIG_IsOK(res2)) {
|
2139
2149
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "draw" "', argument " "2"" of type '" "char *""'");
|
2140
2150
|
}
|
2141
|
-
arg2 =
|
2151
|
+
arg2 = buf2;
|
2142
2152
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
2143
2153
|
if (!SWIG_IsOK(ecode3)) {
|
2144
2154
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "int""'");
|
@@ -2168,11 +2178,6 @@ fail:
|
|
2168
2178
|
}
|
2169
2179
|
|
2170
2180
|
|
2171
|
-
SWIGINTERN void
|
2172
|
-
free_QRDrawPS(QRDrawPS *arg1) {
|
2173
|
-
delete arg1;
|
2174
|
-
}
|
2175
|
-
|
2176
2181
|
swig_class cQRDrawTIFF;
|
2177
2182
|
|
2178
2183
|
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
@@ -2247,7 +2252,7 @@ _wrap_QRDrawTIFF_draw(int argc, VALUE *argv, VALUE self) {
|
|
2247
2252
|
if (!SWIG_IsOK(res2)) {
|
2248
2253
|
SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "draw" "', argument " "2"" of type '" "char *""'");
|
2249
2254
|
}
|
2250
|
-
arg2 =
|
2255
|
+
arg2 = buf2;
|
2251
2256
|
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
2252
2257
|
if (!SWIG_IsOK(ecode3)) {
|
2253
2258
|
SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "draw" "', argument " "3"" of type '" "int""'");
|
@@ -3354,7 +3359,7 @@ _wrap_CQR_Encode_EncodeData__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
|
3354
3359
|
if (!SWIG_IsOK(res6)) {
|
3355
3360
|
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "EncodeData" "', argument " "6"" of type '" "LPCSTR""'");
|
3356
3361
|
}
|
3357
|
-
arg6 =
|
3362
|
+
arg6 = buf6;
|
3358
3363
|
ecode7 = SWIG_AsVal_int(argv[5], &val7);
|
3359
3364
|
if (!SWIG_IsOK(ecode7)) {
|
3360
3365
|
SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "EncodeData" "', argument " "7"" of type '" "int""'");
|
@@ -3426,7 +3431,7 @@ _wrap_CQR_Encode_EncodeData__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
|
3426
3431
|
if (!SWIG_IsOK(res6)) {
|
3427
3432
|
SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "EncodeData" "', argument " "6"" of type '" "LPCSTR""'");
|
3428
3433
|
}
|
3429
|
-
arg6 =
|
3434
|
+
arg6 = buf6;
|
3430
3435
|
result = (BOOL)(arg1)->EncodeData(arg2,arg3,arg4,arg5,arg6);
|
3431
3436
|
vresult = SWIG_From_bool(static_cast< bool >(result));
|
3432
3437
|
if (alloc6 == SWIG_NEWOBJ) delete[] buf6;
|
@@ -3631,7 +3636,7 @@ static swig_cast_info *swig_cast_initial[] = {
|
|
3631
3636
|
* structures together.
|
3632
3637
|
*
|
3633
3638
|
* The generated swig_type_info structures are assigned staticly to an initial
|
3634
|
-
* array. We just loop
|
3639
|
+
* array. We just loop though that array, and handle each type individually.
|
3635
3640
|
* First we lookup if this type has been already loaded, and if so, use the
|
3636
3641
|
* loaded structure instead of the generated one. Then we have to fill in the
|
3637
3642
|
* cast linked list. The cast data is initially stored in something like a
|
@@ -3669,49 +3674,32 @@ extern "C" {
|
|
3669
3674
|
#define SWIGRUNTIME_DEBUG
|
3670
3675
|
#endif
|
3671
3676
|
|
3672
|
-
|
3673
3677
|
SWIGRUNTIME void
|
3674
3678
|
SWIG_InitializeModule(void *clientdata) {
|
3675
3679
|
size_t i;
|
3676
|
-
swig_module_info *module_head
|
3677
|
-
int
|
3680
|
+
swig_module_info *module_head;
|
3681
|
+
static int init_run = 0;
|
3678
3682
|
|
3679
3683
|
clientdata = clientdata;
|
3680
3684
|
|
3681
|
-
|
3682
|
-
|
3683
|
-
|
3684
|
-
|
3685
|
-
|
3686
|
-
|
3687
|
-
}
|
3685
|
+
if (init_run) return;
|
3686
|
+
init_run = 1;
|
3687
|
+
|
3688
|
+
/* Initialize the swig_module */
|
3689
|
+
swig_module.type_initial = swig_type_initial;
|
3690
|
+
swig_module.cast_initial = swig_cast_initial;
|
3688
3691
|
|
3689
3692
|
/* Try and load any already created modules */
|
3690
3693
|
module_head = SWIG_GetModule(clientdata);
|
3691
|
-
if (
|
3692
|
-
/* This is the first module loaded for this interpreter */
|
3693
|
-
/* so set the swig module into the interpreter */
|
3694
|
-
SWIG_SetModule(clientdata, &swig_module);
|
3695
|
-
module_head = &swig_module;
|
3696
|
-
} else {
|
3697
|
-
/* the interpreter has loaded a SWIG module, but has it loaded this one? */
|
3698
|
-
found=0;
|
3699
|
-
iter=module_head;
|
3700
|
-
do {
|
3701
|
-
if (iter==&swig_module) {
|
3702
|
-
found=1;
|
3703
|
-
break;
|
3704
|
-
}
|
3705
|
-
iter=iter->next;
|
3706
|
-
} while (iter!= module_head);
|
3707
|
-
|
3708
|
-
/* if the is found in the list, then all is done and we may leave */
|
3709
|
-
if (found) return;
|
3710
|
-
/* otherwise we must add out module into the list */
|
3694
|
+
if (module_head) {
|
3711
3695
|
swig_module.next = module_head->next;
|
3712
3696
|
module_head->next = &swig_module;
|
3697
|
+
} else {
|
3698
|
+
/* This is the first module loaded */
|
3699
|
+
swig_module.next = &swig_module;
|
3700
|
+
SWIG_SetModule(clientdata, &swig_module);
|
3713
3701
|
}
|
3714
|
-
|
3702
|
+
|
3715
3703
|
/* Now work on filling in swig_module.types */
|
3716
3704
|
#ifdef SWIGRUNTIME_DEBUG
|
3717
3705
|
printf("SWIG_InitializeModule: size %d\n", swig_module.size);
|
@@ -3869,6 +3857,7 @@ SWIGEXPORT void Init_QR(void) {
|
|
3869
3857
|
rb_undef_alloc_func(cQRDraw.klass);
|
3870
3858
|
rb_define_method(cQRDraw.klass, "setup", VALUEFUNC(_wrap_QRDraw_setup), -1);
|
3871
3859
|
rb_define_method(cQRDraw.klass, "draw", VALUEFUNC(_wrap_QRDraw_draw), -1);
|
3860
|
+
rb_define_method(cQRDraw.klass, "close", VALUEFUNC(_wrap_QRDraw_close), -1);
|
3872
3861
|
cQRDraw.mark = 0;
|
3873
3862
|
cQRDraw.destroy = (void (*)(void *)) free_QRDraw;
|
3874
3863
|
cQRDraw.trackObjects = 0;
|