MythTV  master
Classes | Macros | Typedefs | Functions | Variables
ifs.cpp File Reference
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include "ifs.h"
#include "goom_tools.h"
Include dependency graph for ifs.cpp:

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

using DBL = double
 
using F_PT = float
 
using SIMI = struct Similitude_Struct
 
using FRACTAL = struct Fractal_Struct
 

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 FRACTALRoot = (FRACTAL *) nullptr
 
static FRACTALCur_F
 
IFSPointBuf
 
static int Cur_Pt
 

Macro Definition Documentation

◆ MODE_ifs

#define MODE_ifs

Definition at line 45 of file ifs.cpp.

◆ PROGCLASS

#define PROGCLASS   "IFS"

Definition at line 47 of file ifs.cpp.

◆ HACK_INIT

#define HACK_INIT   init_ifs

Definition at line 49 of file ifs.cpp.

◆ HACK_DRAW

#define HACK_DRAW   draw_ifs

Definition at line 50 of file ifs.cpp.

◆ ifs_opts

#define ifs_opts   xlockmore_opts

Definition at line 52 of file ifs.cpp.

◆ DEFAULTS

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

Definition at line 54 of file ifs.cpp.

◆ SMOOTH_COLORS

#define SMOOTH_COLORS

Definition at line 57 of file ifs.cpp.

◆ LRAND

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

Definition at line 81 of file ifs.cpp.

◆ NRAND

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

Definition at line 82 of file ifs.cpp.

◆ MAXRAND

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

Definition at line 83 of file ifs.cpp.

◆ FIX

#define FIX   12

Definition at line 92 of file ifs.cpp.

◆ UNIT

#define UNIT   ( 1<<FIX )

Definition at line 93 of file ifs.cpp.

◆ MAX_SIMI

#define MAX_SIMI   6

Definition at line 94 of file ifs.cpp.

◆ MAX_DEPTH_2

#define MAX_DEPTH_2   10

Definition at line 96 of file ifs.cpp.

◆ MAX_DEPTH_3

#define MAX_DEPTH_3   6

Definition at line 97 of file ifs.cpp.

◆ MAX_DEPTH_4

#define MAX_DEPTH_4   4

Definition at line 98 of file ifs.cpp.

◆ MAX_DEPTH_5

#define MAX_DEPTH_5   2

Definition at line 99 of file ifs.cpp.

◆ DBL_To_F_PT

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

Definition at line 111 of file ifs.cpp.

Typedef Documentation

◆ DBL

using DBL = double

Definition at line 86 of file ifs.cpp.

◆ F_PT

using F_PT = float

Definition at line 87 of file ifs.cpp.

◆ SIMI

using SIMI = struct Similitude_Struct

Definition at line 112 of file ifs.cpp.

◆ FRACTAL

using FRACTAL = struct Fractal_Struct

Definition at line 113 of file ifs.cpp.

Function Documentation

◆ Gauss_Rand()

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

Definition at line 151 of file ifs.cpp.

Referenced by Random_Simis().

◆ Half_Gauss_Rand()

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

Definition at line 161 of file ifs.cpp.

Referenced by Random_Simis().

◆ Random_Simis()

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

Definition at line 169 of file ifs.cpp.

Referenced by draw_ifs(), and init_ifs().

◆ free_ifs_buffers()

static void free_ifs_buffers ( FRACTAL Fractal)
static

Definition at line 183 of file ifs.cpp.

Referenced by free_ifs(), and init_ifs().

◆ free_ifs()

static void free_ifs ( FRACTAL Fractal)
static

Definition at line 197 of file ifs.cpp.

Referenced by init_ifs(), and release_ifs().

◆ init_ifs()

void init_ifs ( int  width,
int  height 
)

Definition at line 205 of file ifs.cpp.

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 331 of file ifs.cpp.

Referenced by Draw_Fractal(), MythComboBufferVulkan::PushData(), and Trace().

◆ Trace()

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

Definition at line 352 of file ifs.cpp.

Referenced by Draw_Fractal().

◆ Draw_Fractal()

static void Draw_Fractal ( void  )
static

Definition at line 376 of file ifs.cpp.

Referenced by draw_ifs().

◆ draw_ifs()

IFSPoint* draw_ifs ( int *  nbPoints)

Definition at line 452 of file ifs.cpp.

Referenced by ifs_update().

◆ release_ifs()

void release_ifs ( )

Definition at line 526 of file ifs.cpp.

Referenced by goom_close().

Variable Documentation

◆ Root

FRACTAL* Root = (FRACTAL *) nullptr
static

Definition at line 142 of file ifs.cpp.

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

◆ Cur_F

FRACTAL * Cur_F
static

Definition at line 142 of file ifs.cpp.

Referenced by Draw_Fractal(), and Trace().

◆ Buf

IFSPoint* Buf

◆ Cur_Pt

int Cur_Pt
static

Definition at line 146 of file ifs.cpp.

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