xine-lib: xine-lib-1.2.13/src/post/goom/ifs.c File Reference

xine-lib 1.2.13-20230125hg15249

Data Structures | Macros | Typedefs | Functions
ifs.c File Reference
`#include <math.h>`
`#include <stdlib.h>`
`#include <stdio.h>`
`#include "goom_config.h"`
`#include "goom_graphic.h"`
`#include "ifs.h"`
`#include "goom_tools.h"`

## Data Structures
struct | _ifsPoint
struct | Similitude_Struct
struct | Fractal_Struct
struct | _IFS_DATA

## Macros
#define | MODE_ifs
#define | PROGCLASS "IFS"
#define | HACK_INIT init_ifs
#define | HACK_DRAW draw_ifs
#define | ifs_opts xlockmore_opts
#define | DEFAULTS
#define | SMOOTH_COLORS
#define | LRAND() ((long) (goom_random(goomInfo->gRandom) & 0x7fffffff))
#define | NRAND(n) ((int) (LRAND() % (n)))
#define | MAXRAND (((float)(RAND_MAX<16)+((float)RAND_MAX)+1.0f)/127.0f)
#define | FIX 12
#define | UNIT ( 1<<FIX )
#define | MAX_SIMI 6
#define | MAX_DEPTH_2 10
#define | MAX_DEPTH_3 6
#define | MAX_DEPTH_4 4
#define | MAX_DEPTH_5 2
#define | DBL_To_F_PT(x) (F_PT)( (DBL)(UNIT)*(x) )
#define | RAND() goom_random(goomInfo->gRandom)
#define | MOD_MER 0
#define | MOD_FEU 1
#define | MOD_MERVER 2

## Typedefs
typedef struct _ifsPoint | IFSPoint
typedef float | DBL
typedef int | F_PT
typedef struct Similitude_Struct | SIMI
typedef struct Fractal_Struct | FRACTAL
typedef struct _IFS_DATA | IfsData

## Functions
static DBL | Gauss_Rand (PluginInfo *goomInfo, DBL c, DBL A, DBL S)
static DBL | Half_Gauss_Rand (PluginInfo *goomInfo, DBL c, DBL A, DBL S)
static void | Random_Simis (PluginInfo *goomInfo, FRACTAL *F, SIMI *Cur, int i)
static void | free_ifs_buffers (FRACTAL *Fractal)
static void | free_ifs (FRACTAL *Fractal)
static void | init_ifs (PluginInfo *goomInfo, IfsData *data)
static void | Transform (SIMI *Simi, F_PT xo, F_PT yo, F_PT *x, F_PT *y)
static void | Trace (FRACTAL *F, F_PT xo, F_PT yo, IfsData *data)
static void | Draw_Fractal (IfsData *data)
static IFSPoint * | draw_ifs (PluginInfo *goomInfo, int *nbpt, IfsData *data)
static void | release_ifs (IfsData *data)
static void | ifs_update (PluginInfo *goomInfo, Pixel *data, Pixel *back, int increment, IfsData *fx_data)
static void | ifs_vfx_apply (VisualFX *_this, Pixel *src, Pixel *dest, PluginInfo *goomInfo)
static void | ifs_vfx_init (VisualFX *_this, PluginInfo *info)
static void | ifs_vfx_free (VisualFX *_this)
VisualFX | ifs_visualfx_create (void)

## Macro Definition Documentation

## ◆ DBL_To_F_PT

#define DBL_To_F_PT | ( |  | x | ) | (F_PT)( (DBL)(UNIT)*(x) )

Referenced by Draw_Fractal().

## ◆ DEFAULTS

#define DEFAULTS

Value:
"*delay: 20000 \n" \
"*ncolours: 100 \n"

## ◆ FIX

#define FIX 12

Referenced by Trace(), and Transform().

## ◆ HACK_DRAW

#define HACK_DRAW draw_ifs

## ◆ HACK_INIT

#define HACK_INIT init_ifs

## ◆ ifs_opts

#define ifs_opts xlockmore_opts

## ◆ LRAND

#define LRAND | ( |  | ) | ((long) (goom_random(goomInfo->gRandom) & 0x7fffffff))

Referenced by Gauss_Rand(), and Half_Gauss_Rand().

## ◆ MAX_DEPTH_2

#define MAX_DEPTH_2 10

Referenced by init_ifs().

## ◆ MAX_DEPTH_3

#define MAX_DEPTH_3 6

Referenced by init_ifs().

## ◆ MAX_DEPTH_4

#define MAX_DEPTH_4 4

Referenced by init_ifs().

## ◆ MAX_DEPTH_5

#define MAX_DEPTH_5 2

Referenced by init_ifs().

## ◆ MAX_SIMI

#define MAX_SIMI 6

Referenced by init_ifs().

## ◆ MAXRAND

#define MAXRAND (((float)(RAND_MAX<16)+((float)RAND_MAX)+1.0f)/127.0f)

Referenced by Gauss_Rand(), and Half_Gauss_Rand().

## ◆ MOD_FEU

#define MOD_FEU 1

Referenced by ifs_update().

## ◆ MOD_MER

#define MOD_MER 0

Referenced by ifs_update().

## ◆ MOD_MERVER

#define MOD_MERVER 2

Referenced by ifs_update().

## ◆ MODE_ifs

#define MODE_ifs

## ◆ NRAND

#define NRAND | ( |  | n | ) | ((int) (LRAND() % (n)))

Referenced by Gauss_Rand(), and init_ifs().

## ◆ PROGCLASS

#define PROGCLASS "IFS"

## ◆ RAND

#define RAND | ( |  | ) | goom_random(goomInfo->gRandom)

Referenced by ifs_update().

## ◆ SMOOTH_COLORS

#define SMOOTH_COLORS

## ◆ UNIT

#define UNIT ( 1<<FIX )

## Typedef Documentation

## ◆ DBL

typedef float DBL

## ◆ F_PT

typedef int F_PT

## ◆ FRACTAL

typedef struct Fractal_Struct FRACTAL

## ◆ IfsData

typedef struct _IFS_DATA IfsData

## ◆ IFSPoint

typedef struct _ifsPoint IFSPoint

## ◆ SIMI

typedef struct Similitude_Struct SIMI

## Function Documentation

## ◆ Draw_Fractal()

static void Draw_Fractal | ( | IfsData * | data | ) |
| static

References Similitude_Struct::A, Similitude_Struct::A2, _IFS_DATA::Buf, Fractal_Struct::Buffer1, Fractal_Struct::Buffer2, Similitude_Struct::c_x, Similitude_Struct::c_y, Fractal_Struct::Components, Similitude_Struct::Ct, Similitude_Struct::Ct2, _IFS_DATA::Cur_F, _IFS_DATA::Cur_Pt, Fractal_Struct::Cur_Pt, Similitude_Struct::Cx, Similitude_Struct::Cy, DBL_To_F_PT, Fractal_Struct::Nb_Simi, Similitude_Struct::R, Similitude_Struct::r, Similitude_Struct::R2, Similitude_Struct::r2, _IFS_DATA::Root, Similitude_Struct::St, Similitude_Struct::St2, Trace(), and Transform().

Referenced by draw_ifs().

## ◆ draw_ifs()

static IFSPoint * draw_ifs | ( | PluginInfo * | goomInfo,
|  | int * | nbpt,
|  | IfsData * | data )
| static

References Similitude_Struct::A, Similitude_Struct::A2, Fractal_Struct::Buffer1, Fractal_Struct::Buffer2, Similitude_Struct::c_x, Similitude_Struct::c_y, Fractal_Struct::Col, Fractal_Struct::Components, Fractal_Struct::Count, _IFS_DATA::Cur_Pt, Draw_Fractal(), Fractal_Struct::Nb_Simi, NULL, Similitude_Struct::r, Similitude_Struct::r2, Random_Simis(), _IFS_DATA::Root, Fractal_Struct::Speed, and v.

Referenced by ifs_update().

## ◆ free_ifs()

static void free_ifs | ( | FRACTAL * | Fractal | ) |
| static

References free_ifs_buffers().

Referenced by init_ifs(), and release_ifs().

## ◆ free_ifs_buffers()

static void free_ifs_buffers | ( | FRACTAL * | Fractal | ) |
| static

References Fractal_Struct::Buffer1, Fractal_Struct::Buffer2, and NULL.

Referenced by free_ifs(), and init_ifs().

## ◆ Gauss_Rand()

static DBL Gauss_Rand | ( | PluginInfo * | goomInfo,
|  | DBL | c,
|  | DBL | A,
|  | DBL | S )
| static

References LRAND, MAXRAND, and NRAND.

Referenced by Random_Simis().

## ◆ Half_Gauss_Rand()

static DBL Half_Gauss_Rand | ( | PluginInfo * | goomInfo,
|  | DBL | c,
|  | DBL | A,
|  | DBL | S )
| static

References LRAND, and MAXRAND.

Referenced by Random_Simis().

## ◆ ifs_update()

static void ifs_update | ( | PluginInfo * | goomInfo,
|  | Pixel * | data,
|  | Pixel * | back,
|  | int | increment,
|  | IfsData * | fx_data )
| static

References ALPHA, BLEU, draw_ifs(), emms, _PLUGIN_INFO::_SIZE_TYPE::height, height, MOD_FEU, MOD_MER, MOD_MERVER, mode(), movd_m2r, movd_r2m, paddusb_r2r, punpckldq_r2r, RAND, ROUGE, _PLUGIN_INFO::screen, v, VERT, _PLUGIN_INFO::_SIZE_TYPE::width, width, _ifsPoint::x, and _ifsPoint::y.

Referenced by ifs_vfx_apply().

## ◆ ifs_vfx_apply()

static void ifs_vfx_apply | ( | VisualFX * | _this,
|  | Pixel * | src,
|  | Pixel * | dest,
|  | PluginInfo * | goomInfo )
| static

VISUAL_FX WRAPPER FOR IFS

References _VISUAL_FX::fx_data, _PLUGIN_INFO::ifs_incr, ifs_update(), init_ifs(), _IFS_DATA::initalized, and _PLUGIN_INFO::update.

Referenced by ifs_visualfx_create().

## ◆ ifs_vfx_free()

static void ifs_vfx_free | ( | VisualFX * | _this | ) |
| static

References _VISUAL_FX::fx_data, and release_ifs().

Referenced by ifs_visualfx_create().

## ◆ ifs_vfx_init()

static void ifs_vfx_init | ( | VisualFX * | _this,
|  | PluginInfo * | info )
| static

References _VISUAL_FX::fx_data, _IFS_DATA::initalized, NULL, and _IFS_DATA::Root.

Referenced by ifs_visualfx_create().

## ◆ ifs_visualfx_create()

VisualFX ifs_visualfx_create | ( | void |  | ) |

References ifs_vfx_apply(), ifs_vfx_free(), ifs_vfx_init(), and _VISUAL_FX::init.

Referenced by goom_init().

## ◆ init_ifs()

static void init_ifs | ( | PluginInfo * | goomInfo,
|  | IfsData * | data )
| static

References Fractal_Struct::Buffer1, Fractal_Struct::Buffer2, Fractal_Struct::Col, Fractal_Struct::Components, Fractal_Struct::Count, Fractal_Struct::Cur_Pt, Fractal_Struct::Depth, Fractal_Struct::dr2_mean, Fractal_Struct::dr_mean, free_ifs(), free_ifs_buffers(), Fractal_Struct::Height, _PLUGIN_INFO::_SIZE_TYPE::height, height, Fractal_Struct::Lx, Fractal_Struct::Ly, MAX_DEPTH_2, MAX_DEPTH_3, MAX_DEPTH_4, MAX_DEPTH_5, Fractal_Struct::Max_Pt, MAX_SIMI, Fractal_Struct::Nb_Simi, NRAND, NULL, Fractal_Struct::r_mean, Random_Simis(), _IFS_DATA::Root, _PLUGIN_INFO::screen, Fractal_Struct::Speed, Fractal_Struct::Width, _PLUGIN_INFO::_SIZE_TYPE::width, and width.

Referenced by ifs_vfx_apply().

## ◆ Random_Simis()

static void Random_Simis | ( | PluginInfo * | goomInfo,
|  | FRACTAL * | F,
|  | SIMI * | Cur,
|  | int | i )
| static

References Similitude_Struct::A, Similitude_Struct::A2, Similitude_Struct::c_x, Similitude_Struct::c_y, Fractal_Struct::dr2_mean, Fractal_Struct::dr_mean, Gauss_Rand(), Half_Gauss_Rand(), Similitude_Struct::r, Similitude_Struct::r2, and Fractal_Struct::r_mean.

Referenced by draw_ifs(), and init_ifs().

## ◆ release_ifs()

static void release_ifs | ( | IfsData * | data | ) |
| static

References free_ifs(), NULL, and _IFS_DATA::Root.

Referenced by ifs_vfx_free().

## ◆ Trace()

static void Trace | ( | FRACTAL * | F,
|  | F_PT | xo,
|  | F_PT | yo,
|  | IfsData * | data )
| static

References _IFS_DATA::Buf, Fractal_Struct::Components, _IFS_DATA::Cur_F, _IFS_DATA::Cur_Pt, Fractal_Struct::Depth, FIX, Fractal_Struct::Lx, Fractal_Struct::Ly, Fractal_Struct::Nb_Simi, Trace(), Transform(), _ifsPoint::x, and _ifsPoint::y.

Referenced by Draw_Fractal(), and Trace().

## ◆ Transform()

static void Transform | ( | SIMI * | Simi,
|  | F_PT | xo,
|  | F_PT | yo,
|  | F_PT * | x,
|  | F_PT * | y )
| inlinestatic

References Similitude_Struct::Ct, Similitude_Struct::Ct2, Similitude_Struct::Cx, Similitude_Struct::Cy, FIX, Similitude_Struct::R, Similitude_Struct::R2, Similitude_Struct::St, and Similitude_Struct::St2.

Referenced by Draw_Fractal(), and Trace().