qr_reader-native 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE-mruby.txt +22 -0
- data/LICENSE-spinel.txt +19 -0
- data/LICENSE.txt +21 -0
- data/README.md +61 -0
- data/ext/qr_reader_native/SPINEL_VERSION +1 -0
- data/ext/qr_reader_native/extconf.rb +8 -0
- data/ext/qr_reader_native/mruby/error.h +13 -0
- data/ext/qr_reader_native/mruby/internal.h +145 -0
- data/ext/qr_reader_native/mruby/string.h +22 -0
- data/ext/qr_reader_native/mruby.h +93 -0
- data/ext/qr_reader_native/mruby_shim.h +118 -0
- data/ext/qr_reader_native/qr_reader_native.c +13513 -0
- data/ext/qr_reader_native/qr_reader_native.h +29 -0
- data/ext/qr_reader_native/qr_reader_native_ext.c +598 -0
- data/ext/qr_reader_native/re_cased.h +71 -0
- data/ext/qr_reader_native/re_compile.c +5784 -0
- data/ext/qr_reader_native/re_ctype.h +3540 -0
- data/ext/qr_reader_native/re_exec.c +2190 -0
- data/ext/qr_reader_native/re_internal.h +671 -0
- data/ext/qr_reader_native/re_prop.h +4629 -0
- data/ext/qr_reader_native/re_spinel.c +363 -0
- data/ext/qr_reader_native/re_spinel.h +22 -0
- data/ext/qr_reader_native/re_spinel_utf8.inc +97 -0
- data/ext/qr_reader_native/re_utf8.c +156 -0
- data/ext/qr_reader_native/sp_alloc.c +1447 -0
- data/ext/qr_reader_native/sp_alloc.h +1196 -0
- data/ext/qr_reader_native/sp_argf.h +33 -0
- data/ext/qr_reader_native/sp_array.c +1052 -0
- data/ext/qr_reader_native/sp_array.h +456 -0
- data/ext/qr_reader_native/sp_bigint.c +5826 -0
- data/ext/qr_reader_native/sp_bigint.h +117 -0
- data/ext/qr_reader_native/sp_cold.c +5259 -0
- data/ext/qr_reader_native/sp_compat.h +402 -0
- data/ext/qr_reader_native/sp_core.c +818 -0
- data/ext/qr_reader_native/sp_core.h +56 -0
- data/ext/qr_reader_native/sp_crypto.c +877 -0
- data/ext/qr_reader_native/sp_crypto.h +169 -0
- data/ext/qr_reader_native/sp_dtoa.c +1533 -0
- data/ext/qr_reader_native/sp_dtoa.h +29 -0
- data/ext/qr_reader_native/sp_encoding_names.h +172 -0
- data/ext/qr_reader_native/sp_enum.h +86 -0
- data/ext/qr_reader_native/sp_exc.c +1185 -0
- data/ext/qr_reader_native/sp_exc.h +186 -0
- data/ext/qr_reader_native/sp_exc_ctx.h +56 -0
- data/ext/qr_reader_native/sp_fiber.c +889 -0
- data/ext/qr_reader_native/sp_fiber.h +162 -0
- data/ext/qr_reader_native/sp_fiber_ctx.h +84 -0
- data/ext/qr_reader_native/sp_format.c +695 -0
- data/ext/qr_reader_native/sp_format.h +83 -0
- data/ext/qr_reader_native/sp_gc.c +1793 -0
- data/ext/qr_reader_native/sp_gc.h +762 -0
- data/ext/qr_reader_native/sp_hash.c +131 -0
- data/ext/qr_reader_native/sp_hash.h +131 -0
- data/ext/qr_reader_native/sp_inspect.c +215 -0
- data/ext/qr_reader_native/sp_inspect.h +128 -0
- data/ext/qr_reader_native/sp_io.c +1676 -0
- data/ext/qr_reader_native/sp_io.h +272 -0
- data/ext/qr_reader_native/sp_iobuffer.c +1014 -0
- data/ext/qr_reader_native/sp_iobuffer.h +167 -0
- data/ext/qr_reader_native/sp_marshal.c +487 -0
- data/ext/qr_reader_native/sp_marshal.h +60 -0
- data/ext/qr_reader_native/sp_net.c +1029 -0
- data/ext/qr_reader_native/sp_net.h +205 -0
- data/ext/qr_reader_native/sp_pack.c +1254 -0
- data/ext/qr_reader_native/sp_poly_cold.c +1220 -0
- data/ext/qr_reader_native/sp_proc.c +410 -0
- data/ext/qr_reader_native/sp_proc.h +327 -0
- data/ext/qr_reader_native/sp_process.c +547 -0
- data/ext/qr_reader_native/sp_process_status.c +211 -0
- data/ext/qr_reader_native/sp_process_status.h +66 -0
- data/ext/qr_reader_native/sp_random.c +287 -0
- data/ext/qr_reader_native/sp_random.h +52 -0
- data/ext/qr_reader_native/sp_range.h +144 -0
- data/ext/qr_reader_native/sp_re.c +1379 -0
- data/ext/qr_reader_native/sp_re.h +186 -0
- data/ext/qr_reader_native/sp_re_names.h +59 -0
- data/ext/qr_reader_native/sp_sched.c +4044 -0
- data/ext/qr_reader_native/sp_sched.h +295 -0
- data/ext/qr_reader_native/sp_slab.c +1507 -0
- data/ext/qr_reader_native/sp_str.c +1462 -0
- data/ext/qr_reader_native/sp_str.h +306 -0
- data/ext/qr_reader_native/sp_str_crypt.c +23 -0
- data/ext/qr_reader_native/sp_string.c +92 -0
- data/ext/qr_reader_native/sp_string.h +253 -0
- data/ext/qr_reader_native/sp_system.c +78 -0
- data/ext/qr_reader_native/sp_system.h +18 -0
- data/ext/qr_reader_native/sp_time.c +860 -0
- data/ext/qr_reader_native/sp_time.h +100 -0
- data/ext/qr_reader_native/sp_types.h +292 -0
- data/ext/qr_reader_native/spinel_rt.h +19017 -0
- data/ext/qr_reader_native/unicase.c +399 -0
- data/ext/qr_reader_native/unicase.h +901 -0
- data/lib/qr_reader/native.rb +6 -0
- metadata +153 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* Generated by Spinel (--ext-init spx_init_qr_reader_native). The contract for a host
|
|
2
|
+
shim: call spx_init_qr_reader_native() once before any entry; wrap entry calls in
|
|
3
|
+
spx_init_qr_reader_native_try to receive a Ruby raise as (class name, message). */
|
|
4
|
+
#ifndef SPINEL_EXT_H
|
|
5
|
+
#define SPINEL_EXT_H
|
|
6
|
+
#define SPINEL_EXT_HOST 1 /* runtime globals resolve to the kernel TU */
|
|
7
|
+
#include "spinel_rt.h"
|
|
8
|
+
|
|
9
|
+
void spx_init_qr_reader_native(void);
|
|
10
|
+
int spx_init_qr_reader_native_try(void (*fn)(void *), void *ctx, const char **cls, const char **msg);
|
|
11
|
+
|
|
12
|
+
const char * sp_QrReaderNative_s_kernels_digest(void);
|
|
13
|
+
sp_StrArray * sp_QrReaderNative_s_kernel_files(void);
|
|
14
|
+
const char * sp_QrReaderNative_s_downscale(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3);
|
|
15
|
+
const char * sp_QrReaderNative_s_pixels_luma(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3, sp_int lv_a4, sp_int lv_a5, sp_int lv_a6, sp_int lv_a7, sp_int lv_a8, sp_int lv_a9);
|
|
16
|
+
const char * sp_QrReaderNative_s_png_rows(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3, sp_int lv_a4, sp_int lv_a5, const char * lv_a6, const char * lv_a7);
|
|
17
|
+
const char * sp_QrReaderNative_s_png_adam7(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3, sp_int lv_a4, const char * lv_a5);
|
|
18
|
+
const char * sp_QrReaderNative_s_png_unpack_rows(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3, sp_int lv_a4);
|
|
19
|
+
sp_IntArray * sp_QrReaderNative_s_jpeg_info(const char * lv_a0);
|
|
20
|
+
const char * sp_QrReaderNative_s_jpeg_luma(const char * lv_a0, sp_int lv_a1);
|
|
21
|
+
sp_StrArray * sp_QrReaderNative_s_jpeg_luma_keep(const char * lv_a0, sp_int lv_a1);
|
|
22
|
+
const char * sp_QrReaderNative_s_jpeg_render(const char * lv_a0, sp_int lv_a1);
|
|
23
|
+
const char * sp_QrReaderNative_s_ccitt_decode(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_int lv_a3, sp_bool lv_a4, sp_bool lv_a5, sp_bool lv_a6, sp_int lv_a7);
|
|
24
|
+
const char * sp_QrReaderNative_s_lzw_decode(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, sp_bool lv_a3);
|
|
25
|
+
const char * sp_QrReaderNative_s_binarize_hybrid(const char * lv_a0, sp_int lv_a1, sp_int lv_a2);
|
|
26
|
+
const char * sp_QrReaderNative_s_binarize_local_mean(const char * lv_a0, sp_int lv_a1, sp_int lv_a2);
|
|
27
|
+
sp_FloatArray * sp_QrReaderNative_s_finder_scan(const char * lv_a0, sp_int lv_a1, sp_int lv_a2, const char * lv_a3, sp_FloatArray * lv_a4);
|
|
28
|
+
|
|
29
|
+
#endif
|
|
@@ -0,0 +1,598 @@
|
|
|
1
|
+
/* Generated by Spinel (--ext cruby). CRuby extension shim over the
|
|
2
|
+
Layer-1 library: conversions under the GVL, the kernel off it, one
|
|
3
|
+
call at a time; a kernel raise re-raises here by class name. */
|
|
4
|
+
#include <ruby.h>
|
|
5
|
+
#include <ruby/encoding.h>
|
|
6
|
+
#include <ruby/thread.h>
|
|
7
|
+
#include "qr_reader_native.h"
|
|
8
|
+
|
|
9
|
+
static VALUE spx_lock;
|
|
10
|
+
static const char *spx_exc_cls, *spx_exc_msg; /* written under spx_lock */
|
|
11
|
+
static VALUE spx_restore_roots(VALUE saved) {
|
|
12
|
+
sp_gc_nroots = (int)saved;
|
|
13
|
+
return Qnil;
|
|
14
|
+
}
|
|
15
|
+
static void spx_reraise(const char *cls, const char *msg) {
|
|
16
|
+
VALUE k = rb_eRuntimeError;
|
|
17
|
+
if (cls && *cls) {
|
|
18
|
+
VALUE found = rb_funcall(rb_cObject, rb_intern("const_get"), 1, rb_str_new_cstr(cls));
|
|
19
|
+
if (RTEST(rb_obj_is_kind_of(found, rb_cClass))) k = found;
|
|
20
|
+
}
|
|
21
|
+
rb_raise(k, "%s", msg ? msg : "");
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static sp_int spx_in_int(VALUE v) {
|
|
25
|
+
if (!FIXNUM_P(v)) {
|
|
26
|
+
if (RB_TYPE_P(v, T_BIGNUM))
|
|
27
|
+
rb_raise(rb_eRangeError, "integer too big for the compiled kernel (64-bit)");
|
|
28
|
+
rb_raise(rb_eTypeError, "no implicit conversion of %s into Integer", rb_obj_classname(v));
|
|
29
|
+
}
|
|
30
|
+
return (sp_int)NUM2LL(v);
|
|
31
|
+
}
|
|
32
|
+
static double spx_in_float(VALUE v) { return NUM2DBL(v); }
|
|
33
|
+
static const char *spx_in_str(VALUE v) {
|
|
34
|
+
if (!RB_TYPE_P(v, T_STRING))
|
|
35
|
+
rb_raise(rb_eTypeError, "no implicit conversion of %s into String", rb_obj_classname(v));
|
|
36
|
+
{ int ei = rb_enc_get_index(v);
|
|
37
|
+
if (ei != rb_utf8_encindex() && ei != rb_usascii_encindex() && ei != rb_ascii8bit_encindex())
|
|
38
|
+
rb_raise(rb_eArgError, "string encoding %s cannot cross into the compiled kernel (UTF-8 or binary only)", rb_enc_name(rb_enc_get(v))); }
|
|
39
|
+
return sp_str_from_bytes(RSTRING_PTR(v), (size_t)RSTRING_LEN(v));
|
|
40
|
+
}
|
|
41
|
+
static sp_IntArray *spx_in_int_array(VALUE v) {
|
|
42
|
+
if (!RB_TYPE_P(v, T_ARRAY)) rb_raise(rb_eTypeError, "no implicit conversion of %s into Array", rb_obj_classname(v));
|
|
43
|
+
{ long n = RARRAY_LEN(v); sp_IntArray *a = sp_IntArray_new(); SP_GC_ROOT(a);
|
|
44
|
+
for (long i = 0; i < n; i++) { VALUE e = RARRAY_AREF(v, i);
|
|
45
|
+
if (!FIXNUM_P(e)) rb_raise(rb_eTypeError, "array element %ld is not an Integer", i);
|
|
46
|
+
sp_IntArray_push(a, (sp_int)NUM2LL(e)); }
|
|
47
|
+
return a; }
|
|
48
|
+
}
|
|
49
|
+
static sp_FloatArray *spx_in_float_array(VALUE v) {
|
|
50
|
+
if (!RB_TYPE_P(v, T_ARRAY)) rb_raise(rb_eTypeError, "no implicit conversion of %s into Array", rb_obj_classname(v));
|
|
51
|
+
{ long n = RARRAY_LEN(v); sp_FloatArray *a = sp_FloatArray_new(); SP_GC_ROOT(a);
|
|
52
|
+
for (long i = 0; i < n; i++) sp_FloatArray_push(a, NUM2DBL(RARRAY_AREF(v, i)));
|
|
53
|
+
return a; }
|
|
54
|
+
}
|
|
55
|
+
static sp_StrArray *spx_in_str_array(VALUE v) {
|
|
56
|
+
if (!RB_TYPE_P(v, T_ARRAY)) rb_raise(rb_eTypeError, "no implicit conversion of %s into Array", rb_obj_classname(v));
|
|
57
|
+
{ long n = RARRAY_LEN(v); sp_StrArray *a = sp_StrArray_new(); SP_GC_ROOT(a);
|
|
58
|
+
for (long i = 0; i < n; i++) { VALUE e = RARRAY_AREF(v, i);
|
|
59
|
+
if (!RB_TYPE_P(e, T_STRING)) rb_raise(rb_eTypeError, "array element %ld is not a String", i);
|
|
60
|
+
sp_StrArray_push(a, sp_str_from_bytes(RSTRING_PTR(e), (size_t)RSTRING_LEN(e))); }
|
|
61
|
+
return a; }
|
|
62
|
+
}
|
|
63
|
+
static VALUE spx_out_int_array(sp_IntArray *a) {
|
|
64
|
+
if (!a) return Qnil;
|
|
65
|
+
{ long n = (long)sp_IntArray_length(a); VALUE r = rb_ary_new_capa(n);
|
|
66
|
+
for (long i = 0; i < n; i++) rb_ary_push(r, LL2NUM((long long)sp_IntArray_get(a, i)));
|
|
67
|
+
return r; }
|
|
68
|
+
}
|
|
69
|
+
static VALUE spx_out_float_array(sp_FloatArray *a) {
|
|
70
|
+
if (!a) return Qnil;
|
|
71
|
+
{ long n = (long)a->len; VALUE r = rb_ary_new_capa(n);
|
|
72
|
+
for (long i = 0; i < n; i++) rb_ary_push(r, DBL2NUM(sp_FloatArray_get(a, i)));
|
|
73
|
+
return r; }
|
|
74
|
+
}
|
|
75
|
+
static VALUE spx_out_str_array(sp_StrArray *a) {
|
|
76
|
+
if (!a) return Qnil;
|
|
77
|
+
{ long n = (long)sp_StrArray_length(a); VALUE r = rb_ary_new_capa(n);
|
|
78
|
+
for (long i = 0; i < n; i++) { const char *e = sp_StrArray_get(a, i);
|
|
79
|
+
rb_ary_push(r, e ? rb_utf8_str_new(e, (long)sp_str_byte_len(e)) : Qnil); }
|
|
80
|
+
return r; }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
typedef struct { const char * ret; } spx_c_249;
|
|
84
|
+
static void spx_body_249(void *p) { spx_c_249 *c = (spx_c_249 *)p; c->ret = sp_QrReaderNative_s_kernels_digest(); }
|
|
85
|
+
static void *spx_run_249(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_249, p, &spx_exc_cls, &spx_exc_msg); }
|
|
86
|
+
typedef struct { spx_c_249 *c; } spx_a_249;
|
|
87
|
+
static VALUE spx_conv_249(VALUE p) { spx_a_249 *a = (spx_a_249 *)p;
|
|
88
|
+
return Qnil;
|
|
89
|
+
}
|
|
90
|
+
static VALUE spx_call_249(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_249, (void *)p, RUBY_UBF_IO, NULL); }
|
|
91
|
+
static VALUE spx_locked_249(VALUE p) {
|
|
92
|
+
spx_a_249 *a__ = (spx_a_249 *)p;
|
|
93
|
+
spx_c_249 *c__ = a__->c;
|
|
94
|
+
spx_conv_249(p);
|
|
95
|
+
if ((int)(intptr_t)spx_call_249((VALUE)c__))
|
|
96
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
97
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
static VALUE spx_entry_249(VALUE p) {
|
|
101
|
+
return rb_ensure(spx_locked_249, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
102
|
+
}
|
|
103
|
+
static VALUE spx_m_249(VALUE self) {
|
|
104
|
+
spx_c_249 c__; memset(&c__, 0, sizeof c__);
|
|
105
|
+
spx_a_249 a__ = { &c__ };
|
|
106
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_249, (VALUE)&a__);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
typedef struct { sp_StrArray * ret; } spx_c_250;
|
|
110
|
+
static void spx_body_250(void *p) { spx_c_250 *c = (spx_c_250 *)p; c->ret = sp_QrReaderNative_s_kernel_files(); }
|
|
111
|
+
static void *spx_run_250(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_250, p, &spx_exc_cls, &spx_exc_msg); }
|
|
112
|
+
typedef struct { spx_c_250 *c; } spx_a_250;
|
|
113
|
+
static VALUE spx_conv_250(VALUE p) { spx_a_250 *a = (spx_a_250 *)p;
|
|
114
|
+
return Qnil;
|
|
115
|
+
}
|
|
116
|
+
static VALUE spx_call_250(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_250, (void *)p, RUBY_UBF_IO, NULL); }
|
|
117
|
+
static VALUE spx_locked_250(VALUE p) {
|
|
118
|
+
spx_a_250 *a__ = (spx_a_250 *)p;
|
|
119
|
+
spx_c_250 *c__ = a__->c;
|
|
120
|
+
spx_conv_250(p);
|
|
121
|
+
if ((int)(intptr_t)spx_call_250((VALUE)c__))
|
|
122
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
123
|
+
return spx_out_str_array(c__->ret);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
static VALUE spx_entry_250(VALUE p) {
|
|
127
|
+
return rb_ensure(spx_locked_250, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
128
|
+
}
|
|
129
|
+
static VALUE spx_m_250(VALUE self) {
|
|
130
|
+
spx_c_250 c__; memset(&c__, 0, sizeof c__);
|
|
131
|
+
spx_a_250 a__ = { &c__ };
|
|
132
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_250, (VALUE)&a__);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; const char * ret; } spx_c_251;
|
|
136
|
+
static void spx_body_251(void *p) { spx_c_251 *c = (spx_c_251 *)p; c->ret = sp_QrReaderNative_s_downscale(c->a0, c->a1, c->a2, c->a3); }
|
|
137
|
+
static void *spx_run_251(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_251, p, &spx_exc_cls, &spx_exc_msg); }
|
|
138
|
+
typedef struct { spx_c_251 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; } spx_a_251;
|
|
139
|
+
static VALUE spx_conv_251(VALUE p) { spx_a_251 *a = (spx_a_251 *)p;
|
|
140
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
141
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
142
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
143
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
144
|
+
return Qnil;
|
|
145
|
+
}
|
|
146
|
+
static VALUE spx_call_251(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_251, (void *)p, RUBY_UBF_IO, NULL); }
|
|
147
|
+
static VALUE spx_locked_251(VALUE p) {
|
|
148
|
+
spx_a_251 *a__ = (spx_a_251 *)p;
|
|
149
|
+
spx_c_251 *c__ = a__->c;
|
|
150
|
+
spx_conv_251(p);
|
|
151
|
+
if ((int)(intptr_t)spx_call_251((VALUE)c__))
|
|
152
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
153
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
static VALUE spx_entry_251(VALUE p) {
|
|
157
|
+
return rb_ensure(spx_locked_251, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
158
|
+
}
|
|
159
|
+
static VALUE spx_m_251(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3) {
|
|
160
|
+
spx_c_251 c__; memset(&c__, 0, sizeof c__);
|
|
161
|
+
spx_a_251 a__ = { &c__, v0, v1, v2, v3 };
|
|
162
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_251, (VALUE)&a__);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; sp_int a4; sp_int a5; sp_int a6; sp_int a7; sp_int a8; sp_int a9; const char * ret; } spx_c_252;
|
|
166
|
+
static void spx_body_252(void *p) { spx_c_252 *c = (spx_c_252 *)p; c->ret = sp_QrReaderNative_s_pixels_luma(c->a0, c->a1, c->a2, c->a3, c->a4, c->a5, c->a6, c->a7, c->a8, c->a9); }
|
|
167
|
+
static void *spx_run_252(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_252, p, &spx_exc_cls, &spx_exc_msg); }
|
|
168
|
+
typedef struct { spx_c_252 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; VALUE v5; VALUE v6; VALUE v7; VALUE v8; VALUE v9; } spx_a_252;
|
|
169
|
+
static VALUE spx_conv_252(VALUE p) { spx_a_252 *a = (spx_a_252 *)p;
|
|
170
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
171
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
172
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
173
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
174
|
+
a->c->a4 = spx_in_int(a->v4);
|
|
175
|
+
a->c->a5 = spx_in_int(a->v5);
|
|
176
|
+
a->c->a6 = spx_in_int(a->v6);
|
|
177
|
+
a->c->a7 = spx_in_int(a->v7);
|
|
178
|
+
a->c->a8 = spx_in_int(a->v8);
|
|
179
|
+
a->c->a9 = spx_in_int(a->v9);
|
|
180
|
+
return Qnil;
|
|
181
|
+
}
|
|
182
|
+
static VALUE spx_call_252(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_252, (void *)p, RUBY_UBF_IO, NULL); }
|
|
183
|
+
static VALUE spx_locked_252(VALUE p) {
|
|
184
|
+
spx_a_252 *a__ = (spx_a_252 *)p;
|
|
185
|
+
spx_c_252 *c__ = a__->c;
|
|
186
|
+
spx_conv_252(p);
|
|
187
|
+
if ((int)(intptr_t)spx_call_252((VALUE)c__))
|
|
188
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
189
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
static VALUE spx_entry_252(VALUE p) {
|
|
193
|
+
return rb_ensure(spx_locked_252, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
194
|
+
}
|
|
195
|
+
static VALUE spx_m_252(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4, VALUE v5, VALUE v6, VALUE v7, VALUE v8, VALUE v9) {
|
|
196
|
+
spx_c_252 c__; memset(&c__, 0, sizeof c__);
|
|
197
|
+
spx_a_252 a__ = { &c__, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9 };
|
|
198
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_252, (VALUE)&a__);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; sp_int a4; sp_int a5; const char * a6; const char * a7; const char * ret; } spx_c_253;
|
|
202
|
+
static void spx_body_253(void *p) { spx_c_253 *c = (spx_c_253 *)p; c->ret = sp_QrReaderNative_s_png_rows(c->a0, c->a1, c->a2, c->a3, c->a4, c->a5, c->a6, c->a7); }
|
|
203
|
+
static void *spx_run_253(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_253, p, &spx_exc_cls, &spx_exc_msg); }
|
|
204
|
+
typedef struct { spx_c_253 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; VALUE v5; VALUE v6; VALUE v7; } spx_a_253;
|
|
205
|
+
static VALUE spx_conv_253(VALUE p) { spx_a_253 *a = (spx_a_253 *)p;
|
|
206
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
207
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
208
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
209
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
210
|
+
a->c->a4 = spx_in_int(a->v4);
|
|
211
|
+
a->c->a5 = spx_in_int(a->v5);
|
|
212
|
+
a->c->a6 = spx_in_str(a->v6); _sp_gc_root_push((void**)((uintptr_t)&a->c->a6 | _SP_GC_SLOT_TAG(a->c->a6)));
|
|
213
|
+
a->c->a7 = spx_in_str(a->v7); _sp_gc_root_push((void**)((uintptr_t)&a->c->a7 | _SP_GC_SLOT_TAG(a->c->a7)));
|
|
214
|
+
return Qnil;
|
|
215
|
+
}
|
|
216
|
+
static VALUE spx_call_253(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_253, (void *)p, RUBY_UBF_IO, NULL); }
|
|
217
|
+
static VALUE spx_locked_253(VALUE p) {
|
|
218
|
+
spx_a_253 *a__ = (spx_a_253 *)p;
|
|
219
|
+
spx_c_253 *c__ = a__->c;
|
|
220
|
+
spx_conv_253(p);
|
|
221
|
+
if ((int)(intptr_t)spx_call_253((VALUE)c__))
|
|
222
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
223
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static VALUE spx_entry_253(VALUE p) {
|
|
227
|
+
return rb_ensure(spx_locked_253, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
228
|
+
}
|
|
229
|
+
static VALUE spx_m_253(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4, VALUE v5, VALUE v6, VALUE v7) {
|
|
230
|
+
spx_c_253 c__; memset(&c__, 0, sizeof c__);
|
|
231
|
+
spx_a_253 a__ = { &c__, v0, v1, v2, v3, v4, v5, v6, v7 };
|
|
232
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_253, (VALUE)&a__);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; sp_int a4; const char * a5; const char * ret; } spx_c_254;
|
|
236
|
+
static void spx_body_254(void *p) { spx_c_254 *c = (spx_c_254 *)p; c->ret = sp_QrReaderNative_s_png_adam7(c->a0, c->a1, c->a2, c->a3, c->a4, c->a5); }
|
|
237
|
+
static void *spx_run_254(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_254, p, &spx_exc_cls, &spx_exc_msg); }
|
|
238
|
+
typedef struct { spx_c_254 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; VALUE v5; } spx_a_254;
|
|
239
|
+
static VALUE spx_conv_254(VALUE p) { spx_a_254 *a = (spx_a_254 *)p;
|
|
240
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
241
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
242
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
243
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
244
|
+
a->c->a4 = spx_in_int(a->v4);
|
|
245
|
+
a->c->a5 = spx_in_str(a->v5); _sp_gc_root_push((void**)((uintptr_t)&a->c->a5 | _SP_GC_SLOT_TAG(a->c->a5)));
|
|
246
|
+
return Qnil;
|
|
247
|
+
}
|
|
248
|
+
static VALUE spx_call_254(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_254, (void *)p, RUBY_UBF_IO, NULL); }
|
|
249
|
+
static VALUE spx_locked_254(VALUE p) {
|
|
250
|
+
spx_a_254 *a__ = (spx_a_254 *)p;
|
|
251
|
+
spx_c_254 *c__ = a__->c;
|
|
252
|
+
spx_conv_254(p);
|
|
253
|
+
if ((int)(intptr_t)spx_call_254((VALUE)c__))
|
|
254
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
255
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
static VALUE spx_entry_254(VALUE p) {
|
|
259
|
+
return rb_ensure(spx_locked_254, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
260
|
+
}
|
|
261
|
+
static VALUE spx_m_254(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4, VALUE v5) {
|
|
262
|
+
spx_c_254 c__; memset(&c__, 0, sizeof c__);
|
|
263
|
+
spx_a_254 a__ = { &c__, v0, v1, v2, v3, v4, v5 };
|
|
264
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_254, (VALUE)&a__);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; sp_int a4; const char * ret; } spx_c_255;
|
|
268
|
+
static void spx_body_255(void *p) { spx_c_255 *c = (spx_c_255 *)p; c->ret = sp_QrReaderNative_s_png_unpack_rows(c->a0, c->a1, c->a2, c->a3, c->a4); }
|
|
269
|
+
static void *spx_run_255(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_255, p, &spx_exc_cls, &spx_exc_msg); }
|
|
270
|
+
typedef struct { spx_c_255 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; } spx_a_255;
|
|
271
|
+
static VALUE spx_conv_255(VALUE p) { spx_a_255 *a = (spx_a_255 *)p;
|
|
272
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
273
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
274
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
275
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
276
|
+
a->c->a4 = spx_in_int(a->v4);
|
|
277
|
+
return Qnil;
|
|
278
|
+
}
|
|
279
|
+
static VALUE spx_call_255(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_255, (void *)p, RUBY_UBF_IO, NULL); }
|
|
280
|
+
static VALUE spx_locked_255(VALUE p) {
|
|
281
|
+
spx_a_255 *a__ = (spx_a_255 *)p;
|
|
282
|
+
spx_c_255 *c__ = a__->c;
|
|
283
|
+
spx_conv_255(p);
|
|
284
|
+
if ((int)(intptr_t)spx_call_255((VALUE)c__))
|
|
285
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
286
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
static VALUE spx_entry_255(VALUE p) {
|
|
290
|
+
return rb_ensure(spx_locked_255, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
291
|
+
}
|
|
292
|
+
static VALUE spx_m_255(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4) {
|
|
293
|
+
spx_c_255 c__; memset(&c__, 0, sizeof c__);
|
|
294
|
+
spx_a_255 a__ = { &c__, v0, v1, v2, v3, v4 };
|
|
295
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_255, (VALUE)&a__);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
typedef struct { const char * a0; sp_IntArray * ret; } spx_c_256;
|
|
299
|
+
static void spx_body_256(void *p) { spx_c_256 *c = (spx_c_256 *)p; c->ret = sp_QrReaderNative_s_jpeg_info(c->a0); }
|
|
300
|
+
static void *spx_run_256(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_256, p, &spx_exc_cls, &spx_exc_msg); }
|
|
301
|
+
typedef struct { spx_c_256 *c; VALUE v0; } spx_a_256;
|
|
302
|
+
static VALUE spx_conv_256(VALUE p) { spx_a_256 *a = (spx_a_256 *)p;
|
|
303
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
304
|
+
return Qnil;
|
|
305
|
+
}
|
|
306
|
+
static VALUE spx_call_256(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_256, (void *)p, RUBY_UBF_IO, NULL); }
|
|
307
|
+
static VALUE spx_locked_256(VALUE p) {
|
|
308
|
+
spx_a_256 *a__ = (spx_a_256 *)p;
|
|
309
|
+
spx_c_256 *c__ = a__->c;
|
|
310
|
+
spx_conv_256(p);
|
|
311
|
+
if ((int)(intptr_t)spx_call_256((VALUE)c__))
|
|
312
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
313
|
+
return spx_out_int_array(c__->ret);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
static VALUE spx_entry_256(VALUE p) {
|
|
317
|
+
return rb_ensure(spx_locked_256, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
318
|
+
}
|
|
319
|
+
static VALUE spx_m_256(VALUE self, VALUE v0) {
|
|
320
|
+
spx_c_256 c__; memset(&c__, 0, sizeof c__);
|
|
321
|
+
spx_a_256 a__ = { &c__, v0 };
|
|
322
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_256, (VALUE)&a__);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
typedef struct { const char * a0; sp_int a1; const char * ret; } spx_c_257;
|
|
326
|
+
static void spx_body_257(void *p) { spx_c_257 *c = (spx_c_257 *)p; c->ret = sp_QrReaderNative_s_jpeg_luma(c->a0, c->a1); }
|
|
327
|
+
static void *spx_run_257(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_257, p, &spx_exc_cls, &spx_exc_msg); }
|
|
328
|
+
typedef struct { spx_c_257 *c; VALUE v0; VALUE v1; } spx_a_257;
|
|
329
|
+
static VALUE spx_conv_257(VALUE p) { spx_a_257 *a = (spx_a_257 *)p;
|
|
330
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
331
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
332
|
+
return Qnil;
|
|
333
|
+
}
|
|
334
|
+
static VALUE spx_call_257(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_257, (void *)p, RUBY_UBF_IO, NULL); }
|
|
335
|
+
static VALUE spx_locked_257(VALUE p) {
|
|
336
|
+
spx_a_257 *a__ = (spx_a_257 *)p;
|
|
337
|
+
spx_c_257 *c__ = a__->c;
|
|
338
|
+
spx_conv_257(p);
|
|
339
|
+
if ((int)(intptr_t)spx_call_257((VALUE)c__))
|
|
340
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
341
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
static VALUE spx_entry_257(VALUE p) {
|
|
345
|
+
return rb_ensure(spx_locked_257, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
346
|
+
}
|
|
347
|
+
static VALUE spx_m_257(VALUE self, VALUE v0, VALUE v1) {
|
|
348
|
+
spx_c_257 c__; memset(&c__, 0, sizeof c__);
|
|
349
|
+
spx_a_257 a__ = { &c__, v0, v1 };
|
|
350
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_257, (VALUE)&a__);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
typedef struct { const char * a0; sp_int a1; sp_StrArray * ret; } spx_c_258;
|
|
354
|
+
static void spx_body_258(void *p) { spx_c_258 *c = (spx_c_258 *)p; c->ret = sp_QrReaderNative_s_jpeg_luma_keep(c->a0, c->a1); }
|
|
355
|
+
static void *spx_run_258(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_258, p, &spx_exc_cls, &spx_exc_msg); }
|
|
356
|
+
typedef struct { spx_c_258 *c; VALUE v0; VALUE v1; } spx_a_258;
|
|
357
|
+
static VALUE spx_conv_258(VALUE p) { spx_a_258 *a = (spx_a_258 *)p;
|
|
358
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
359
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
360
|
+
return Qnil;
|
|
361
|
+
}
|
|
362
|
+
static VALUE spx_call_258(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_258, (void *)p, RUBY_UBF_IO, NULL); }
|
|
363
|
+
static VALUE spx_locked_258(VALUE p) {
|
|
364
|
+
spx_a_258 *a__ = (spx_a_258 *)p;
|
|
365
|
+
spx_c_258 *c__ = a__->c;
|
|
366
|
+
spx_conv_258(p);
|
|
367
|
+
if ((int)(intptr_t)spx_call_258((VALUE)c__))
|
|
368
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
369
|
+
return spx_out_str_array(c__->ret);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
static VALUE spx_entry_258(VALUE p) {
|
|
373
|
+
return rb_ensure(spx_locked_258, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
374
|
+
}
|
|
375
|
+
static VALUE spx_m_258(VALUE self, VALUE v0, VALUE v1) {
|
|
376
|
+
spx_c_258 c__; memset(&c__, 0, sizeof c__);
|
|
377
|
+
spx_a_258 a__ = { &c__, v0, v1 };
|
|
378
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_258, (VALUE)&a__);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
typedef struct { const char * a0; sp_int a1; const char * ret; } spx_c_259;
|
|
382
|
+
static void spx_body_259(void *p) { spx_c_259 *c = (spx_c_259 *)p; c->ret = sp_QrReaderNative_s_jpeg_render(c->a0, c->a1); }
|
|
383
|
+
static void *spx_run_259(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_259, p, &spx_exc_cls, &spx_exc_msg); }
|
|
384
|
+
typedef struct { spx_c_259 *c; VALUE v0; VALUE v1; } spx_a_259;
|
|
385
|
+
static VALUE spx_conv_259(VALUE p) { spx_a_259 *a = (spx_a_259 *)p;
|
|
386
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
387
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
388
|
+
return Qnil;
|
|
389
|
+
}
|
|
390
|
+
static VALUE spx_call_259(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_259, (void *)p, RUBY_UBF_IO, NULL); }
|
|
391
|
+
static VALUE spx_locked_259(VALUE p) {
|
|
392
|
+
spx_a_259 *a__ = (spx_a_259 *)p;
|
|
393
|
+
spx_c_259 *c__ = a__->c;
|
|
394
|
+
spx_conv_259(p);
|
|
395
|
+
if ((int)(intptr_t)spx_call_259((VALUE)c__))
|
|
396
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
397
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
static VALUE spx_entry_259(VALUE p) {
|
|
401
|
+
return rb_ensure(spx_locked_259, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
402
|
+
}
|
|
403
|
+
static VALUE spx_m_259(VALUE self, VALUE v0, VALUE v1) {
|
|
404
|
+
spx_c_259 c__; memset(&c__, 0, sizeof c__);
|
|
405
|
+
spx_a_259 a__ = { &c__, v0, v1 };
|
|
406
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_259, (VALUE)&a__);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_int a3; sp_bool a4; sp_bool a5; sp_bool a6; sp_int a7; const char * ret; } spx_c_260;
|
|
410
|
+
static void spx_body_260(void *p) { spx_c_260 *c = (spx_c_260 *)p; c->ret = sp_QrReaderNative_s_ccitt_decode(c->a0, c->a1, c->a2, c->a3, c->a4, c->a5, c->a6, c->a7); }
|
|
411
|
+
static void *spx_run_260(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_260, p, &spx_exc_cls, &spx_exc_msg); }
|
|
412
|
+
typedef struct { spx_c_260 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; VALUE v5; VALUE v6; VALUE v7; } spx_a_260;
|
|
413
|
+
static VALUE spx_conv_260(VALUE p) { spx_a_260 *a = (spx_a_260 *)p;
|
|
414
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
415
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
416
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
417
|
+
a->c->a3 = spx_in_int(a->v3);
|
|
418
|
+
a->c->a4 = RTEST(a->v4);
|
|
419
|
+
a->c->a5 = RTEST(a->v5);
|
|
420
|
+
a->c->a6 = RTEST(a->v6);
|
|
421
|
+
a->c->a7 = spx_in_int(a->v7);
|
|
422
|
+
return Qnil;
|
|
423
|
+
}
|
|
424
|
+
static VALUE spx_call_260(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_260, (void *)p, RUBY_UBF_IO, NULL); }
|
|
425
|
+
static VALUE spx_locked_260(VALUE p) {
|
|
426
|
+
spx_a_260 *a__ = (spx_a_260 *)p;
|
|
427
|
+
spx_c_260 *c__ = a__->c;
|
|
428
|
+
spx_conv_260(p);
|
|
429
|
+
if ((int)(intptr_t)spx_call_260((VALUE)c__))
|
|
430
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
431
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
static VALUE spx_entry_260(VALUE p) {
|
|
435
|
+
return rb_ensure(spx_locked_260, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
436
|
+
}
|
|
437
|
+
static VALUE spx_m_260(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4, VALUE v5, VALUE v6, VALUE v7) {
|
|
438
|
+
spx_c_260 c__; memset(&c__, 0, sizeof c__);
|
|
439
|
+
spx_a_260 a__ = { &c__, v0, v1, v2, v3, v4, v5, v6, v7 };
|
|
440
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_260, (VALUE)&a__);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; sp_bool a3; const char * ret; } spx_c_261;
|
|
444
|
+
static void spx_body_261(void *p) { spx_c_261 *c = (spx_c_261 *)p; c->ret = sp_QrReaderNative_s_lzw_decode(c->a0, c->a1, c->a2, c->a3); }
|
|
445
|
+
static void *spx_run_261(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_261, p, &spx_exc_cls, &spx_exc_msg); }
|
|
446
|
+
typedef struct { spx_c_261 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; } spx_a_261;
|
|
447
|
+
static VALUE spx_conv_261(VALUE p) { spx_a_261 *a = (spx_a_261 *)p;
|
|
448
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
449
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
450
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
451
|
+
a->c->a3 = RTEST(a->v3);
|
|
452
|
+
return Qnil;
|
|
453
|
+
}
|
|
454
|
+
static VALUE spx_call_261(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_261, (void *)p, RUBY_UBF_IO, NULL); }
|
|
455
|
+
static VALUE spx_locked_261(VALUE p) {
|
|
456
|
+
spx_a_261 *a__ = (spx_a_261 *)p;
|
|
457
|
+
spx_c_261 *c__ = a__->c;
|
|
458
|
+
spx_conv_261(p);
|
|
459
|
+
if ((int)(intptr_t)spx_call_261((VALUE)c__))
|
|
460
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
461
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
static VALUE spx_entry_261(VALUE p) {
|
|
465
|
+
return rb_ensure(spx_locked_261, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
466
|
+
}
|
|
467
|
+
static VALUE spx_m_261(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3) {
|
|
468
|
+
spx_c_261 c__; memset(&c__, 0, sizeof c__);
|
|
469
|
+
spx_a_261 a__ = { &c__, v0, v1, v2, v3 };
|
|
470
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_261, (VALUE)&a__);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; const char * ret; } spx_c_262;
|
|
474
|
+
static void spx_body_262(void *p) { spx_c_262 *c = (spx_c_262 *)p; c->ret = sp_QrReaderNative_s_binarize_hybrid(c->a0, c->a1, c->a2); }
|
|
475
|
+
static void *spx_run_262(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_262, p, &spx_exc_cls, &spx_exc_msg); }
|
|
476
|
+
typedef struct { spx_c_262 *c; VALUE v0; VALUE v1; VALUE v2; } spx_a_262;
|
|
477
|
+
static VALUE spx_conv_262(VALUE p) { spx_a_262 *a = (spx_a_262 *)p;
|
|
478
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
479
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
480
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
481
|
+
return Qnil;
|
|
482
|
+
}
|
|
483
|
+
static VALUE spx_call_262(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_262, (void *)p, RUBY_UBF_IO, NULL); }
|
|
484
|
+
static VALUE spx_locked_262(VALUE p) {
|
|
485
|
+
spx_a_262 *a__ = (spx_a_262 *)p;
|
|
486
|
+
spx_c_262 *c__ = a__->c;
|
|
487
|
+
spx_conv_262(p);
|
|
488
|
+
if ((int)(intptr_t)spx_call_262((VALUE)c__))
|
|
489
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
490
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
static VALUE spx_entry_262(VALUE p) {
|
|
494
|
+
return rb_ensure(spx_locked_262, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
495
|
+
}
|
|
496
|
+
static VALUE spx_m_262(VALUE self, VALUE v0, VALUE v1, VALUE v2) {
|
|
497
|
+
spx_c_262 c__; memset(&c__, 0, sizeof c__);
|
|
498
|
+
spx_a_262 a__ = { &c__, v0, v1, v2 };
|
|
499
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_262, (VALUE)&a__);
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; const char * ret; } spx_c_263;
|
|
503
|
+
static void spx_body_263(void *p) { spx_c_263 *c = (spx_c_263 *)p; c->ret = sp_QrReaderNative_s_binarize_local_mean(c->a0, c->a1, c->a2); }
|
|
504
|
+
static void *spx_run_263(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_263, p, &spx_exc_cls, &spx_exc_msg); }
|
|
505
|
+
typedef struct { spx_c_263 *c; VALUE v0; VALUE v1; VALUE v2; } spx_a_263;
|
|
506
|
+
static VALUE spx_conv_263(VALUE p) { spx_a_263 *a = (spx_a_263 *)p;
|
|
507
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
508
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
509
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
510
|
+
return Qnil;
|
|
511
|
+
}
|
|
512
|
+
static VALUE spx_call_263(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_263, (void *)p, RUBY_UBF_IO, NULL); }
|
|
513
|
+
static VALUE spx_locked_263(VALUE p) {
|
|
514
|
+
spx_a_263 *a__ = (spx_a_263 *)p;
|
|
515
|
+
spx_c_263 *c__ = a__->c;
|
|
516
|
+
spx_conv_263(p);
|
|
517
|
+
if ((int)(intptr_t)spx_call_263((VALUE)c__))
|
|
518
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
519
|
+
return (c__->ret) ? rb_utf8_str_new(c__->ret, (long)sp_str_byte_len(c__->ret)) : Qnil;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
static VALUE spx_entry_263(VALUE p) {
|
|
523
|
+
return rb_ensure(spx_locked_263, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
524
|
+
}
|
|
525
|
+
static VALUE spx_m_263(VALUE self, VALUE v0, VALUE v1, VALUE v2) {
|
|
526
|
+
spx_c_263 c__; memset(&c__, 0, sizeof c__);
|
|
527
|
+
spx_a_263 a__ = { &c__, v0, v1, v2 };
|
|
528
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_263, (VALUE)&a__);
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
typedef struct { const char * a0; sp_int a1; sp_int a2; const char * a3; sp_FloatArray * a4; sp_FloatArray * ret; } spx_c_264;
|
|
532
|
+
static void spx_body_264(void *p) { spx_c_264 *c = (spx_c_264 *)p; c->ret = sp_QrReaderNative_s_finder_scan(c->a0, c->a1, c->a2, c->a3, c->a4); }
|
|
533
|
+
static void *spx_run_264(void *p) { return (void *)(intptr_t)spx_init_qr_reader_native_try(spx_body_264, p, &spx_exc_cls, &spx_exc_msg); }
|
|
534
|
+
typedef struct { spx_c_264 *c; VALUE v0; VALUE v1; VALUE v2; VALUE v3; VALUE v4; } spx_a_264;
|
|
535
|
+
static VALUE spx_conv_264(VALUE p) { spx_a_264 *a = (spx_a_264 *)p;
|
|
536
|
+
a->c->a0 = spx_in_str(a->v0); _sp_gc_root_push((void**)((uintptr_t)&a->c->a0 | _SP_GC_SLOT_TAG(a->c->a0)));
|
|
537
|
+
a->c->a1 = spx_in_int(a->v1);
|
|
538
|
+
a->c->a2 = spx_in_int(a->v2);
|
|
539
|
+
a->c->a3 = spx_in_str(a->v3); _sp_gc_root_push((void**)((uintptr_t)&a->c->a3 | _SP_GC_SLOT_TAG(a->c->a3)));
|
|
540
|
+
a->c->a4 = spx_in_float_array(a->v4); _sp_gc_root_push((void**)((uintptr_t)&a->c->a4 | _SP_GC_SLOT_TAG(a->c->a4)));
|
|
541
|
+
return Qnil;
|
|
542
|
+
}
|
|
543
|
+
static VALUE spx_call_264(VALUE p) { return (VALUE)(intptr_t)rb_thread_call_without_gvl(spx_run_264, (void *)p, RUBY_UBF_IO, NULL); }
|
|
544
|
+
static VALUE spx_locked_264(VALUE p) {
|
|
545
|
+
spx_a_264 *a__ = (spx_a_264 *)p;
|
|
546
|
+
spx_c_264 *c__ = a__->c;
|
|
547
|
+
spx_conv_264(p);
|
|
548
|
+
if ((int)(intptr_t)spx_call_264((VALUE)c__))
|
|
549
|
+
spx_reraise(spx_exc_cls, spx_exc_msg);
|
|
550
|
+
return spx_out_float_array(c__->ret);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
static VALUE spx_entry_264(VALUE p) {
|
|
554
|
+
return rb_ensure(spx_locked_264, p, spx_restore_roots, (VALUE)sp_gc_nroots);
|
|
555
|
+
}
|
|
556
|
+
static VALUE spx_m_264(VALUE self, VALUE v0, VALUE v1, VALUE v2, VALUE v3, VALUE v4) {
|
|
557
|
+
spx_c_264 c__; memset(&c__, 0, sizeof c__);
|
|
558
|
+
spx_a_264 a__ = { &c__, v0, v1, v2, v3, v4 };
|
|
559
|
+
return rb_mutex_synchronize(spx_lock, spx_entry_264, (VALUE)&a__);
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
void Init_qr_reader_native(void) {
|
|
563
|
+
spx_init_qr_reader_native();
|
|
564
|
+
spx_lock = rb_mutex_new();
|
|
565
|
+
rb_global_variable(&spx_lock);
|
|
566
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
567
|
+
rb_define_module_function(m, "kernels_digest", spx_m_249, 0); }
|
|
568
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
569
|
+
rb_define_module_function(m, "kernel_files", spx_m_250, 0); }
|
|
570
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
571
|
+
rb_define_module_function(m, "downscale", spx_m_251, 4); }
|
|
572
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
573
|
+
rb_define_module_function(m, "pixels_luma", spx_m_252, 10); }
|
|
574
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
575
|
+
rb_define_module_function(m, "png_rows", spx_m_253, 8); }
|
|
576
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
577
|
+
rb_define_module_function(m, "png_adam7", spx_m_254, 6); }
|
|
578
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
579
|
+
rb_define_module_function(m, "png_unpack_rows", spx_m_255, 5); }
|
|
580
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
581
|
+
rb_define_module_function(m, "jpeg_info", spx_m_256, 1); }
|
|
582
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
583
|
+
rb_define_module_function(m, "jpeg_luma", spx_m_257, 2); }
|
|
584
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
585
|
+
rb_define_module_function(m, "jpeg_luma_keep", spx_m_258, 2); }
|
|
586
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
587
|
+
rb_define_module_function(m, "jpeg_render", spx_m_259, 2); }
|
|
588
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
589
|
+
rb_define_module_function(m, "ccitt_decode", spx_m_260, 8); }
|
|
590
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
591
|
+
rb_define_module_function(m, "lzw_decode", spx_m_261, 4); }
|
|
592
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
593
|
+
rb_define_module_function(m, "binarize_hybrid", spx_m_262, 3); }
|
|
594
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
595
|
+
rb_define_module_function(m, "binarize_local_mean", spx_m_263, 3); }
|
|
596
|
+
{ VALUE m = rb_define_module("QrReaderNative");
|
|
597
|
+
rb_define_module_function(m, "finder_scan", spx_m_264, 5); }
|
|
598
|
+
}
|