summaryrefslogtreecommitdiff
blob: a95cc2f39b383d691dd55294082ebcfc5f20d212 (plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
Index: configure.in
===================================================================
RCS file: /cvsroot/refocus/refocus/configure.in,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 configure.in
--- configure.in	30 Jan 2003 21:29:29 -0000	1.1.1.1
+++ configure.in	6 Apr 2004 20:26:54 -0000
@@ -1,8 +1,8 @@
 dnl Process this file with autoconf to produce a configure script.
 
-AC_INIT(README)
-
-AM_INIT_AUTOMAKE(refocus, 0.9.0)
+AC_INIT([refocus],[0.9.0])
+AC_CONFIG_SRCDIR(README)
+AM_INIT_AUTOMAKE
 
 AC_PROG_CC
 AC_CHECK_PROG(GCC3, gcc3, gcc3)
@@ -12,7 +12,7 @@
    AC_MSG_RESULT([using $CC as compiler])
 fi
 
-AC_STDC_HEADERS
+AC_HEADER_STDC([])
 AC_PROG_RANLIB
 
 # Check if the user has ATLAS installed in ./lib-atlas
@@ -36,7 +36,7 @@
 AC_SUBST(LAPACK_INCLUDE_DIR)
 AM_CONDITIONAL(HAVE_ATLAS, test x${have_atlas} = xyes)
 
-AM_PATH_GIMP(1.2.0)
+AM_PATH_GIMP_2_0(2.0.0)
 AM_PATH_GTK_2_0(2.0.0)
 AM_PATH_GLIB_2_0(2.0.0)
 
@@ -106,5 +106,6 @@
 #Check if erf is defined in the mathlibrary
 AC_CHECK_LIB(m, erf, AC_DEFINE(HAVE_ERF))
 
-AC_OUTPUT([Makefile src/Makefile lib/Makefile doc/Makefile gtk-doc/Makefile ])
+AC_CONFIG_FILES([Makefile src/Makefile lib/Makefile doc/Makefile gtk-doc/Makefile ])
+AC_OUTPUT
 
Index: lib/Makefile.am
===================================================================
RCS file: /cvsroot/refocus/refocus/lib/Makefile.am,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 Makefile.am
--- lib/Makefile.am	30 Jan 2003 21:29:52 -0000	1.1.1.1
+++ lib/Makefile.am	6 Apr 2004 20:26:55 -0000
@@ -1,4 +1,4 @@
-CFLAGS=-fomit-frame-pointer -O3 -funroll-all-loops
+AM_CFLAGS=-fomit-frame-pointer -O3 -funroll-all-loops
 
 
 noinst_LIBRARIES = liblapack.a libatlas.a libcblas.a
Index: src/Makefile.am
===================================================================
RCS file: /cvsroot/refocus/refocus/src/Makefile.am,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 Makefile.am
--- src/Makefile.am	30 Jan 2003 21:30:18 -0000	1.1.1.1
+++ src/Makefile.am	6 Apr 2004 20:26:55 -0000
@@ -11,7 +11,7 @@
 EXTRA_DIST = dummy-plugin.c
 
 refocus_SOURCES = refocus.c conv.c gimppreview.c prevman.c util.c matrix.c tilebuf.c bdclosure.c fwlapack.c
-refocus_LDADD = @GTK_LIBS@ -lgimp ${ldadd_atlas}
+refocus_LDADD = @GIMP_LIBS@ ${ldadd_atlas}
 refocus_DEPENDENCIES=@LAPACK_LIB_DIR@/liblapack.a
 
 test_matrix_SOURCES = matrix.c test-matrix.c fwlapack.c
Index: src/gimppreview.c
===================================================================
RCS file: /cvsroot/refocus/refocus/src/gimppreview.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 gimppreview.c
--- src/gimppreview.c	30 Jan 2003 21:30:18 -0000	1.1.1.1
+++ src/gimppreview.c	6 Apr 2004 20:26:55 -0000
@@ -344,7 +344,7 @@
 
   /* Save the drawable info. */
   preview->drawable = drawable;
-  preview->drawable_has_alpha = gimp_drawable_has_alpha (drawable->id);
+  preview->drawable_has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
 
   /* Calculate our preview size. */
   if (preview_size == PREVIEW_FIXED_SIZE)
Index: src/prevman.c
===================================================================
RCS file: /cvsroot/refocus/refocus/src/prevman.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 prevman.c
--- src/prevman.c	30 Jan 2003 21:30:18 -0000	1.1.1.1
+++ src/prevman.c	6 Apr 2004 20:26:56 -0000
@@ -52,7 +52,7 @@
   tile_source->width = drawable->width;
   tile_source->height = drawable->height;
   tile_source->bpp = drawable->bpp;
-  tile_source->has_alpha = gimp_drawable_has_alpha (drawable->id);
+  tile_source->has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
   tile_source->un.drw.drawable = drawable;
   gimp_pixel_rgn_init (&tile_source->un.drw.pixel_rgn, drawable, x, y, width,
                        height, FALSE, FALSE);
@@ -144,7 +144,7 @@
   tile_sink->width = drawable->width;
   tile_sink->height = drawable->height;
   tile_sink->bpp = drawable->bpp;
-  tile_sink->has_alpha = gimp_drawable_has_alpha (drawable->id);
+  tile_sink->has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
   gimp_pixel_rgn_init (&tile_sink->un.drw.pixel_rgn, drawable, x, y, width,
                        height, TRUE, TRUE);
 }
@@ -159,7 +159,7 @@
   tile_sink->width = width;
   tile_sink->height = height;
   tile_sink->bpp = drawable->bpp;
-  tile_sink->has_alpha = gimp_drawable_has_alpha (drawable->id);
+  tile_sink->has_alpha = gimp_drawable_has_alpha (drawable->drawable_id);
   tile_sink->un.prv.data = g_new (guchar,
                                   tile_sink->width * tile_sink->height *
                                   tile_sink->bpp);
Index: src/refocus.c
===================================================================
RCS file: /cvsroot/refocus/refocus/src/refocus.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 refocus.c
--- src/refocus.c	30 Jan 2003 21:30:19 -0000	1.1.1.1
+++ src/refocus.c	6 Apr 2004 20:26:56 -0000
@@ -45,9 +45,9 @@
 
 /* Declare local functions. */
 static void query (void);
-static void run (char *name,
+static void run (const gchar *name,
                  gint nparams,
-                 GimpParam * param,
+                 const GimpParam * param,
                  gint * nreturn_vals, GimpParam ** return_vals);
 static gint dialog ();
 static void doit (void);
@@ -111,7 +111,6 @@
     {GIMP_PDB_FLOAT, "noise", "Noise to Signal ratio"},
   };
   static GimpParamDef *return_vals = NULL;
-  static gint nargs = (gint) (sizeof (args) / sizeof (args[0]));
   static gint nreturn_vals = 0;
 
   gimp_install_procedure ("plug_in_refocus",
@@ -123,15 +122,15 @@
                           "<Image>/Filters/Enhance/Refocus ...",
                           "RGB*, GRAY*",
                           GIMP_PLUGIN,
-                          nargs, nreturn_vals, args, return_vals);
+                          G_N_ELEMENTS(args), nreturn_vals, args, return_vals);
 }
 
 static void
-run (char *name, gint n_params, GimpParam * param,
+run (const gchar *name, gint n_params, const GimpParam * param,
      gint * nreturn_vals, GimpParam ** return_vals)
 {
   static GimpParam values[1];
-  GimpRunModeType run_mode;
+  GimpRunMode run_mode;
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
 
   (void) name;                  /* Shut up warnings about unused parameters. */
@@ -186,8 +185,8 @@
     {
 
       /*  Make sure that the drawable is gray or RGB color  */
-      if (gimp_drawable_is_rgb (drawable->id) ||
-          gimp_drawable_is_gray (drawable->id))
+      if (gimp_drawable_is_rgb (drawable->drawable_id) ||
+          gimp_drawable_is_gray (drawable->drawable_id))
         {
           doit ();
 
@@ -411,7 +410,7 @@
           event_is_current =
             gimp_preview_draw_unscaled_row (GIMP_PREVIEW (my_widgets.preview),
                                             event->event_id,
-                                            gimp_drawable_type (drawable->id),
+                                            gimp_drawable_type (drawable->drawable_id),
                                             row, buf);
         };
       g_free (buf);
@@ -608,7 +607,7 @@
   gimp_progress_init ("Computing matrix");
   update_matrix ();
   gimp_progress_init ("Applying convolution");
-  gimp_drawable_mask_bounds (drawable->id, &sx1, &sy1, &sx2, &sy2);
+  gimp_drawable_mask_bounds (drawable->drawable_id, &sx1, &sy1, &sx2, &sy2);
   width = sx2 - sx1;
   height = sy2 - sy1;
   tile_source_init_from_drawable (&source, drawable, sx1, sy1, width, height);
@@ -618,7 +617,7 @@
                   matrix, 2 * my_config.mat_width + 1,
                   &update_progress_closure);
   gimp_drawable_flush (drawable);
-  gimp_drawable_merge_shadow (drawable->id, TRUE);
-  gimp_drawable_update (drawable->id, sx1, sy1, width, height);
+  gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
+  gimp_drawable_update (drawable->drawable_id, sx1, sy1, width, height);
   g_free (matrix);
 }
Index: src/tilebuf.c
===================================================================
RCS file: /cvsroot/refocus/refocus/src/tilebuf.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 tilebuf.c
--- src/tilebuf.c	30 Jan 2003 21:30:19 -0000	1.1.1.1
+++ src/tilebuf.c	6 Apr 2004 20:26:56 -0000
@@ -140,7 +140,10 @@
 
         for (x = x_lo - 1; x >= buf->real_x; x--)
           {
-            copy_col (buf, 2 * x_lo - x, y_start, y_end - y_start, x);
+            gint sx = 2 * x_lo - x;
+            copy_col (buf,
+                      sx<=buf->real_x+buf->real_width-1?sx:buf->real_x+buf->real_width-1,
+                      y_start, y_end - y_start, x);
           };
       }
       break;
@@ -171,7 +174,9 @@
 
         for (x = x_hi; x < buf->real_x + buf->real_width; x++)
           {
-            copy_col (buf, 2 * (x_hi - 1) - x, y_start, y_end - y_start, x);
+            gint sx = 2 * (x_hi - 1) - x;
+            copy_col (buf, sx>=buf->real_x?sx:buf->real_x,
+                      y_start, y_end - y_start, x);
           };
       }
       break;
@@ -200,7 +205,10 @@
 
         for (y = y_lo - 1; y >= buf->real_y; y--)
           {
-            copy_row (buf, buf->real_x, 2 * y_lo - y, buf->real_width, y);
+            gint sy = 2 * y_lo - y;
+            copy_row (buf, buf->real_x,
+                      sy<=buf->real_y+buf->real_height-1?sy:buf->real_y+buf->real_height-1,
+                      buf->real_width, y);
           };
       }
       break;
@@ -230,8 +238,9 @@
 
         for (y = y_hi; y < buf->real_y + buf->real_height; y++)
           {
-            copy_row (buf, buf->real_x, 2 * (y_hi - 1) - y, buf->real_width,
-                      y);
+            gint sy = 2 * (y_hi - 1) - y;
+            copy_row (buf, buf->real_x, sy>=buf->real_y?sy:buf->real_y,
+                      buf->real_width, y);
           };
       }
       break;