};
enum VectorscopeMode {
- GRAY,
+ TINT,
COLOR,
COLOR2,
COLOR3,
int intensity;
float fintensity;
uint16_t bg_color[4];
+ float ftint[2];
int planewidth[4];
int planeheight[4];
int hsub, vsub;
float bgopacity;
float lthreshold;
float hthreshold;
+ int tint[2];
int tmin;
int tmax;
int flags;
static const AVOption vectorscope_options[] = {
{ "mode", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
{ "m", "set vectorscope mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64=0}, 0, MODE_NB-1, FLAGS, "mode"},
- { "gray", 0, 0, AV_OPT_TYPE_CONST, {.i64=GRAY}, 0, 0, FLAGS, "mode" },
+ { "gray", 0, 0, AV_OPT_TYPE_CONST, {.i64=TINT}, 0, 0, FLAGS, "mode" },
+ { "tint", 0, 0, AV_OPT_TYPE_CONST, {.i64=TINT}, 0, 0, FLAGS, "mode" },
{ "color", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR}, 0, 0, FLAGS, "mode" },
{ "color2", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR2}, 0, 0, FLAGS, "mode" },
{ "color3", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR3}, 0, 0, FLAGS, "mode" },
{ "auto", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "colorspace" },
{ "601", 0, 0, AV_OPT_TYPE_CONST, {.i64=1}, 0, 0, FLAGS, "colorspace" },
{ "709", 0, 0, AV_OPT_TYPE_CONST, {.i64=2}, 0, 0, FLAGS, "colorspace" },
+ { "tint0", "set 1st tint", OFFSET(ftint[0]), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS},
+ { "t0", "set 1st tint", OFFSET(ftint[0]), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS},
+ { "tint1", "set 2nd tint", OFFSET(ftint[1]), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS},
+ { "t1", "set 2nd tint", OFFSET(ftint[1]), AV_OPT_TYPE_FLOAT, {.dbl=0}, -1, 1, FLAGS},
{ NULL }
};
switch (s->mode) {
case COLOR:
case COLOR5:
- case GRAY:
+ case TINT:
if (s->is_yuv) {
for (i = 0; i < h; i++) {
const int iwx = i * slinesizex;
}
}
- if (s->mode == COLOR) {
+ if (s->mode == TINT && (s->tint[0] != mid ||
+ s->tint[1] != mid)) {
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ if (dpd[i * dlinesize + j]) {
+ dst[1][i * dlinesize + j] = s->tint[0];
+ dst[2][i * dlinesize + j] = s->tint[1];
+ }
+ }
+ }
+ } else if (s->mode == COLOR) {
for (i = 0; i < out->height; i++) {
for (j = 0; j < out->width; j++) {
if (!dpd[i * dlinesize + j]) {
switch (s->mode) {
case COLOR5:
case COLOR:
- case GRAY:
+ case TINT:
if (s->is_yuv) {
for (i = 0; i < h; i++) {
const int iwx = i * slinesizex;
}
}
- if (s->mode == COLOR) {
+ if (s->mode == TINT && (s->tint[0] != 128 ||
+ s->tint[1] != 128)) {
+ for (i = 0; i < out->height; i++) {
+ for (j = 0; j < out->width; j++) {
+ if (dpd[i * dlinesize + j]) {
+ dst[1][i * dlinesize + j] = s->tint[0];
+ dst[2][i * dlinesize + j] = s->tint[1];
+ }
+ }
+ }
+ } else if (s->mode == COLOR) {
for (i = 0; i < out->height; i++) {
for (j = 0; j < out->width; j++) {
if (!dpd[i * out->linesize[pd] + j]) {
return AVERROR(EINVAL);
}
- if (s->mode == GRAY && s->is_yuv)
+ if (s->mode == TINT && s->is_yuv) {
s->pd = 0;
- else {
+ } else {
if ((s->x == 1 && s->y == 2) || (s->x == 2 && s->y == 1))
s->pd = 0;
else if ((s->x == 0 && s->y == 2) || (s->x == 2 && s->y == 0))
s->bg_color[3] = s->bgopacity * (s->size - 1);
+ s->tint[0] = .5f * (s->ftint[0] + 1.f) * (s->size - 1);
+ s->tint[1] = .5f * (s->ftint[1] + 1.f) * (s->size - 1);
+
switch (inlink->format) {
case AV_PIX_FMT_GBRP12:
case AV_PIX_FMT_GBRP10:
break;
default:
s->bg_color[0] = 0;
- s->bg_color[1] = s->size / 2 - 1;
- s->bg_color[2] = s->size / 2 - 1;
+ s->bg_color[1] = s->size / 2;
+ s->bg_color[2] = s->size / 2;
}
s->hsub = desc->log2_chroma_w;