From bf650e3cee3e6154a6fa028f0c1f927a8d0af797 Mon Sep 17 00:00:00 2001 From: Charles Lohr Date: Sat, 17 Dec 2016 23:03:18 -0500 Subject: Add combiner --- tools/combiner/Makefile | 7 +++++++ tools/combiner/combiner.c | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 tools/combiner/Makefile create mode 100644 tools/combiner/combiner.c (limited to 'tools') diff --git a/tools/combiner/Makefile b/tools/combiner/Makefile new file mode 100644 index 0000000..fe2457f --- /dev/null +++ b/tools/combiner/Makefile @@ -0,0 +1,7 @@ +all : combiner + +combiner : combiner.c + gcc -o $@ $^ + +clean : + rm -rf combiner diff --git a/tools/combiner/combiner.c b/tools/combiner/combiner.c new file mode 100644 index 0000000..cd724ce --- /dev/null +++ b/tools/combiner/combiner.c @@ -0,0 +1,26 @@ +#include +#include + +uint8_t rd[131072]; +uint8_t ld[131072]; +uint8_t lo[131072*4]; + +int main() +{ + FILE * l = fopen( "l_lighthouse.dat", "rb" ); + FILE * r = fopen( "r_lighthouse.dat", "rb" ); + FILE * o = fopen( "dual_lighthouse.dat", "wb" ); + fread( rd, 131072, 1, r ); + fread( ld, 131072, 1, l ); + int i; + for( i = 0; i < 131072; i++ ) + { + int rr = rd[i]; + int lr = ld[i]; + int alpha = (rr>lr)?rr:lr; + fprintf( o, "%c%c%c%c", rr, lr, 0, alpha ); + } + fclose( o ); + +} + -- cgit v1.2.3