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
ddeb194b
Commit
ddeb194b
authored
Nov 11, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mandelbrot: add a end_scale and pts so we can zoom in.
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
dece0172
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
vsrc_mandelbrot.c
libavfilter/vsrc_mandelbrot.c
+10
-3
No files found.
libavfilter/vsrc_mandelbrot.c
View file @
ddeb194b
...
...
@@ -43,6 +43,8 @@ typedef struct {
double
start_x
;
double
start_y
;
double
start_scale
;
double
end_scale
;
double
end_pts
;
double
bailout
;
enum
Outer
outer
;
}
MBContext
;
...
...
@@ -57,8 +59,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
mb
->
maxiter
=
256
;
mb
->
start_x
=
0
;
mb
->
start_y
=
0
;
mb
->
start_y
=
1
;
mb
->
start_scale
=
3
.
0
;
mb
->
end_scale
=
0
.
3
;
mb
->
end_pts
=
200
;
mb
->
bailout
=
100
;
mb
->
outer
=
NORMALIZED_ITERATION_COUNT
;
if
(
args
)
...
...
@@ -69,6 +73,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
return
AVERROR
(
EINVAL
);
}
mb
->
start_scale
/=
mb
->
h
;
mb
->
end_scale
/=
mb
->
h
;
if
(
av_parse_video_rate
(
&
frame_rate_q
,
frame_rate
)
<
0
||
frame_rate_q
.
den
<=
0
||
frame_rate_q
.
num
<=
0
)
{
...
...
@@ -119,10 +124,12 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
MBContext
*
mb
=
ctx
->
priv
;
int
x
,
y
,
i
;
double
scale
=
mb
->
start_scale
*
pow
(
mb
->
end_scale
/
mb
->
start_scale
,
pts
/
mb
->
end_pts
);
for
(
y
=
0
;
y
<
mb
->
h
;
y
++
){
for
(
x
=
0
;
x
<
mb
->
w
;
x
++
){
const
double
cr
=
mb
->
start_x
+
mb
->
start_
scale
*
(
x
-
mb
->
w
/
2
);
const
double
ci
=
mb
->
start_y
+
mb
->
start_
scale
*
(
y
-
mb
->
h
/
2
);
const
double
cr
=
mb
->
start_x
+
scale
*
(
x
-
mb
->
w
/
2
);
const
double
ci
=
mb
->
start_y
+
scale
*
(
y
-
mb
->
h
/
2
);
double
zr
=
cr
;
double
zi
=
ci
;
uint32_t
c
=
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