removed...
2003-09-15 Sven Neumann <sven@gimp.org> * app/core/gimpdrawable-transform-utils.[ch]: removed... * app/core/gimp-transform-utils.[ch]: ...and added under new names because these functions are not at all related to GimpDrawable. Changed the function names accordingly. * app/tools/gimpperspectivetool.c * app/tools/gimprotatetool.c * app/tools/gimpscaletool.c * app/tools/gimpsheartool.c * app/vectors/gimpstroke.c * app/vectors/gimpvectors.c * tools/pdbgen/pdb/transform_tools.pdb: changed accordingly. * app/pdb/transform_tools_cmds.c: regenerated.
This commit is contained in:

committed by
Sven Neumann

parent
28d6f0a241
commit
b4cc25eb18
18
ChangeLog
18
ChangeLog
@ -1,3 +1,21 @@
|
|||||||
|
2003-09-15 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/core/gimpdrawable-transform-utils.[ch]: removed...
|
||||||
|
|
||||||
|
* app/core/gimp-transform-utils.[ch]: ...and added under new names
|
||||||
|
because these functions are not at all related to GimpDrawable.
|
||||||
|
Changed the function names accordingly.
|
||||||
|
|
||||||
|
* app/tools/gimpperspectivetool.c
|
||||||
|
* app/tools/gimprotatetool.c
|
||||||
|
* app/tools/gimpscaletool.c
|
||||||
|
* app/tools/gimpsheartool.c
|
||||||
|
* app/vectors/gimpstroke.c
|
||||||
|
* app/vectors/gimpvectors.c
|
||||||
|
* tools/pdbgen/pdb/transform_tools.pdb: changed accordingly.
|
||||||
|
|
||||||
|
* app/pdb/transform_tools_cmds.c: regenerated.
|
||||||
|
|
||||||
2003-09-15 Michael Natterer <mitch@gimp.org>
|
2003-09-15 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* app/core/gimpedit.[ch]
|
* app/core/gimpedit.[ch]
|
||||||
|
@ -34,6 +34,8 @@ libappcore_a_sources = \
|
|||||||
gimp-parasites.h \
|
gimp-parasites.h \
|
||||||
gimp-templates.c \
|
gimp-templates.c \
|
||||||
gimp-templates.h \
|
gimp-templates.h \
|
||||||
|
gimp-transform-utils.c \
|
||||||
|
gimp-transform-utils.h \
|
||||||
gimp-units.c \
|
gimp-units.c \
|
||||||
gimp-units.h \
|
gimp-units.h \
|
||||||
gimp-utils.c \
|
gimp-utils.c \
|
||||||
@ -85,8 +87,6 @@ libappcore_a_sources = \
|
|||||||
gimpdrawable-preview.h \
|
gimpdrawable-preview.h \
|
||||||
gimpdrawable-transform.c \
|
gimpdrawable-transform.c \
|
||||||
gimpdrawable-transform.h \
|
gimpdrawable-transform.h \
|
||||||
gimpdrawable-transform-utils.c \
|
|
||||||
gimpdrawable-transform-utils.h \
|
|
||||||
gimpenvirontable.h \
|
gimpenvirontable.h \
|
||||||
gimpenvirontable.c \
|
gimpenvirontable.c \
|
||||||
gimpgradient.c \
|
gimpgradient.c \
|
||||||
|
@ -24,11 +24,11 @@
|
|||||||
|
|
||||||
#include "core-types.h"
|
#include "core-types.h"
|
||||||
|
|
||||||
#include "gimpdrawable-transform-utils.h"
|
#include "gimp-transform-utils.h"
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_flip (GimpOrientationType flip_type,
|
gimp_transform_matrix_flip (GimpOrientationType flip_type,
|
||||||
gdouble axis,
|
gdouble axis,
|
||||||
GimpMatrix3 *result)
|
GimpMatrix3 *result)
|
||||||
{
|
{
|
||||||
@ -54,7 +54,7 @@ gimp_drawable_transform_matrix_flip (GimpOrientationType flip_type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_rotate (gint x1,
|
gimp_transform_matrix_rotate (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
@ -74,7 +74,7 @@ gimp_drawable_transform_matrix_rotate (gint x1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_rotate_center (gdouble cx,
|
gimp_transform_matrix_rotate_center (gdouble cx,
|
||||||
gdouble cy,
|
gdouble cy,
|
||||||
gdouble angle,
|
gdouble angle,
|
||||||
GimpMatrix3 *result)
|
GimpMatrix3 *result)
|
||||||
@ -86,7 +86,7 @@ gimp_drawable_transform_matrix_rotate_center (gdouble cx,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_scale (gint x1,
|
gimp_transform_matrix_scale (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
@ -114,7 +114,7 @@ gimp_drawable_transform_matrix_scale (gint x1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_shear (gint x1,
|
gimp_transform_matrix_shear (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
@ -150,7 +150,7 @@ gimp_drawable_transform_matrix_shear (gint x1,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
gimp_drawable_transform_matrix_perspective (gint x1,
|
gimp_transform_matrix_perspective (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
|
@ -16,24 +16,24 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __GIMP_DRAWABLE_TRANSFORM_UTILS_H__
|
#ifndef __GIMP_TRANSFORM_UTILS_H__
|
||||||
#define __GIMP_DRAWABLE_TRANSFORM_UTILS_H__
|
#define __GIMP_TRANSFORM_UTILS_H__
|
||||||
|
|
||||||
|
|
||||||
void gimp_drawable_transform_matrix_flip (GimpOrientationType flip_type,
|
void gimp_transform_matrix_flip (GimpOrientationType flip_type,
|
||||||
gdouble axis,
|
gdouble axis,
|
||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
void gimp_drawable_transform_matrix_rotate (gint x1,
|
void gimp_transform_matrix_rotate (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
gdouble angle,
|
gdouble angle,
|
||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
void gimp_drawable_transform_matrix_rotate_center (gdouble cx,
|
void gimp_transform_matrix_rotate_center (gdouble cx,
|
||||||
gdouble cy,
|
gdouble cy,
|
||||||
gdouble angle,
|
gdouble angle,
|
||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
void gimp_drawable_transform_matrix_scale (gint x1,
|
void gimp_transform_matrix_scale (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
@ -42,14 +42,14 @@ void gimp_drawable_transform_matrix_scale (gint x1,
|
|||||||
gdouble tx2,
|
gdouble tx2,
|
||||||
gdouble ty2,
|
gdouble ty2,
|
||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
void gimp_drawable_transform_matrix_shear (gint x1,
|
void gimp_transform_matrix_shear (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
GimpOrientationType orientation,
|
GimpOrientationType orientation,
|
||||||
gdouble amount,
|
gdouble amount,
|
||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
void gimp_drawable_transform_matrix_perspective (gint x1,
|
void gimp_transform_matrix_perspective (gint x1,
|
||||||
gint y1,
|
gint y1,
|
||||||
gint x2,
|
gint x2,
|
||||||
gint y2,
|
gint y2,
|
||||||
@ -64,4 +64,4 @@ void gimp_drawable_transform_matrix_perspective (gint x1,
|
|||||||
GimpMatrix3 *result);
|
GimpMatrix3 *result);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DRAWABLE_TRANSFORM_SHEAR_H__ */
|
#endif /* __GIMP_TRANSFORM_UTILS_H__ */
|
||||||
|
@ -1,231 +0,0 @@
|
|||||||
/* The GIMP -- an image manipulation program
|
|
||||||
* Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
|
|
||||||
*
|
|
||||||
* 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 "config.h"
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
|
|
||||||
#include "libgimpmath/gimpmath.h"
|
|
||||||
|
|
||||||
#include "core-types.h"
|
|
||||||
|
|
||||||
#include "gimpdrawable-transform-utils.h"
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_flip (GimpOrientationType flip_type,
|
|
||||||
gdouble axis,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
|
|
||||||
switch (flip_type)
|
|
||||||
{
|
|
||||||
case GIMP_ORIENTATION_HORIZONTAL:
|
|
||||||
gimp_matrix3_translate (result, - axis, 0.0);
|
|
||||||
gimp_matrix3_scale (result, -1.0, 1.0);
|
|
||||||
gimp_matrix3_translate (result, axis, 0.0);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_ORIENTATION_VERTICAL:
|
|
||||||
gimp_matrix3_translate (result, 0.0, - axis);
|
|
||||||
gimp_matrix3_scale (result, 1.0, -1.0);
|
|
||||||
gimp_matrix3_translate (result, 0.0, axis);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case GIMP_ORIENTATION_UNKNOWN:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_rotate (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble angle,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
gdouble cx;
|
|
||||||
gdouble cy;
|
|
||||||
|
|
||||||
cx = (gdouble) (x1 + x2) / 2.0;
|
|
||||||
cy = (gdouble) (y1 + y2) / 2.0;
|
|
||||||
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
gimp_matrix3_translate (result, -cx, -cy);
|
|
||||||
gimp_matrix3_rotate (result, angle);
|
|
||||||
gimp_matrix3_translate (result, +cx, +cy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_rotate_center (gdouble cx,
|
|
||||||
gdouble cy,
|
|
||||||
gdouble angle,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
gimp_matrix3_translate (result, -cx, -cy);
|
|
||||||
gimp_matrix3_rotate (result, angle);
|
|
||||||
gimp_matrix3_translate (result, +cx, +cy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_scale (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble tx1,
|
|
||||||
gdouble ty1,
|
|
||||||
gdouble tx2,
|
|
||||||
gdouble ty2,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
gdouble scalex;
|
|
||||||
gdouble scaley;
|
|
||||||
|
|
||||||
scalex = scaley = 1.0;
|
|
||||||
|
|
||||||
if ((x2 - x1) > 0)
|
|
||||||
scalex = (tx2 - tx1) / (gdouble) (x2 - x1);
|
|
||||||
|
|
||||||
if ((y2 - y1) > 0)
|
|
||||||
scaley = (ty2 - ty1) / (gdouble) (y2 - y1);
|
|
||||||
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
gimp_matrix3_translate (result, -x1, -y1);
|
|
||||||
gimp_matrix3_scale (result, scalex, scaley);
|
|
||||||
gimp_matrix3_translate (result, tx1, ty1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_shear (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
GimpOrientationType orientation,
|
|
||||||
gdouble amount,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
gint width;
|
|
||||||
gint height;
|
|
||||||
gdouble cx;
|
|
||||||
gdouble cy;
|
|
||||||
|
|
||||||
width = x2 - x1;
|
|
||||||
height = y2 - y1;
|
|
||||||
|
|
||||||
if (width == 0)
|
|
||||||
width = 1;
|
|
||||||
if (height == 0)
|
|
||||||
height = 1;
|
|
||||||
|
|
||||||
cx = (gdouble) (x1 + x2) / 2.0;
|
|
||||||
cy = (gdouble) (y1 + y2) / 2.0;
|
|
||||||
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
gimp_matrix3_translate (result, -cx, -cy);
|
|
||||||
|
|
||||||
if (orientation == GIMP_ORIENTATION_HORIZONTAL)
|
|
||||||
gimp_matrix3_xshear (result, amount / height);
|
|
||||||
else
|
|
||||||
gimp_matrix3_yshear (result, amount / width);
|
|
||||||
|
|
||||||
gimp_matrix3_translate (result, +cx, +cy);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gimp_drawable_transform_matrix_perspective (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble tx1,
|
|
||||||
gdouble ty1,
|
|
||||||
gdouble tx2,
|
|
||||||
gdouble ty2,
|
|
||||||
gdouble tx3,
|
|
||||||
gdouble ty3,
|
|
||||||
gdouble tx4,
|
|
||||||
gdouble ty4,
|
|
||||||
GimpMatrix3 *result)
|
|
||||||
{
|
|
||||||
GimpMatrix3 matrix;
|
|
||||||
gdouble scalex;
|
|
||||||
gdouble scaley;
|
|
||||||
|
|
||||||
scalex = scaley = 1.0;
|
|
||||||
|
|
||||||
if ((x2 - x1) > 0)
|
|
||||||
scalex = 1.0 / (gdouble) (x2 - x1);
|
|
||||||
|
|
||||||
if ((y2 - y1) > 0)
|
|
||||||
scaley = 1.0 / (gdouble) (y2 - y1);
|
|
||||||
|
|
||||||
/* Determine the perspective transform that maps from
|
|
||||||
* the unit cube to the transformed coordinates
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
gdouble dx1, dx2, dx3, dy1, dy2, dy3;
|
|
||||||
|
|
||||||
dx1 = tx2 - tx4;
|
|
||||||
dx2 = tx3 - tx4;
|
|
||||||
dx3 = tx1 - tx2 + tx4 - tx3;
|
|
||||||
|
|
||||||
dy1 = ty2 - ty4;
|
|
||||||
dy2 = ty3 - ty4;
|
|
||||||
dy3 = ty1 - ty2 + ty4 - ty3;
|
|
||||||
|
|
||||||
/* Is the mapping affine? */
|
|
||||||
if ((dx3 == 0.0) && (dy3 == 0.0))
|
|
||||||
{
|
|
||||||
matrix.coeff[0][0] = tx2 - tx1;
|
|
||||||
matrix.coeff[0][1] = tx4 - tx2;
|
|
||||||
matrix.coeff[0][2] = tx1;
|
|
||||||
matrix.coeff[1][0] = ty2 - ty1;
|
|
||||||
matrix.coeff[1][1] = ty4 - ty2;
|
|
||||||
matrix.coeff[1][2] = ty1;
|
|
||||||
matrix.coeff[2][0] = 0.0;
|
|
||||||
matrix.coeff[2][1] = 0.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gdouble det1, det2;
|
|
||||||
|
|
||||||
det1 = dx3 * dy2 - dy3 * dx2;
|
|
||||||
det2 = dx1 * dy2 - dy1 * dx2;
|
|
||||||
matrix.coeff[2][0] = det1 / det2;
|
|
||||||
det1 = dx1 * dy3 - dy1 * dx3;
|
|
||||||
matrix.coeff[2][1] = det1 / det2;
|
|
||||||
|
|
||||||
matrix.coeff[0][0] = tx2 - tx1 + matrix.coeff[2][0] * tx2;
|
|
||||||
matrix.coeff[0][1] = tx3 - tx1 + matrix.coeff[2][1] * tx3;
|
|
||||||
matrix.coeff[0][2] = tx1;
|
|
||||||
|
|
||||||
matrix.coeff[1][0] = ty2 - ty1 + matrix.coeff[2][0] * ty2;
|
|
||||||
matrix.coeff[1][1] = ty3 - ty1 + matrix.coeff[2][1] * ty3;
|
|
||||||
matrix.coeff[1][2] = ty1;
|
|
||||||
}
|
|
||||||
|
|
||||||
matrix.coeff[2][2] = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
gimp_matrix3_identity (result);
|
|
||||||
gimp_matrix3_translate (result, -x1, -y1);
|
|
||||||
gimp_matrix3_scale (result, scalex, scaley);
|
|
||||||
gimp_matrix3_mult (&matrix, result);
|
|
||||||
}
|
|
@ -1,67 +0,0 @@
|
|||||||
/* The GIMP -- an image manipulation program
|
|
||||||
* Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
|
|
||||||
*
|
|
||||||
* 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 __GIMP_DRAWABLE_TRANSFORM_UTILS_H__
|
|
||||||
#define __GIMP_DRAWABLE_TRANSFORM_UTILS_H__
|
|
||||||
|
|
||||||
|
|
||||||
void gimp_drawable_transform_matrix_flip (GimpOrientationType flip_type,
|
|
||||||
gdouble axis,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
void gimp_drawable_transform_matrix_rotate (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble angle,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
void gimp_drawable_transform_matrix_rotate_center (gdouble cx,
|
|
||||||
gdouble cy,
|
|
||||||
gdouble angle,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
void gimp_drawable_transform_matrix_scale (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble tx1,
|
|
||||||
gdouble ty1,
|
|
||||||
gdouble tx2,
|
|
||||||
gdouble ty2,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
void gimp_drawable_transform_matrix_shear (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
GimpOrientationType orientation,
|
|
||||||
gdouble amount,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
void gimp_drawable_transform_matrix_perspective (gint x1,
|
|
||||||
gint y1,
|
|
||||||
gint x2,
|
|
||||||
gint y2,
|
|
||||||
gdouble tx1,
|
|
||||||
gdouble ty1,
|
|
||||||
gdouble tx2,
|
|
||||||
gdouble ty2,
|
|
||||||
gdouble tx3,
|
|
||||||
gdouble ty3,
|
|
||||||
gdouble tx4,
|
|
||||||
gdouble ty5,
|
|
||||||
GimpMatrix3 *result);
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DRAWABLE_TRANSFORM_SHEAR_H__ */
|
|
@ -29,8 +29,8 @@
|
|||||||
#include "procedural_db.h"
|
#include "procedural_db.h"
|
||||||
|
|
||||||
#include "config/gimpcoreconfig.h"
|
#include "config/gimpcoreconfig.h"
|
||||||
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimp.h"
|
#include "core/gimp.h"
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable.h"
|
#include "core/gimpdrawable.h"
|
||||||
|
|
||||||
@ -163,7 +163,7 @@ perspective_invoker (Gimp *gimp,
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_perspective (x1, y1, x2, y2,
|
gimp_transform_matrix_perspective (x1, y1, x2, y2,
|
||||||
trans_info[X0],
|
trans_info[X0],
|
||||||
trans_info[Y0],
|
trans_info[Y0],
|
||||||
trans_info[X1],
|
trans_info[X1],
|
||||||
@ -299,9 +299,7 @@ rotate_invoker (Gimp *gimp,
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_rotate (x1, y1, x2, y2,
|
gimp_transform_matrix_rotate (x1, y1, x2, y2, angle, &matrix);
|
||||||
angle,
|
|
||||||
&matrix);
|
|
||||||
|
|
||||||
if (interpolation)
|
if (interpolation)
|
||||||
interpolation_type = gimp->config->interpolation_type;
|
interpolation_type = gimp->config->interpolation_type;
|
||||||
@ -401,7 +399,7 @@ scale_invoker (Gimp *gimp,
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_scale (x1, y1, x2, y2,
|
gimp_transform_matrix_scale (x1, y1, x2, y2,
|
||||||
trans_info[X0],
|
trans_info[X0],
|
||||||
trans_info[Y0],
|
trans_info[Y0],
|
||||||
trans_info[X1],
|
trans_info[X1],
|
||||||
@ -522,7 +520,7 @@ shear_invoker (Gimp *gimp,
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_shear (x1, y1, x2, y2,
|
gimp_transform_matrix_shear (x1, y1, x2, y2,
|
||||||
shear_type,
|
shear_type,
|
||||||
magnitude,
|
magnitude,
|
||||||
&matrix);
|
&matrix);
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
#include "tools-types.h"
|
#include "tools-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
@ -219,7 +219,7 @@ static void
|
|||||||
gimp_perspective_tool_recalc (GimpTransformTool *tr_tool,
|
gimp_perspective_tool_recalc (GimpTransformTool *tr_tool,
|
||||||
GimpDisplay *gdisp)
|
GimpDisplay *gdisp)
|
||||||
{
|
{
|
||||||
gimp_drawable_transform_matrix_perspective (tr_tool->x1,
|
gimp_transform_matrix_perspective (tr_tool->x1,
|
||||||
tr_tool->y1,
|
tr_tool->y1,
|
||||||
tr_tool->x2,
|
tr_tool->x2,
|
||||||
tr_tool->y2,
|
tr_tool->y2,
|
||||||
|
@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
#include "tools-types.h"
|
#include "tools-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
@ -340,7 +340,7 @@ gimp_rotate_tool_recalc (GimpTransformTool *tr_tool,
|
|||||||
tr_tool->cx = cx;
|
tr_tool->cx = cx;
|
||||||
tr_tool->cy = cy;
|
tr_tool->cy = cy;
|
||||||
|
|
||||||
gimp_drawable_transform_matrix_rotate_center (tr_tool->cx,
|
gimp_transform_matrix_rotate_center (tr_tool->cx,
|
||||||
tr_tool->cy,
|
tr_tool->cy,
|
||||||
tr_tool->trans_info[ANGLE],
|
tr_tool->trans_info[ANGLE],
|
||||||
&tr_tool->transform);
|
&tr_tool->transform);
|
||||||
|
@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
#include "tools-types.h"
|
#include "tools-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
@ -391,7 +391,7 @@ static void
|
|||||||
gimp_scale_tool_recalc (GimpTransformTool *tr_tool,
|
gimp_scale_tool_recalc (GimpTransformTool *tr_tool,
|
||||||
GimpDisplay *gdisp)
|
GimpDisplay *gdisp)
|
||||||
{
|
{
|
||||||
gimp_drawable_transform_matrix_scale (tr_tool->x1,
|
gimp_transform_matrix_scale (tr_tool->x1,
|
||||||
tr_tool->y1,
|
tr_tool->y1,
|
||||||
tr_tool->x2,
|
tr_tool->x2,
|
||||||
tr_tool->y2,
|
tr_tool->y2,
|
||||||
|
@ -27,9 +27,9 @@
|
|||||||
|
|
||||||
#include "tools-types.h"
|
#include "tools-types.h"
|
||||||
|
|
||||||
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpdrawable-transform.h"
|
#include "core/gimpdrawable-transform.h"
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
#include "core/gimptoolinfo.h"
|
#include "core/gimptoolinfo.h"
|
||||||
|
|
||||||
#include "widgets/gimphelp-ids.h"
|
#include "widgets/gimphelp-ids.h"
|
||||||
@ -281,7 +281,7 @@ gimp_shear_tool_recalc (GimpTransformTool *tr_tool,
|
|||||||
else
|
else
|
||||||
amount = tr_tool->trans_info[YSHEAR];
|
amount = tr_tool->trans_info[YSHEAR];
|
||||||
|
|
||||||
gimp_drawable_transform_matrix_shear (tr_tool->x1,
|
gimp_transform_matrix_shear (tr_tool->x1,
|
||||||
tr_tool->y1,
|
tr_tool->y1,
|
||||||
tr_tool->x2,
|
tr_tool->x2,
|
||||||
tr_tool->y2,
|
tr_tool->y2,
|
||||||
|
@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
#include "vectors-types.h"
|
#include "vectors-types.h"
|
||||||
|
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
|
||||||
|
|
||||||
#include "gimpanchor.h"
|
#include "gimpanchor.h"
|
||||||
#include "gimpstroke.h"
|
#include "gimpstroke.h"
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
#include "vectors-types.h"
|
#include "vectors-types.h"
|
||||||
|
|
||||||
#include "core/gimpdrawable-transform-utils.h"
|
#include "core/gimp-transform-utils.h"
|
||||||
#include "core/gimpimage.h"
|
#include "core/gimpimage.h"
|
||||||
#include "core/gimpimage-undo-push.h"
|
#include "core/gimpimage-undo-push.h"
|
||||||
#include "core/gimpmarshal.h"
|
#include "core/gimpmarshal.h"
|
||||||
@ -431,7 +431,7 @@ gimp_vectors_flip (GimpItem *item,
|
|||||||
GList *list;
|
GList *list;
|
||||||
GimpMatrix3 matrix;
|
GimpMatrix3 matrix;
|
||||||
|
|
||||||
gimp_drawable_transform_matrix_flip (flip_type, axis, &matrix);
|
gimp_transform_matrix_flip (flip_type, axis, &matrix);
|
||||||
|
|
||||||
vectors = GIMP_VECTORS (item);
|
vectors = GIMP_VECTORS (item);
|
||||||
|
|
||||||
@ -476,8 +476,7 @@ gimp_vectors_rotate (GimpItem *item,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
gimp_drawable_transform_matrix_rotate_center (center_x, center_y, angle,
|
gimp_transform_matrix_rotate_center (center_x, center_y, angle, &matrix);
|
||||||
&matrix);
|
|
||||||
|
|
||||||
vectors = GIMP_VECTORS (item);
|
vectors = GIMP_VECTORS (item);
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ HELP
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_perspective (x1, y1, x2, y2,
|
gimp_transform_matrix_perspective (x1, y1, x2, y2,
|
||||||
trans_info[X0],
|
trans_info[X0],
|
||||||
trans_info[Y0],
|
trans_info[Y0],
|
||||||
trans_info[X1],
|
trans_info[X1],
|
||||||
@ -189,9 +189,7 @@ HELP
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_rotate (x1, y1, x2, y2,
|
gimp_transform_matrix_rotate (x1, y1, x2, y2, angle, &matrix);
|
||||||
angle,
|
|
||||||
&matrix);
|
|
||||||
|
|
||||||
if (interpolation)
|
if (interpolation)
|
||||||
interpolation_type = gimp->config->interpolation_type;
|
interpolation_type = gimp->config->interpolation_type;
|
||||||
@ -255,7 +253,7 @@ HELP
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_scale (x1, y1, x2, y2,
|
gimp_transform_matrix_scale (x1, y1, x2, y2,
|
||||||
trans_info[X0],
|
trans_info[X0],
|
||||||
trans_info[Y0],
|
trans_info[Y0],
|
||||||
trans_info[X1],
|
trans_info[X1],
|
||||||
@ -322,7 +320,7 @@ HELP
|
|||||||
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
gimp_drawable_mask_bounds (drawable, &x1, &y1, &x2, &y2);
|
||||||
|
|
||||||
/* Assemble the transformation matrix */
|
/* Assemble the transformation matrix */
|
||||||
gimp_drawable_transform_matrix_shear (x1, y1, x2, y2,
|
gimp_transform_matrix_shear (x1, y1, x2, y2,
|
||||||
shear_type,
|
shear_type,
|
||||||
magnitude,
|
magnitude,
|
||||||
&matrix);
|
&matrix);
|
||||||
@ -411,8 +409,8 @@ CODE
|
|||||||
}
|
}
|
||||||
|
|
||||||
@headers = qw("libgimpmath/gimpmath.h" "config/gimpcoreconfig.h"
|
@headers = qw("libgimpmath/gimpmath.h" "config/gimpcoreconfig.h"
|
||||||
"core/gimp.h" "core/gimpdrawable-transform.h"
|
"core/gimp.h" "core/gimp-transform-utils.h"
|
||||||
"core/gimpdrawable-transform-utils.h" "core/gimpdrawable.h");
|
"core/gimpdrawable.h" "core/gimpdrawable-transform.h");
|
||||||
|
|
||||||
@procs = qw(flip perspective rotate scale shear transform_2d);
|
@procs = qw(flip perspective rotate scale shear transform_2d);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user