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
91cc3aa8
Commit
91cc3aa8
authored
Sep 15, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/avf_showspectrum: add magma color map
parent
6304268e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
filters.texi
doc/filters.texi
+4
-0
avf_showspectrum.c
libavfilter/avf_showspectrum.c
+13
-1
No files found.
doc/filters.texi
View file @
91cc3aa8
...
...
@@ -20506,6 +20506,8 @@ each channel is displayed using the fiery color scheme
each channel is displayed using the fruit color scheme
@item cool
each channel is displayed using the cool color scheme
@item magma
each channel is displayed using the magma color scheme
@end table
Default value is @samp{channel}.
...
...
@@ -20655,6 +20657,8 @@ each channel is displayed using the fiery color scheme
each channel is displayed using the fruit color scheme
@item cool
each channel is displayed using the cool color scheme
@item magma
each channel is displayed using the magma color scheme
@end table
Default value is @samp{intensity}.
...
...
libavfilter/avf_showspectrum.c
View file @
91cc3aa8
...
...
@@ -44,7 +44,7 @@
enum
DisplayMode
{
COMBINED
,
SEPARATE
,
NB_MODES
};
enum
DataMode
{
D_MAGNITUDE
,
D_PHASE
,
NB_DMODES
};
enum
DisplayScale
{
LINEAR
,
SQRT
,
CBRT
,
LOG
,
FOURTHRT
,
FIFTHRT
,
NB_SCALES
};
enum
ColorMode
{
CHANNEL
,
INTENSITY
,
RAINBOW
,
MORELAND
,
NEBULAE
,
FIRE
,
FIERY
,
FRUIT
,
COOL
,
NB_CLMODES
};
enum
ColorMode
{
CHANNEL
,
INTENSITY
,
RAINBOW
,
MORELAND
,
NEBULAE
,
FIRE
,
FIERY
,
FRUIT
,
COOL
,
MAGMA
,
NB_CLMODES
};
enum
SlideMode
{
REPLACE
,
SCROLL
,
FULLFRAME
,
RSCROLL
,
NB_SLIDES
};
enum
Orientation
{
VERTICAL
,
HORIZONTAL
,
NB_ORIENTATIONS
};
...
...
@@ -109,6 +109,7 @@ static const AVOption showspectrum_options[] = {
{
"fiery"
,
"fiery based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FIERY
},
0
,
0
,
FLAGS
,
"color"
},
{
"fruit"
,
"fruit based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FRUIT
},
0
,
0
,
FLAGS
,
"color"
},
{
"cool"
,
"cool based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COOL
},
0
,
0
,
FLAGS
,
"color"
},
{
"magma"
,
"magma based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MAGMA
},
0
,
0
,
FLAGS
,
"color"
},
{
"scale"
,
"set display scale"
,
OFFSET
(
scale
),
AV_OPT_TYPE_INT
,
{.
i64
=
SQRT
},
LINEAR
,
NB_SCALES
-
1
,
FLAGS
,
"scale"
},
{
"lin"
,
"linear"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LINEAR
},
0
,
0
,
FLAGS
,
"scale"
},
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
...
...
@@ -222,6 +223,15 @@ static const struct ColorTable {
{
0
,
0
,
0
,
0
},
{
.
15
,
0
,
.
5
,
-
.
5
},
{
1
,
1
,
-
.
5
,
.
5
}},
[
MAGMA
]
=
{
{
0
,
0
,
0
,
0
},
{
0
.
10
,
23
/
256
.,
(
175
-
128
)
/
256
.,
(
120
-
128
)
/
256
.
},
{
0
.
23
,
43
/
256
.,
(
158
-
128
)
/
256
.,
(
144
-
128
)
/
256
.
},
{
0
.
35
,
85
/
256
.,
(
138
-
128
)
/
256
.,
(
179
-
128
)
/
256
.
},
{
0
.
48
,
96
/
256
.,
(
128
-
128
)
/
256
.,
(
189
-
128
)
/
256
.
},
{
0
.
64
,
128
/
256
.,
(
103
-
128
)
/
256
.,
(
214
-
128
)
/
256
.
},
{
0
.
78
,
167
/
256
.,
(
85
-
128
)
/
256
.,
(
174
-
128
)
/
256
.
},
{
1
,
205
/
256
.,
(
80
-
128
)
/
256
.,
(
152
-
128
)
/
256
.
}},
};
static
av_cold
void
uninit
(
AVFilterContext
*
ctx
)
...
...
@@ -560,6 +570,7 @@ static void color_range(ShowSpectrumContext *s, int ch,
case
FIERY
:
case
FRUIT
:
case
COOL
:
case
MAGMA
:
case
INTENSITY
:
*
uf
=
*
yf
;
*
vf
=
*
yf
;
...
...
@@ -946,6 +957,7 @@ static const AVOption showspectrumpic_options[] = {
{
"fiery"
,
"fiery based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FIERY
},
0
,
0
,
FLAGS
,
"color"
},
{
"fruit"
,
"fruit based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
FRUIT
},
0
,
0
,
FLAGS
,
"color"
},
{
"cool"
,
"cool based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
COOL
},
0
,
0
,
FLAGS
,
"color"
},
{
"magma"
,
"magma based coloring"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MAGMA
},
0
,
0
,
FLAGS
,
"color"
},
{
"scale"
,
"set display scale"
,
OFFSET
(
scale
),
AV_OPT_TYPE_INT
,
{.
i64
=
LOG
},
0
,
NB_SCALES
-
1
,
FLAGS
,
"scale"
},
{
"lin"
,
"linear"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
LINEAR
},
0
,
0
,
FLAGS
,
"scale"
},
{
"sqrt"
,
"square root"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
SQRT
},
0
,
0
,
FLAGS
,
"scale"
},
...
...
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