aboutsummaryrefslogtreecommitdiff
path: root/lpg/libqr/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'lpg/libqr/test.c')
-rw-r--r--lpg/libqr/test.c15
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;
}