diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/combiner/Makefile | 7 | ||||
-rw-r--r-- | tools/combiner/combiner.c | 26 |
2 files changed, 33 insertions, 0 deletions
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 <stdint.h> +#include <stdio.h> + +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 ); + +} + |