3 * sushivision copyright (C) 2006-2007 Monty <monty@xiph.org>
5 * sushivision 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, or (at your option)
10 * sushivision 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.
15 * You should have received a copy of the GNU General Public License
16 * along with sushivision; see the file COPYING. If not, write to the
17 * Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25 #include "sushivision.h"
27 static void fractal_objective(double *d
, double *ret
){
31 double c
=d
[0],ci
=d
[1];
37 for(i
=0;i
<max_iter
;i
++){
41 if (z
*z
+ zi
*zi
> 4.0){
42 ret
[0] = (double)i
/max_iter
;
48 ret
[1] = sqrt(z
*z
+ zi
*zi
)/4.;
51 int main(int argc
, char *argv
[]){
53 // before any gtk, gdk or glib setup
56 //g_thread_init (NULL);
57 //gtk_init (&argc, &argv);
58 //gdk_threads_init ();
60 // "name:label(arg,arg,arg...)"
62 sv_dim_new("rc:Re\\(c\\)");
63 sv_dim_make_scale("-2.25, -0.75, 0, 0.25, 0.75");
65 sv_dim_new("ic:Im\\(c\\)");
66 sv_dim_make_scale("-2,-1,0,1,2");
68 sv_dim_new("rz:Re\\(z0\\)");
69 sv_dim_make_scale("-2.25, -1, 0, 1, 2.25");
71 sv_dim_new("iz:Im\\(z0\\)");
72 sv_dim_make_scale("-2.25, -1, 0, 1, 2.25");
74 sv_dim_new("it:Max Iterations(picklist)");
75 sv_dim_make_scale("100:one hundred,"
78 "100000:one hundred thousand");
79 sv_dim_set_value(100);
81 sv_obj_new("outer",fractal_objective
,"rc,ic,rz,iz,it", "Z,*");
82 sv_obj_make_scale("0, .001, .01, .1, 1.0");
84 sv_obj_new("inner",fractal_objective
,"rc,ic,rz,iz,it", "*,Z");
85 sv_obj_make_scale("0, .001, .01, .1, 1.0");
87 sv_panel_new_2d(0,"Mandel/Julia Fractal",
89 "rc(X,Y), ic(X,Y), rz(X,Y), iz(X,Y), it",