#include #include #include #include "paulslib.h" #include "bitmaplib.h" #define n 6 // nxy is the image width and height = 3^n #define nxy 729 int main(int argc,char **argv) { int i,j,k; int **b = NULL; int sum; BITMAP4 *image,white={255,255,255,0},black={0,0,0,0}; char fname[64]; FILE *fptr; /* Form the matrix */ b = malloc((nxy+1)*sizeof(int *)); for (i=0;i 0) Draw_Pixel(image,nxy,nxy,i,j,black); } } /* Write the image */ sprintf(fname,"hadamard.tga"); if ((fptr = fopen(fname,"w")) == NULL) { fprintf(stderr,"Unable to open bitmap file\n"); exit(0); } Write_Bitmap(fptr,image,nxy,nxy,12); fclose(fptr); exit(0); }