#include "avfilter.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
#include <float.h>
#include <math.h>
Go to the source code of this file.
| Data Structures | |
| struct | Point | 
| struct | MBContext | 
| Defines | |
| #define | SQR(a) ((a)*(a)) | 
| #define | OFFSET(x) offsetof(MBContext, x) | 
| #define | Z_Z2_C(outr, outi, inr, ini) | 
| #define | Z_Z2_C_ZYKLUS(outr, outi, inr, ini, Z) | 
| Enumerations | |
| enum | Outer { ITERATION_COUNT, NORMALIZED_ITERATION_COUNT } | 
| enum | Inner { BLACK, PERIOD, CONVTIME, MINCOL } | 
| Functions | |
| static const char * | mandelbrot_get_name (void *ctx) | 
| static av_cold int | init (AVFilterContext *ctx, const char *args, void *opaque) | 
| static av_cold void | uninit (AVFilterContext *ctx) | 
| static int | query_formats (AVFilterContext *ctx) | 
| static int | config_props (AVFilterLink *inlink) | 
| static void | fill_from_cache (AVFilterContext *ctx, uint32_t *color, int *in_cidx, int *out_cidx, double py, double scale) | 
| static int | interpol (MBContext *mb, uint32_t *color, int x, int y, int linesize) | 
| static void | draw_mandelbrot (AVFilterContext *ctx, uint32_t *color, int linesize, int64_t pts) | 
| static int | request_frame (AVFilterLink *link) | 
| Variables | |
| static const AVOption | mandelbrot_options [] | 
| static const AVClass | mandelbrot_class | 
| AVFilter | avfilter_vsrc_mandelbrot | 
Definition in file vsrc_mandelbrot.c.
| #define OFFSET | ( | x | ) | offsetof(MBContext, x) | 
Definition at line 78 of file vsrc_mandelbrot.c.
| #define SQR | ( | a | ) | ((a)*(a)) | 
| #define Z_Z2_C | ( | outr, | |||
| outi, | |||||
| inr, | |||||
| ini | ) | 
Value:
outr= inr*inr - ini*ini + cr;\ outi= 2*inr*ini + ci;
| #define Z_Z2_C_ZYKLUS | ( | outr, | |||
| outi, | |||||
| inr, | |||||
| ini, | |||||
| Z | ) | 
Value:
Z_Z2_C(outr,outi,inr,ini)\ if(use_zyklus){\ if(Z && fabs(mb->zyklus[i>>1][0]-outr)+fabs(mb->zyklus[i>>1][1]-outi) <= epsilon)\ break;\ }\ mb->zyklus[i][0]= outr;\ mb->zyklus[i][1]= outi;\
Referenced by draw_mandelbrot().
| enum Inner | 
| enum Outer | 
Definition at line 38 of file vsrc_mandelbrot.c.
| static int config_props | ( | AVFilterLink * | inlink | ) |  [static] | 
Definition at line 178 of file vsrc_mandelbrot.c.
| static void draw_mandelbrot | ( | AVFilterContext * | ctx, | |
| uint32_t * | color, | |||
| int | linesize, | |||
| int64_t | pts | |||
| ) |  [static] | 
| static void fill_from_cache | ( | AVFilterContext * | ctx, | |
| uint32_t * | color, | |||
| int * | in_cidx, | |||
| int * | out_cidx, | |||
| double | py, | |||
| double | scale | |||
| ) |  [static] | 
| static av_cold int init | ( | AVFilterContext * | ctx, | |
| const char * | args, | |||
| void * | opaque | |||
| ) |  [static] | 
Definition at line 117 of file vsrc_mandelbrot.c.
| static int interpol | ( | MBContext * | mb, | |
| uint32_t * | color, | |||
| int | x, | |||
| int | y, | |||
| int | linesize | |||
| ) |  [static] | 
Definition at line 209 of file vsrc_mandelbrot.c.
Referenced by dequant_lsp10r(), dequant_lsp16r(), and draw_mandelbrot().
| static const char* mandelbrot_get_name | ( | void * | ctx | ) |  [static] | 
Definition at line 106 of file vsrc_mandelbrot.c.
| static int query_formats | ( | AVFilterContext * | ctx | ) |  [static] | 
Definition at line 167 of file vsrc_mandelbrot.c.
| static int request_frame | ( | AVFilterLink * | link | ) |  [static] | 
Definition at line 395 of file vsrc_mandelbrot.c.
| static av_cold void uninit | ( | AVFilterContext * | ctx | ) |  [static] | 
Definition at line 156 of file vsrc_mandelbrot.c.
Initial value:
 {
    .name        = "mandelbrot",
    .description = NULL_IF_CONFIG_SMALL("Mandelbrot fractal renderer"),
    .priv_size = sizeof(MBContext),
    .init      = init,
    .uninit    = uninit,
    .query_formats = query_formats,
    .inputs    = (const AVFilterPad[]) {{ .name = NULL}},
    .outputs   = (const AVFilterPad[]) {{ .name      = "default",
                                    .type            = AVMEDIA_TYPE_VIDEO,
                                    .request_frame   = request_frame,
                                    .config_props    = config_props },
                                  { .name = NULL}},
}
Definition at line 412 of file vsrc_mandelbrot.c.
| const AVClass mandelbrot_class  [static] | 
Initial value:
 {
    "MBContext",
    mandelbrot_get_name,
    mandelbrot_options
}
Definition at line 111 of file vsrc_mandelbrot.c.
| const AVOption mandelbrot_options[]  [static] | 
Initial value:
 {
    {"size",        "set frame size",                OFFSET(size),    AV_OPT_TYPE_STRING,     {.str="640x480"},  CHAR_MIN, CHAR_MAX },
    {"s",           "set frame size",                OFFSET(size),    AV_OPT_TYPE_STRING,     {.str="640x480"},  CHAR_MIN, CHAR_MAX },
    {"rate",        "set frame rate",                OFFSET(rate),    AV_OPT_TYPE_STRING,     {.str="25"},  CHAR_MIN, CHAR_MAX },
    {"r",           "set frame rate",                OFFSET(rate),    AV_OPT_TYPE_STRING,     {.str="25"},  CHAR_MIN, CHAR_MAX },
    {"maxiter",     "set max iterations number",     OFFSET(maxiter), AV_OPT_TYPE_INT,        {.dbl=7189},  1,        INT_MAX  },
    {"start_x",     "set the initial x position",    OFFSET(start_x), AV_OPT_TYPE_DOUBLE,     {.dbl=-0.743643887037158704752191506114774}, -100, 100  },
    {"start_y",     "set the initial y position",    OFFSET(start_y), AV_OPT_TYPE_DOUBLE,     {.dbl=-0.131825904205311970493132056385139}, -100, 100  },
    {"start_scale", "set the initial scale value",   OFFSET(start_scale), AV_OPT_TYPE_DOUBLE, {.dbl=3.0},  0, FLT_MAX },
    {"end_scale",   "set the terminal scale value",  OFFSET(end_scale), AV_OPT_TYPE_DOUBLE,   {.dbl=0.3},  0, FLT_MAX },
    {"end_pts",     "set the terminal pts value",    OFFSET(end_pts), AV_OPT_TYPE_DOUBLE,     {.dbl=400},  0, INT64_MAX },
    {"bailout",     "set the bailout value",         OFFSET(bailout), AV_OPT_TYPE_DOUBLE,     {.dbl=10},   0, FLT_MAX },
    {"outer",       "set outer coloring mode",       OFFSET(outer), AV_OPT_TYPE_INT, {.dbl=NORMALIZED_ITERATION_COUNT}, 0, INT_MAX, 0, "outer"},
    {"iteration_count", "set iteration count mode",  0, AV_OPT_TYPE_CONST, {.dbl=ITERATION_COUNT}, INT_MIN, INT_MAX, 0, "outer" },
    {"normalized_iteration_count", "set normalized iteration count mode",   0, AV_OPT_TYPE_CONST, {.dbl=NORMALIZED_ITERATION_COUNT}, INT_MIN, INT_MAX, 0, "outer" },
    {"inner",       "set inner coloring mode",       OFFSET(inner), AV_OPT_TYPE_INT, {.dbl=MINCOL}, 0, INT_MAX, 0, "inner"},
    {"black",       "set black mode",                0, AV_OPT_TYPE_CONST, {.dbl=BLACK}, INT_MIN, INT_MAX, 0, "inner" },
    {"period",      "set period mode",               0, AV_OPT_TYPE_CONST, {.dbl=PERIOD}, INT_MIN, INT_MAX, 0, "inner" },
    {"convergence", "show time until convergence",   0, AV_OPT_TYPE_CONST, {.dbl=CONVTIME}, INT_MIN, INT_MAX, 0, "inner" },
    {"mincol",      "color based on point closest to the origin of the iterations",   0, AV_OPT_TYPE_CONST, {.dbl=MINCOL}, INT_MIN, INT_MAX, 0, "inner" },
    {NULL},
}
Definition at line 80 of file vsrc_mandelbrot.c.
 1.5.8
 1.5.8