mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-21 03:52:33 +00:00
df68aba3a7
Thu May 13 22:41:26 BST 1999 Andy Thomas <alt@gimp.org> Changed:- * app/bezier_select.c * app/bezier_selectP.h * app/cursorutil.c * app/cursorutil.h * app/curves.c * app/paths_dialog.c New:- * cursor/mouse1_ap * cursor/mouse1_apmsk * cursor/mouse1_cp * cursor/mouse1_cpmsk * cursor/mouse1_mm * cursor/mouse1_mmmsk * cursor/mouse1_sel * cursor/mouse1_selm * cursor/mouse1_selmmsk * cursor/mouse1_selmsk * cursor/mouse1_selp * cursor/mouse1_selpmsk Paths changes:- Implemented multi-part paths. (Import the path (RMB in paths dialog brings menu up) http://www.picnic.demon.co.uk/tmp/gimp.path into a 600x256 (WxH) for an example). Can copy/paste paths. Fully custom cursors when using the Bezier tool. A number of bug fixes re boundary problems also fixed. Note that heavy use is made of the modifier keys in the bezier tool. MB1 inside a closed curve converts it to a selection. The modifiers change how the selection interacts with any current selection (in much the same way as the selection tool does). MB1 + ALT on control point will move a curve, if shift modifier active then single curve is moved. Curves:- In curves dialog you can now press MB1 + shift will add point to curves dialog corresponding to the current position in the currently selected channel. MB1 + CNTRL will add the point to all channels. (Thanks to Carey Bunks for the initial idea).
90 lines
3.5 KiB
C
90 lines
3.5 KiB
C
/* The GIMP -- an image manipulation program
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
*
|
|
* 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 __BEZIER_SELECTP_H__
|
|
#define __BEZIER_SELECTP_H__
|
|
|
|
|
|
#define BEZIER_START 1
|
|
#define BEZIER_ADD 2
|
|
#define BEZIER_EDIT 4
|
|
#define BEZIER_DRAG 8
|
|
|
|
#define BEZIER_ANCHOR 1
|
|
#define BEZIER_CONTROL 2
|
|
#define BEZIER_MOVE 3
|
|
|
|
#define IMAGE_COORDS 1
|
|
#define AA_IMAGE_COORDS 2
|
|
#define SCREEN_COORDS 3
|
|
|
|
#define SUBDIVIDE 1000
|
|
|
|
enum { EXTEND_EDIT, EXTEND_ADD, EXTEND_REMOVE, EXTEND_NEW };
|
|
|
|
typedef struct _bezier_point BezierPoint;
|
|
|
|
struct _bezier_point
|
|
{
|
|
int type; /* type of point (anchor/control/move) */
|
|
double x, y; /* location of point in image space */
|
|
int sx, sy; /* location of point in screen space */
|
|
BezierPoint *next; /* next point on curve */
|
|
BezierPoint *prev; /* prev point on curve */
|
|
BezierPoint *next_curve; /* Next curve segment */
|
|
};
|
|
|
|
typedef struct _bezier_select BezierSelect;
|
|
|
|
struct _bezier_select
|
|
{
|
|
int state; /* start, add, edit or drag */
|
|
int draw; /* all or part */
|
|
int closed; /* is the last curve closed */
|
|
DrawCore *core; /* Core drawing object */
|
|
BezierPoint *points; /* the curve */
|
|
BezierPoint *cur_anchor; /* the current active anchor point */
|
|
BezierPoint *cur_control; /* the current active control point */
|
|
BezierPoint *last_point; /* the last point on the curve */
|
|
int num_points; /* number of points in the curve */
|
|
Channel *mask; /* null if the curve is open */
|
|
GSList **scanlines; /* used in converting a curve */
|
|
};
|
|
|
|
/* All udata that are passed to the bezier_draw_curve must
|
|
* have this structure as the first element.
|
|
*/
|
|
|
|
typedef struct {
|
|
gint count;
|
|
} CountCurves;
|
|
|
|
typedef void (*BezierPointsFunc) (BezierSelect *, GdkPoint *, int,gpointer);
|
|
|
|
/* Functions */
|
|
int bezier_select_load (void *, BezierPoint *, int, int);
|
|
void bezier_draw_curve (BezierSelect *,BezierPointsFunc, int,gpointer);
|
|
void bezier_select_reset (BezierSelect *);
|
|
void bezier_add_point (BezierSelect *, int, gdouble, gdouble);
|
|
void bezier_paste_bezierselect_to_current (GDisplay *,BezierSelect *);
|
|
void bezier_select_mode (gint);
|
|
void bezier_stroke (BezierSelect *, GDisplay *, int, int);
|
|
void bezier_to_selection (BezierSelect *, GDisplay *);
|
|
gint bezier_distance_along (BezierSelect *, gint, gdouble,gint *,gint *,gdouble *);
|
|
|
|
#endif /* __BEZIER_SELECTP_H__ */
|