app/appenv.h New file. Includes <math.h>. Move G_PI, RINT(), ROUND() etc

1999-09-01  Tor Lillqvist  <tml@iki.fi>

* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.

* libgimp/gimp.h: Include gimpmath.h.

* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.

* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.

* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().

* app/app_procs.[ch]: app_exit() takes a gboolean.

* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.

* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.

* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it.  g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
This commit is contained in:
Tor Lillqvist 1999-09-01 20:30:56 +00:00 committed by Tor Lillqvist
parent 28449546ae
commit 6ef23d984f
115 changed files with 556 additions and 533 deletions

View File

@ -1,3 +1,41 @@
1999-09-01 Tor Lillqvist <tml@iki.fi>
* app/appenv.h
* libgimp/gimpmath.h: New file. Includes <math.h>. Move G_PI,
RINT(), ROUND() etc from app/appenv.h here, so plug-ins can
use them, too. Remove some commented-out old stuff in appenv.h.
* libgimp/gimp.h: Include gimpmath.h.
* libgimp/gimp.c (gimp_main): Win32: Don't install signal
handlers, we can't do anything useful in the handler ourselves
anyway (it would be nice to print out a backtrace, but that seems
pretty hard to do, even if not impossible). Let Windows inform the
user about the crash. If the plug-in was compiled with MSVC, and
the user also has it, she is offered a chance to start the
debugger automatically anyway.
* app/*several*.c: Include gimpmath.h for G_PI etc. Don't include
<math.h>, as gimpmath.h includes it.
* plug-ins/*/*many*.c: Include config.h. Don't include <math.h>.
Remove all the duplicated definitions of G_PI and rint(). Use
RINT() instead of rint().
* app/app_procs.[ch]: app_exit() takes a gboolean.
* app/batch.c
* app/commands.c
* app/interface.c: Call app_exit() with FALSE or TRUE.
* app/main.c (on_error): Call gimp_fatal_error. (main): Don't
install any signal handler on Win32 here, either.
* app/errors.c (gimp_fatal_error, gimp_terminate): Win32: Format
the message and call MessageBox with it. g_on_error_query doesn't
do anything useful on Win32, and printf'ing a message to stdout or
stderr doesn't do anything, either, in a windowing application.
Wed Sep 1 22:16:41 MEST 1999 Sven Neumann <sven@gimp.org>
* app/paint_core.c: Only set the defaults for non_gui operations
@ -18,6 +56,7 @@ Wed Sep 1 20:45:56 MEST 1999 Sven Neumann <sven@gimp.org>
when drawing a line using <Shift>. Do we need the angle here too??
Wed Sep 1 14:12:17 CEST 1999 Pablo Saratxaga <pablo@mandrakesoft.com>
* po/da.po, configure.in: added danish file from
Henrik Hansen <hh@mailserver.dk>

View File

@ -130,7 +130,7 @@ void
file_quit_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
app_exit (0);
app_exit (FALSE);
}
void

View File

@ -677,10 +677,10 @@ app_exit_finish (void)
}
void
app_exit (int kill_it)
app_exit (gboolean kill_it)
{
/* If it's the user's perogative, and there are dirty images */
if (kill_it == FALSE && gdisplays_dirty () && no_interface == FALSE)
if (!kill_it && gdisplays_dirty () && no_interface == FALSE)
really_quit_dialog ();
else
app_exit_finish ();

View File

@ -21,7 +21,7 @@
/* Function declarations */
void gimp_init (int, char **);
void app_init (void);
void app_exit (int);
void app_exit (gboolean);
void app_exit_finish (void);
int app_exit_finish_done (void);
void app_init_update_status(char *label1val, char *label2val, float pct_progress);

View File

@ -20,60 +20,15 @@
#include "glib.h"
/* The GIMP shouldn't need to know much about X11 (or Windows), so
* I'll remove this inclusion of gdkx.h. This will speed up compilations
* a bit, too. If some source file needs gdkx.h, it can include it.
*/
#if 0
#include "gdk/gdkx.h"
#endif
#include "gtk/gtk.h"
#include "gimpsetF.h"
#include "colormap_dialog.t.h"
/* Without gdkx.h no GDK_DISPLAY() */
#if 0
#define DISPLAY ((Display *) GDK_DISPLAY())
#endif
/* important macros - we reuse the ones from glib */
#define BOUNDS(a,x,y) CLAMP(a,x,y)
#define MINIMUM(x,y) MIN(x,y)
#define MAXIMUM(x,y) MAX(x,y)
#ifndef G_PI /* G_PI will be in GLib eventually */
#define G_PI 3.14159265358979323846
#endif
#ifndef G_PI_2 /* As will G_PI_2 */
#define G_PI_2 1.57079632679489661923
#endif
#ifndef G_PI_4 /* As will G_PI_4 */
#define G_PI_4 0.78539816339744830962
#endif
#ifndef G_SQRT2 /* As will G_SQRT2 */
#define G_SQRT2 1.4142135623730951
#endif
#ifdef HAVE_RINT
#define RINT(x) rint(x)
#else
#define RINT(x) floor ((x) + 0.5)
#endif
#define ROUND(x) ((int) ((x) + 0.5))
/* Square */
#define SQR(x) ((x) * (x))
/* limit a (0->511) int to 255 */
#define MAX255(a) ((a) | (((a) & 256) - (((a) & 256) >> 8)))
/* clamp a >>int32<<-range int between 0 and 255 inclusive */
/* broken! -> #define CLAMP0255(a) ((a & 0xFFFFFF00)? (~(a>>31)) : a) */
#define CLAMP0255(a) CLAMP(a,0,255)
typedef enum {
MESSAGE_BOX,
CONSOLE,

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "color_balance.h"
@ -30,6 +32,7 @@
#include "interface.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define TEXT_WIDTH 55

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "buildmenu.h"
@ -32,6 +34,7 @@
#include "gimplut.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define GRAPH 0x1
#define XRANGE_TOP 0x2

View File

@ -96,7 +96,7 @@ batch_run_cmd (char *cmd)
if (g_strcasecmp (cmd, "(gimp-quit 0)") == 0)
{
app_exit (0);
app_exit (FALSE);
exit (0);
}

View File

@ -18,7 +18,7 @@
#include "config.h"
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "cursorutil.h"
#include "draw_core.h"
@ -34,6 +34,7 @@
#include "selection_options.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* Bezier extensions made by Raphael FRANCOIS (fraph@ibm.net)

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "asupsample.h"
#include "blend.h"
@ -39,6 +40,7 @@
#include "tile.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* target size */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "channel.h"
#include "drawable.h"
@ -32,6 +34,7 @@
#include "gimppreviewcache.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "channel_pvt.h"
#include "tile.h"

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "color_balance.h"
@ -30,6 +32,7 @@
#include "interface.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define TEXT_WIDTH 55

View File

@ -130,7 +130,7 @@ void
file_quit_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
app_exit (0);
app_exit (FALSE);
}
void

View File

@ -78,10 +78,10 @@
* [Adam D. Moss - adam@gimp.org]
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
@ -97,6 +97,7 @@
#include "preferences_dialog.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "layer_pvt.h" /* ick. */
#include "drawable_pvt.h" /* ick ick. */

View File

@ -17,10 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -30,6 +28,8 @@
#include "gimprc.h"
#include "gimpbrush.h"
#include "libgimp/gimpmath.h"
#define OVERSAMPLING 5
static void

View File

@ -17,10 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -30,6 +28,8 @@
#include "gimprc.h"
#include "gimpbrush.h"
#include "libgimp/gimpmath.h"
#define OVERSAMPLING 5
static void

View File

@ -17,10 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -30,6 +28,8 @@
#include "gimprc.h"
#include "gimpbrush.h"
#include "libgimp/gimpmath.h"
#define OVERSAMPLING 5
static void

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -35,7 +34,9 @@
#include "gimpbrushpipeP.h"
#include "paint_core.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* Code duplicated from plug-ins/common/gpb.c...
* The struct, and code to parse/build it probably should be in libgimp.

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -35,7 +34,9 @@
#include "gimpbrushpipeP.h"
#include "paint_core.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* Code duplicated from plug-ins/common/gpb.c...
* The struct, and code to parse/build it probably should be in libgimp.

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "channel.h"
#include "drawable.h"
@ -32,6 +34,7 @@
#include "gimppreviewcache.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "channel_pvt.h"
#include "tile.h"

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "channel.h"
#include "drawable.h"
@ -32,6 +34,7 @@
#include "gimppreviewcache.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "channel_pvt.h"
#include "tile.h"

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "asupsample.h"
#include "blend.h"
@ -39,6 +40,7 @@
#include "tile.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* target size */

View File

@ -78,10 +78,10 @@
* [Adam D. Moss - adam@gimp.org]
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
@ -97,6 +97,7 @@
#include "preferences_dialog.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "layer_pvt.h" /* ick. */
#include "drawable_pvt.h" /* ick ick. */

View File

@ -15,8 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
@ -48,6 +51,7 @@
#include "layer_pvt.h" /* ick. (not alone either) */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define OVERHEAD 25 /* in units of pixel area */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "buildmenu.h"
@ -32,6 +34,7 @@
#include "gimplut.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define GRAPH 0x1
#define XRANGE_TOP 0x2

View File

@ -15,8 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
@ -48,6 +51,7 @@
#include "layer_pvt.h" /* ick. (not alone either) */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define OVERHEAD 25 /* in units of pixel area */

View File

@ -170,7 +170,7 @@ toolbox_delete (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
app_exit (0);
app_exit (FALSE);
return TRUE;
}

View File

@ -170,7 +170,7 @@ toolbox_delete (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
app_exit (0);
app_exit (FALSE);
return TRUE;
}

View File

@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -35,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* the dodgeburn structures */

View File

@ -41,6 +41,10 @@
#include "errors.h"
#include "libgimp/gimpintl.h"
#ifdef NATIVE_WIN32
#include <windows.h>
#endif
extern gchar *prog_name;
void
@ -68,28 +72,33 @@ gimp_message_func (gchar *str)
void
gimp_fatal_error (gchar *fmt, ...)
{
#ifndef NATIVE_WIN32
va_list args;
va_start (args, fmt);
#ifndef NATIVE_WIN32
printf (_("%s: fatal error: %s\n"), prog_name, g_strdup_vprintf (fmt, args));
#else
g_error (_("%s: fatal error: %s\n"), prog_name, g_strdup_vprintf (fmt, args));
#endif
va_end (args);
#ifndef NATIVE_WIN32
g_on_error_query (prog_name);
#else
/* g_on_error_query unreliable on Win32 */
abort ();
/* g_on_error_query doesn't do anything reasonable on Win32. */
va_list args;
gchar *msg;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
MessageBox (NULL, msg, prog_name, MB_OK|MB_ICONERROR);
/* I don't dare do anything more. */
ExitProcess (1);
#endif
app_exit (1);
app_exit (TRUE);
}
void
gimp_terminate (gchar *fmt, ...)
{
#ifndef NATIVE_WIN32
va_list args;
va_start (args, fmt);
@ -98,9 +107,18 @@ gimp_terminate (gchar *fmt, ...)
printf ("\n");
va_end (args);
#ifndef NATIVE_WIN32
if (use_debug_handler)
g_on_error_query (prog_name);
#else
/* g_on_error_query doesn't do anything reasonable on Win32. */
va_list args;
gchar *msg;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
MessageBox (NULL, msg, prog_name, MB_OK|MB_ICONERROR);
#endif
gdk_exit (1);
}

View File

@ -58,6 +58,7 @@
#include "undo.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
typedef struct _OverwriteBox OverwriteBox;

View File

@ -15,8 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "colormaps.h"
#include "cursorutil.h"
@ -48,6 +51,7 @@
#include "layer_pvt.h" /* ick. (not alone either) */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define OVERHEAD 25 /* in units of pixel area */

View File

@ -17,10 +17,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <string.h>
@ -30,6 +28,8 @@
#include "gimprc.h"
#include "gimpbrush.h"
#include "libgimp/gimpmath.h"
#define OVERSAMPLING 5
static void

View File

@ -19,7 +19,6 @@
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -35,7 +34,9 @@
#include "gimpbrushpipeP.h"
#include "paint_core.h"
#include "gimprc.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* Code duplicated from plug-ins/common/gpb.c...
* The struct, and code to parse/build it probably should be in libgimp.

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "channel.h"
#include "drawable.h"
@ -32,6 +34,7 @@
#include "gimppreviewcache.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "channel_pvt.h"
#include "tile.h"

View File

@ -78,10 +78,10 @@
* [Adam D. Moss - adam@gimp.org]
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
@ -97,6 +97,7 @@
#include "preferences_dialog.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "layer_pvt.h" /* ick. */
#include "drawable_pvt.h" /* ick ick. */

View File

@ -130,7 +130,7 @@ void
file_quit_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
app_exit (0);
app_exit (FALSE);
}
void

View File

@ -130,7 +130,7 @@ void
file_quit_cmd_callback (GtkWidget *widget,
gpointer client_data)
{
app_exit (0);
app_exit (FALSE);
}
void

View File

@ -22,9 +22,9 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "draw_core.h"
#include "actionarea.h"
@ -57,6 +57,7 @@
#include "drawable_pvt.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "pixmaps/new.xpm"
#include "pixmaps/duplicate.xpm"

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "drawable.h"
#include "draw_core.h"
@ -32,6 +34,7 @@
#include "gdisplay.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -170,7 +170,7 @@ toolbox_delete (GtkWidget *widget,
GdkEvent *event,
gpointer data)
{
app_exit (0);
app_exit (FALSE);
return TRUE;
}

View File

@ -30,7 +30,8 @@
* The 0.54 version of the algorithm was then forwards ported to 1.1.4
* by Austin Donnelly. */
#include <math.h>
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -53,6 +54,7 @@
#include "bezier_selectP.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* local structures */

View File

@ -46,10 +46,12 @@
#include "libgimp/gimpintl.h"
#ifndef NATIVE_WIN32
static RETSIGTYPE on_signal (int);
#ifdef SIGCHLD
static RETSIGTYPE on_sig_child (int);
#endif
#endif
static void init (void);
static void test_gserialize();
static void on_error (const gchar* domain,
@ -314,6 +316,14 @@ main (int argc, char **argv)
g_set_message_handler ((GPrintFunc) gimp_message_func);
#ifndef NATIVE_WIN32
/* No use catching these on Win32, the user won't get any
* stack trace from glib anyhow. It's better to let Windows inform
* about the program error, and offer debugging (if the use
* has installed MSVC or some other compiler that knows how to
* install itself as a handler for program errors).
*/
/* Handle some signals */
#ifdef SIGHUP
signal (SIGHUP, on_signal);
@ -346,6 +356,8 @@ main (int argc, char **argv)
#ifdef SIGCHLD
/* Handle child exits */
signal (SIGCHLD, on_sig_child);
#endif
#endif
g_log_set_handler (NULL, G_LOG_LEVEL_ERROR | G_LOG_FLAG_FATAL,
@ -395,12 +407,13 @@ on_error (const gchar *domain,
const gchar *msg,
gpointer user_data)
{
fprintf (stderr, "%s: fatal error: %s\n", prog_name, msg);
g_on_error_query (prog_name);
gimp_fatal_error ("%s", msg);
}
static int caught_fatal_sig = 0;
#ifndef NATIVE_WIN32
static RETSIGTYPE
on_signal (int sig_num)
{
@ -481,6 +494,8 @@ on_sig_child (int sig_num)
}
#endif
#endif
typedef struct
{
gint32 test_gint32;

View File

@ -20,7 +20,7 @@
*/
#include "config.h"
#include <math.h>
#include "actionarea.h"
#include "appenv.h"
#include "draw_core.h"
@ -29,7 +29,7 @@
#include "tool_options_ui.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* definitions */
#define TARGET 8

View File

@ -21,7 +21,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "gimprc.h"
@ -33,6 +32,7 @@
#include "tile.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define STD_BUF_SIZE 1021
#define MAXDIFF 195076

View File

@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -35,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* the dodgeburn structures */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "drawable.h"
#include "draw_core.h"
@ -32,6 +34,7 @@
#include "gdisplay.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -15,10 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -34,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* default defines */

View File

@ -15,10 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h> /* temporary for debugging */
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "gimpbrushlist.h"
#include "drawable.h"
@ -36,6 +38,7 @@
#include "cursorutil.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -21,7 +21,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "gimprc.h"
@ -33,6 +32,7 @@
#include "tile.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define STD_BUF_SIZE 1021
#define MAXDIFF 195076

View File

@ -22,9 +22,9 @@
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "draw_core.h"
#include "actionarea.h"
@ -57,6 +57,7 @@
#include "drawable_pvt.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "pixmaps/new.xpm"
#include "pixmaps/duplicate.xpm"

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "drawable.h"
#include "gdisplay.h"
@ -33,6 +34,7 @@
#include "libgimp/gimpsizeentry.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* index into trans_info array */
#define ANGLE 0

View File

@ -15,10 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -34,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* default defines */

View File

@ -18,7 +18,7 @@
#include "config.h"
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "cursorutil.h"
#include "draw_core.h"
@ -34,6 +34,7 @@
#include "selection_options.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* Bezier extensions made by Raphael FRANCOIS (fraph@ibm.net)

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "asupsample.h"
#include "blend.h"
@ -39,6 +40,7 @@
#include "tile.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* target size */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "color_balance.h"
@ -30,6 +32,7 @@
#include "interface.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define TEXT_WIDTH 55

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "buildmenu.h"
@ -32,6 +34,7 @@
#include "gimplut.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define GRAPH 0x1
#define XRANGE_TOP 0x2

View File

@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -35,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* the dodgeburn structures */

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "asupsample.h"
#include "blend.h"
@ -39,6 +40,7 @@
#include "tile.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* target size */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "color_balance.h"
@ -30,6 +32,7 @@
#include "interface.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define TEXT_WIDTH 55

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "buildmenu.h"
@ -32,6 +34,7 @@
#include "gimplut.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define GRAPH 0x1
#define XRANGE_TOP 0x2

View File

@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -35,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* the dodgeburn structures */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "drawable.h"
#include "draw_core.h"
@ -32,6 +34,7 @@
#include "gdisplay.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -30,7 +30,8 @@
* The 0.54 version of the algorithm was then forwards ported to 1.1.4
* by Austin Donnelly. */
#include <math.h>
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -53,6 +54,7 @@
#include "bezier_selectP.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* local structures */

View File

@ -20,7 +20,7 @@
*/
#include "config.h"
#include <math.h>
#include "actionarea.h"
#include "appenv.h"
#include "draw_core.h"
@ -29,7 +29,7 @@
#include "tool_options_ui.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* definitions */
#define TARGET 8

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "drawable.h"
#include "gdisplay.h"
@ -33,6 +34,7 @@
#include "libgimp/gimpsizeentry.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* index into trans_info array */
#define ANGLE 0

View File

@ -15,10 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -34,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* default defines */

View File

@ -15,9 +15,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "drawable.h"
#include "draw_core.h"
@ -32,6 +34,7 @@
#include "gdisplay.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -30,7 +30,8 @@
* The 0.54 version of the algorithm was then forwards ported to 1.1.4
* by Austin Donnelly. */
#include <math.h>
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -53,6 +54,7 @@
#include "bezier_selectP.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* local structures */

View File

@ -20,7 +20,7 @@
*/
#include "config.h"
#include <math.h>
#include "actionarea.h"
#include "appenv.h"
#include "draw_core.h"
@ -29,7 +29,7 @@
#include "tool_options_ui.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* definitions */
#define TARGET 8

View File

@ -15,10 +15,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h> /* temporary for debugging */
#include <string.h>
#include <math.h>
#include "appenv.h"
#include "gimpbrushlist.h"
#include "drawable.h"
@ -36,6 +38,7 @@
#include "cursorutil.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#include "tile.h" /* ick. */

View File

@ -15,7 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include "appenv.h"
#include "drawable.h"
#include "gdisplay.h"
@ -33,6 +34,7 @@
#include "libgimp/gimpsizeentry.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* index into trans_info array */
#define ANGLE 0

View File

@ -15,10 +15,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include "gdk/gdkkeysyms.h"
#include "appenv.h"
#include "drawable.h"
#include "errors.h"
@ -34,6 +37,7 @@
#include "gimage.h"
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
/* default defines */

View File

@ -15,9 +15,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "cursorutil.h"
@ -42,6 +43,7 @@
#include "tile.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define BILINEAR(jk,j1k,jk1,j1k1,dx,dy) \
((1-dy) * (jk + dx * (j1k - jk)) + \

View File

@ -15,9 +15,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include "appenv.h"
#include "actionarea.h"
#include "cursorutil.h"
@ -42,6 +43,7 @@
#include "tile.h" /* ick. */
#include "libgimp/gimpintl.h"
#include "libgimp/gimpmath.h"
#define BILINEAR(jk,j1k,jk1,j1k1,dx,dy) \
((1-dy) * (jk + dx * (j1k - jk)) + \

View File

@ -70,7 +70,9 @@ void gimp_extension_ack (void);
void gimp_read_expect_msg(WireMessage *msg, int type);
#ifndef NATIVE_WIN32
static RETSIGTYPE gimp_signal (int signum);
#endif
static int gimp_write (GIOChannel *channel , guint8 *buf, gulong count);
static int gimp_flush (GIOChannel *channel );
static void gimp_loop (void);
@ -181,6 +183,12 @@ gimp_main (int argc,
progname = argv[0];
#ifndef NATIVE_WIN32
/* No use catching these on Win32, the user won't get any meaningful
* stack trace from glib anyhow. It's better to let Windows inform
* about the program error, and offer debugging if the plug-in
* has been built with MSVC, and the user has MSVC installed.
*/
#ifdef SIGHUP
signal (SIGHUP, gimp_signal);
#endif
@ -201,6 +209,7 @@ gimp_main (int argc,
#ifdef SIGFPE
signal (SIGFPE, gimp_signal);
#endif
#endif
#ifndef NATIVE_WIN32
_readchannel = g_io_channel_unix_new (atoi (argv[2]));
@ -1131,6 +1140,7 @@ gimp_request_wakeups (void)
gimp_quit ();
}
#ifndef NATIVE_WIN32
static RETSIGTYPE
gimp_signal (int signum)
{
@ -1170,6 +1180,7 @@ gimp_signal (int signum)
gimp_quit ();
}
#endif
static int
gimp_write (GIOChannel *channel, guint8 *buf, gulong count)

View File

@ -24,6 +24,7 @@
#include "libgimp/gimpenums.h"
#include "libgimp/gimpfeatures.h"
#include "libgimp/gimpenv.h"
#include "libgimp/gimpmath.h"
#include "libgimp/parasite.h"
#include "libgimp/parasiteP.h"
#include "libgimp/gimpunit.h"

View File

@ -69,11 +69,13 @@
* Michael Sweet <mike@easysw.com>
*
*/
#include "config.h"
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include <errno.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -81,13 +83,8 @@
#include <sys/stat.h>
#include <time.h> /* for seed of random number */
#include "config.h"
#include "libgimp/stdplugins-intl.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#ifndef RAND_MAX
#define RAND_MAX 2147483647
#endif /* RAND_MAX */
@ -1103,16 +1100,16 @@ logistic_function (CML_PARAM *param, gdouble x, gdouble power)
break;
case CML_SIN_CURVE:
if (1.0 < power)
result = 0.5 * (sin (M_PI * ABS (x1 - 0.5) / power) / sin (M_PI * 0.5 / power) + 1);
result = 0.5 * (sin (G_PI * ABS (x1 - 0.5) / power) / sin (G_PI * 0.5 / power) + 1);
else
result = 0.5 * (pow (sin (M_PI * ABS (x1 - 0.5)), power) + 1);
result = 0.5 * (pow (sin (G_PI * ABS (x1 - 0.5)), power) + 1);
if (x1 < 0.5) result = 1 - result;
break;
case CML_SIN_CURVE_STEP:
if (1.0 < power)
result = 0.5 * (sin (M_PI * ABS (x1 - 0.5) / power) / sin (M_PI * 0.5 / power) + 1);
result = 0.5 * (sin (G_PI * ABS (x1 - 0.5) / power) / sin (G_PI * 0.5 / power) + 1);
else
result = 0.5 * (pow (sin (M_PI * ABS (x1 - 0.5)), power) + 1);
result = 0.5 * (pow (sin (G_PI * ABS (x1 - 0.5)), power) + 1);
if (x1 < 0.5) result = 1 - result;
result = (result + step) / (gdouble) n;
break;

View File

@ -51,20 +51,16 @@
- clean up source code
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "libgimp/gimp.h"
#include "gtk/gtk.h"
#include "config.h"
#include "libgimp/stdplugins-intl.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define ENTRY_WIDTH 100
/* Declare local functions.
@ -231,15 +227,15 @@ find_projected_pos(gfloat a, gfloat b,
n[2] = sqrt((1-x*x/(a*a)-y*y/(b*b))*(c*c));
nxangle = acos(n[0]/sqrt(n[0]*n[0]+n[2]*n[2]));
theta1 = M_PI/2 - nxangle;
theta1 = G_PI/2 - nxangle;
theta2 = asin(sin(theta1)*ri1/ri2);
theta2 = M_PI/2 - nxangle - theta2;
theta2 = G_PI/2 - nxangle - theta2;
*projx = x - tan(theta2)*n[2];
nyangle = acos(n[1]/sqrt(n[1]*n[1]+n[2]*n[2]));
theta1 = M_PI/2 - nyangle;
theta1 = G_PI/2 - nyangle;
theta2 = asin(sin(theta1)*ri1/ri2);
theta2 = M_PI/2 - nyangle - theta2;
theta2 = G_PI/2 - nyangle - theta2;
*projy = y - tan(theta2)*n[2];
}

View File

@ -47,19 +47,15 @@
* Added patches supplied by Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
* to allow the plug-in to build with Digitals compiler.
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
/***** Magic numbers *****/
/* Don't make preview >255!!! It won't work for horizontal blinds */
@ -743,7 +739,7 @@ blindsapply(guchar *srow,guchar *drow,gint width,gint bpp,guchar *bg)
}
/* Disp for each point */
ang = (bvals.angledsp*2*M_PI)/360; /* Angle in rads */
ang = (bvals.angledsp*2*G_PI)/360; /* Angle in rads */
ang = (1-fabs(cos(ang)));
available = 0;

View File

@ -86,7 +86,6 @@
#include "config.h"
#include <math.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@ -104,10 +103,6 @@
/***** Magic numbers *****/
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define PLUG_IN_NAME "plug_in_bump_map"
#define PLUG_IN_VERSION "August 1997, 2.04"
@ -606,8 +601,8 @@ bumpmap_init_params(bumpmap_params_t *params)
/* Convert to radians */
azimuth = M_PI * bmvals.azimuth / 180.0;
elevation = M_PI * bmvals.elevation / 180.0;
azimuth = G_PI * bmvals.azimuth / 180.0;
elevation = G_PI * bmvals.elevation / 180.0;
/* Calculate the light vector */
@ -640,7 +635,7 @@ bumpmap_init_params(bumpmap_params_t *params)
case SINUOSIDAL:
n = i / 255.0;
params->lut[i] = (int) (255.0 * (sin((-M_PI / 2.0) + M_PI * n) + 1.0) /
params->lut[i] = (int) (255.0 * (sin((-G_PI / 2.0) + G_PI * n) + 1.0) /
2.0 + 0.5);
break;

View File

@ -19,24 +19,15 @@
* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu
* Speedups by Elliot Lee
*/
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#include "config.h"
#include "libgimp/stdplugins-intl.h"
/* Some useful macros */
#define SQR(a) ((a) * (a))
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#ifndef RAND_MAX
#define RAND_MAX 2147483647
#endif /* RAND_MAX */
@ -473,7 +464,7 @@ render_cubism (GDrawable *drawable)
cvals.tile_saturation;
height = (cvals.tile_size + fp_rand (cvals.tile_size / 4.0) - cvals.tile_size / 8.0) *
cvals.tile_saturation;
theta = fp_rand (2 * M_PI);
theta = fp_rand (2 * G_PI);
polygon_reset (&poly);
polygon_add_point (&poly, -width / 2.0, -height / 2.0);
polygon_add_point (&poly, width / 2.0, -height / 2.0);

View File

@ -23,7 +23,6 @@
#include "config.h"
#include <math.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@ -37,10 +36,6 @@
/***** Magic numbers *****/
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define ITERATIONS 100 /* 100 */
#define WEIRD_FACTOR 0.04 /* 0.04 */
@ -390,7 +385,7 @@ diff_init_luts(void)
double a;
double sina;
a = -M_PI;
a = -G_PI;
for (i = 0; i <= ITERATIONS; i++) {
sina = sin(a);
@ -400,7 +395,7 @@ diff_init_luts(void)
param_lut1[i] = 0.75 * sina;
param_lut2[i] = 0.5 * (4.0 * cos_lut[i] * cos_lut[i] + sina * sina);
a += (2.0 * M_PI / ITERATIONS);
a += (2.0 * G_PI / ITERATIONS);
} /* for */
} /* diff_init_luts */
@ -454,7 +449,7 @@ diff_intensity(double x, double y, double lam)
cxy *= WEIRD_FACTOR;
sxy *= WEIRD_FACTOR;
polpi2 = dvals.polarization * (M_PI / 2.0);
polpi2 = dvals.polarization * (G_PI / 2.0);
cospolpi2 = cos(polpi2);
sinpolpi2 = sin(polpi2);
@ -496,7 +491,7 @@ diff_intensity(double x, double y, double lam)
sxy += 0.04 * sin(param);
} /* for */
polpi2 = dvals.polarization * (M_PI / 2.0);
polpi2 = dvals.polarization * (G_PI / 2.0);
cospolpi2 = cos(polpi2);
sinpolpi2 = sin(polpi2);

View File

@ -26,24 +26,19 @@
* $Id$
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <sys/types.h>
#include <libgimp/gimp.h>
#include <gtk/gtk.h>
#include <plug-ins/megawidget/megawidget.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
static mw_preview_t emboss_do_preview;
struct Grgb {
@ -91,7 +86,7 @@ static inline void EmbossInit(gdouble azimuth, gdouble elevation,
static inline void EmbossRow(guchar *src, guchar *texture, guchar *dst,
guint xSize, guint bypp, gint alpha);
#define DtoR(d) ((d)*(M_PI/(gdouble)180))
#define DtoR(d) ((d)*(G_PI/(gdouble)180))
GPlugInInfo PLUG_IN_INFO = {
NULL, /* init */

View File

@ -31,11 +31,13 @@
*/
static char ident[] = "@(#) GIMP Film plug-in v1.03a 1999-07-22";
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"

View File

@ -15,17 +15,15 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <math.h>
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define ENTRY_WIDTH 100
typedef struct
@ -633,7 +631,7 @@ find_constants (gdouble n_p[],
* using a 4th order approximation of the gaussian operator
*/
div = sqrt(2 * M_PI) * std_dev;
div = sqrt(2 * G_PI) * std_dev;
constants [0] = -1.783 / std_dev;
constants [1] = -1.723 / std_dev;
constants [2] = 0.6318 / std_dev;

View File

@ -19,25 +19,18 @@
* Removed possible div-by-0 errors, took the plugin out
* of hiding (guess we need a new easter-egg for GIMP 1.2!)
*/
#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <time.h>
#include "glib.h"
#include "libgimp/gimp.h"
#include "gtk/gtk.h"
#include "config.h"
#ifndef HAVE_RINT
#define rint(x) floor ((x) + 0.5)
#endif
/* Test for GTK1.2-style gdkrgb code, else use old 'preview' code. */
#ifdef __GDK_RGB_H__
#define RAPH_IS_HOME yep
@ -339,7 +332,7 @@ static void init_lut(void)
for (i=0; i<LUTSIZE; i++)
{
wigglelut[i] = rint((double)(wiggleamp<<11))*(sin((double)(i) /
wigglelut[i] = RINT((double)(wiggleamp<<11))*(sin((double)(i) /
((double)LUTSIZEMASK /
31.4159265358979323)));
}

View File

@ -37,18 +37,15 @@
(thanks to Arthur Hagen for reporting it)
*/
#include "config.h"
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define MAX_PREVIEW_WIDTH 256
#define MAX_PREVIEW_HEIGHT 256
#define MAX_DEFORM_AREA_RADIUS 100
@ -742,7 +739,7 @@ iwarp_init()
iwarp_cpy_images();
for (i=0; i <MAX_DEFORM_AREA_RADIUS; i++) {
filter[i] =
pow((cos(sqrt((gfloat)i / MAX_DEFORM_AREA_RADIUS)*M_PI)+1)*0.5,0.7); /*0.7*/
pow((cos(sqrt((gfloat)i / MAX_DEFORM_AREA_RADIUS)*G_PI)+1)*0.5,0.7); /*0.7*/
}
g_free(linebuffer);

View File

@ -33,10 +33,10 @@
/* Some of the code is based on code by Steinar Haugen (thanks!), the Perlin */
/* noise function is practically ripped as is :) */
/*********************************************************************************/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <signal.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
@ -47,10 +47,6 @@
/* Typedefs */
/************/
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#define CHECKBOUNDS(x,y) (x>=0 && y>=0 && x<width && y<height)
#define EPSILON 1.0e-5
@ -370,7 +366,7 @@ void generatevectors(void)
{
for (j=0; j<numy; j++)
{
alpha = (gdouble)(rand()%1000)*(M_PI/500.0);
alpha = (gdouble)(rand()%1000)*(G_PI/500.0);
G[i][j][0] = cos(alpha);
G[i][j][1] = sin(alpha);
}

View File

@ -47,7 +47,6 @@
#include "config.h"
#include <stdlib.h>
#include <math.h>
#include <signal.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
@ -56,10 +55,6 @@
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define PLUG_IN_NAME "plug_in_mblur"
#define PLUG_IN_VERSION "Sep 1997, 1.2"
@ -322,8 +317,8 @@ mblur_linear(void)
max_progress = sel_width * sel_height;
n = mbvals.length;
px = n*cos(mbvals.angle/180.0*M_PI);
py = n*sin(mbvals.angle/180.0*M_PI);
px = n*cos(mbvals.angle/180.0*G_PI);
py = n*sin(mbvals.angle/180.0*G_PI);
/*
* Initialization for Bresenham algorithm:
@ -447,7 +442,7 @@ mblur_radial(void)
progress = 0;
max_progress = sel_width * sel_height;
angle = ((float) mbvals.angle)/180.0*M_PI;
angle = ((float) mbvals.angle)/180.0*G_PI;
w = MAX(img_width-cen_x, cen_x);
h = MAX(img_height-cen_y, cen_y);
R = sqrt(w*w + h*h);

View File

@ -22,8 +22,8 @@
* Copyright (C) 1996 Spencer Kimball
* Speedups by Elliot Lee
*/
#include "config.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "gtk/gtk.h"
@ -36,14 +36,8 @@
#define RAND_MAX 2147483647
#endif /* RAND_MAX */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define SCALE_WIDTH 150
#define SQR(x) ((x) * (x))
#define HORIZONTAL 0
#define VERTICAL 1
#define OPAQUE 255
@ -493,8 +487,8 @@ mosaic (GDrawable *drawable)
back[alpha] = OPAQUE;
}
light_x = -cos (mvals.light_dir * M_PI / 180.0);
light_y = sin (mvals.light_dir * M_PI / 180.0);
light_x = -cos (mvals.light_dir * G_PI / 180.0);
light_y = sin (mvals.light_dir * G_PI / 180.0);
scale = (mvals.tile_spacing > mvals.tile_size / 2.0) ?
0.5 : 1.0 - mvals.tile_spacing / mvals.tile_size;

View File

@ -48,19 +48,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#ifndef HAVE_RINT
#define rint(x) floor((x)+0.5)
#endif
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
#ifdef RCSID
static char rcsid[] = "$Id$";
#endif
@ -122,7 +113,7 @@ do { \
#define BOUNDS(a,x,y) ((a < x) ? x : ((a > y) ? y : a))
#define ISNEG(x) (((x) < 0)? 1 : 0)
#define DEG2RAD(d) ((d) * M_PI / 180)
#define DEG2RAD(d) ((d) * G_PI / 180)
#define VALID_BOOL(x) ((x) == TRUE || (x) == FALSE)
#define CLAMPED_ADD(a, b) (((a)+(b) > 0xff)? 0xff : (a) + (b))
@ -820,7 +811,7 @@ preview_update(channel_st *st)
/* redraw preview widget */
gtk_widget_draw(prev->widget, NULL);
sprintf(pct, "%2d%%", (int)rint(spotfn_list[sfn].prev_lvl[i] * 100));
sprintf(pct, "%2d%%", (int)RINT(spotfn_list[sfn].prev_lvl[i] * 100));
gtk_label_set_text (GTK_LABEL(prev->label), pct);
}
@ -1612,8 +1603,8 @@ newsprint_cspace_update (GtkWidget *widget,
* Richard Mortier for this one:
*
* #define a(r) \
* ((r<=1)? M_PI * (r*r) : \
* 4 * sqrt(r*r - 1) + M_PI*r*r - 4*r*r*acos(1/r))
* ((r<=1)? G_PI * (r*r) : \
* 4 * sqrt(r*r - 1) + G_PI*r*r - 4*r*r*acos(1/r))
*
* radius = sqrt(x*x + y*y);
*
@ -2012,8 +2003,8 @@ do { \
for(b=0; b<cspace_nchans[colourspace]; b++)
{
rx = rint(r * cos(theta + rot[b]));
ry = rint(r * sin(theta + rot[b]));
rx = RINT(r * cos(theta + rot[b]));
ry = RINT(r * sin(theta + rot[b]));
/* Make sure rx and ry are positive and within
* the range 0 .. width-1 (incl). Can't use %

View File

@ -49,11 +49,12 @@
* - fix preview
* - add notebook interface and so on
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
@ -65,10 +66,6 @@ static char rcsid[] = "$Id$";
/* Some useful macros */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#ifndef RAND_MAX
#define RAND_MAX 2147483647
#endif /* RAND_MAX */
@ -1119,7 +1116,7 @@ nova (GDrawable *drawable)
l = sqrt( u*u + v*v );
/* This algorithm is still under construction. */
c = (atan2 (u, v) / (2 * M_PI) + .51) * pvals.nspoke;
c = (atan2 (u, v) / (2 * G_PI) + .51) * pvals.nspoke;
i = (int) floor (c);
c -= i;
i %= pvals.nspoke;

View File

@ -57,7 +57,6 @@
#include "config.h"
#include <math.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
@ -68,11 +67,6 @@
#include <gtk/gtk.h>
#include <libgimp/gimp.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define sqr(x) ((x) * (x))
#define WITHIN(a, b, c) ((((a) <= (b)) && ((b) <= (c))) ? 1 : 0)
@ -495,29 +489,29 @@ calc_undistorted_coords(double wx, double wy,
ym = ydiff / 2.0;
circle = pcvals.circle;
angle = pcvals.angle;
angl = (double)angle / 180.0 * M_PI;
angl = (double)angle / 180.0 * G_PI;
if (pcvals.polrec) {
if (wx >= cen_x) {
if (wy > cen_y) {
phi = M_PI - atan (((double)(wx - cen_x))/((double)(wy - cen_y)));
r = sqrt (sqr (wx - cen_x) + sqr (wy - cen_y));
phi = G_PI - atan (((double)(wx - cen_x))/((double)(wy - cen_y)));
r = sqrt (SQR (wx - cen_x) + SQR (wy - cen_y));
} else if (wy < cen_y) {
phi = atan (((double)(wx - cen_x))/((double)(cen_y - wy)));
r = sqrt (sqr (wx - cen_x) + sqr (cen_y - wy));
r = sqrt (SQR (wx - cen_x) + SQR (cen_y - wy));
} else {
phi = M_PI / 2;
phi = G_PI / 2;
r = wx - cen_x; /* cen_x - x1; */
}
} else if (wx < cen_x) {
if (wy < cen_y) {
phi = 2 * M_PI - atan (((double)(cen_x -wx))/((double)(cen_y - wy)));
r = sqrt (sqr (cen_x - wx) + sqr (cen_y - wy));
phi = 2 * G_PI - atan (((double)(cen_x -wx))/((double)(cen_y - wy)));
r = sqrt (SQR (cen_x - wx) + SQR (cen_y - wy));
} else if (wy > cen_y) {
phi = M_PI + atan (((double)(cen_x - wx))/((double)(wy - cen_y)));
r = sqrt (sqr (cen_x - wx) + sqr (wy - cen_y));
phi = G_PI + atan (((double)(cen_x - wx))/((double)(wy - cen_y)));
r = sqrt (SQR (cen_x - wx) + SQR (wy - cen_y));
} else {
phi = 1.5 * M_PI;
phi = 1.5 * G_PI;
r = cen_x - wx; /* cen_x - x1; */
}
}
@ -540,17 +534,17 @@ calc_undistorted_coords(double wx, double wy,
xmax = ymax / m;
}
rmax = sqrt ( (double)(sqr (xmax) + sqr (ymax)) );
rmax = sqrt ( (double)(SQR (xmax) + SQR (ymax)) );
t = ((cen_y - y1) < (cen_x - x1)) ? (cen_y - y1) : (cen_x - x1);
rmax = (rmax - t) / 100 * (100 - circle) + t;
phi = fmod (phi + angl, 2*M_PI);
phi = fmod (phi + angl, 2*G_PI);
if (pcvals.backwards)
x_calc = x2 - 1 - (x2 - x1 - 1)/(2*M_PI) * phi;
x_calc = x2 - 1 - (x2 - x1 - 1)/(2*G_PI) * phi;
else
x_calc = (x2 - x1 - 1)/(2*M_PI) * phi + x1;
x_calc = (x2 - x1 - 1)/(2*G_PI) * phi + x1;
if (pcvals.inverse)
y_calc = (y2 - y1)/rmax * r + y1;
@ -571,20 +565,20 @@ calc_undistorted_coords(double wx, double wy,
} else {
if (pcvals.backwards)
phi = (2 * M_PI) * (x2 - wx) / xdiff;
phi = (2 * G_PI) * (x2 - wx) / xdiff;
else
phi = (2 * M_PI) * (wx - x1) / xdiff;
phi = (2 * G_PI) * (wx - x1) / xdiff;
phi = fmod (phi + angl, 2 * M_PI);
phi = fmod (phi + angl, 2 * G_PI);
if (phi >= 1.5 * M_PI)
phi2 = 2 * M_PI - phi;
if (phi >= 1.5 * G_PI)
phi2 = 2 * G_PI - phi;
else
if (phi >= M_PI)
phi2 = phi - M_PI;
if (phi >= G_PI)
phi2 = phi - G_PI;
else
if (phi >= 0.5 * M_PI)
phi2 = M_PI - phi;
if (phi >= 0.5 * G_PI)
phi2 = G_PI - phi;
else
phi2 = phi;
@ -613,7 +607,7 @@ calc_undistorted_coords(double wx, double wy,
xmax = ymax / m;
}
rmax = sqrt ((double)(sqr (xmax) + sqr (ymax)));
rmax = sqrt ((double)(SQR (xmax) + SQR (ymax)));
t = ((ym - y1) < (xm - x1)) ? (ym - y1) : (xm - x1);
@ -627,19 +621,19 @@ calc_undistorted_coords(double wx, double wy,
xx = r * sin (phi2);
yy = r * cos (phi2);
if (phi >= 1.5 * M_PI)
if (phi >= 1.5 * G_PI)
{
x_calc = (double)xm - xx;
y_calc = (double)ym - yy;
}
else
if (phi >= M_PI)
if (phi >= G_PI)
{
x_calc = (double)xm - xx;
y_calc = (double)ym + yy;
}
else
if (phi >= 0.5 * M_PI)
if (phi >= 0.5 * G_PI)
{
x_calc = (double)xm + xx;
y_calc = (double)ym + yy;

View File

@ -146,15 +146,10 @@
#include <unistd.h>
#endif
#include <string.h>
#include <math.h>
#include <glib.h>
#include <libgimp/gimp.h>
#ifndef HAVE_RINT
#define rint(x) floor (x + 0.5)
#endif
/* Local types etc
*/
typedef enum
@ -765,14 +760,14 @@ dispatch_resID(guint ID, FILE *fd, guint32 *offset, guint32 Size)
if (psd_image.guides[i].horizontal)
{
psd_image.guides[i].position =
rint((double)(psd_image.guides[i].position *
RINT((double)(psd_image.guides[i].position *
(magic4>>8))
/(double)(magic4&255));
}
else
{
psd_image.guides[i].position =
rint((double)(psd_image.guides[i].position *
RINT((double)(psd_image.guides[i].position *
(magic6>>8))
/(double)(magic6&255));
}

View File

@ -20,20 +20,17 @@
*
* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu
*/
#include <math.h>
#include "config.h"
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
/* Some useful macros */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define SCALE_WIDTH 200
#define TILE_CACHE_SIZE 16
#define ENTRY_WIDTH 35
@ -1012,7 +1009,7 @@ displace_amount (gint location)
switch (rvals.waveform)
{
case SINE:
return rvals.amplitude*sin(location*(2*M_PI)/(double)rvals.period);
return rvals.amplitude*sin(location*(2*G_PI)/(double)rvals.period);
case SAWTOOTH:
return floor(rvals.amplitude*(fabs((((location%rvals.period)/(double)rvals.period)*4)-2)-1));
}

View File

@ -22,18 +22,15 @@
/*
* Sparkle - simulate pixel bloom and diffraction effects
*/
#include "config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define SCALE_WIDTH 125
#define TILE_CACHE_SIZE 16
#define MAX_CHANNELS 4
@ -657,8 +654,8 @@ fspike (GPixelRgn *dest_rgn,
hsl_to_rgb (ho, 1.0, vo, &val[0], &val[1], &val[2]);
}
dx = 0.2 * cos (theta * M_PI / 180.0);
dy = 0.2 * sin (theta * M_PI / 180.0);
dx = 0.2 * cos (theta * G_PI / 180.0);
dy = 0.2 * sin (theta * G_PI / 180.0);
xrt = xr;
yrt = yr;
rpos = 0.2;

View File

@ -32,10 +32,6 @@
#include <libgimp/gimp.h>
#ifndef G_PI /* G_PI will be in GLib eventually */
#define G_PI 3.14159265358979323846
#endif
/* Tor Lillqvist used these, but they're not defined on my system? -Vidar */
/* They are in GIMP's config.h. --tml */
#ifndef SRAND_FUNC

View File

@ -21,19 +21,16 @@
* You can contact Federico Mena Quintero at quartic@polloux.fciencias.unam.mx
* You can contact the original The Gimp authors at gimp@xcf.berkeley.edu
*/
#include "config.h"
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "gtk/gtk.h"
#include "libgimp/gimp.h"
/* Some useful macros */
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
#define SCALE_WIDTH 200
#define TILE_CACHE_SIZE 16
#define ENTRY_WIDTH 50
@ -270,7 +267,7 @@ spread (GDrawable *drawable)
/* Initialize random stuff */
srand (time (NULL));
angle_mod_value = M_PI*2;
angle_mod_value = G_PI*2;
angle_sub_value = angle_mod_value / 2;
x_mod_value = x_amount + 1;
x_sub_value = x_mod_value / 2;

View File

@ -25,9 +25,8 @@
*
* $Id$
*/
#include "config.h"
#include <math.h>
#include <string.h>
#include <stdlib.h>
@ -35,10 +34,6 @@
#include <gtk/gtk.h>
#include <plug-ins/megawidget/megawidget.h>
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif /* M_PI */
struct Grgb {
guint8 red;
guint8 green;
@ -371,7 +366,7 @@ wave(guchar *src, guchar *dst, gint width, gint height, gint bypp,
gint k;
phase = phase*M_PI/180;
phase = phase*G_PI/180;
rowsiz = width * bypp;
if (verbose) {
@ -461,13 +456,13 @@ wave(guchar *src, guchar *dst, gint width, gint height, gint bypp,
if (reflective){
amnt = amplitude * fabs(sin(((d / wavelength)
* (2.0 * M_PI) + phase)));
* (2.0 * G_PI) + phase)));
needx = (amnt * dx) / xscale + cen_x;
needy = (amnt * dy) / yscale + cen_y;
} else {
amnt = amplitude * sin(((d / wavelength)
* (2.0 * M_PI) + phase));
* (2.0 * G_PI) + phase));
needx = (amnt + dx) / xscale + cen_x;
needy = (amnt + dy) / yscale + cen_y;

Some files were not shown because too many files have changed in this diff Show More