Beispiel #1
0
function usage($argc, $argv)
{
    fprintf(STDERR, "Usage: %s [OPTIONS]... <IMAGE>\n", $argv[0]);
    fprintf(STDERR, "Convert IMAGE to any text based available format.\n");
    fprintf(STDERR, "Example : %s -W 80 -f ansi ./caca.png\n\n", $argv[0]);
    fprintf(STDERR, "Options:\n");
    fprintf(STDERR, "  -h, --help\t\t\tThis help\n");
    fprintf(STDERR, "  -v, --version\t\t\tVersion of the program\n");
    fprintf(STDERR, "  -W, --width=WIDTH\t\tWidth of resulting image\n");
    fprintf(STDERR, "  -H, --height=HEIGHT\t\tHeight of resulting image\n");
    fprintf(STDERR, "  -x, --font-width=WIDTH\t\tWidth of output font\n");
    fprintf(STDERR, "  -y, --font-height=HEIGHT\t\tHeight of output font\n");
    fprintf(STDERR, "  -b, --brightness=BRIGHTNESS\tBrightness of resulting image\n");
    fprintf(STDERR, "  -c, --contrast=CONTRAST\tContrast of resulting image\n");
    fprintf(STDERR, "  -g, --gamma=GAMMA\t\tGamma of resulting image\n");
    fprintf(STDERR, "  -d, --dither=DITHER\t\tDithering algorithm to use :\n");
    $list = caca_get_dither_algorithm_list(caca_create_dither(imagecreate(1, 1)));
    foreach ($list as $type => $name) {
        fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name);
    }
    fprintf(STDERR, "  -f, --format=FORMAT\t\tFormat of the resulting image :\n");
    $list = caca_get_export_list();
    foreach ($list as $type => $name) {
        fprintf(STDERR, "\t\t\t%s: %s\n", $type, $name);
    }
}
Beispiel #2
0
 function getAlgorithmList()
 {
     return caca_get_dither_algorithm_list($this->dt);
 }