diff options
author | Leo Howell <leo@lwh.jp> | 2009-09-05 09:33:22 +0900 |
---|---|---|
committer | Leo Howell <leo@lwh.jp> | 2009-09-05 09:33:22 +0900 |
commit | ef01767c732629b7eff7d1601e76a1bac58f5bfd (patch) | |
tree | ac29871fd3c6f1bab8dc8e3c51e33292d5544a96 /lpg/libqr/qr | |
download | pdf-simple-sign-ef01767c732629b7eff7d1601e76a1bac58f5bfd.tar.gz pdf-simple-sign-ef01767c732629b7eff7d1601e76a1bac58f5bfd.tar.xz pdf-simple-sign-ef01767c732629b7eff7d1601e76a1bac58f5bfd.zip |
The story so far
Diffstat (limited to 'lpg/libqr/qr')
-rw-r--r-- | lpg/libqr/qr/code.h | 35 | ||||
-rw-r--r-- | lpg/libqr/qr/data.h | 34 | ||||
-rw-r--r-- | lpg/libqr/qr/types.h | 8 |
3 files changed, 77 insertions, 0 deletions
diff --git a/lpg/libqr/qr/code.h b/lpg/libqr/qr/code.h new file mode 100644 index 0000000..6ae1aa9 --- /dev/null +++ b/lpg/libqr/qr/code.h @@ -0,0 +1,35 @@ +#ifndef QR_CODE_H +#define QR_CODE_H + +#include <stddef.h> +#include "types.h" + +enum qr_ec_level { + QR_EC_LEVEL_L, + QR_EC_LEVEL_M, + QR_EC_LEVEL_Q, + QR_EC_LEVEL_H +}; + +struct qr_code * qr_code_create(enum qr_ec_level ec, + const struct qr_data * data); + +void qr_code_destroy(struct qr_code *); + +int qr_code_width(const struct qr_code *); + +struct qr_code * qr_code_parse(const void * buffer, + size_t line_bits, + size_t line_stride, + size_t line_count); + +void qr_code_render(const struct qr_code * code, + void * buffer, + size_t mod_bits, + size_t line_stride, + size_t line_repeat, + unsigned long mark, + unsigned long space); + +#endif + diff --git a/lpg/libqr/qr/data.h b/lpg/libqr/qr/data.h new file mode 100644 index 0000000..5fbdded --- /dev/null +++ b/lpg/libqr/qr/data.h @@ -0,0 +1,34 @@ +#ifndef QR_DATA_H +#define QR_DATA_H + +#include <stddef.h> +#include "types.h" + +enum qr_data_type { + QR_DATA_INVALID = -1, + QR_DATA_ECI = 7, + QR_DATA_NUMERIC = 1, + QR_DATA_ALPHA = 2, + QR_DATA_8BIT = 4, + QR_DATA_KANJI = 8, /* JIS X 0208 */ + QR_DATA_MIXED = 3, + QR_DATA_FNC1 = 9 +}; + +struct qr_data * qr_create_data(int format, /* 1 ~ 40 */ + enum qr_data_type type, + const char * input, + size_t length); + +void qr_free_data(struct qr_data *); + +enum qr_data_type qr_get_data_type(const struct qr_data *); + +int qr_get_data_length(const struct qr_data *); + +enum qr_data_type qr_parse_data(const struct qr_data * input, + char ** output, + size_t * length); + +#endif + diff --git a/lpg/libqr/qr/types.h b/lpg/libqr/qr/types.h new file mode 100644 index 0000000..bb44cde --- /dev/null +++ b/lpg/libqr/qr/types.h @@ -0,0 +1,8 @@ +#ifndef QR_TYPES_H +#define QR_TYPES_H + +struct qr_data; +struct qr_code; + +#endif + |