home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2002 April / pcpro0402.iso / essentials / graphics / Gimp / gimp-src-20001226.exe / src / gimp / plug-ins / flame / libifs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-12  |  3.5 KB  |  90 lines

  1. /*
  2.     flame - cosmic recursive fractal flames
  3.     Copyright (C) 1992  Scott Draves <spot@cs.cmu.edu>
  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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19.  
  20.  
  21. #ifndef libifs_included
  22. #define libifs_included
  23.  
  24. #include <stdlib.h>
  25. #include <stdio.h>
  26. #include <math.h>
  27.  
  28. #include "cmap.h"
  29.  
  30. #define EPS (1e-10)
  31.  
  32. #define variation_random (-1)
  33.  
  34. #define NVARS   7
  35. #define NXFORMS 6
  36.  
  37. typedef double point[3];
  38.  
  39. typedef struct {
  40.    double var[NVARS];   /* normalized interp coefs between variations */
  41.    double c[3][2];      /* the coefs to the affine part of the function */
  42.    double density;      /* prob is this function is chosen. 0 - 1 */
  43.    double color;        /* color coord for this function. 0 - 1 */
  44. } xform;
  45.  
  46. typedef struct {
  47.    xform xform[NXFORMS];
  48.    clrmap cmap;
  49.    double time;
  50.    int  cmap_index;
  51.    double brightness;           /* 1.0 = normal */
  52.    double contrast;             /* 1.0 = normal */
  53.    double gamma;
  54.    int  width, height;          /* of the final image */
  55.    int  spatial_oversample;
  56.    double center[2];             /* camera center */
  57.    double zoom;                  /* effects ppu and sample density */
  58.    double pixels_per_unit;       /* and scale */
  59.    double spatial_filter_radius; /* variance of gaussian */
  60.    double sample_density;        /* samples per pixel (not bucket) */
  61.    /* in order to motion blur more accurately we compute the logs of the 
  62.       sample density many times and average the results.  we interplate
  63.       only this many times. */
  64.    int nbatches;
  65.    /* this much color resolution.  but making it too high induces clipping */
  66.    int white_level;
  67.    int cmap_inter; /* if this is true, then color map interpolates one entry
  68.               at a time with a bright edge */
  69.    double pulse[2][2]; /* [i][0]=magnitute [i][1]=frequency */
  70.    double wiggle[2][2]; /* frequency is /minute, assuming 30 frames/s */
  71. } control_point;
  72.  
  73.  
  74.  
  75. extern void iterate(control_point *cp, int n, int fuse, point points[]);
  76. extern void interpolate(control_point cps[], int ncps, double time, control_point *result);
  77. extern void tokenize(char **ss, char *argv[], int *argc);
  78. extern void print_control_point(FILE *f, control_point *cp, int quote);
  79. extern void random_control_point(control_point *cp, int ivar);
  80. extern void parse_control_point(char **ss, control_point *cp);
  81. extern void estimate_bounding_box(control_point *cp, double eps, double *bmin, double *bmax);
  82. extern void sort_control_points(control_point *cps, int ncps, double (*metric)());
  83. extern double standard_metric(control_point *cp1, control_point *cp2);
  84. extern double random_uniform01();
  85. extern double random_uniform11();
  86. extern double random_gaussian();
  87. extern void mult_matrix(double s1[2][2], double s2[2][2], double d[2][2]);
  88. void copy_variation(control_point *cp0, control_point *cp1);
  89. #endif
  90.