From 089f3ece744b6acdceecf39cbd16b98b8c99b32b Mon Sep 17 00:00:00 2001 From: hackbard Date: Thu, 9 Oct 2003 20:25:50 +0000 Subject: [PATCH] inversed image --- conv_fg_tif.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) 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); } } -- 2.39.2