--- joko/Uni/BSArch/04/bmp_fractal.c 2006/06/30 20:39:33 1.1 +++ joko/Uni/BSArch/04/bmp_fractal.c 2006/07/01 09:40:29 1.2 @@ -11,7 +11,7 @@ #define YSIZE 500 #include "algorithm.h" -/* BMP Header +/* BMP Header */ unsigned char header[54]={0x42,0x4d, // signature BM 0xe6,0x71,0x0b,0x0, // filesize 750054 0x0,0x0,0x0,0x0, // reserved @@ -28,7 +28,6 @@ 0x0,0x0,0x0,0x0, // number of colortables 0x0,0x0,0x0,0x0 // number of important colors }; -*/ int main(int argc, char *argv[]) { @@ -37,61 +36,13 @@ char bgr[3]; short svalue; int lvalue; - unsigned char header[54],*ptr=&header[0]; + //unsigned char header[54],*ptr=&header[0]; fd=fopen("test.bmp","wb+"); if(NULL==fd) { perror("open"); exit(1); } -/* Der folgende Abschnitt dient nur zur information und kann durch - schreiben der auskommentierten Variable header ersetzt werden */ - svalue=0x4d42; - memcpy(ptr,&svalue,2);//signatur - ptr+=2; - lvalue=XSIZE*YSIZE*3+54; - memcpy(ptr,&lvalue,4); //filesize - ptr+=4; - lvalue=0; - memcpy(ptr,&lvalue,4);//reserved - ptr+=4; - lvalue=54; - memcpy(ptr,&lvalue,4);//image offset - ptr+=4; - lvalue=40; - memcpy(ptr,&lvalue,4);//size of header follows - ptr+=4; - lvalue=XSIZE; - memcpy(ptr,&lvalue,4);//with of image - ptr+=4; - lvalue=YSIZE; - memcpy(ptr,&lvalue,4); //height of image - ptr+=4; - svalue=1; - memcpy(ptr,&svalue,2); //number of planes - ptr+=2; - svalue=24; - memcpy(ptr,&svalue,2); //number of pixel - ptr+=2; - lvalue=0; //compression - memcpy(ptr,&lvalue,4); //compression - ptr+=4; - lvalue=XSIZE*YSIZE*3; - memcpy(ptr,&lvalue,4); //size of image - ptr+=4; - lvalue=0; - memcpy(ptr,&lvalue,4); //xres - ptr+=4; - lvalue=0; - memcpy(ptr,&lvalue,4); //yres - ptr+=4; - lvalue=0; - memcpy(ptr,&lvalue,4); //number of colortables - ptr+=4; - lvalue=0; - memcpy(ptr,&lvalue,4); //number of important colors - ptr+=4; -/* Ende Information */ len=fwrite(header,1,sizeof(header),fd); //write header