Hi,
I'm using current HEAD cvs of the Gimp.
I've seen that all the filter plugins which use a GTK interface are
crashing. Is this a known bug and is this due to the switch to the
version 2.0 of gtk+? Is there anything I can do to help fixing this?
I've notice that plugins use gtk_signal* fonctions while the gimp
application (under the app directory) use g_signal* ones. This lets me
think the plugins are not yet converted to use gtk+-2.0.
If you can tell me what need to be changed for the migration, I'll be
happy to fix all these plugins.
Apart from this, you'll find a patch for the apply_lens plugins which
improve a little bit its speed attached to this mail. I'm pretty sure
this could be even more optimized.
Regards,
DindinX
--
[EMAIL PROTECTED]
Fishbowl, n.:
A glass-enclosed isolation cell where newly promoted managers are
kept for observation.
--- apply_lens.c.orig Sun Aug 26 19:25:22 2001
+++ apply_lens.c Sun Aug 26 19:37:27 2001
@@ -210,25 +210,22 @@
Ellipsoid formula: x^2/a^2 + y^2/b^2 + z^2/c^2 = 1
*/
static void
-find_projected_pos (gfloat a,
- gfloat b,
+find_projected_pos (gfloat a2,
+ gfloat b2,
+ gfloat c2,
gfloat x,
gfloat y,
gfloat *projx,
gfloat *projy)
{
- gfloat c;
gfloat n[3];
gfloat nxangle, nyangle, theta1, theta2;
gfloat ri1 = 1.0;
gfloat ri2 = lvals.refraction;
- /* PARAM */
- c = MIN (a, b);
-
n[0] = x;
n[1] = y;
- n[2] = sqrt ((1 - x * x / (a * a) - y * y / (b * b)) * (c * c));
+ n[2] = sqrt ((1 - x * x / a2 - y * y / b2) * c2);
nxangle = acos (n[0] / sqrt(n[0] * n[0] + n[2] * n[2]));
theta1 = G_PI / 2 - nxangle;
@@ -255,7 +252,7 @@
guchar *src, *dest;
gint i, col;
gfloat regionwidth, regionheight, dx, dy, xsqr, ysqr;
- gfloat a, b, asqr, bsqr, x, y;
+ gfloat a, b, c, asqr, bsqr, csqr, x, y;
glong pixelpos, pos;
GimpRGB background;
guchar bgr_red, bgr_blue, bgr_green;
@@ -271,8 +268,11 @@
regionheight = y2 - y1;
b = regionheight / 2;
+ c = MIN (a, b);
+
asqr = a * a;
bsqr = b * b;
+ csqr = c * c;
width = drawable->width;
height = drawable->height;
@@ -296,7 +296,7 @@
ysqr = dy * dy;
if (ysqr < (bsqr - (bsqr * xsqr) / asqr))
{
- find_projected_pos (a, b, dx, dy, &x, &y);
+ find_projected_pos (asqr, bsqr, csqr, dx, dy, &x, &y);
y = -y;
pos = ((gint) (y + b) * regionwidth + (gint) (x + a)) * bytes;