Unified · Split
| @@ -1518,6 +1518,18 @@ int show_filters(void *optctx, const char *opt, const char *arg) · 1517 unmodified lines | ||
| 1518 | 1518 | return 0; |
| 1519 | 1519 | } |
| 1520 | 1520 | |
| 1521 | +void show_colors(void *optctx, const char *opt, const char *arg) | |
| 1522 | +{ | |
| 1523 | + const char *name; | |
| 1524 | + const uint8_t *rgb; | |
| 1525 | + int i; | |
| 1526 | + | |
| 1527 | + printf("%-32s #RRGGBB\n", "name"); | |
| 1528 | + | |
| 1529 | + for (i = 0; name = av_get_known_color_name(i, &rgb); i++) | |
| 1530 | + printf("%-32s #%02x%02x%02x\n", name, rgb[0], rgb[1], rgb[2]); | |
| 1531 | +} | |
| 1532 | + | |
| 1521 | 1533 | int show_pix_fmts(void *optctx, const char *opt, const char *arg) |
| 1522 | 1534 | { |
| 1523 | 1535 | const AVPixFmtDescriptor *pix_desc = NULL; |
| @@ -488,6 +488,12 @@ int show_layouts(void *optctx, const char *opt, const char *arg); · 487 unmodified lines | ||
| 488 | 488 | */ |
| 489 | 489 | int show_sample_fmts(void *optctx, const char *opt, const char *arg); |
| 490 | 490 | |
| 491 | +/** | |
| 492 | + * Print a listing containing all the color names and values recognized | |
| 493 | + * by the program. | |
| 494 | + */ | |
| 495 | +void show_colors(void *optctx, const char *opt, const char *arg); | |
| 496 | + | |
| 491 | 497 | /** |
| 492 | 498 | * Return a positive value if a line read from standard input |
| 493 | 499 | * starts with [yY], otherwise return 0. |
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | { "pix_fmts" , OPT_EXIT, {.func_arg = show_pix_fmts }, "show available pixel formats" }, |
| 15 | 15 | { "layouts" , OPT_EXIT, {.func_arg = show_layouts }, "show standard channel layouts" }, |
| 16 | 16 | { "sample_fmts", OPT_EXIT, {.func_arg = show_sample_fmts }, "show available audio sample formats" }, |
| 17 | + { "colors" , OPT_EXIT, {.func_arg = show_colors }, "show available color names" }, | |
| 17 | 18 | { "loglevel" , HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" }, |
| 18 | 19 | { "v", HAS_ARG, {.func_arg = opt_loglevel}, "set logging level", "loglevel" }, |
| 19 | 20 | { "report" , 0, {(void*)opt_report}, "generate a report" }, |
| @@ -128,6 +128,9 @@ Show available sample formats. · 127 unmodified lines | ||
| 128 | 128 | @item -layouts |
| 129 | 129 | Show channel names and standard channel layouts. |
| 130 | 130 | |
| 131 | +@item -colors | |
| 132 | +Show recognized color names. | |
| 133 | + | |
| 131 | 134 | @item -loglevel [repeat+]@var{loglevel} | -v [repeat+]@var{loglevel} |
| 132 | 135 | Set the logging level used by the library. |
| 133 | 136 | Adding "repeat+" indicates that repeated log output should not be compressed |