gimp/app/core/gimp-transform-utils.c

330 lines
9.4 KiB
C
Raw Normal View History

/* GIMP - The GNU Image Manipulation Program
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
* Copyright (C) 1995-2001 Spencer Kimball, Peter Mattis, and others
*
* This program is free software: you can redistribute it and/or modify
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
* (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, see <http://www.gnu.org/licenses/>.
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
*/
#include "config.h"
#include <glib-object.h>
#include "libgimpmath/gimpmath.h"
#include "core-types.h"
#include "gimp-transform-utils.h"
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
void
gimp_transform_get_rotate_center (gint x,
gint y,
gint width,
gint height,
gboolean auto_center,
gdouble *center_x,
gdouble *center_y)
{
g_return_if_fail (center_x != NULL);
g_return_if_fail (center_y != NULL);
if (auto_center)
{
*center_x = (gdouble) x + (gdouble) width / 2.0;
*center_y = (gdouble) y + (gdouble) height / 2.0;
}
}
void
gimp_transform_get_flip_axis (gint x,
gint y,
gint width,
gint height,
GimpOrientationType flip_type,
gboolean auto_center,
gdouble *axis)
{
g_return_if_fail (axis != NULL);
if (auto_center)
{
switch (flip_type)
{
case GIMP_ORIENTATION_HORIZONTAL:
*axis = ((gdouble) x + (gdouble) width / 2.0);
break;
case GIMP_ORIENTATION_VERTICAL:
*axis = ((gdouble) y + (gdouble) height / 2.0);
break;
default:
g_return_if_reached ();
break;
}
}
}
void
gimp_transform_matrix_flip (GimpMatrix3 *matrix,
GimpOrientationType flip_type,
gdouble axis)
{
g_return_if_fail (matrix != NULL);
switch (flip_type)
{
case GIMP_ORIENTATION_HORIZONTAL:
gimp_matrix3_translate (matrix, - axis, 0.0);
gimp_matrix3_scale (matrix, -1.0, 1.0);
gimp_matrix3_translate (matrix, axis, 0.0);
break;
case GIMP_ORIENTATION_VERTICAL:
gimp_matrix3_translate (matrix, 0.0, - axis);
gimp_matrix3_scale (matrix, 1.0, -1.0);
gimp_matrix3_translate (matrix, 0.0, axis);
break;
case GIMP_ORIENTATION_UNKNOWN:
break;
}
}
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
void
gimp_transform_matrix_flip_free (GimpMatrix3 *matrix,
gdouble x1,
gdouble y1,
gdouble x2,
gdouble y2)
{
gdouble angle;
g_return_if_fail (matrix != NULL);
angle = atan2 (y2 - y1, x2 - x1);
gimp_matrix3_identity (matrix);
gimp_matrix3_translate (matrix, -x1, -y1);
gimp_matrix3_rotate (matrix, -angle);
gimp_matrix3_scale (matrix, 1.0, -1.0);
gimp_matrix3_rotate (matrix, angle);
gimp_matrix3_translate (matrix, x1, y1);
}
void
gimp_transform_matrix_rotate (GimpMatrix3 *matrix,
GimpRotationType rotate_type,
gdouble center_x,
gdouble center_y)
{
gdouble angle = 0;
switch (rotate_type)
{
case GIMP_ROTATE_90:
angle = G_PI_2;
break;
case GIMP_ROTATE_180:
angle = G_PI;
break;
case GIMP_ROTATE_270:
angle = - G_PI_2;
break;
}
gimp_transform_matrix_rotate_center (matrix, center_x, center_y, angle);
}
void
gimp_transform_matrix_rotate_rect (GimpMatrix3 *matrix,
gint x,
gint y,
gint width,
gint height,
gdouble angle)
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
{
gdouble center_x;
gdouble center_y;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
g_return_if_fail (matrix != NULL);
center_x = (gdouble) x + (gdouble) width / 2.0;
center_y = (gdouble) y + (gdouble) height / 2.0;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gimp_matrix3_translate (matrix, -center_x, -center_y);
gimp_matrix3_rotate (matrix, angle);
gimp_matrix3_translate (matrix, +center_x, +center_y);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}
void
gimp_transform_matrix_rotate_center (GimpMatrix3 *matrix,
gdouble center_x,
gdouble center_y,
gdouble angle)
{
g_return_if_fail (matrix != NULL);
gimp_matrix3_translate (matrix, -center_x, -center_y);
gimp_matrix3_rotate (matrix, angle);
gimp_matrix3_translate (matrix, +center_x, +center_y);
}
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
void
gimp_transform_matrix_scale (GimpMatrix3 *matrix,
gint x,
gint y,
gint width,
gint height,
gdouble t_x,
gdouble t_y,
gdouble t_width,
gdouble t_height)
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
{
gdouble scale_x = 1.0;
gdouble scale_y = 1.0;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
g_return_if_fail (matrix != NULL);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
if (width > 0)
scale_x = t_width / (gdouble) width;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
if (height > 0)
scale_y = t_height / (gdouble) height;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gimp_matrix3_identity (matrix);
gimp_matrix3_translate (matrix, -x, -y);
gimp_matrix3_scale (matrix, scale_x, scale_y);
gimp_matrix3_translate (matrix, t_x, t_y);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}
void
gimp_transform_matrix_shear (GimpMatrix3 *matrix,
gint x,
gint y,
gint width,
gint height,
GimpOrientationType orientation,
gdouble amount)
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
{
gdouble center_x;
gdouble center_y;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
g_return_if_fail (matrix != NULL);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
if (width == 0)
width = 1;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
if (height == 0)
height = 1;
center_x = (gdouble) x + (gdouble) width / 2.0;
center_y = (gdouble) y + (gdouble) height / 2.0;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gimp_matrix3_identity (matrix);
gimp_matrix3_translate (matrix, -center_x, -center_y);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
Added object properties for almost all tool_options values and registered 2003-02-07 Michael Natterer <mitch@gimp.org> Added object properties for almost all tool_options values and registered lots of enums with the type system: Part I (enum and type cleanup): * app/core/core-enums.[ch] * app/core/core-types.h: removed InternalOrientaionType and register GimpOrientationType. Register GimpChannelOps. Removed GimpToolOptionsGUIFunc. * app/xcf/xcf-private.h: added XcfOrientationType with the same values as the old InternalOrientationType * app/xcf/xcf-load.c * app/xcf/xcf-save.c: translate between GimpOrientationType and XcfOrientationType. * app/core/gimpdrawable-transform-utils.[ch] * app/core/gimpdrawable-transform.[ch] * app/core/gimpimage-crop.c * app/core/gimpimage-duplicate.c * app/core/gimpimage-guides.c * app/core/gimpimage-resize.c * app/core/gimpimage-scale.c * app/core/gimpimage.h * app/display/gimpdisplayshell.c * tools/pdbgen/stddefs.pdb * tools/pdbgen/pdb/transform_tools.pdb: changed accordingly. * app/pdb/guides_cmds.c * app/pdb/transform_tools_cmds.c * libgimp/gimpenums.h * libgimpproxy/gimpproxytypes.h * plug-ins/script-fu/script-fu-constants.c * tools/pdbgen/enums.pl: regenerated. * libgimptool/gimptoolenums.[ch]: added GimpTransformGridType. * libgimptool/gimptooltypes.h: removed GimpToolOptionsResetFunc, added GimpToolOptionsGUIFunc. Part II (tool options changes): * app/config/gimpconfig-utils.c (gimp_config_reset_properties): don't reset object properties because they have NULL as default value. * app/widgets/gimppropwidgets.[ch]: added gimp_prop_[enum|boolean]_radio_frame_new(), gimp_prop_paint_mode_menu_new() and gimp_prop_scale_entry_new(), which are all needed by the new tool options GUI code. * app/tools/tool_options.[ch]: removed the "reset_func" since the virtual reset() method is used now. * app/paint/gimpairbrushoptions.[ch] * app/paint/gimpcloneoptions.[ch] * app/paint/gimpconvolveoptions.[ch] * app/paint/gimpdodgeburnoptions.[ch] * app/paint/gimperaseroptions.[ch] * app/paint/gimppaintoptions.[ch] * app/paint/gimpsmudgeoptions.[ch]: added properties all over the place and removed the widget and default_value members from the structs. Renamed some values (e.g. s/type/clone_type/). Don't #include <gtk/gtk.h>. * app/paint/gimpairbrush.c * app/paint/gimpclone.c * app/paint/gimpconvolve.c * app/paint/gimpdodgeburn.c * app/paint/gimperaser.c * app/paint/gimppaintbrush.c * app/paint/gimppaintcore-stroke.c * app/paint/gimppaintcore.c * app/paint/gimppencil.c * app/paint/gimpsmudge.c * app/paint/paint-types.h * app/paint/paint.c: changed accordingly. Don't #include <gtk/gtk.h>. * tools/pdbgen/pdb/paint_tools.pdb: changed accordingly. * app/pdb/paint_tools_cmds.c: regenerated. * app/tools/gimpblendoptions.[ch] * app/tools/gimpbucketfilloptions.[ch] * app/tools/gimpcolorpickeroptions.[ch] * app/tools/gimpcropoptions.[ch] * app/tools/gimpflipoptions.[ch] * app/tools/gimpinkoptions.c * app/tools/gimpmagnifyoptions.[ch] * app/tools/gimpmeasureoptions.[ch] * app/tools/gimpmoveoptions.[ch] * app/tools/gimptextoptions.c * app/tools/paint_options.[ch] * app/tools/selection_options.[ch] * app/tools/transform_options.[ch]: ditto: added properties and removed widget and default_value stuff. Removed most reset functions. Use gimp_prop widgets all over the place, renamed some values as above. * app/tools/Makefile.am * app/tools/gimpairbrushtool.c * app/tools/gimpblendtool.c * app/tools/gimpbucketfilltool.c * app/tools/gimpbycolorselecttool.c * app/tools/gimpclonetool.c * app/tools/gimpconvolvetool.c * app/tools/gimpcroptool.c * app/tools/gimpdodgeburntool.c * app/tools/gimperasertool.c * app/tools/gimpfliptool.c * app/tools/gimpfuzzyselecttool.c * app/tools/gimpmagnifytool.c * app/tools/gimpmovetool.c * app/tools/gimpselectiontool.c * app/tools/gimpsheartool.c * app/tools/gimpsmudgetool.c * app/tools/gimptransformtool.c * app/tools/gimpvectoroptions.c: changed accordingly. Ported the paint_options GUI constructors to gimp_prop widgets. * app/widgets/gimpselectioneditor.c * app/gui/tool-options-dialog.c: changed accordingly.
2003-02-08 01:12:21 +08:00
if (orientation == GIMP_ORIENTATION_HORIZONTAL)
gimp_matrix3_xshear (matrix, amount / height);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
else
gimp_matrix3_yshear (matrix, amount / width);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gimp_matrix3_translate (matrix, +center_x, +center_y);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}
void
gimp_transform_matrix_perspective (GimpMatrix3 *matrix,
gint x,
gint y,
gint width,
gint height,
gdouble t_x1,
gdouble t_y1,
gdouble t_x2,
gdouble t_y2,
gdouble t_x3,
gdouble t_y3,
gdouble t_x4,
gdouble t_y4)
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
{
GimpMatrix3 trafo;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gdouble scalex;
gdouble scaley;
g_return_if_fail (matrix != NULL);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
scalex = scaley = 1.0;
if (width > 0)
scalex = 1.0 / (gdouble) width;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
if (height > 0)
scaley = 1.0 / (gdouble) height;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
gimp_matrix3_translate (matrix, -x, -y);
gimp_matrix3_scale (matrix, scalex, scaley);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
/* Determine the perspective transform that maps from
* the unit cube to the transformed coordinates
*/
{
gdouble dx1, dx2, dx3, dy1, dy2, dy3;
dx1 = t_x2 - t_x4;
dx2 = t_x3 - t_x4;
dx3 = t_x1 - t_x2 + t_x4 - t_x3;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
dy1 = t_y2 - t_y4;
dy2 = t_y3 - t_y4;
dy3 = t_y1 - t_y2 + t_y4 - t_y3;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
/* Is the mapping affine? */
if ((dx3 == 0.0) && (dy3 == 0.0))
{
trafo.coeff[0][0] = t_x2 - t_x1;
trafo.coeff[0][1] = t_x4 - t_x2;
trafo.coeff[0][2] = t_x1;
trafo.coeff[1][0] = t_y2 - t_y1;
trafo.coeff[1][1] = t_y4 - t_y2;
trafo.coeff[1][2] = t_y1;
trafo.coeff[2][0] = 0.0;
trafo.coeff[2][1] = 0.0;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}
else
{
gdouble det1, det2;
det1 = dx3 * dy2 - dy3 * dx2;
det2 = dx1 * dy2 - dy1 * dx2;
trafo.coeff[2][0] = (det2 == 0.0) ? 1.0 : det1 / det2;
det1 = dx1 * dy3 - dy1 * dx3;
trafo.coeff[2][1] = (det2 == 0.0) ? 1.0 : det1 / det2;
trafo.coeff[0][0] = t_x2 - t_x1 + trafo.coeff[2][0] * t_x2;
trafo.coeff[0][1] = t_x3 - t_x1 + trafo.coeff[2][1] * t_x3;
trafo.coeff[0][2] = t_x1;
trafo.coeff[1][0] = t_y2 - t_y1 + trafo.coeff[2][0] * t_y2;
trafo.coeff[1][1] = t_y3 - t_y1 + trafo.coeff[2][1] * t_y3;
trafo.coeff[1][2] = t_y1;
}
trafo.coeff[2][2] = 1.0;
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}
gimp_matrix3_mult (&trafo, matrix);
forgot to commit last time. 2001-11-19 Michael Natterer <mitch@gimp.org> * app/display/gimpdisplay-foreach.c: forgot to commit last time. Transform stuff cleanup: * app/core/Makefile.am * app/core/core-types.h * app/core/gimpdrawable-transform.[ch]: new files implementing the actual transform functions cut from tools/gimptransformtool.*. * app/core/gimpdrawable-transform-utils.[ch]: new files implementing transform matrix assembly utility functions. * app/tools/gimptransformtool.[ch]: removed the stuff here. cleanup. * app/tools/transform_options.[ch]: removed all stuff which does not belong here, e.g. the transform_tool_* functions and the global "transform_options" variable. Works like all other tool options now. * app/tools/gimpfliptool.[ch] * app/tools/gimpperspectivetool.[ch] * app/tools/gimprotatetool.[ch] * app/tools/gimpscaletool.[ch] * app/tools/gimpsheartool.[ch]: massive code removal because we can use core/gimpdrawable-fransform* functions now. cleanup. * tools/pdbgen/Makefile.am * tools/pdbgen/groups.pl: added new PDB group "transform_tools". * tools/pdbgen/pdb/tools.pdb: removed the transform stuff here... * tools/pdbgen/pdb/transform_tools.pdb: and added *much* simplified versions which use the new core/gimpdrawable-transform* utilities. * app/pdb/Makefile.am * app/pdb/transform_tools_cmds.c: new file. * app/pdb/internal_procs.c * app/pdb/tools_cmds.c: regenerated. * libgimp/Makefile.am * libgimp/gimp_pdb.h * libgimp/gimptransformtools_pdb.[ch]: new files. * libgimp/gimptools_pdb.[ch]: regenerated.
2001-11-20 02:23:43 +08:00
}