app/Makefile.am removed.

2000-02-14  Michael Natterer  <mitch@gimp.org>

	* app/Makefile.am
	* app/vector2d.[ch]: removed.

	* app/gimpbrush.h
	* app/paint_core.c: use the vectors from libgimp.
This commit is contained in:
Michael Natterer 2000-02-14 18:09:33 +00:00 committed by Michael Natterer
parent db784a41c5
commit 2715fd15c8
8 changed files with 67 additions and 123 deletions

View File

@ -1,3 +1,11 @@
2000-02-14 Michael Natterer <mitch@gimp.org>
* app/Makefile.am
* app/vector2d.[ch]: removed.
* app/gimpbrush.h
* app/paint_core.c: use the vectors from libgimp.
Mon Feb 14 18:53:23 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/common/winclipboard.c: typo
@ -56,7 +64,7 @@ Mon Feb 14 18:53:23 CET 2000 Sven Neumann <sven@gimp.org>
adjustment returned by gimp_scale_entry_new().
* plug-ins/common/film.c: set reasonable climb_rate's for the
advanced options's spinbuttons.
advanced options' spinbuttons.
Mon Feb 14 12:22:06 CET 2000 Sven Neumann <sven@gimp.org>

View File

@ -433,8 +433,6 @@ gimp_SOURCES = \
unitrc.h \
unit_cmds.c \
wilber.h \
vector2d.c \
vector2d.h \
xcf.c \
xcf.h \
xinput_airbrush.c \

View File

@ -24,18 +24,19 @@
#include "gimpobjectP.h"
#include "paint_core.h"
#include "temp_buf.h"
#include "vector2d.h"
#include "libgimp/gimpvector.h"
struct _GimpBrush
{
GimpObject gobject;
gchar *filename; /* actual filename--brush's location on disk */
gchar *name; /* brush's name--for brush selection dialog */
gint spacing; /* brush's spacing */
vector2d x_axis; /* for calculating brush spacing */
vector2d y_axis; /* for calculating brush spacing */
TempBuf *mask; /* the actual mask... */
gchar *filename; /* actual filename--brush's location on disk */
gchar *name; /* brush's name--for brush selection dialog */
gint spacing; /* brush's spacing */
GimpVector2 x_axis; /* for calculating brush spacing */
GimpVector2 y_axis; /* for calculating brush spacing */
TempBuf *mask; /* the actual mask... */
};
struct _GimpBrushClass

View File

@ -24,18 +24,19 @@
#include "gimpobjectP.h"
#include "paint_core.h"
#include "temp_buf.h"
#include "vector2d.h"
#include "libgimp/gimpvector.h"
struct _GimpBrush
{
GimpObject gobject;
gchar *filename; /* actual filename--brush's location on disk */
gchar *name; /* brush's name--for brush selection dialog */
gint spacing; /* brush's spacing */
vector2d x_axis; /* for calculating brush spacing */
vector2d y_axis; /* for calculating brush spacing */
TempBuf *mask; /* the actual mask... */
gchar *filename; /* actual filename--brush's location on disk */
gchar *name; /* brush's name--for brush selection dialog */
gint spacing; /* brush's spacing */
GimpVector2 x_axis; /* for calculating brush spacing */
GimpVector2 y_axis; /* for calculating brush spacing */
TempBuf *mask; /* the actual mask... */
};
struct _GimpBrushClass

View File

@ -778,24 +778,25 @@ void
paint_core_interpolate (PaintCore *paint_core,
GimpDrawable *drawable)
{
double n;
vector2d delta;
gdouble n;
GimpVector2 delta;
#ifdef GTK_HAVE_SIX_VALUATORS
double dpressure, dxtilt, dytilt, dwheel;
gdouble dpressure, dxtilt, dytilt, dwheel;
#else /* !GTK_HAVE_SIX_VALUATORS */
double dpressure, dxtilt, dytilt;
gdouble dpressure, dxtilt, dytilt;
#endif /* GTK_HAVE_SIX_VALUATORS */
/* double spacing; */
/* double lastscale, curscale; */
double left;
double t;
double initial;
double dist;
double total;
double pixel_dist;
double pixel_initial;
double xd, yd;
double mag;
gdouble left;
gdouble t;
gdouble initial;
gdouble dist;
gdouble total;
gdouble pixel_dist;
gdouble pixel_initial;
gdouble xd, yd;
gdouble mag;
delta.x = paint_core->curx - paint_core->lastx;
delta.y = paint_core->cury - paint_core->lasty;
dpressure = paint_core->curpressure - paint_core->lastpressure;
@ -814,17 +815,19 @@ paint_core_interpolate (PaintCore *paint_core,
return;
/* calculate the distance traveled in the coordinate space of the brush */
mag = vector2d_magnitude (&(paint_core->brush->x_axis));
xd = vector2d_dot_product(&delta, &(paint_core->brush->x_axis)) / (mag*mag);
mag = gimp_vector2_length (&(paint_core->brush->x_axis));
xd = gimp_vector2_inner_product (&delta,
&(paint_core->brush->x_axis)) / (mag*mag);
mag = vector2d_magnitude (&(paint_core->brush->y_axis));
yd = vector2d_dot_product(&delta, &(paint_core->brush->y_axis)) / (mag*mag);
mag = gimp_vector2_length (&(paint_core->brush->y_axis));
yd = gimp_vector2_inner_product (&delta,
&(paint_core->brush->y_axis)) / (mag*mag);
dist = 0.5 * sqrt (xd*xd + yd*yd);
total = dist + paint_core->distance;
initial = paint_core->distance;
pixel_dist = vector2d_magnitude (&delta);
pixel_dist = gimp_vector2_length (&delta);
pixel_initial = paint_core->pixel_dist;
/* FIXME: need to adapt the spacing to the size */

View File

@ -778,24 +778,25 @@ void
paint_core_interpolate (PaintCore *paint_core,
GimpDrawable *drawable)
{
double n;
vector2d delta;
gdouble n;
GimpVector2 delta;
#ifdef GTK_HAVE_SIX_VALUATORS
double dpressure, dxtilt, dytilt, dwheel;
gdouble dpressure, dxtilt, dytilt, dwheel;
#else /* !GTK_HAVE_SIX_VALUATORS */
double dpressure, dxtilt, dytilt;
gdouble dpressure, dxtilt, dytilt;
#endif /* GTK_HAVE_SIX_VALUATORS */
/* double spacing; */
/* double lastscale, curscale; */
double left;
double t;
double initial;
double dist;
double total;
double pixel_dist;
double pixel_initial;
double xd, yd;
double mag;
gdouble left;
gdouble t;
gdouble initial;
gdouble dist;
gdouble total;
gdouble pixel_dist;
gdouble pixel_initial;
gdouble xd, yd;
gdouble mag;
delta.x = paint_core->curx - paint_core->lastx;
delta.y = paint_core->cury - paint_core->lasty;
dpressure = paint_core->curpressure - paint_core->lastpressure;
@ -814,17 +815,19 @@ paint_core_interpolate (PaintCore *paint_core,
return;
/* calculate the distance traveled in the coordinate space of the brush */
mag = vector2d_magnitude (&(paint_core->brush->x_axis));
xd = vector2d_dot_product(&delta, &(paint_core->brush->x_axis)) / (mag*mag);
mag = gimp_vector2_length (&(paint_core->brush->x_axis));
xd = gimp_vector2_inner_product (&delta,
&(paint_core->brush->x_axis)) / (mag*mag);
mag = vector2d_magnitude (&(paint_core->brush->y_axis));
yd = vector2d_dot_product(&delta, &(paint_core->brush->y_axis)) / (mag*mag);
mag = gimp_vector2_length (&(paint_core->brush->y_axis));
yd = gimp_vector2_inner_product (&delta,
&(paint_core->brush->y_axis)) / (mag*mag);
dist = 0.5 * sqrt (xd*xd + yd*yd);
total = dist + paint_core->distance;
initial = paint_core->distance;
pixel_dist = vector2d_magnitude (&delta);
pixel_dist = gimp_vector2_length (&delta);
pixel_initial = paint_core->pixel_dist;
/* FIXME: need to adapt the spacing to the size */

View File

@ -1,39 +0,0 @@
/* vector2d
* Copyright (C) 1998 Jay Cox <jaycox@earthlink.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "vector2d.h"
#include <math.h>
double
vector2d_dot_product (vector2d *v1, vector2d *v2)
{
return ((v1->x * v2->x) + (v1->y * v2->y));
}
double
vector2d_magnitude (vector2d *v)
{
return (sqrt((v->x*v->x) + (v->y*v->y)));
}
void
vector2d_set (vector2d *v, double x, double y)
{
v->x = x; v->y = y;
}

View File

@ -1,31 +0,0 @@
/* vector2d
* Copyright (C) 1998 Jay Cox <jaycox@earthlink.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __VECTOR2D_H__
#define __VECTOR2D_H__
typedef struct _vector2d
{
double x, y;
} vector2d;
void vector2d_set (vector2d *v, double x, double y);
double vector2d_dot_product (vector2d *v1, vector2d *v2);
double vector2d_magnitude (vector2d *v);
#endif /* __VECTOR2D_H__ */