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
d122c8b1
Commit
d122c8b1
authored
May 03, 2018
by
Paul B Mahol
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/vf_edgedetect: add canny mode
Signed-off-by:
Paul B Mahol
<
onemda@gmail.com
>
parent
aba39cc1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
filters.texi
doc/filters.texi
+3
-0
vf_edgedetect.c
libavfilter/vf_edgedetect.c
+5
-0
No files found.
doc/filters.texi
View file @
d122c8b1
...
@@ -8276,6 +8276,9 @@ Draw white/gray wires on black background.
...
@@ -8276,6 +8276,9 @@ Draw white/gray wires on black background.
@item colormix
@item colormix
Mix the colors to create a paint/cartoon effect.
Mix the colors to create a paint/cartoon effect.
@item canny
Apply Canny edge detector on all selected planes.
@end table
@end table
Default value is @var{wires}.
Default value is @var{wires}.
...
...
libavfilter/vf_edgedetect.c
View file @
d122c8b1
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
enum
FilterMode
{
enum
FilterMode
{
MODE_WIRES
,
MODE_WIRES
,
MODE_COLORMIX
,
MODE_COLORMIX
,
MODE_CANNY
,
NB_MODE
NB_MODE
};
};
...
@@ -61,6 +62,7 @@ static const AVOption edgedetect_options[] = {
...
@@ -61,6 +62,7 @@ static const AVOption edgedetect_options[] = {
{
"mode"
,
"set mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_WIRES
},
0
,
NB_MODE
-
1
,
FLAGS
,
"mode"
},
{
"mode"
,
"set mode"
,
OFFSET
(
mode
),
AV_OPT_TYPE_INT
,
{.
i64
=
MODE_WIRES
},
0
,
NB_MODE
-
1
,
FLAGS
,
"mode"
},
{
"wires"
,
"white/gray wires on black"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_WIRES
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"wires"
,
"white/gray wires on black"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_WIRES
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"colormix"
,
"mix colors"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_COLORMIX
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"colormix"
,
"mix colors"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_COLORMIX
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
"canny"
,
"detect edges on planes"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
MODE_CANNY
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"mode"
},
{
NULL
}
{
NULL
}
};
};
...
@@ -79,6 +81,7 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -79,6 +81,7 @@ static int query_formats(AVFilterContext *ctx)
{
{
const
EdgeDetectContext
*
edgedetect
=
ctx
->
priv
;
const
EdgeDetectContext
*
edgedetect
=
ctx
->
priv
;
static
const
enum
AVPixelFormat
wires_pix_fmts
[]
=
{
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
wires_pix_fmts
[]
=
{
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
canny_pix_fmts
[]
=
{
AV_PIX_FMT_YUV444P
,
AV_PIX_FMT_GBRP
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
colormix_pix_fmts
[]
=
{
AV_PIX_FMT_GBRP
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
static
const
enum
AVPixelFormat
colormix_pix_fmts
[]
=
{
AV_PIX_FMT_GBRP
,
AV_PIX_FMT_GRAY8
,
AV_PIX_FMT_NONE
};
AVFilterFormats
*
fmts_list
;
AVFilterFormats
*
fmts_list
;
const
enum
AVPixelFormat
*
pix_fmts
=
NULL
;
const
enum
AVPixelFormat
*
pix_fmts
=
NULL
;
...
@@ -87,6 +90,8 @@ static int query_formats(AVFilterContext *ctx)
...
@@ -87,6 +90,8 @@ static int query_formats(AVFilterContext *ctx)
pix_fmts
=
wires_pix_fmts
;
pix_fmts
=
wires_pix_fmts
;
}
else
if
(
edgedetect
->
mode
==
MODE_COLORMIX
)
{
}
else
if
(
edgedetect
->
mode
==
MODE_COLORMIX
)
{
pix_fmts
=
colormix_pix_fmts
;
pix_fmts
=
colormix_pix_fmts
;
}
else
if
(
edgedetect
->
mode
==
MODE_CANNY
)
{
pix_fmts
=
canny_pix_fmts
;
}
else
{
}
else
{
av_assert0
(
0
);
av_assert0
(
0
);
}
}
...
...
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