diff --git a/mlaa.cpp b/mlaa.cpp new file mode 100644 index 0000000..cb9983b --- /dev/null +++ b/mlaa.cpp @@ -0,0 +1,76 @@ +#include +#include +#include + +void writeImg(int *pix, int w, int h) { + + int filesize = 54 + 3*w*h; + unsigned char *img = new unsigned char[3*w*h]; + int ind = 0; + + for (int i=0; i> 8); + bmpfileheader[ 4] = (unsigned char)(filesize>>16); + bmpfileheader[ 5] = (unsigned char)(filesize>>24); + + bmpinfoheader[ 4] = (unsigned char)( w ); + bmpinfoheader[ 5] = (unsigned char)( w>> 8); + bmpinfoheader[ 6] = (unsigned char)( w>>16); + bmpinfoheader[ 7] = (unsigned char)( w>>24); + bmpinfoheader[ 8] = (unsigned char)( h ); + bmpinfoheader[ 9] = (unsigned char)( h>> 8); + bmpinfoheader[10] = (unsigned char)( h>>16); + bmpinfoheader[11] = (unsigned char)( h>>24); + + FILE *f; + + f = fopen("img.bmp","wb"); + fwrite(bmpfileheader,1,14,f); + fwrite(bmpinfoheader,1,40,f); + for (int i=0; i