/* usage: pbmtobraille [infile|- [outfile]] pbmtobraille reads a pbm file and produces a 6-dot raw braille file suitable to be embossed in graphics mode by the VersaPoint BP1D embosser. Requires the netpbm library to read the input image. dot numbering conventions: each braille symbol is enconded in one little endian octect. bit: 7 6 5 4 3 2 1 0 dot: - - 1 2 3 4 5 6 Copyright © 2007 Danton Nunes, licenced by GPL-2. */ #include #include #include #include char *infilename="-"; char *outfilename="-"; FILE *infile; FILE *outfile; /* this is based on the VersaPoint BP1D manual, thanks to Fundação Dorina Nowill. */ char *translation=" ,\";`.~\177'-90/+>#1534i{jw2867s!t)a*e:c%d?kuozmxnyb0) { int i; pbm_readpbmrow(infile,a,cols,format); rows--; if (rows-->0) pbm_readpbmrow(infile,b,cols,format); else white_pad(b,cols); if (rows-->0) pbm_readpbmrow(infile,c,cols,format); else white_pad(c,cols); for (i=0; i