char *w_expr, *h_expr; ///< expression for width and height
char *t_expr; ///< expression for thickness
int have_alpha;
+ int replace;
} DrawBoxContext;
static const int NUM_EXPR_EVALS = 5;
int plane, x, y, xb = s->x, yb = s->y;
unsigned char *row[4];
- if (s->have_alpha) {
+ if (s->have_alpha && s->replace) {
for (y = FFMAX(yb, 0); y < frame->height && y < (yb + s->h); y++) {
row[0] = frame->data[0] + y * frame->linesize[0];
row[3] = frame->data[3] + y * frame->linesize[3];
{ "c", "set color of the box", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "thickness", "set the box thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, { .str="3" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "t", "set the box thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, { .str="3" }, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "replace", "replace color & alpha", OFFSET(replace), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, FLAGS },
{ NULL }
};
int plane, x, y;
uint8_t *row[4];
- if (drawgrid->have_alpha) {
+ if (drawgrid->have_alpha && drawgrid->replace) {
for (y = 0; y < frame->height; y++) {
row[0] = frame->data[0] + y * frame->linesize[0];
row[3] = frame->data[3] + y * frame->linesize[3];
{ "c", "set color of the grid", OFFSET(color_str), AV_OPT_TYPE_STRING, { .str = "black" }, CHAR_MIN, CHAR_MAX, FLAGS },
{ "thickness", "set grid line thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX, FLAGS },
{ "t", "set grid line thickness", OFFSET(t_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX, FLAGS },
+ { "replace", "replace color & alpha", OFFSET(replace), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, FLAGS },
{ NULL }
};