#include #include #include #include "pict.h" #ifdef THINK_C #include #endif #define IW ( pict->image_W ) #define IH ( pict->image_H ) static char chr_map[256]= "@8X!<:. " ; main(int argc, char** argv) { char fname[256]; Pict pict; int ni, nj, ii, jj, i, j; unsigned char pixel; #ifdef THINK_C argc = ccommand(&argv); #endif if ( argc != 4 ) { printf("Uso: %s file w h \n",argv[0]);exit(-1);} ni = atoi(argv[2]); nj = atoi(argv[3]); pict = pict_read_pict( argv[1] ); if (nj==0) nj= (int)((float)IH/13.0 * 6.0 / (float)IW * (float)ni); for(jj=0;jjpixels + j*IW + i); printf("%c",chr_map[(pict->map[pixel][0])/32]); } puts(""); } }