Browse Source

lavfi/curves: make possible to customize presets.

tags/n2.0
Clément Bœsch 13 years ago
parent
commit
7e7dc1489f
2 changed files with 6 additions and 10 deletions
  1. +3
    -2
      doc/filters.texi
  2. +3
    -8
      libavfilter/vf_curves.c

+ 3
- 2
doc/filters.texi View File

@@ -2371,8 +2371,9 @@ The filter accepts the following options:

@table @option
@item preset
Select one of the available color presets. This option can not be used in
addition to the @option{r}, @option{g}, @option{b} parameters.
Select one of the available color presets. This option can be used in addition
to the @option{r}, @option{g}, @option{b} parameters; in this case, the later
options takes priority on the preset values.
Available presets are:
@table @samp
@item none


+ 3
- 8
libavfilter/vf_curves.c View File

@@ -333,14 +333,9 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
}

if (curves->preset != PRESET_NONE) {
if (pts[0] || pts[1] || pts[2]) {
av_log(ctx, AV_LOG_ERROR, "It is not possible to mix a preset "
"with explicit points placements\n");
return AVERROR(EINVAL);
}
pts[0] = av_strdup(curves_presets[curves->preset].r);
pts[1] = av_strdup(curves_presets[curves->preset].g);
pts[2] = av_strdup(curves_presets[curves->preset].b);
if (!pts[0]) pts[0] = av_strdup(curves_presets[curves->preset].r);
if (!pts[1]) pts[1] = av_strdup(curves_presets[curves->preset].g);
if (!pts[2]) pts[2] = av_strdup(curves_presets[curves->preset].b);
if (!pts[0] || !pts[1] || !pts[2])
return AVERROR(ENOMEM);
}


Loading…
Cancel
Save