X-Git-Url: https://hackdaworld.org/gitweb/?p=physik%2Fnlsop.git;a=blobdiff_plain;f=conv_fg_tif.c;h=26fcdd7c381bc0b733db79f9694d688f03b0f1fb;hp=eb1205adeccfa1e941a8210fcc3ead3b8ce265f2;hb=f8eab7046ff397059600f9f25181b38c101e6f81;hpb=f52b9904f9433013ae0f1a5a059b0f20e66c5552 diff --git a/conv_fg_tif.c b/conv_fg_tif.c index eb1205a..26fcdd7 100644 --- a/conv_fg_tif.c +++ b/conv_fg_tif.c @@ -129,6 +129,7 @@ int main(int argc,char **argv) { int foo,k,l,bmps; unsigned char bbuf[128]; short bla; + int m; puts(""); puts("ati framegrabber tiff to bmp converter."); @@ -164,22 +165,18 @@ int main(int argc,char **argv) { printf("let's see what we have:\n"); puts(""); printf("we have %d strips, the offsets are:\n",pi.soc); - printf("1st: %04x, 2nd: %04x, ... last: %04x\n",pi.so[0],pi.so[1],pi.so[pi.soc-1]); + printf("1st: %04x, 2nd: %04x, ... last: %04x\n", + pi.so[0],pi.so[1],pi.so[pi.soc-1]); printf("their lenght in bytes is:\n"); printf("1st: %d ... last: %d\n",pi.sb[0],pi.sb[pi.sbc-1]); printf("checking ...\n"); - printf("we have %d pixels, each has %d bytes => %d bytes\n",pi.width*pi.height,pi.bps*pi.bits[0]/8,pi.width*pi.height*pi.bps*pi.bits[0]/8); + printf("we have %d pixels, each has %d bytes => %d bytes\n", + pi.width*pi.height,pi.bps*pi.bits[0]/8, + pi.width*pi.height*pi.bps*pi.bits[0]/8); for(i=0;i>10)<<3; - bbuf[1]=((bla>>5)&31)<<3; - bbuf[2]=(bla&31)<<3; + short2int(bla,buf+2*(pi.width*(pi.height-k-1)+l)); + bbuf[0]=((bla>>10)&31)<<3; /* blau */ + bbuf[1]=((bla>>5)&31)<<3; /* gelb */ + bbuf[2]=(bla&31)<<3; /* rot */ write(tfd,bbuf,3); } if(foo%4) { memset(bbuf,0,4-foo%4); - write(tfd,bbuf,4-foo%4); + write(tfd,bbuf,4-foo%4); } }