mirror of https://github.com/GNOME/gimp.git
added new "supersample" property to GimpTransformOptions and added
2004-03-13 Raphael Quinet <quinet@gamers.org> * app/tools/gimptransformoptions.[ch]: added new "supersample" property to GimpTransformOptions and added corresponding check button in the option dialog for the transform tools. * app/core/gimpdrawable-transform.[ch], * app/core/gimpdrawable.c, * app/tools/gimptransformtool.c: new "gboolean supersample" parameter added to gimp_drawable_transform_tiles_affine() and gimp_drawable_transform_affine(). * tools/pdbgen/pdb/transform_tools.pdb: ditto. For the PDB calls, the supersample parameter is set to FALSE for "rotate" and "shear" and set to TRUE for "perspective", "scale" and "transform_2d". * app/pdb/transform_tools_cmds.c: regenerated. The new "supersample" option lets the user decide if the transformations should use supersampling (RECURSION_LEVEL 3) or not. This fixes both bug #136702 and bug #109817. Hopefully for good, this time.
This commit is contained in:
parent
40825ad048
commit
59dfdac9b1
23
ChangeLog
23
ChangeLog
|
@ -1,3 +1,26 @@
|
||||||
|
2004-03-13 Raphaël Quinet <quinet@gamers.org>
|
||||||
|
|
||||||
|
* app/tools/gimptransformoptions.[ch]: added new "supersample"
|
||||||
|
property to GimpTransformOptions and added corresponding check
|
||||||
|
button in the option dialog for the transform tools.
|
||||||
|
|
||||||
|
* app/core/gimpdrawable-transform.[ch],
|
||||||
|
* app/core/gimpdrawable.c,
|
||||||
|
* app/tools/gimptransformtool.c: new "gboolean supersample"
|
||||||
|
parameter added to gimp_drawable_transform_tiles_affine() and
|
||||||
|
gimp_drawable_transform_affine().
|
||||||
|
|
||||||
|
* tools/pdbgen/pdb/transform_tools.pdb: ditto. For the PDB calls,
|
||||||
|
the supersample parameter is set to FALSE for "rotate" and "shear"
|
||||||
|
and set to TRUE for "perspective", "scale" and "transform_2d".
|
||||||
|
|
||||||
|
* app/pdb/transform_tools_cmds.c: regenerated.
|
||||||
|
|
||||||
|
The new "supersample" option lets the user decide if the
|
||||||
|
transformations should use supersampling (RECURSION_LEVEL 3) or
|
||||||
|
not. This fixes both bug #136702 and bug #109817. Hopefully for
|
||||||
|
good, this time.
|
||||||
|
|
||||||
2004-03-13 Raphaël Quinet <quinet@gamers.org>
|
2004-03-13 Raphaël Quinet <quinet@gamers.org>
|
||||||
|
|
||||||
* app/tools/gimptexttool.c (gimp_text_tool_set_layer): added
|
* app/tools/gimptexttool.c (gimp_text_tool_set_layer): added
|
||||||
|
|
|
@ -55,8 +55,7 @@
|
||||||
|
|
||||||
/* recursion level should be a usersettable parameter,
|
/* recursion level should be a usersettable parameter,
|
||||||
3 seems to be a reasonable default */
|
3 seems to be a reasonable default */
|
||||||
/* temporarily set to 0 - http://bugzilla.gnome.org/show_bug.cgi?id=136702 */
|
#define RECURSION_LEVEL 3
|
||||||
#define RECURSION_LEVEL 0
|
|
||||||
|
|
||||||
|
|
||||||
/* forward function prototypes */
|
/* forward function prototypes */
|
||||||
|
@ -104,6 +103,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result,
|
gboolean clip_result,
|
||||||
GimpProgressFunc progress_callback,
|
GimpProgressFunc progress_callback,
|
||||||
gpointer progress_data)
|
gpointer progress_data)
|
||||||
|
@ -373,7 +373,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
|
||||||
{
|
{
|
||||||
guchar color[MAX_CHANNELS];
|
guchar color[MAX_CHANNELS];
|
||||||
|
|
||||||
if (RECURSION_LEVEL &&
|
if (supersample &&
|
||||||
supersample_dtest (u[1], v[1], u[2], v[2],
|
supersample_dtest (u[1], v[1], u[2], v[2],
|
||||||
u[3], v[3], u[4], v[4]))
|
u[3], v[3], u[4], v[4]))
|
||||||
{
|
{
|
||||||
|
@ -807,6 +807,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result)
|
gboolean clip_result)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
|
@ -841,6 +842,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
|
||||||
matrix,
|
matrix,
|
||||||
GIMP_TRANSFORM_FORWARD,
|
GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type,
|
interpolation_type,
|
||||||
|
supersample,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,7 @@
|
||||||
|
|
||||||
/* recursion level should be a usersettable parameter,
|
/* recursion level should be a usersettable parameter,
|
||||||
3 seems to be a reasonable default */
|
3 seems to be a reasonable default */
|
||||||
/* temporarily set to 0 - http://bugzilla.gnome.org/show_bug.cgi?id=136702 */
|
#define RECURSION_LEVEL 3
|
||||||
#define RECURSION_LEVEL 0
|
|
||||||
|
|
||||||
|
|
||||||
/* forward function prototypes */
|
/* forward function prototypes */
|
||||||
|
@ -104,6 +103,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result,
|
gboolean clip_result,
|
||||||
GimpProgressFunc progress_callback,
|
GimpProgressFunc progress_callback,
|
||||||
gpointer progress_data)
|
gpointer progress_data)
|
||||||
|
@ -373,7 +373,7 @@ gimp_drawable_transform_tiles_affine (GimpDrawable *drawable,
|
||||||
{
|
{
|
||||||
guchar color[MAX_CHANNELS];
|
guchar color[MAX_CHANNELS];
|
||||||
|
|
||||||
if (RECURSION_LEVEL &&
|
if (supersample &&
|
||||||
supersample_dtest (u[1], v[1], u[2], v[2],
|
supersample_dtest (u[1], v[1], u[2], v[2],
|
||||||
u[3], v[3], u[4], v[4]))
|
u[3], v[3], u[4], v[4]))
|
||||||
{
|
{
|
||||||
|
@ -807,6 +807,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result)
|
gboolean clip_result)
|
||||||
{
|
{
|
||||||
GimpImage *gimage;
|
GimpImage *gimage;
|
||||||
|
@ -841,6 +842,7 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
|
||||||
matrix,
|
matrix,
|
||||||
GIMP_TRANSFORM_FORWARD,
|
GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type,
|
interpolation_type,
|
||||||
|
supersample,
|
||||||
FALSE,
|
FALSE,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ TileManager * gimp_drawable_transform_tiles_affine (GimpDrawable *draw
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result,
|
gboolean clip_result,
|
||||||
GimpProgressFunc progress_callback,
|
GimpProgressFunc progress_callback,
|
||||||
gpointer progress_data);
|
gpointer progress_data);
|
||||||
|
@ -57,6 +58,7 @@ gboolean gimp_drawable_transform_affine (GimpDrawable *draw
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result);
|
gboolean clip_result);
|
||||||
gboolean gimp_drawable_transform_flip (GimpDrawable *drawable,
|
gboolean gimp_drawable_transform_flip (GimpDrawable *drawable,
|
||||||
GimpOrientationType flip_type);
|
GimpOrientationType flip_type);
|
||||||
|
|
|
@ -96,6 +96,7 @@ static void gimp_drawable_transform (GimpItem *item,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result,
|
gboolean clip_result,
|
||||||
GimpProgressFunc progress_callback,
|
GimpProgressFunc progress_callback,
|
||||||
gpointer progress_data);
|
gpointer progress_data);
|
||||||
|
@ -527,6 +528,7 @@ gimp_drawable_transform (GimpItem *item,
|
||||||
const GimpMatrix3 *matrix,
|
const GimpMatrix3 *matrix,
|
||||||
GimpTransformDirection direction,
|
GimpTransformDirection direction,
|
||||||
GimpInterpolationType interpolation_type,
|
GimpInterpolationType interpolation_type,
|
||||||
|
gboolean supersample,
|
||||||
gboolean clip_result,
|
gboolean clip_result,
|
||||||
GimpProgressFunc progress_callback,
|
GimpProgressFunc progress_callback,
|
||||||
gpointer progress_data)
|
gpointer progress_data)
|
||||||
|
@ -547,6 +549,7 @@ gimp_drawable_transform (GimpItem *item,
|
||||||
drawable->tiles,
|
drawable->tiles,
|
||||||
matrix, direction,
|
matrix, direction,
|
||||||
interpolation_type,
|
interpolation_type,
|
||||||
|
supersample,
|
||||||
clip_result,
|
clip_result,
|
||||||
progress_callback,
|
progress_callback,
|
||||||
progress_data);
|
progress_data);
|
||||||
|
|
|
@ -187,7 +187,8 @@ perspective_invoker (Gimp *gimp,
|
||||||
/* Perspective the selection */
|
/* Perspective the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,7 +321,8 @@ rotate_invoker (Gimp *gimp,
|
||||||
/* Rotate the selection */
|
/* Rotate the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, FALSE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,7 +430,8 @@ scale_invoker (Gimp *gimp,
|
||||||
/* Scale the selection */
|
/* Scale the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,7 +550,8 @@ shear_invoker (Gimp *gimp,
|
||||||
/* Shear the selection */
|
/* Shear the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, FALSE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -668,7 +672,8 @@ transform_2d_invoker (Gimp *gimp,
|
||||||
/* Transform the selection */
|
/* Transform the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ enum
|
||||||
PROP_TYPE,
|
PROP_TYPE,
|
||||||
PROP_DIRECTION,
|
PROP_DIRECTION,
|
||||||
PROP_INTERPOLATION,
|
PROP_INTERPOLATION,
|
||||||
|
PROP_SUPERSAMPLE,
|
||||||
PROP_CLIP,
|
PROP_CLIP,
|
||||||
PROP_GRID_TYPE,
|
PROP_GRID_TYPE,
|
||||||
PROP_GRID_SIZE,
|
PROP_GRID_SIZE,
|
||||||
|
@ -137,6 +138,10 @@ gimp_transform_options_class_init (GimpTransformOptionsClass *klass)
|
||||||
GIMP_TYPE_INTERPOLATION_TYPE,
|
GIMP_TYPE_INTERPOLATION_TYPE,
|
||||||
GIMP_INTERPOLATION_LINEAR,
|
GIMP_INTERPOLATION_LINEAR,
|
||||||
0);
|
0);
|
||||||
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_SUPERSAMPLE,
|
||||||
|
"supersample", NULL,
|
||||||
|
FALSE,
|
||||||
|
0);
|
||||||
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CLIP,
|
GIMP_CONFIG_INSTALL_PROP_BOOLEAN (object_class, PROP_CLIP,
|
||||||
"clip", NULL,
|
"clip", NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
@ -186,6 +191,9 @@ gimp_transform_options_set_property (GObject *object,
|
||||||
case PROP_INTERPOLATION:
|
case PROP_INTERPOLATION:
|
||||||
options->interpolation = g_value_get_enum (value);
|
options->interpolation = g_value_get_enum (value);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SUPERSAMPLE:
|
||||||
|
options->supersample = g_value_get_boolean (value);
|
||||||
|
break;
|
||||||
case PROP_CLIP:
|
case PROP_CLIP:
|
||||||
options->clip = g_value_get_boolean (value);
|
options->clip = g_value_get_boolean (value);
|
||||||
break;
|
break;
|
||||||
|
@ -228,6 +236,9 @@ gimp_transform_options_get_property (GObject *object,
|
||||||
case PROP_INTERPOLATION:
|
case PROP_INTERPOLATION:
|
||||||
g_value_set_enum (value, options->interpolation);
|
g_value_set_enum (value, options->interpolation);
|
||||||
break;
|
break;
|
||||||
|
case PROP_SUPERSAMPLE:
|
||||||
|
g_value_set_boolean (value, options->supersample);
|
||||||
|
break;
|
||||||
case PROP_CLIP:
|
case PROP_CLIP:
|
||||||
g_value_set_boolean (value, options->clip);
|
g_value_set_boolean (value, options->clip);
|
||||||
break;
|
break;
|
||||||
|
@ -315,6 +326,12 @@ gimp_transform_options_gui (GimpToolOptions *tool_options)
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), optionmenu, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (optionmenu);
|
gtk_widget_show (optionmenu);
|
||||||
|
|
||||||
|
/* the supersample toggle button */
|
||||||
|
button = gimp_prop_check_button_new (config, "supersample",
|
||||||
|
_("Supersample"));
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (button);
|
||||||
|
|
||||||
/* the clip resulting image toggle button */
|
/* the clip resulting image toggle button */
|
||||||
button = gimp_prop_check_button_new (config, "clip", _("Clip Result"));
|
button = gimp_prop_check_button_new (config, "clip", _("Clip Result"));
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||||
|
|
|
@ -41,6 +41,7 @@ struct _GimpTransformOptions
|
||||||
GimpTransformType type;
|
GimpTransformType type;
|
||||||
GimpTransformDirection direction;
|
GimpTransformDirection direction;
|
||||||
GimpInterpolationType interpolation;
|
GimpInterpolationType interpolation;
|
||||||
|
gboolean supersample;
|
||||||
gboolean clip;
|
gboolean clip;
|
||||||
GimpTransformGridType grid_type;
|
GimpTransformGridType grid_type;
|
||||||
gint grid_size;
|
gint grid_size;
|
||||||
|
|
|
@ -848,6 +848,7 @@ gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
|
||||||
&tr_tool->transform,
|
&tr_tool->transform,
|
||||||
options->direction,
|
options->direction,
|
||||||
options->interpolation,
|
options->interpolation,
|
||||||
|
options->supersample,
|
||||||
clip_result,
|
clip_result,
|
||||||
progress ?
|
progress ?
|
||||||
gimp_progress_update_and_flush :
|
gimp_progress_update_and_flush :
|
||||||
|
|
|
@ -152,7 +152,8 @@ HELP
|
||||||
/* Perspective the selection */
|
/* Perspective the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
|
@ -211,7 +212,8 @@ HELP
|
||||||
/* Rotate the selection */
|
/* Rotate the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, FALSE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
|
@ -284,7 +286,8 @@ HELP
|
||||||
/* Scale the selection */
|
/* Scale the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
|
@ -350,7 +353,8 @@ HELP
|
||||||
/* Shear the selection */
|
/* Shear the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, FALSE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
|
@ -425,7 +429,8 @@ HELP
|
||||||
/* Transform the selection */
|
/* Transform the selection */
|
||||||
success = gimp_drawable_transform_affine (drawable,
|
success = gimp_drawable_transform_affine (drawable,
|
||||||
&matrix, GIMP_TRANSFORM_FORWARD,
|
&matrix, GIMP_TRANSFORM_FORWARD,
|
||||||
interpolation_type, FALSE);
|
interpolation_type, TRUE,
|
||||||
|
FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CODE
|
CODE
|
||||||
|
|
Loading…
Reference in New Issue