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
a2b58256
Commit
a2b58256
authored
Mar 27, 2013
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vsrc_mandelbrot: support coloring the outside white
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
ace0cfea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
vsrc_mandelbrot.c
libavfilter/vsrc_mandelbrot.c
+12
-3
No files found.
libavfilter/vsrc_mandelbrot.c
View file @
a2b58256
...
...
@@ -41,6 +41,7 @@
enum
Outer
{
ITERATION_COUNT
,
NORMALIZED_ITERATION_COUNT
,
WHITE
,
};
enum
Inner
{
...
...
@@ -96,6 +97,7 @@ static const AVOption mandelbrot_options[] = {
{
"outer"
,
"set outer coloring mode"
,
OFFSET
(
outer
),
AV_OPT_TYPE_INT
,
{.
i64
=
NORMALIZED_ITERATION_COUNT
},
0
,
INT_MAX
,
FLAGS
,
"outer"
},
{
"iteration_count"
,
"set iteration count mode"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
ITERATION_COUNT
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"outer"
},
{
"normalized_iteration_count"
,
"set normalized iteration count mode"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
NORMALIZED_ITERATION_COUNT
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"outer"
},
{
"white"
,
"set white mode"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
WHITE
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"outer"
},
{
"inner"
,
"set inner coloring mode"
,
OFFSET
(
inner
),
AV_OPT_TYPE_INT
,
{.
i64
=
MINCOL
},
0
,
INT_MAX
,
FLAGS
,
"inner"
},
{
"black"
,
"set black mode"
,
0
,
AV_OPT_TYPE_CONST
,
{.
i64
=
BLACK
},
INT_MIN
,
INT_MAX
,
FLAGS
,
"inner"
},
...
...
@@ -318,10 +320,17 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
zi
=
mb
->
zyklus
[
i
][
1
];
if
(
zr
*
zr
+
zi
*
zi
>
mb
->
bailout
){
switch
(
mb
->
outer
){
case
ITERATION_COUNT
:
zr
=
i
;
break
;
case
NORMALIZED_ITERATION_COUNT
:
zr
=
i
+
log2
(
log
(
mb
->
bailout
)
/
log
(
zr
*
zr
+
zi
*
zi
));
break
;
case
ITERATION_COUNT
:
zr
=
i
;
c
=
lrintf
((
sin
(
zr
)
+
1
)
*
127
)
+
lrintf
((
sin
(
zr
/
1
.
234
)
+
1
)
*
127
)
*
256
*
256
+
lrintf
((
sin
(
zr
/
100
)
+
1
)
*
127
)
*
256
;
break
;
case
NORMALIZED_ITERATION_COUNT
:
zr
=
i
+
log2
(
log
(
mb
->
bailout
)
/
log
(
zr
*
zr
+
zi
*
zi
));
c
=
lrintf
((
sin
(
zr
)
+
1
)
*
127
)
+
lrintf
((
sin
(
zr
/
1
.
234
)
+
1
)
*
127
)
*
256
*
256
+
lrintf
((
sin
(
zr
/
100
)
+
1
)
*
127
)
*
256
;
break
;
case
WHITE
:
c
=
0xFFFFFF
;
}
c
=
lrintf
((
sin
(
zr
)
+
1
)
*
127
)
+
lrintf
((
sin
(
zr
/
1
.
234
)
+
1
)
*
127
)
*
256
*
256
+
lrintf
((
sin
(
zr
/
100
)
+
1
)
*
127
)
*
256
;
break
;
}
}
...
...
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