| @@ -52,6 +52,7 @@ typedef struct { · 51 unmodified lines |
| 52 | const AVClass *class; | 52 | const AVClass *class; |
| 53 | enum preset preset; | 53 | enum preset preset; |
| 54 | char *comp_points_str[NB_COMP]; | 54 | char *comp_points_str[NB_COMP]; |
| | 55 | char *comp_points_str_all; |
| 55 | uint8_t graph[NB_COMP][256]; | 56 | uint8_t graph[NB_COMP][256]; |
| 56 | } CurvesContext; | 57 | } CurvesContext; |
| 57 | | 58 | |
| @@ -64,6 +65,7 @@ static const AVOption curves_options[] = { · 6 unmodified lines |
| 64 | { "g", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, | 65 | { "g", "set green points coordinates", OFFSET(comp_points_str[1]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, |
| 65 | { "blue", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, | 66 | { "blue", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, |
| 66 | { "b", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, | 67 | { "b", "set blue points coordinates", OFFSET(comp_points_str[2]), AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, |
| | 68 | { "all", "set points coordinates for all components", OFFSET(comp_points_str_all),AV_OPT_TYPE_STRING, {.str=NULL}, .flags = FLAGS }, |
| 67 | { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, "preset_name" }, | 69 | { "preset", "select a color curves preset", OFFSET(preset), AV_OPT_TYPE_INT, {.i64=PRESET_NONE}, PRESET_NONE, NB_PRESETS-1, FLAGS, "preset_name" }, |
| 68 | { "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" }, | 70 | { "color_negative", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_COLOR_NEGATIVE}, INT_MIN, INT_MAX, FLAGS, "preset_name" }, |
| 69 | { "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, INT_MIN, INT_MAX, FLAGS, "preset_name" }, | 71 | { "cross_process", NULL, 0, AV_OPT_TYPE_CONST, {.i64=PRESET_CROSS_PROCESS}, INT_MIN, INT_MAX, FLAGS, "preset_name" }, |
| @@ -318,9 +320,18 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 248 unmodified lines |
| 318 | int i, j, ret; | 320 | int i, j, ret; |
| 319 | CurvesContext *curves = ctx->priv; | 321 | CurvesContext *curves = ctx->priv; |
| 320 | struct keypoint *comp_points[NB_COMP] = {0}; | 322 | struct keypoint *comp_points[NB_COMP] = {0}; |
| | 323 | char **pts = curves->comp_points_str; |
| | 324 | |
| | 325 | if (curves->comp_points_str_all) { |
| | 326 | for (i = 0; i < NB_COMP; i++) { |
| | 327 | if (!pts[i]) |
| | 328 | pts[i] = av_strdup(curves->comp_points_str_all); |
| | 329 | if (!pts[i]) |
| | 330 | return AVERROR(ENOMEM); |
| | 331 | } |
| | 332 | } |
| 321 | | 333 | |
| 322 | if (curves->preset != PRESET_NONE) { | 334 | if (curves->preset != PRESET_NONE) { |
| 323 | char **pts = curves->comp_points_str; | | |
| 324 | if (pts[0] || pts[1] || pts[2]) { | 335 | if (pts[0] || pts[1] || pts[2]) { |
| 325 | av_log(ctx, AV_LOG_ERROR, "It is not possible to mix a preset " | 336 | av_log(ctx, AV_LOG_ERROR, "It is not possible to mix a preset " |
| 326 | "with explicit points placements\n"); | 337 | "with explicit points placements\n"); |