From: hackbard Date: Thu, 9 Oct 2003 20:25:50 +0000 (+0000) Subject: inversed image X-Git-Tag: fpb~8 X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=089f3ece744b6acdceecf39cbd16b98b8c99b32b;p=physik%2Fnlsop.git inversed image --- 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); } }