aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-27 16:19:50 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-27 16:21:44 +0100
commit79938a4e9748174146a7b2ecddbb23208c776e77 (patch)
treec09f54398cc30eb925bc6e67e9ffeffdb42ee22a
parenta2b58256490d18828f6d5a014ba585fbee3eab61 (diff)
downloadffmpeg-79938a4e9748174146a7b2ecddbb23208c776e77.tar.gz
mandelbrot: add outer coloring method showing bailouted z
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavfilter/vsrc_mandelbrot.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c
index b9487dd2d1..c323d103a8 100644
--- a/libavfilter/vsrc_mandelbrot.c
+++ b/libavfilter/vsrc_mandelbrot.c
@@ -42,6 +42,7 @@ enum Outer{
ITERATION_COUNT,
NORMALIZED_ITERATION_COUNT,
WHITE,
+ OUTZ,
};
enum Inner{
@@ -98,6 +99,7 @@ static const AVOption mandelbrot_options[] = {
{"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" },
+ {"outz", "set outz mode", 0, AV_OPT_TYPE_CONST, {.i64=OUTZ}, 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"},
@@ -330,6 +332,11 @@ static void draw_mandelbrot(AVFilterContext *ctx, uint32_t *color, int linesize,
break;
case WHITE:
c = 0xFFFFFF;
+ break;
+ case OUTZ:
+ zr /= mb->bailout;
+ zi /= mb->bailout;
+ c = (((int)(zr*128+128))&0xFF)*256 + (((int)(zi*128+128))&0xFF);
}
break;
}