~ubuntu-branches/ubuntu/maverick/gimp/maverick-updates

« back to all changes in this revision

Viewing changes to plug-ins/ifscompose/ifscompose.h

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-12-09 19:44:52 UTC
  • Revision ID: james.westby@ubuntu.com-20051209194452-yggpemjlofpjqyf4
Tags: upstream-2.2.9
ImportĀ upstreamĀ versionĀ 2.2.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* The GIMP -- an image manipulation program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * IfsCompose is a interface for creating IFS fractals by
 
5
 * direct manipulation.
 
6
 * Copyright (C) 1997 Owen Taylor
 
7
 *
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
20
 */
 
21
 
 
22
typedef struct {
 
23
  gdouble a11,a12,a21,a22,b1,b2;
 
24
} Aff2;
 
25
 
 
26
typedef struct {
 
27
  gdouble vals[3][4];
 
28
} Aff3;
 
29
 
 
30
typedef struct {
 
31
  GdkPoint *points;
 
32
  gint      npoints;
 
33
} IPolygon;
 
34
 
 
35
typedef struct {
 
36
  gdouble  x, y;
 
37
  gdouble  theta;
 
38
  gdouble  scale;
 
39
  gdouble  asym;
 
40
  gdouble  shear;
 
41
  gint     flip;
 
42
 
 
43
  GimpRGB  red_color;
 
44
  GimpRGB  green_color;
 
45
  GimpRGB  blue_color;
 
46
  GimpRGB  black_color;
 
47
 
 
48
  GimpRGB  target_color;
 
49
  gdouble  hue_scale;
 
50
  gdouble  value_scale;
 
51
 
 
52
  gint     simple_color;
 
53
  gdouble  prob;
 
54
} AffElementVals;
 
55
 
 
56
typedef struct
 
57
{
 
58
  gint num_elements;
 
59
  gint iterations;
 
60
  gint max_memory;
 
61
  gint subdivide;
 
62
  gdouble radius;
 
63
  gdouble aspect_ratio;
 
64
  gdouble center_x;
 
65
  gdouble center_y;
 
66
} IfsComposeVals;
 
67
 
 
68
typedef struct {
 
69
  AffElementVals v;
 
70
 
 
71
  Aff2 trans;
 
72
  Aff3 color_trans;
 
73
 
 
74
  gchar *name;
 
75
 
 
76
  IPolygon *click_boundary;
 
77
  IPolygon *draw_boundary;
 
78
} AffElement;
 
79
 
 
80
 
 
81
/* manipulation of affine transforms */
 
82
void aff2_translate       (Aff2 *naff, gdouble x, gdouble y);
 
83
void aff2_rotate          (Aff2 *naff, gdouble theta);
 
84
void aff2_scale           (Aff2 *naff, gdouble s, gint flip);
 
85
void aff2_distort         (Aff2 *naff, gdouble asym, gdouble shear);
 
86
void aff2_compute_stretch (Aff2 *naff,
 
87
                           gdouble xo, gdouble yo,
 
88
                           gdouble xn, gdouble yn);
 
89
void aff2_compute_distort (Aff2 *naff,
 
90
                           gdouble xo, gdouble yo,
 
91
                           gdouble xn, gdouble yn);
 
92
void aff2_compose         (Aff2 *naff, Aff2 *aff1, Aff2 *aff2);
 
93
void aff2_invert          (Aff2 *naff, Aff2 *aff);
 
94
void aff2_apply           (Aff2 *aff, gdouble x,  gdouble y, 
 
95
                           gdouble *xf, gdouble *yf);
 
96
void aff2_fixed_point     (Aff2 *aff, gdouble *xf, gdouble *yf);
 
97
void aff3_apply           (Aff3 *t, gdouble x, gdouble y, gdouble z,
 
98
                           gdouble *xf, gdouble *yf, gdouble *zf);
 
99
 
 
100
 
 
101
/* manipulation of polygons */
 
102
IPolygon *ipolygon_convex_hull (IPolygon *poly);
 
103
gint      ipolygon_contains    (IPolygon *poly, gint xt, gint yt);
 
104
 
 
105
 
 
106
/* manipulation of composite transforms */
 
107
AffElement *aff_element_new                  (gdouble x, gdouble y, GimpRGB *color, gint count);
 
108
void        aff_element_free                 (AffElement *elem);
 
109
void        aff_element_compute_trans        (AffElement *elem, gdouble width,
 
110
                                              gdouble height,
 
111
                                              gdouble center_x, gdouble center_y);
 
112
void        aff_element_compute_color_trans  (AffElement *elem);
 
113
void        aff_element_decompose_trans      (AffElement *elem, Aff2 *aff, 
 
114
                                              gdouble width, gdouble height,
 
115
                                              gdouble center_x, gdouble center_y);
 
116
void        aff_element_compute_boundary     (AffElement *elem, gint width,
 
117
                                              gint height,
 
118
                                              AffElement **elements, 
 
119
                                              int num_elements);
 
120
void        aff_element_draw                 (AffElement  *elem,
 
121
                                              gint         selected,
 
122
                                              gint         width,
 
123
                                              gint         height,
 
124
                                              GdkDrawable *win,
 
125
                                              GdkGC       *normal_gc,
 
126
                                              GdkGC       *selected_gc,
 
127
                                              PangoLayout *layout);
 
128
 
 
129
 
 
130
void ifs_render (AffElement **elements, gint num_elements,
 
131
                 gint width, gint height, gint nsteps,
 
132
                 IfsComposeVals *vals, gint band_y, gint band_height,
 
133
                 guchar *data, guchar *mask, guchar *nhits, gint preview);
 
134
 
 
135
gchar    * ifsvals_stringify    (IfsComposeVals   *vals,
 
136
                                 AffElement      **elements);
 
137
gboolean   ifsvals_parse_string (const gchar      *str,
 
138
                                 IfsComposeVals   *vals,
 
139
                                 AffElement     ***elements);
 
140
 
 
141
 
 
142
 
 
143