From 1cd536809b6c39cba15ab66f72b51aa5f99d7b35 Mon Sep 17 00:00:00 2001 From: C Nelson Date: Sat, 6 Apr 2013 22:50:19 -0500 Subject: [PATCH 1/3] First attempt at automated builds. --- .travis.yml | 5 +++++ Makefile | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..cf0c0d5 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: c +compiler: + - clang + - gcc +script: "make" diff --git a/Makefile b/Makefile index 7f3e575..dc32b61 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +CC?=gcc LDFLAGS=-lm CFLAGS=-O3 -Wall -Wuninitialized -fomit-frame-pointer -funroll-loops \ -fstrength-reduce -DNODEBUG `libpng-config --I_opts` @@ -18,31 +19,31 @@ clean: rm -f optar unoptar golay golay_codes.c *.o common.o: common.c optar.h - gcc -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< parity.o: parity.c - gcc -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< optar.o: optar.c optar.h font.h parity.h - gcc -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< golay_codes.o: golay_codes.c - gcc -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< golay.o: golay.c parity.h - gcc -c $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< unoptar.o: unoptar.c optar.h parity.h - gcc -c -I/usr/local/include/libpng $(CPPFLAGS) $(CFLAGS) -o $@ $< + $(CC) -c -I/usr/local/include/libpng $(CPPFLAGS) $(CFLAGS) -o $@ $< optar: optar.o common.o golay_codes.o parity.o - gcc $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ golay_codes.c: golay ./$< > $@ golay: golay.o parity.o - gcc $(LDFLAGS) -o $@ $^ + $(CC) $(LDFLAGS) -o $@ $^ unoptar: unoptar.o common.o golay_codes.o parity.o - gcc -o $@ -L/usr/local/lib $^ -lm -lpng -lz + $(CC) -o $@ -L/usr/local/lib $^ -lm -lpng -lz From fb08f9215c0fa781dc05f9023ae56119e3e8c5c8 Mon Sep 17 00:00:00 2001 From: C Nelson Date: Sat, 6 Apr 2013 22:56:02 -0500 Subject: [PATCH 2/3] Add the travis status to the readme. --- README => README.md | 2 ++ 1 file changed, 2 insertions(+) rename README => README.md (97%) diff --git a/README b/README.md similarity index 97% rename from README rename to README.md index a1ad5e3..a50c058 100644 --- a/README +++ b/README.md @@ -1,6 +1,8 @@ Twibright Optar --------------- +[![Build Status](https://travis-ci.org/cnelsonsic/optar.png?branch=add_travisci)](https://travis-ci.org/cnelsonsic/optar) + This is a program to store data on paper using a 600dpi b/w laser printer and a 600+ dpi scanner. From a7e71cddbca6abd13e5c871b47cc69bde92e7ced Mon Sep 17 00:00:00 2001 From: C Nelson Date: Sat, 6 Apr 2013 22:59:46 -0500 Subject: [PATCH 3/3] Convert most of the readme to markdown --- README.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index a50c058..3baafd2 100644 --- a/README.md +++ b/README.md @@ -13,28 +13,28 @@ there is no unnecessary jitter). Make sure you have libpng installed and if you type "libpng-config" on the commandline, there's a program which prints something. -Compile with "make". Become root (su -) and type "make install". Now you have +Compile with ``make``. Become root ``su -`` and type ``make install``. Now you have optar, unoptar and pgm2ps installed on your system in /usr/local/bin. Later -you can uninstall by typing "make uninstall" the same way as you typed -"make install". +you can uninstall by typing ``make uninstall`` the same way as you typed +``make install``. Encoding (writing) ------------------ Run -./optar other_guys.ogg other_guys.ogg +``./optar other_guys.ogg other_guys.ogg`` which will produce files: -other_guys.ogg_0001.pgm -other_guys.ogg_0002.pgm -other_guys.ogg_0003.pgm -other_guys.ogg_0004.pgm -other_guys.ogg_0005.pgm -other_guys.ogg_0006.pgm +* other_guys.ogg_0001.pgm +* other_guys.ogg_0002.pgm +* other_guys.ogg_0003.pgm +* other_guys.ogg_0004.pgm +* other_guys.ogg_0005.pgm +* other_guys.ogg_0006.pgm Now convert them into PostScript using the included pgm2ps tool: -./pgm2ps *.pgm +``./pgm2ps *.pgm`` Print them using a 600dpi (or more) laser printer. Inkjet or dot matrix was never tested and will not probably work at the pre-defined data density. See @@ -51,18 +51,18 @@ yellow pages on the scanner lid to get sharper picture *). Insert the page so that the text on the bottom is upright. Scan the pages into PNG (not JPEG!) on 600dpi (or 1200dpi, slightly better): -scan_0001.png -scan_0002.png -scan_0003.png -scan_0004.png -scan_0005.png -scan_0006.png +* scan_0001.png +* scan_0002.png +* scan_0003.png +* scan_0004.png +* scan_0005.png +* scan_0006.png Read the number sequence (format specification) from any of the papers and feed it as 1st argument to the optar, 2nd argument is the filename part before the underscore: -unoptar 0-65-93-24-3-1-2-24 scan > out.ogg +``unoptar 0-65-93-24-3-1-2-24 scan > out.ogg`` Then play out.ogg with mplayer. You should get first about 41 seconds from the Ogg Vorbis file. @@ -109,7 +109,7 @@ Future improvement camera. Currently it cannot since digital camera blurs at the sides of the picture. -(c) GPL 2007 Karel 'Clock' Kulhavy of Twibright Labs +© GPL 2007 Karel 'Clock' Kulhavy of Twibright Labs See COPYING for the text of the GPL license. e-mail: clock (at) twibright (dot) com Twibright Optar homepage: http://ronja.twibright.com/optar/