From 4670274ec303082e0fb86ff3be1ea4170a17662f Mon Sep 17 00:00:00 2001 From: Leo Uino Date: Fri, 15 Jul 2011 14:20:41 +0900 Subject: qr_mask_apply() works in-place --- lpg/libqr/code-create.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lpg/libqr/code-create.c') diff --git a/lpg/libqr/code-create.c b/lpg/libqr/code-create.c index 680b405..f29778f 100644 --- a/lpg/libqr/code-create.c +++ b/lpg/libqr/code-create.c @@ -332,11 +332,12 @@ static int mask_data(struct qr_code * code) /* Generate bitmap for each mask and evaluate */ for (i = 0; i < 8; ++i) { - test = qr_mask_apply(code->modules, i); + test = qr_bitmap_clone(code->modules); if (!test) { qr_bitmap_destroy(mask); return -1; } + qr_mask_apply(test, i); score = score_mask(test); fprintf(stderr, "mask %d scored %d\n", i, score); if (!mask || score < best) { -- cgit v1.2.3-70-g09d2