diff options
author | Leo Howell <leo@lwh.jp> | 2009-09-26 16:08:27 +0900 |
---|---|---|
committer | Leo Howell <leo@lwh.jp> | 2009-09-26 16:08:27 +0900 |
commit | 28849b589dcd933b2527d9f231ce6668ed7d19fa (patch) | |
tree | fe3bd370668940c18e37a0a10176c09e5a54be3c /lpg/libqr/test.c | |
parent | 64a96442629b720b2e2b1cc3997ee3dbc6a71b90 (diff) | |
download | pdf-simple-sign-28849b589dcd933b2527d9f231ce6668ed7d19fa.tar.gz pdf-simple-sign-28849b589dcd933b2527d9f231ce6668ed7d19fa.tar.xz pdf-simple-sign-28849b589dcd933b2527d9f231ce6668ed7d19fa.zip |
(partially) layout code
Diffstat (limited to 'lpg/libqr/test.c')
-rw-r--r-- | lpg/libqr/test.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lpg/libqr/test.c b/lpg/libqr/test.c index ec77bfe..f51b90b 100644 --- a/lpg/libqr/test.c +++ b/lpg/libqr/test.c @@ -33,6 +33,21 @@ int main() { printf("Code width %d\n", qr_code_width(code)); + { + /* Hack: render the code using ANSI terminal art */ + char buf[80*25]; + int x, y; + + qr_code_render(code, buf, 8, 80, 0, 1, 0); + for (y=0;y<21;++y) { + printf("\t|"); + for (x=0;x<21;++x) { + printf("%s ", buf[y*80+x]?"\033[7m":"\033[0m"); + } + printf("\033[0m|\n"); + } + } + return 0; } |