Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
294854bd
Commit
294854bd
authored
Jan 16, 2021
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vsrc_testsrc: add complement mode to rgbtestsrc
parent
79f2bca5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
2 deletions
+32
-2
vsrc_testsrc.c
libavfilter/vsrc_testsrc.c
+32
-2
No files found.
libavfilter/vsrc_testsrc.c
View file @
294854bd
...
@@ -77,6 +77,7 @@ typedef struct TestSourceContext {
...
@@ -77,6 +77,7 @@ typedef struct TestSourceContext {
/* only used by rgbtest */
/* only used by rgbtest */
uint8_t
rgba_map
[
4
];
uint8_t
rgba_map
[
4
];
int
complement
;
int
depth
;
int
depth
;
/* only used by haldclut */
/* only used by haldclut */
...
@@ -963,7 +964,13 @@ AVFilter ff_vsrc_testsrc2 = {
...
@@ -963,7 +964,13 @@ AVFilter ff_vsrc_testsrc2 = {
#if CONFIG_RGBTESTSRC_FILTER
#if CONFIG_RGBTESTSRC_FILTER
#define rgbtestsrc_options options
static
const
AVOption
rgbtestsrc_options
[]
=
{
COMMON_OPTIONS
{
"complement"
,
"set complement colors"
,
OFFSET
(
complement
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
"co"
,
"set complement colors"
,
OFFSET
(
complement
),
AV_OPT_TYPE_BOOL
,
{.
i64
=
0
},
0
,
1
,
FLAGS
},
{
NULL
}
};
AVFILTER_DEFINE_CLASS
(
rgbtestsrc
);
AVFILTER_DEFINE_CLASS
(
rgbtestsrc
);
#define R 0
#define R 0
...
@@ -1024,6 +1031,29 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
...
@@ -1024,6 +1031,29 @@ static void rgbtest_put_pixel(uint8_t *dstp[4], int dst_linesizep[4],
}
}
}
}
static
void
rgbtest_fill_picture_complement
(
AVFilterContext
*
ctx
,
AVFrame
*
frame
)
{
TestSourceContext
*
test
=
ctx
->
priv
;
int
x
,
y
,
w
=
frame
->
width
,
h
=
frame
->
height
;
for
(
y
=
0
;
y
<
h
;
y
++
)
{
for
(
x
=
0
;
x
<
w
;
x
++
)
{
int
c
=
(
1
<<
FFMAX
(
test
->
depth
,
8
))
*
x
/
w
;
int
r
=
0
,
g
=
0
,
b
=
0
;
if
(
6
*
y
<
h
)
r
=
c
;
else
if
(
6
*
y
<
2
*
h
)
g
=
c
,
b
=
c
;
else
if
(
6
*
y
<
3
*
h
)
g
=
c
;
else
if
(
6
*
y
<
4
*
h
)
r
=
c
,
b
=
c
;
else
if
(
6
*
y
<
5
*
h
)
b
=
c
;
else
r
=
c
,
g
=
c
;
rgbtest_put_pixel
(
frame
->
data
,
frame
->
linesize
,
x
,
y
,
r
,
g
,
b
,
ctx
->
outputs
[
0
]
->
format
,
test
->
rgba_map
);
}
}
}
static
void
rgbtest_fill_picture
(
AVFilterContext
*
ctx
,
AVFrame
*
frame
)
static
void
rgbtest_fill_picture
(
AVFilterContext
*
ctx
,
AVFrame
*
frame
)
{
{
TestSourceContext
*
test
=
ctx
->
priv
;
TestSourceContext
*
test
=
ctx
->
priv
;
...
@@ -1049,7 +1079,7 @@ static av_cold int rgbtest_init(AVFilterContext *ctx)
...
@@ -1049,7 +1079,7 @@ static av_cold int rgbtest_init(AVFilterContext *ctx)
TestSourceContext
*
test
=
ctx
->
priv
;
TestSourceContext
*
test
=
ctx
->
priv
;
test
->
draw_once
=
1
;
test
->
draw_once
=
1
;
test
->
fill_picture_fn
=
rgbtest_fill_picture
;
test
->
fill_picture_fn
=
test
->
complement
?
rgbtest_fill_picture_complement
:
rgbtest_fill_picture
;
return
init
(
ctx
);
return
init
(
ctx
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment