Commit 212960ee authored by Paul B Mahol's avatar Paul B Mahol

colorchannelmixer filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 449cdd54
......@@ -24,6 +24,7 @@ version <next>:
- smptehdbars source
- inverse telecine filters (fieldmatch and decimate)
- colorbalance filter
- colorchannelmixer filter
version 1.2:
......
......@@ -2091,6 +2091,61 @@ colorbalance=rs=.3
@end example
@end itemize
@section colorchannelmixer
Adjust video input frames by re-mixing color channels.
This filter modifies a color channel by adding the values associated to
the other channels of the same pixels. For example if the value to
modify is red, the output value will be:
@example
@var{red}=@var{red}*@var{rr} + @var{blue}*@var{rb} + @var{green}*@var{rg} + @var{alpha}*@var{ra}
@end example
The filter accepts the following options:
@table @option
@item rr
@item rg
@item rb
@item ra
Adjust contribution of input red, green, blue and alpha channels for output red channel.
Default is @code{1} for @var{rr}, and @code{0} for @var{rg}, @var{rb} and @var{ra}.
@item gr
@item gg
@item gb
@item ga
Adjust contribution of input red, green, blue and alpha channels for output green channel.
Default is @code{1} for @var{gg}, and @code{0} for @var{gr}, @var{gb} and @var{ga}.
@item br
@item bg
@item bb
@item ba
Adjust contribution of input red, green, blue and alpha channels for output blue channel.
Default is @code{1} for @var{bb}, and @code{0} for @var{br}, @var{bg} and @var{ba}.
@item ar
@item ag
@item ab
@item aa
Adjust contribution of input red, green, blue and alpha channels for output alpha channel.
Default is @code{1} for @var{aa}, and @code{0} for @var{ar}, @var{ag} and @var{ab}.
Allowed ranges for options are @code{[-2.0, 2.0]}.
@end table
@subsection Examples
@itemize
@item
Convert source to grayscale:
@example
colorchannelmixer=.3:.4:.3:0:.3:.4:.3:0:.3:.4:.3
@end example
@end itemize
@section colormatrix
Convert color matrix.
......
......@@ -105,6 +105,7 @@ OBJS-$(CONFIG_BLACKFRAME_FILTER) += vf_blackframe.o
OBJS-$(CONFIG_BLEND_FILTER) += vf_blend.o
OBJS-$(CONFIG_BOXBLUR_FILTER) += vf_boxblur.o
OBJS-$(CONFIG_COLORBALANCE_FILTER) += vf_colorbalance.o
OBJS-$(CONFIG_COLORCHANNELMIXER_FILTER) += vf_colorchannelmixer.o
OBJS-$(CONFIG_COLORMATRIX_FILTER) += vf_colormatrix.o
OBJS-$(CONFIG_COPY_FILTER) += vf_copy.o
OBJS-$(CONFIG_CROP_FILTER) += vf_crop.o
......
......@@ -103,6 +103,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(BLEND, blend, vf);
REGISTER_FILTER(BOXBLUR, boxblur, vf);
REGISTER_FILTER(COLORBALANCE, colorbalance, vf);
REGISTER_FILTER(COLORCHANNELMIXER, colorchannelmixer, vf);
REGISTER_FILTER(COLORMATRIX, colormatrix, vf);
REGISTER_FILTER(COPY, copy, vf);
REGISTER_FILTER(CROP, crop, vf);
......
......@@ -29,7 +29,7 @@
#include "libavutil/avutil.h"
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 57
#define LIBAVFILTER_VERSION_MINOR 58
#define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment