MythTV  master
Classes | Macros | Typedefs | Functions | Variables
ifs.c File Reference
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "ifs.h"
#include "goom_tools.h"
Include dependency graph for ifs.c:

Go to the source code of this file.

Classes

struct  Similitude_Struct
 
struct  Fractal_Struct
 

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) (RAND() & 0x7fffffff))
 
#define NRAND(n)   ((int) (LRAND() % (n)))
 
#define MAXRAND
 
#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) )
 

Typedefs

typedef double DBL
 
typedef float F_PT
 
typedef struct Similitude_Struct SIMI
 
typedef struct Fractal_Struct FRACTAL
 

Functions

static DBL Gauss_Rand (DBL c, DBL A, DBL S)
 
static DBL Half_Gauss_Rand (DBL c, DBL A, DBL S)
 
static void Random_Simis (FRACTAL *F, SIMI *Cur, int i)
 
static void free_ifs_buffers (FRACTAL *Fractal)
 
static void free_ifs (FRACTAL *Fractal)
 
void init_ifs (int width, int height)
 
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)
 
static void Draw_Fractal (void)
 
IFSPointdraw_ifs (int *nbPoints)
 
void release_ifs ()
 

Variables

static const char sccsid [] = "@(#)ifs.c 5.00 2002/04/11 baffe"
 
static FRACTALRoot = (FRACTAL *) NULL
 
static FRACTALCur_F
 
IFSPointBuf
 
static int Cur_Pt
 

Macro Definition Documentation

◆ MODE_ifs

#define MODE_ifs

Definition at line 44 of file ifs.c.

◆ PROGCLASS

#define PROGCLASS   "IFS"

Definition at line 46 of file ifs.c.

◆ HACK_INIT

#define HACK_INIT   init_ifs

Definition at line 48 of file ifs.c.

◆ HACK_DRAW

#define HACK_DRAW   draw_ifs

Definition at line 49 of file ifs.c.

◆ ifs_opts

#define ifs_opts   xlockmore_opts

Definition at line 51 of file ifs.c.

◆ DEFAULTS

#define DEFAULTS
Value:
"*delay: 20000 \n" \
"*ncolors: 100 \n"

Definition at line 53 of file ifs.c.

◆ SMOOTH_COLORS

#define SMOOTH_COLORS

Definition at line 56 of file ifs.c.

◆ LRAND

#define LRAND ( )    ((long) (RAND() & 0x7fffffff))

Definition at line 79 of file ifs.c.

◆ NRAND

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

Definition at line 80 of file ifs.c.

◆ MAXRAND

#define MAXRAND
Value:
(2147483648.0) /* unsigned 1<<31 as a * *
* * float */

Definition at line 81 of file ifs.c.

◆ FIX

#define FIX   12

Definition at line 93 of file ifs.c.

◆ UNIT

#define UNIT   ( 1<<FIX )

Definition at line 94 of file ifs.c.

◆ MAX_SIMI

#define MAX_SIMI   6

Definition at line 95 of file ifs.c.

◆ MAX_DEPTH_2

#define MAX_DEPTH_2   10

Definition at line 97 of file ifs.c.

◆ MAX_DEPTH_3

#define MAX_DEPTH_3   6

Definition at line 98 of file ifs.c.

◆ MAX_DEPTH_4

#define MAX_DEPTH_4   4

Definition at line 99 of file ifs.c.

◆ MAX_DEPTH_5

#define MAX_DEPTH_5   2

Definition at line 100 of file ifs.c.

◆ DBL_To_F_PT

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

Definition at line 112 of file ifs.c.

Typedef Documentation

◆ DBL

typedef double DBL

Definition at line 86 of file ifs.c.

◆ F_PT

typedef float F_PT

Definition at line 87 of file ifs.c.

◆ SIMI

typedef struct Similitude_Struct SIMI

Definition at line 114 of file ifs.c.

◆ FRACTAL

typedef struct Fractal_Struct FRACTAL

Definition at line 115 of file ifs.c.

Function Documentation

◆ Gauss_Rand()

static DBL Gauss_Rand ( DBL  c,
DBL  A,
DBL  S 
)
static

Definition at line 153 of file ifs.c.

Referenced by Random_Simis().

◆ Half_Gauss_Rand()

static DBL Half_Gauss_Rand ( DBL  c,
DBL  A,
DBL  S 
)
static

Definition at line 165 of file ifs.c.

Referenced by Random_Simis().

◆ Random_Simis()

static void Random_Simis ( FRACTAL F,
SIMI Cur,
int  i 
)
static

Definition at line 175 of file ifs.c.

Referenced by draw_ifs(), and init_ifs().

◆ free_ifs_buffers()

static void free_ifs_buffers ( FRACTAL Fractal)
static

Definition at line 189 of file ifs.c.

Referenced by free_ifs(), and init_ifs().

◆ free_ifs()

static void free_ifs ( FRACTAL Fractal)
static

Definition at line 203 of file ifs.c.

Referenced by init_ifs(), and release_ifs().

◆ init_ifs()

void init_ifs ( int  width,
int  height 
)

Definition at line 211 of file ifs.c.

Referenced by goom_init(), and goom_set_resolution().

◆ Transform()

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

Definition at line 340 of file ifs.c.

Referenced by Draw_Fractal(), and Trace().

◆ Trace()

static void Trace ( FRACTAL F,
F_PT  xo,
F_PT  yo 
)
static

Definition at line 361 of file ifs.c.

Referenced by Draw_Fractal().

◆ Draw_Fractal()

static void Draw_Fractal ( void  )
static

Definition at line 386 of file ifs.c.

Referenced by draw_ifs().

◆ draw_ifs()

IFSPoint* draw_ifs ( int *  nbPoints)

Definition at line 462 of file ifs.c.

Referenced by ifs_update().

◆ release_ifs()

void release_ifs ( void  )

Definition at line 536 of file ifs.c.

Referenced by goom_close().

Variable Documentation

◆ sccsid

const char sccsid[] = "@(#)ifs.c 5.00 2002/04/11 baffe"
static

Definition at line 5 of file ifs.c.

◆ Root

FRACTAL* Root = (FRACTAL *) NULL
static

Definition at line 144 of file ifs.c.

Referenced by Draw_Fractal(), draw_ifs(), init_ifs(), and release_ifs().

◆ Cur_F

FRACTAL * Cur_F
static

Definition at line 144 of file ifs.c.

Referenced by Draw_Fractal(), and Trace().

◆ Buf

IFSPoint* Buf

Definition at line 147 of file ifs.c.

Referenced by Draw_Fractal(), and Trace().

◆ Cur_Pt

int Cur_Pt
static

Definition at line 148 of file ifs.c.

Referenced by Draw_Fractal(), draw_ifs(), and Trace().