Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
0d8b6a15
Commit
0d8b6a15
authored
Aug 19, 2016
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_histogram: make foreground and background opacity configurable
parent
ca906e81
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
filters.texi
doc/filters.texi
+6
-0
vf_histogram.c
libavfilter/vf_histogram.c
+15
-6
No files found.
doc/filters.texi
View file @
0d8b6a15
...
...
@@ -8555,6 +8555,12 @@ Default is @code{linear}.
@item components
Set what color components to display.
Default is @code{7}.
@item fgopacity
Set foreground opacity. Default is @code{0.7}.
@item bgopacity
Set background opacity. Default is @code{0.5}.
@end table
@subsection Examples
...
...
libavfilter/vf_histogram.c
View file @
0d8b6a15
...
...
@@ -35,14 +35,16 @@ typedef struct HistogramContext {
int
histogram_size
;
int
mult
;
int
ncomp
;
const
uint8_t
*
bg_color
;
const
uint8_t
*
fg_color
;
uint8_t
bg_color
[
4
]
;
uint8_t
fg_color
[
4
]
;
int
level_height
;
int
scale_height
;
int
display_mode
;
int
levels_mode
;
const
AVPixFmtDescriptor
*
desc
,
*
odesc
;
int
components
;
float
fgopacity
;
float
bgopacity
;
int
planewidth
[
4
];
int
planeheight
[
4
];
}
HistogramContext
;
...
...
@@ -63,6 +65,10 @@ static const AVOption histogram_options[] = {
{
"logarithmic"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
1
},
0
,
0
,
FLAGS
,
"levels_mode"
},
{
"components"
,
"set color components to display"
,
OFFSET
(
components
),
AV_OPT_TYPE_INT
,
{.
i64
=
7
},
1
,
15
,
FLAGS
},
{
"c"
,
"set color components to display"
,
OFFSET
(
components
),
AV_OPT_TYPE_INT
,
{.
i64
=
7
},
1
,
15
,
FLAGS
},
{
"fgopacity"
,
"set foreground opacity"
,
OFFSET
(
fgopacity
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
7
},
0
,
1
,
FLAGS
},
{
"f"
,
"set foreground opacity"
,
OFFSET
(
fgopacity
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
7
},
0
,
1
,
FLAGS
},
{
"bgopacity"
,
"set background opacity"
,
OFFSET
(
bgopacity
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
5
},
0
,
1
,
FLAGS
},
{
"b"
,
"set background opacity"
,
OFFSET
(
bgopacity
),
AV_OPT_TYPE_FLOAT
,
{.
dbl
=
0
.
5
},
0
,
1
,
FLAGS
},
{
NULL
}
};
...
...
@@ -197,14 +203,17 @@ static int config_input(AVFilterLink *inlink)
case
AV_PIX_FMT_GBRP9
:
case
AV_PIX_FMT_GBRAP
:
case
AV_PIX_FMT_GBRP
:
h
->
bg_color
=
black_gbrp_color
;
h
->
fg_color
=
white_gbrp_color
;
memcpy
(
h
->
bg_color
,
black_gbrp_color
,
4
)
;
memcpy
(
h
->
fg_color
,
white_gbrp_color
,
4
)
;
break
;
default:
h
->
bg_color
=
black_yuva_color
;
h
->
fg_color
=
white_yuva_color
;
memcpy
(
h
->
bg_color
,
black_yuva_color
,
4
)
;
memcpy
(
h
->
fg_color
,
white_yuva_color
,
4
)
;
}
h
->
fg_color
[
3
]
=
h
->
fgopacity
*
255
;
h
->
bg_color
[
3
]
=
h
->
bgopacity
*
255
;
h
->
planeheight
[
1
]
=
h
->
planeheight
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
h
,
h
->
desc
->
log2_chroma_h
);
h
->
planeheight
[
0
]
=
h
->
planeheight
[
3
]
=
inlink
->
h
;
h
->
planewidth
[
1
]
=
h
->
planewidth
[
2
]
=
AV_CEIL_RSHIFT
(
inlink
->
w
,
h
->
desc
->
log2_chroma_w
);
...
...
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