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
480ddf2b
Commit
480ddf2b
authored
Feb 18, 2013
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/histogram: overlay display mode for levels histogram mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
e39821a6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
17 deletions
+26
-17
filters.texi
doc/filters.texi
+16
-12
vf_histogram.c
libavfilter/vf_histogram.c
+10
-5
No files found.
doc/filters.texi
View file @
480ddf2b
...
...
@@ -3170,29 +3170,33 @@ Set mode for @code{waveform}. Can be either @code{row}, or @code{column}.
Default is @code{row}.
@item display_mode
Set display mode for @code{waveform}.
Set display mode for @code{waveform}
and @code{levels}
.
It accepts the following values:
@table @samp
@item parade
Display separate waveforms for the color components side by side in
@code{row} mode or one below other in @code{column} mode.
In this display mode it is easy to spot color casts in the highlights and
shadows of an image, by comparing the contours of the top and the bottom
of each waveform. Since whites, grays, and blacks are characterized by
Display separate graph for the color components side by side in
@code{row} waveform mode or one below other in @code{column} waveform mode
for @code{waveform} histogram mode. For @code{levels} histogram mode
per color component graphs are placed one bellow other.
This display mode in @code{waveform} histogram mode makes it easy to spot
color casts in the highlights and shadows of an image, by comparing the
contours of the top and the bottom of each waveform.
Since whites, grays, and blacks are characterized by
exactly equal amounts of red, green, and blue, neutral areas of the
picture should display three waveforms of roughly equal height.
picture should display three waveforms of roughly equal
width/
height.
If not, the correction is easy to make by making adjustments to level the
three waveforms.
@item overlay
Presents information that's identical to that in the @code{parade}, except
that the
waveform
s representing color components are superimposed directly
that the
graph
s representing color components are superimposed directly
over one another.
This display mode can make it easier to spot the relative differences or
similarities in overlapping areas of the color components that are supposed
to be identical, such as neutral whites, grays, or blacks.
This display mode in @code{waveform} histogram mode can make it easier to spot
the relative differences or similarities in overlapping areas of the color
components that are supposed to be identical, such as neutral whites, grays,
or blacks.
@end table
Default is @code{parade}.
@end table
...
...
libavfilter/vf_histogram.c
View file @
480ddf2b
...
...
@@ -153,7 +153,7 @@ static int config_output(AVFilterLink *outlink)
switch
(
h
->
mode
)
{
case
MODE_LEVELS
:
outlink
->
w
=
256
;
outlink
->
h
=
(
h
->
level_height
+
h
->
scale_height
)
*
h
->
ncomp
;
outlink
->
h
=
(
h
->
level_height
+
h
->
scale_height
)
*
FFMAX
(
h
->
ncomp
*
h
->
display_mode
,
1
)
;
break
;
case
MODE_WAVEFORM
:
if
(
h
->
waveform_mode
)
...
...
@@ -200,7 +200,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
switch
(
h
->
mode
)
{
case
MODE_LEVELS
:
for
(
k
=
0
;
k
<
h
->
ncomp
;
k
++
)
{
int
start
=
k
*
(
h
->
level_height
+
h
->
scale_height
);
int
start
=
k
*
(
h
->
level_height
+
h
->
scale_height
)
*
h
->
display_mode
;
for
(
i
=
0
;
i
<
in
->
video
->
h
;
i
++
)
{
src
=
in
->
data
[
k
]
+
i
*
in
->
linesize
[
k
];
...
...
@@ -214,9 +214,14 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *in)
for
(
i
=
0
;
i
<
outlink
->
w
;
i
++
)
{
int
col_height
=
h
->
level_height
-
(
float
)
h
->
histogram
[
i
]
/
h
->
max_hval
*
h
->
level_height
;
for
(
j
=
h
->
level_height
-
1
;
j
>=
col_height
;
j
--
)
for
(
j
=
h
->
level_height
-
1
;
j
>=
col_height
;
j
--
)
{
if
(
h
->
display_mode
)
{
for
(
l
=
0
;
l
<
h
->
ncomp
;
l
++
)
out
->
data
[
l
][(
j
+
start
)
*
out
->
linesize
[
l
]
+
i
]
=
h
->
fg_color
[
l
];
}
else
{
out
->
data
[
k
][(
j
+
start
)
*
out
->
linesize
[
k
]
+
i
]
=
255
;
}
}
for
(
j
=
h
->
level_height
+
h
->
scale_height
-
1
;
j
>=
h
->
level_height
;
j
--
)
out
->
data
[
k
][(
j
+
start
)
*
out
->
linesize
[
k
]
+
i
]
=
i
;
}
...
...
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