Przeglądaj źródła

not needed anymore with new false color generation

tags/v1.3
Thierry Leconte 21 lat temu
rodzic
commit
3a4ff68c7f
1 zmienionych plików z 0 dodań i 32 usunięć
  1. +0
    -32
      convert.c

+ 0
- 32
convert.c Wyświetl plik

@@ -1,32 +0,0 @@
#include <stdio.h>

main(int argc,char **argv)
{
FILE *fin,*fout;
int x,y;
int width,height;
int r,v,g;

fin=fopen(argv[1],"r");
fout=fopen(argv[2],"w");

fscanf(fin,"P3\n");
fscanf(fin,"%d %d\n",&width,&height);
fscanf(fin,"255\n");

fprintf(fout,"png_color cmap[%d][%d]={\n",width,height);
for(y=0;y<height;y++) {
fprintf(fout,"{");
for(x=0;x<width;x++) {
fscanf(fin,"%d\n%d\n%d\n",&r,&v,&g);
fprintf(fout,"{ %d,%d,%d},",r,v,g);
if(x%8==0) fprintf(fout,"\n");
}
fprintf(fout,"},\n");
}
fprintf(fout,"};\n");
fclose(fin);
fclose(fout);

}


Ładowanie…
Anuluj
Zapisz