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:

committed by
Michael Natterer

parent
db784a41c5
commit
2715fd15c8
10
ChangeLog
10
ChangeLog
@ -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>
|
Mon Feb 14 18:53:23 CET 2000 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/winclipboard.c: typo
|
* 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().
|
adjustment returned by gimp_scale_entry_new().
|
||||||
|
|
||||||
* plug-ins/common/film.c: set reasonable climb_rate's for the
|
* 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>
|
Mon Feb 14 12:22:06 CET 2000 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
@ -433,8 +433,6 @@ gimp_SOURCES = \
|
|||||||
unitrc.h \
|
unitrc.h \
|
||||||
unit_cmds.c \
|
unit_cmds.c \
|
||||||
wilber.h \
|
wilber.h \
|
||||||
vector2d.c \
|
|
||||||
vector2d.h \
|
|
||||||
xcf.c \
|
xcf.c \
|
||||||
xcf.h \
|
xcf.h \
|
||||||
xinput_airbrush.c \
|
xinput_airbrush.c \
|
||||||
|
@ -24,18 +24,19 @@
|
|||||||
#include "gimpobjectP.h"
|
#include "gimpobjectP.h"
|
||||||
#include "paint_core.h"
|
#include "paint_core.h"
|
||||||
#include "temp_buf.h"
|
#include "temp_buf.h"
|
||||||
#include "vector2d.h"
|
|
||||||
|
#include "libgimp/gimpvector.h"
|
||||||
|
|
||||||
struct _GimpBrush
|
struct _GimpBrush
|
||||||
{
|
{
|
||||||
GimpObject gobject;
|
GimpObject gobject;
|
||||||
|
|
||||||
gchar *filename; /* actual filename--brush's location on disk */
|
gchar *filename; /* actual filename--brush's location on disk */
|
||||||
gchar *name; /* brush's name--for brush selection dialog */
|
gchar *name; /* brush's name--for brush selection dialog */
|
||||||
gint spacing; /* brush's spacing */
|
gint spacing; /* brush's spacing */
|
||||||
vector2d x_axis; /* for calculating brush spacing */
|
GimpVector2 x_axis; /* for calculating brush spacing */
|
||||||
vector2d y_axis; /* for calculating brush spacing */
|
GimpVector2 y_axis; /* for calculating brush spacing */
|
||||||
TempBuf *mask; /* the actual mask... */
|
TempBuf *mask; /* the actual mask... */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpBrushClass
|
struct _GimpBrushClass
|
||||||
|
@ -24,18 +24,19 @@
|
|||||||
#include "gimpobjectP.h"
|
#include "gimpobjectP.h"
|
||||||
#include "paint_core.h"
|
#include "paint_core.h"
|
||||||
#include "temp_buf.h"
|
#include "temp_buf.h"
|
||||||
#include "vector2d.h"
|
|
||||||
|
#include "libgimp/gimpvector.h"
|
||||||
|
|
||||||
struct _GimpBrush
|
struct _GimpBrush
|
||||||
{
|
{
|
||||||
GimpObject gobject;
|
GimpObject gobject;
|
||||||
|
|
||||||
gchar *filename; /* actual filename--brush's location on disk */
|
gchar *filename; /* actual filename--brush's location on disk */
|
||||||
gchar *name; /* brush's name--for brush selection dialog */
|
gchar *name; /* brush's name--for brush selection dialog */
|
||||||
gint spacing; /* brush's spacing */
|
gint spacing; /* brush's spacing */
|
||||||
vector2d x_axis; /* for calculating brush spacing */
|
GimpVector2 x_axis; /* for calculating brush spacing */
|
||||||
vector2d y_axis; /* for calculating brush spacing */
|
GimpVector2 y_axis; /* for calculating brush spacing */
|
||||||
TempBuf *mask; /* the actual mask... */
|
TempBuf *mask; /* the actual mask... */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GimpBrushClass
|
struct _GimpBrushClass
|
||||||
|
@ -778,24 +778,25 @@ void
|
|||||||
paint_core_interpolate (PaintCore *paint_core,
|
paint_core_interpolate (PaintCore *paint_core,
|
||||||
GimpDrawable *drawable)
|
GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
double n;
|
gdouble n;
|
||||||
vector2d delta;
|
GimpVector2 delta;
|
||||||
#ifdef GTK_HAVE_SIX_VALUATORS
|
#ifdef GTK_HAVE_SIX_VALUATORS
|
||||||
double dpressure, dxtilt, dytilt, dwheel;
|
gdouble dpressure, dxtilt, dytilt, dwheel;
|
||||||
#else /* !GTK_HAVE_SIX_VALUATORS */
|
#else /* !GTK_HAVE_SIX_VALUATORS */
|
||||||
double dpressure, dxtilt, dytilt;
|
gdouble dpressure, dxtilt, dytilt;
|
||||||
#endif /* GTK_HAVE_SIX_VALUATORS */
|
#endif /* GTK_HAVE_SIX_VALUATORS */
|
||||||
/* double spacing; */
|
/* double spacing; */
|
||||||
/* double lastscale, curscale; */
|
/* double lastscale, curscale; */
|
||||||
double left;
|
gdouble left;
|
||||||
double t;
|
gdouble t;
|
||||||
double initial;
|
gdouble initial;
|
||||||
double dist;
|
gdouble dist;
|
||||||
double total;
|
gdouble total;
|
||||||
double pixel_dist;
|
gdouble pixel_dist;
|
||||||
double pixel_initial;
|
gdouble pixel_initial;
|
||||||
double xd, yd;
|
gdouble xd, yd;
|
||||||
double mag;
|
gdouble mag;
|
||||||
|
|
||||||
delta.x = paint_core->curx - paint_core->lastx;
|
delta.x = paint_core->curx - paint_core->lastx;
|
||||||
delta.y = paint_core->cury - paint_core->lasty;
|
delta.y = paint_core->cury - paint_core->lasty;
|
||||||
dpressure = paint_core->curpressure - paint_core->lastpressure;
|
dpressure = paint_core->curpressure - paint_core->lastpressure;
|
||||||
@ -814,17 +815,19 @@ paint_core_interpolate (PaintCore *paint_core,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* calculate the distance traveled in the coordinate space of the brush */
|
/* calculate the distance traveled in the coordinate space of the brush */
|
||||||
mag = vector2d_magnitude (&(paint_core->brush->x_axis));
|
mag = gimp_vector2_length (&(paint_core->brush->x_axis));
|
||||||
xd = vector2d_dot_product(&delta, &(paint_core->brush->x_axis)) / (mag*mag);
|
xd = gimp_vector2_inner_product (&delta,
|
||||||
|
&(paint_core->brush->x_axis)) / (mag*mag);
|
||||||
|
|
||||||
mag = vector2d_magnitude (&(paint_core->brush->y_axis));
|
mag = gimp_vector2_length (&(paint_core->brush->y_axis));
|
||||||
yd = vector2d_dot_product(&delta, &(paint_core->brush->y_axis)) / (mag*mag);
|
yd = gimp_vector2_inner_product (&delta,
|
||||||
|
&(paint_core->brush->y_axis)) / (mag*mag);
|
||||||
|
|
||||||
dist = 0.5 * sqrt (xd*xd + yd*yd);
|
dist = 0.5 * sqrt (xd*xd + yd*yd);
|
||||||
total = dist + paint_core->distance;
|
total = dist + paint_core->distance;
|
||||||
initial = paint_core->distance;
|
initial = paint_core->distance;
|
||||||
|
|
||||||
pixel_dist = vector2d_magnitude (&delta);
|
pixel_dist = gimp_vector2_length (&delta);
|
||||||
pixel_initial = paint_core->pixel_dist;
|
pixel_initial = paint_core->pixel_dist;
|
||||||
|
|
||||||
/* FIXME: need to adapt the spacing to the size */
|
/* FIXME: need to adapt the spacing to the size */
|
||||||
|
@ -778,24 +778,25 @@ void
|
|||||||
paint_core_interpolate (PaintCore *paint_core,
|
paint_core_interpolate (PaintCore *paint_core,
|
||||||
GimpDrawable *drawable)
|
GimpDrawable *drawable)
|
||||||
{
|
{
|
||||||
double n;
|
gdouble n;
|
||||||
vector2d delta;
|
GimpVector2 delta;
|
||||||
#ifdef GTK_HAVE_SIX_VALUATORS
|
#ifdef GTK_HAVE_SIX_VALUATORS
|
||||||
double dpressure, dxtilt, dytilt, dwheel;
|
gdouble dpressure, dxtilt, dytilt, dwheel;
|
||||||
#else /* !GTK_HAVE_SIX_VALUATORS */
|
#else /* !GTK_HAVE_SIX_VALUATORS */
|
||||||
double dpressure, dxtilt, dytilt;
|
gdouble dpressure, dxtilt, dytilt;
|
||||||
#endif /* GTK_HAVE_SIX_VALUATORS */
|
#endif /* GTK_HAVE_SIX_VALUATORS */
|
||||||
/* double spacing; */
|
/* double spacing; */
|
||||||
/* double lastscale, curscale; */
|
/* double lastscale, curscale; */
|
||||||
double left;
|
gdouble left;
|
||||||
double t;
|
gdouble t;
|
||||||
double initial;
|
gdouble initial;
|
||||||
double dist;
|
gdouble dist;
|
||||||
double total;
|
gdouble total;
|
||||||
double pixel_dist;
|
gdouble pixel_dist;
|
||||||
double pixel_initial;
|
gdouble pixel_initial;
|
||||||
double xd, yd;
|
gdouble xd, yd;
|
||||||
double mag;
|
gdouble mag;
|
||||||
|
|
||||||
delta.x = paint_core->curx - paint_core->lastx;
|
delta.x = paint_core->curx - paint_core->lastx;
|
||||||
delta.y = paint_core->cury - paint_core->lasty;
|
delta.y = paint_core->cury - paint_core->lasty;
|
||||||
dpressure = paint_core->curpressure - paint_core->lastpressure;
|
dpressure = paint_core->curpressure - paint_core->lastpressure;
|
||||||
@ -814,17 +815,19 @@ paint_core_interpolate (PaintCore *paint_core,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* calculate the distance traveled in the coordinate space of the brush */
|
/* calculate the distance traveled in the coordinate space of the brush */
|
||||||
mag = vector2d_magnitude (&(paint_core->brush->x_axis));
|
mag = gimp_vector2_length (&(paint_core->brush->x_axis));
|
||||||
xd = vector2d_dot_product(&delta, &(paint_core->brush->x_axis)) / (mag*mag);
|
xd = gimp_vector2_inner_product (&delta,
|
||||||
|
&(paint_core->brush->x_axis)) / (mag*mag);
|
||||||
|
|
||||||
mag = vector2d_magnitude (&(paint_core->brush->y_axis));
|
mag = gimp_vector2_length (&(paint_core->brush->y_axis));
|
||||||
yd = vector2d_dot_product(&delta, &(paint_core->brush->y_axis)) / (mag*mag);
|
yd = gimp_vector2_inner_product (&delta,
|
||||||
|
&(paint_core->brush->y_axis)) / (mag*mag);
|
||||||
|
|
||||||
dist = 0.5 * sqrt (xd*xd + yd*yd);
|
dist = 0.5 * sqrt (xd*xd + yd*yd);
|
||||||
total = dist + paint_core->distance;
|
total = dist + paint_core->distance;
|
||||||
initial = paint_core->distance;
|
initial = paint_core->distance;
|
||||||
|
|
||||||
pixel_dist = vector2d_magnitude (&delta);
|
pixel_dist = gimp_vector2_length (&delta);
|
||||||
pixel_initial = paint_core->pixel_dist;
|
pixel_initial = paint_core->pixel_dist;
|
||||||
|
|
||||||
/* FIXME: need to adapt the spacing to the size */
|
/* FIXME: need to adapt the spacing to the size */
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
|
|
@ -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__ */
|
|
Reference in New Issue
Block a user