updated refract and warp plugins changed the INSTALL file to reflect the
* updated refract and warp plugins * changed the INSTALL file to reflect the fact that gtk is a separate package * app/text_tool.c: small patch for indexed images and antialiased toggle -Yosh
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 29 01:05:10 PST 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
|
* updated refract and warp plugins
|
||||||
|
* changed the INSTALL file to reflect the fact that gtk is a
|
||||||
|
separate package
|
||||||
|
* app/text_tool.c: small patch for indexed images and
|
||||||
|
antialiased toggle
|
||||||
|
|
||||||
Thu Jan 29 00:00:54 PST 1998 Manish Singh <yosh@gimp.org>
|
Thu Jan 29 00:00:54 PST 1998 Manish Singh <yosh@gimp.org>
|
||||||
|
|
||||||
* removed all usage of linked.[ch] and switched to GSLists
|
* removed all usage of linked.[ch] and switched to GSLists
|
||||||
|
18
INSTALL
18
INSTALL
@ -51,27 +51,11 @@ recognizes. These are:
|
|||||||
the gimp uses to search for its configuration files from ~/.gimp (the
|
the gimp uses to search for its configuration files from ~/.gimp (the
|
||||||
directory .gimp in the users home directory) to DIR.
|
directory .gimp in the users home directory) to DIR.
|
||||||
|
|
||||||
5. --with-libtiff=DIR. This option specifies the location of the
|
|
||||||
tiff library and header files. For instance, the libtiff library
|
|
||||||
may reside in "/usr/local". This may be specified by
|
|
||||||
--with-libtiff="/usr/local". (Note: The compilation process
|
|
||||||
should automatically find the tiff library if it resides in
|
|
||||||
"/usr/local").
|
|
||||||
|
|
||||||
6. --with-libjpeg=DIR. This option specifies the location of the
|
|
||||||
jpeg library and header files. For instance, the libjpeg library
|
|
||||||
may reside in "/usr/local". This may be specified by
|
|
||||||
--with-libjpeg="/usr/local". (Note: The compilation process
|
|
||||||
should automatically find the tiff library if it resides in
|
|
||||||
"/usr/local").
|
|
||||||
|
|
||||||
The `make' command builds several things:
|
The `make' command builds several things:
|
||||||
- The libraries `gtk+/glib/libglib.la', `gtk+/gdk/libgdk.la',
|
- The libraries `libgimp/libgimp.la', `libgimp/libgimpi.la' and
|
||||||
`gtk+/gtk/libgtk.la', `libgimp/libgimp.la', `libgimp/libgimpi.la' and
|
|
||||||
`libgimp/libgimpui.la'. The `.la' suffix is used by libtool, the
|
`libgimp/libgimpui.la'. The `.la' suffix is used by libtool, the
|
||||||
program used to ease the compilation of shared libraries on
|
program used to ease the compilation of shared libraries on
|
||||||
different platforms.
|
different platforms.
|
||||||
- The test programs `gtk+/glib/testglib' and `gtk+/gtk/testgtk'.
|
|
||||||
- The plug-in programs in the `plug-ins' subdirectory.
|
- The plug-in programs in the `plug-ins' subdirectory.
|
||||||
- The main GIMP program in `app/gimp'.
|
- The main GIMP program in `app/gimp'.
|
||||||
|
|
||||||
|
@ -283,12 +283,19 @@ text_button_press (Tool *tool,
|
|||||||
{
|
{
|
||||||
case RGB:
|
case RGB:
|
||||||
case GRAY:
|
case GRAY:
|
||||||
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_show (text_tool->antialias_toggle);
|
gtk_widget_show (text_tool->antialias_toggle);
|
||||||
|
if (GTK_TOGGLE_BUTTON (text_tool->antialias_toggle)->active)
|
||||||
|
text_tool->antialias = TRUE;
|
||||||
|
else
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INDEXED:
|
case INDEXED:
|
||||||
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_hide (text_tool->antialias_toggle);
|
gtk_widget_hide (text_tool->antialias_toggle);
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,12 +283,19 @@ text_button_press (Tool *tool,
|
|||||||
{
|
{
|
||||||
case RGB:
|
case RGB:
|
||||||
case GRAY:
|
case GRAY:
|
||||||
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_show (text_tool->antialias_toggle);
|
gtk_widget_show (text_tool->antialias_toggle);
|
||||||
|
if (GTK_TOGGLE_BUTTON (text_tool->antialias_toggle)->active)
|
||||||
|
text_tool->antialias = TRUE;
|
||||||
|
else
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INDEXED:
|
case INDEXED:
|
||||||
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_hide (text_tool->antialias_toggle);
|
gtk_widget_hide (text_tool->antialias_toggle);
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,12 +283,19 @@ text_button_press (Tool *tool,
|
|||||||
{
|
{
|
||||||
case RGB:
|
case RGB:
|
||||||
case GRAY:
|
case GRAY:
|
||||||
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (!GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_show (text_tool->antialias_toggle);
|
gtk_widget_show (text_tool->antialias_toggle);
|
||||||
|
if (GTK_TOGGLE_BUTTON (text_tool->antialias_toggle)->active)
|
||||||
|
text_tool->antialias = TRUE;
|
||||||
|
else
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case INDEXED:
|
case INDEXED:
|
||||||
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle))
|
if (GTK_WIDGET_VISIBLE (text_tool->antialias_toggle)) {
|
||||||
gtk_widget_hide (text_tool->antialias_toggle);
|
gtk_widget_hide (text_tool->antialias_toggle);
|
||||||
|
text_tool->antialias = FALSE;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,3 +1,12 @@
|
|||||||
|
1/10/98:
|
||||||
|
|
||||||
|
Simultaniously changed the name of the menu entry to "Refract" instead
|
||||||
|
of "Refract&Reflect" and made changes preparing to add Reflect
|
||||||
|
functionality. Note that this changed the PDB interface.
|
||||||
|
|
||||||
|
Discovered that the GParam thing didn't need to be "fixed", so I put
|
||||||
|
it back.
|
||||||
|
|
||||||
1/2/98: refract-Beta
|
1/2/98: refract-Beta
|
||||||
|
|
||||||
Refract is back, and better than ever! That's right... The New Layer
|
Refract is back, and better than ever! That's right... The New Layer
|
||||||
|
@ -26,3 +26,6 @@ shipped with all sorts of debugging flags turned on and optimizations
|
|||||||
turned OFF. If you don't care why refract crashes if and when it
|
turned OFF. If you don't care why refract crashes if and when it
|
||||||
does, go ahead and comment out the debug flags and uncomment the
|
does, go ahead and comment out the debug flags and uncomment the
|
||||||
optimizations. Hopefully it will pick up some speed that way.
|
optimizations. Hopefully it will pick up some speed that way.
|
||||||
|
|
||||||
|
There are also a few options available for dinking in refract.h, but
|
||||||
|
none too interesting at the moment.
|
||||||
|
@ -114,7 +114,7 @@ go_refract( GDrawable * drawable, gint32 image_id)
|
|||||||
/***************************/
|
/***************************/
|
||||||
/* Initialize lens region: */
|
/* Initialize lens region: */
|
||||||
|
|
||||||
lensmap = gimp_drawable_get (refractvals.lensmap);
|
lensmap = gimp_drawable_get (refractvals.lens_id);
|
||||||
|
|
||||||
/* Fortunately, this isn't really run repeatedly, so it's OK if
|
/* Fortunately, this isn't really run repeatedly, so it's OK if
|
||||||
it's not all that compact, right? */
|
it's not all that compact, right? */
|
||||||
@ -406,14 +406,11 @@ delta(gdouble *offset, gdouble slope, gint height)
|
|||||||
alpha = atan(slope);
|
alpha = atan(slope);
|
||||||
|
|
||||||
if( alpha > asin( refractvals.nb / refractvals.na )) {
|
if( alpha > asin( refractvals.nb / refractvals.na )) {
|
||||||
#ifdef REFRACT_DEBUG
|
|
||||||
puts("!");
|
|
||||||
#endif
|
|
||||||
return FALSE; /* Total Internal Refraction. Aiee! */
|
return FALSE; /* Total Internal Refraction. Aiee! */
|
||||||
}
|
}
|
||||||
|
|
||||||
beta = asin(refractvals.na * sin(alpha)/refractvals.nb);
|
beta = asin(refractvals.na * sin(alpha)/refractvals.nb);
|
||||||
*offset = -(refractvals.dist + height) * tan(beta - alpha);
|
*offset = -(refractvals.refr_dist + height) * tan(beta - alpha);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -95,8 +95,10 @@ GPlugInInfo PLUG_IN_INFO =
|
|||||||
RefractValues refractvals =
|
RefractValues refractvals =
|
||||||
{
|
{
|
||||||
-1, /* Lens map ID */
|
-1, /* Lens map ID */
|
||||||
|
-1, /* Reflection source ID */
|
||||||
32, /* lens thickness */
|
32, /* lens thickness */
|
||||||
0, /* distance */
|
0, /* lens to image distance */
|
||||||
|
64, /* lens to reflection source distance */
|
||||||
1.0003, /* index a */
|
1.0003, /* index a */
|
||||||
1.333, /* index b */
|
1.333, /* index b */
|
||||||
WRAP, /* wrap behaviour */
|
WRAP, /* wrap behaviour */
|
||||||
@ -121,9 +123,11 @@ query ()
|
|||||||
{ PARAM_IMAGE, "image", "Input image" },
|
{ PARAM_IMAGE, "image", "Input image" },
|
||||||
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
|
||||||
/* If we did have parameters, these be them: */
|
/* If we did have parameters, these be them: */
|
||||||
{ PARAM_DRAWABLE, "lensmap", "Lens map drawable" },
|
{ PARAM_DRAWABLE, "lens_id", "Lens map drawable" },
|
||||||
|
{ PARAM_DRAWABLE, "refl_id", "Reflection source drawable." },
|
||||||
{ PARAM_INT32, "thick", "Lens thickness" },
|
{ PARAM_INT32, "thick", "Lens thickness" },
|
||||||
{ PARAM_INT32, "dist", "Lens distance from image" },
|
{ PARAM_INT32, "refr_dist", "Lens distance from image" },
|
||||||
|
{ PARAM_INT32, "refl_dist", "Lens distance from reflection source" },
|
||||||
{ PARAM_FLOAT, "na", "Index of Refraction A" },
|
{ PARAM_FLOAT, "na", "Index of Refraction A" },
|
||||||
{ PARAM_FLOAT, "nb", "Index of Refraction B" },
|
{ PARAM_FLOAT, "nb", "Index of Refraction B" },
|
||||||
{ PARAM_INT32, "edge", "Background (0), Outside (1), Wrap (2)" },
|
{ PARAM_INT32, "edge", "Background (0), Outside (1), Wrap (2)" },
|
||||||
@ -164,6 +168,8 @@ run (gchar *name,
|
|||||||
printf("refract: pid %d\n", getpid());
|
printf("refract: pid %d\n", getpid());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* values=g_new(GParam,1); */
|
||||||
|
|
||||||
run_mode = param[0].data.d_int32;
|
run_mode = param[0].data.d_int32;
|
||||||
|
|
||||||
*nreturn_vals = 1;
|
*nreturn_vals = 1;
|
||||||
@ -188,15 +194,17 @@ run (gchar *name,
|
|||||||
|
|
||||||
case RUN_NONINTERACTIVE:
|
case RUN_NONINTERACTIVE:
|
||||||
if (status == STATUS_SUCCESS) {
|
if (status == STATUS_SUCCESS) {
|
||||||
refractvals.lensmap = param[3].data.d_drawable;
|
refractvals.lens_id = param[3].data.d_drawable;
|
||||||
refractvals.thick = param[4].data.d_int32;
|
refractvals.refl_id = param[4].data.d_int32;
|
||||||
refractvals.dist = param[5].data.d_int32;
|
refractvals.thick = param[5].data.d_int32;
|
||||||
refractvals.na = param[6].data.d_float;
|
refractvals.refr_dist = param[6].data.d_float;
|
||||||
refractvals.nb = param[7].data.d_float;
|
refractvals.refl_dist = param[7].data.d_float;
|
||||||
refractvals.edge = param[8].data.d_int32;
|
refractvals.na = param[8].data.d_int32;
|
||||||
refractvals.newl = param[9].data.d_int32;
|
refractvals.nb = param[9].data.d_int32;
|
||||||
refractvals.xofs = param[10].data.d_int32;
|
refractvals.edge = param[10].data.d_int32;
|
||||||
refractvals.yofs = param[11].data.d_int32;
|
refractvals.newl = param[11].data.d_int32;
|
||||||
|
refractvals.xofs = param[12].data.d_int32;
|
||||||
|
refractvals.yofs = param[13].data.d_int32;
|
||||||
} /* if */
|
} /* if */
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -309,7 +317,7 @@ refract_dialog()
|
|||||||
option_menu = gtk_option_menu_new();
|
option_menu = gtk_option_menu_new();
|
||||||
|
|
||||||
menu = gimp_drawable_menu_new(map_constrain, map_menu_callback,
|
menu = gimp_drawable_menu_new(map_constrain, map_menu_callback,
|
||||||
NULL, refractvals.lensmap);
|
NULL, refractvals.lens_id);
|
||||||
gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu),menu);
|
gtk_option_menu_set_menu(GTK_OPTION_MENU(option_menu),menu);
|
||||||
gtk_tooltips_set_tips (tooltips, option_menu,
|
gtk_tooltips_set_tips (tooltips, option_menu,
|
||||||
"The drawable to use as the lens.");
|
"The drawable to use as the lens.");
|
||||||
@ -339,7 +347,7 @@ refract_dialog()
|
|||||||
0, 1000,
|
0, 1000,
|
||||||
1, 10, 0/*what's this do?*/,
|
1, 10, 0/*what's this do?*/,
|
||||||
0, 2, 2, 3,
|
0, 2, 2, 3,
|
||||||
&refractvals.dist);
|
&refractvals.refr_dist);
|
||||||
|
|
||||||
/* a entry/scale/drop-menu for each index */
|
/* a entry/scale/drop-menu for each index */
|
||||||
mw_fscale_entry_new(table, "Index A",
|
mw_fscale_entry_new(table, "Index A",
|
||||||
@ -523,5 +531,5 @@ refract_ok_callback (GtkWidget *widget, gpointer data)
|
|||||||
static void
|
static void
|
||||||
map_menu_callback (gint32 id, gpointer data)
|
map_menu_callback (gint32 id, gpointer data)
|
||||||
{
|
{
|
||||||
refractvals.lensmap = id;
|
refractvals.lens_id = id;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef REFRACT_DEBUG
|
#ifndef REFRACT_DEBUG
|
||||||
#warning "REFRACT_DEBUG flag is Off."
|
|
||||||
#define REFRACT_TITLE "Refract 1/2/98-Beta"
|
#define REFRACT_TITLE "Refract 1/2/98-Beta"
|
||||||
#else
|
#else
|
||||||
#warning "REFRACT_DEBUG flag is On."
|
|
||||||
#define REFRACT_TITLE "Refract 1/2/98 (debug)"
|
#define REFRACT_TITLE "Refract 1/2/98 (debug)"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -47,15 +45,17 @@
|
|||||||
#include "gtk/gtk.h"
|
#include "gtk/gtk.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gint32 lensmap; /* lens map id */
|
gint32 lens_id; /* lens map id */
|
||||||
gint32 thick; /* lens thickness */
|
gint32 refl_id; /* Reflection source ID */
|
||||||
gint32 dist; /* distance */
|
gint32 thick; /* lens thickness */
|
||||||
gdouble na; /* index a */
|
gint32 refr_dist; /* distance from lens to image. */
|
||||||
gdouble nb; /* index b */
|
gint32 refl_dist; /* Distance from lens/mirror to reflection source. */
|
||||||
gint edge; /* wrap/transparent */
|
gdouble na; /* index a */
|
||||||
gint newl; /* new layer? */
|
gdouble nb; /* index b */
|
||||||
gint xofs; /* offset x */
|
gint32 edge; /* wrap/transparent */
|
||||||
gint yofs; /* offset y */
|
gint32 newl; /* new layer? */
|
||||||
|
gint32 xofs; /* offset x */
|
||||||
|
gint32 yofs; /* offset y */
|
||||||
} RefractValues;
|
} RefractValues;
|
||||||
|
|
||||||
/* for refractvals.edge */
|
/* for refractvals.edge */
|
||||||
|
1057
plug-ins/warp/warp.c
1057
plug-ins/warp/warp.c
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user