aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/qr/common.h
blob: f2bd1279a8339be078137bea396a4530c0a980b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef QR_COMMON_H
#define QR_COMMON_H

#include <qr/types.h>

struct qr_bitmap * qr_mask_apply(const struct qr_bitmap * orig,
                                 unsigned int mask);

size_t qr_code_total_capacity(int version);

int qr_code_width(const struct qr_code *);

/* See table 19 of the spec for the layout of EC data. There are at
 * most two different block lengths, so the total number of data+ec
 * blocks is the sum of block_count[]. The total number of 8-bit
 * words in each kind of block is data_length + ec_length.
 */
void qr_get_rs_block_sizes(int version,
                           enum qr_ec_level ec,
                           int block_count[2],
                           int data_length[2],
                           int ec_length[2]);

#endif