Changeset 1906
- Timestamp:
- Nov 6, 2007, 2:45:18 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/src/img2txt.c
r1902 r1906 46 46 fprintf(stderr, " -h, --help\tThis help\n"); 47 47 fprintf(stderr, " -W, --width=WIDTH\tWidth of resulting image\n"); 48 fprintf(stderr, " -H, --HEIGHT=HEIGHT\tHeight of resulting image\n"); 48 fprintf(stderr, " -H, --height=HEIGHT\tHeight of resulting image\n"); 49 fprintf(stderr, " -d, --dither=DITHER\tDithering algorithm to use :\n"); 50 fprintf(stderr, "\t\t\tnone : Nearest color\n"); 51 fprintf(stderr, "\t\t\tordered2 : Ordered 2x2\n"); 52 fprintf(stderr, "\t\t\tordered4 : Ordered 4x4\n"); 53 fprintf(stderr, "\t\t\tordered8 : Ordered 8x8\n"); 54 fprintf(stderr, "\t\t\trandom : Random\n"); 55 fprintf(stderr, "\t\t\tfstein : Floyd Steinberg (default)\n"); 49 56 fprintf(stderr, " -f, --format=FORMAT\tFormat of the resulting image :\n"); 50 fprintf(stderr, "\t\t\tansi : coulored ANSI \n");57 fprintf(stderr, "\t\t\tansi : coulored ANSI (default)\n"); 51 58 fprintf(stderr, "\t\t\tcaca : internal libcaca format\n"); 52 59 fprintf(stderr, "\t\t\tutf8 : UTF8 with CR\n"); … … 69 76 unsigned int cols = 0, lines = 0; 70 77 char *format = NULL; 78 char *dither = NULL; 71 79 72 80 … … 86 94 { "height", 1, NULL, 'H' }, 87 95 { "format", 1, NULL, 'f' }, 96 { "dither", 1, NULL, 'd' }, 88 97 { "help", 0, NULL, 'h' }, 89 98 }; 90 int c = mygetopt(argc, argv, "W:H:f: h", long_options, &option_index);99 int c = mygetopt(argc, argv, "W:H:f:d:h", long_options, &option_index); 91 100 if(c == -1) 92 101 break; … … 103 112 format = myoptarg; 104 113 break; 114 case 'd': /* --dither */ 115 dither = myoptarg; 116 break; 105 117 case 'h': /* --help */ 106 118 usage(argc, argv); … … 112 124 } 113 125 } 114 115 126 116 127 … … 149 160 cucul_set_color_ansi(cv, CUCUL_DEFAULT, CUCUL_TRANSPARENT); 150 161 cucul_clear_canvas(cv); 162 cucul_set_dither_algorithm(i->dither, dither?dither:"fstein"); 151 163 cucul_dither_bitmap(cv, 0, 0, cols, lines, i->dither, i->pixels); 152 164
Note: See TracChangeset
for help on using the changeset viewer.