瀏覽代碼

not needed anymore with new false color generation

tags/v1.3
Thierry Leconte 21 年之前
父節點
當前提交
3a4ff68c7f
共有 1 個檔案被更改,包括 0 行新增32 行删除
  1. +0
    -32
      convert.c

+ 0
- 32
convert.c 查看文件

@@ -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);

}


Loading…
取消
儲存