diff options
author | Leo Uino <leo@norisys.jp> | 2011-07-14 11:06:47 +0900 |
---|---|---|
committer | Leo Uino <leo@norisys.jp> | 2011-07-14 11:06:47 +0900 |
commit | 35baea42d794bec1fd5f2200f1f6f48877c5c26c (patch) | |
tree | 835460220763ca90bd17ed2c91999ebd28731ca7 /lpg/libqr/code-layout.c | |
parent | 44fc0ba93934ea9915fcd4f1902f49de57f2a949 (diff) | |
download | pdf-simple-sign-35baea42d794bec1fd5f2200f1f6f48877c5c26c.tar.gz pdf-simple-sign-35baea42d794bec1fd5f2200f1f6f48877c5c26c.tar.xz pdf-simple-sign-35baea42d794bec1fd5f2200f1f6f48877c5c26c.zip |
First attempt at parsing
Diffstat (limited to 'lpg/libqr/code-layout.c')
-rw-r--r-- | lpg/libqr/code-layout.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lpg/libqr/code-layout.c b/lpg/libqr/code-layout.c index 68a1a0e..04b6ca6 100644 --- a/lpg/libqr/code-layout.c +++ b/lpg/libqr/code-layout.c @@ -26,6 +26,9 @@ void qr_layout_init_mask(struct qr_code * code) const int * am_pos = QR_ALIGNMENT_LOCATION[code->version - 1]; int am_side; + if (!bmp->mask) + qr_bitmap_add_mask(bmp); + assert(bmp->mask); memset(bmp->mask, 0, bmp->height * bmp->stride); @@ -164,9 +167,8 @@ unsigned int qr_layout_read(struct qr_iterator * i) int b; for (b = 0; b < 8; ++b) { - x |= (*i->p & i->mask) ? 1 : 0; + x = (x << 1) | ((*i->p & i->mask) ? 1 : 0); advance(i); - x <<= 1; } return x; |