-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.h
66 lines (49 loc) · 1.31 KB
/
functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* Author: Ted Cooper
* Last revised: 7-2-2009
* FRACTAL FLAME RENDERER
* See top of engine.c for program description.
*
* functions.h: see functions.c for description.
*/
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include "variations.h"
//DATA TYPES
//linear transformation
typedef struct {
int (*f)(coords * c,
F_params * fp);
F_params fp;
} F_func;
//a linear function Fi, excluding final transformation Ffinal
typedef struct {
//going from inside out in function structure
//1. initial linear transformation
F_func f;
//2. array of nonlinear variations and variational coefficients
V_func * v;
long double * v_coeff;
int nv;
//3. linear post transformation
F_func p;
//color index associated with this function
float c;
//weight associated with this function
float w;
float startw; //where in the weight vector this function's weight range
//begins
} F;
//FUNCTIONS
//public
//init/teardown:
//this init should take care of _everything_
extern int init_functions(int nframes);
extern int cleanup_functions();
//invoke functions:
extern int run_function(float vector_pos, coords * c, float * ci);
extern int run_final(coords * c, float * cfinal);
//accessors
extern float get_weight_vector_len();
//mutators
extern int set_frame(int t);
#endif