aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/code-layout.c
diff options
context:
space:
mode:
authorLeo Uino <leo@norisys.jp>2011-07-14 11:06:47 +0900
committerLeo Uino <leo@norisys.jp>2011-07-14 11:06:47 +0900
commit35baea42d794bec1fd5f2200f1f6f48877c5c26c (patch)
tree835460220763ca90bd17ed2c91999ebd28731ca7 /lpg/libqr/code-layout.c
parent44fc0ba93934ea9915fcd4f1902f49de57f2a949 (diff)
downloadpdf-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.c6
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;