~ubuntu-branches/ubuntu/trusty/electricsheep/trusty-proposed

« back to all changes in this revision

Viewing changes to flame/libifs.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexis Sukrieh
  • Date: 2005-06-17 18:28:17 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050617182817-3ju56pnktawusjt8
Tags: 2.6.2-1
* New upstream release: 2.6.2.
  (closes: #309852)
* Added myself as maintainer (Sander Smeenk offered it to me).
* Added dpatch for handling changes applied on upstream sources.
* Added all missing manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
    flame - cosmic recursive fractal flames
3
 
    Copyright (C) 1992-2003  Scott Draves <source@flam3.com>
4
 
 
5
 
    This program is free software; you can redistribute it and/or modify
6
 
    it under the terms of the GNU General Public License as published by
7
 
    the Free Software Foundation; either version 2 of the License, or
8
 
    (at your option) any later version.
9
 
 
10
 
    This program is distributed in the hope that it will be useful,
11
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
    GNU General Public License for more details.
14
 
 
15
 
    You should have received a copy of the GNU General Public License
16
 
    along with this program; if not, write to the Free Software
17
 
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
*/
19
 
 
20
 
 
21
 
#ifndef libifs_included
22
 
#define libifs_included
23
 
 
24
 
static char *libifs_h_id =
25
 
"@(#) $Id: libifs.h,v 1.15 2004/03/28 23:16:53 spotspot Exp $";
26
 
 
27
 
#include <stdlib.h>
28
 
#include <stdio.h>
29
 
#include <math.h>
30
 
 
31
 
#include "cmap.h"
32
 
 
33
 
#define EPS (1e-10)
34
 
 
35
 
#define variation_random (-1)
36
 
#define variation_none   (-1)
37
 
 
38
 
#define NVARS   18
39
 
#define NXFORMS 12
40
 
 
41
 
typedef double point[3];
42
 
 
43
 
typedef struct {
44
 
   double var[NVARS];   /* normalized interp coefs between variations */
45
 
   double c[3][2];      /* the coefs to the affine part of the function */
46
 
   double density;      /* probability that this function is chosen. 0 - 1 */
47
 
   double color;        /* color coord for this function. 0 - 1 */
48
 
   double symmetry;     /* 1=this is a symmetry xform, 0=not */
49
 
} xform;
50
 
 
51
 
typedef struct {
52
 
   xform xform[NXFORMS];
53
 
   int symmetry;                /* 0 means none */
54
 
   clrmap cmap;
55
 
   double time;
56
 
   int  cmap_index;
57
 
   double brightness;           /* 1.0 = normal */
58
 
   double contrast;             /* 1.0 = normal */
59
 
   double gamma;
60
 
   int  width, height;          /* of the final image */
61
 
   int  spatial_oversample;
62
 
   double center[2];             /* camera center */
63
 
   double vibrancy;              /* blend between color algs (0=old,1=new) */
64
 
   double hue_rotation;          /* applies to cmap, 0-1 */
65
 
   double background[3];
66
 
   double zoom;                  /* effects ppu, sample density, scale */
67
 
   double pixels_per_unit;       /* vertically */
68
 
   double spatial_filter_radius; /* variance of gaussian */
69
 
   double sample_density;        /* samples per pixel (not bucket) */
70
 
   /* in order to motion blur more accurately we compute the logs of the 
71
 
      sample density many times and average the results.  we interplate
72
 
      only this many times. */
73
 
   int nbatches;
74
 
   /* this much color resolution.  but making it too high induces clipping */
75
 
   int white_level;
76
 
 
77
 
  /* for cmap_interpolated hack */
78
 
  int cmap_index0;
79
 
  double hue_rotation0;
80
 
  int cmap_index1;
81
 
  double hue_rotation1;
82
 
  double palette_blend;
83
 
} control_point;
84
 
 
85
 
 
86
 
 
87
 
void iterate(control_point *cp, int n, int fuse, point points[]);
88
 
void interpolate(control_point cps[], int ncps, double time, control_point *result);
89
 
void print_control_point(FILE *f, control_point *cp, char *extra_attributes);
90
 
void random_control_point(control_point *cp, int ivar, int sym);
91
 
control_point *parse_control_points(char *s, int *ncps);
92
 
control_point *parse_control_points_from_file(FILE *f, int *ncps);
93
 
int add_symmetry_to_control_point(control_point *cp, int sym);
94
 
void estimate_bounding_box(control_point *cp, double eps,
95
 
                           double *bmin, double *bmax);
96
 
void rotate_control_point(control_point *cp, double by);
97
 
double lyapunov(control_point *cp, int ntries);
98
 
double random_uniform01();
99
 
double random_uniform11();
100
 
double random_gaussian();
101
 
#endif