55 caca_free_dither(c->
dither);
59 caca_free_canvas(c->
canvas);
67 const char *
const *drivers = caca_get_display_driver_list();
71 for (i = 0; drivers[i]; i += 2)
75 #define DEFINE_LIST_DITHER(thing, thing_str) \
76 static void list_dither_## thing(CACAContext *c) \
78 const char *const *thing = caca_get_dither_## thing ##_list(c->dither); \
81 av_log(c->ctx, AV_LOG_INFO, "Available %s:\n", thing_str); \
82 for (i = 0; thing[i]; i += 2) \
83 av_log(c->ctx, AV_LOG_INFO, "%s : %s\n", thing[i], thing[i + 1]); \
105 list_dither_color(c);
107 list_dither_charset(c);
108 }
else if (!strcmp(c->
list_dither,
"algorithms")) {
109 list_dither_algorithm(c);
110 }
else if (!strcmp(c->
list_dither,
"antialiases")) {
111 list_dither_antialias(c);
114 "Invalid argument '%s', for 'list_dither' option\n"
115 "Argument must be one of 'algorithms, 'antialiases', 'charsets', 'colors'\n",
131 "Unsupported pixel format '%s', choose rgb24\n",
145 bpp / 8 * encctx->
width,
146 0x0000ff, 0x00ff00, 0xff0000, 0);
153 #define CHECK_DITHER_OPT(opt) \
154 if (caca_set_dither_##opt(c->dither, c->opt) < 0) { \
155 ret = AVERROR(errno); \
156 av_log(s, AV_LOG_ERROR, "Failed to set value '%s' for option '%s'\n", \
195 caca_refresh_display(c->
display);
200 #define OFFSET(x) offsetof(CACAContext,x)
201 #define ENC AV_OPT_FLAG_ENCODING_PARAM
240 .priv_class = &caca_class,