[gimp] Change coords in GimpDynamicsOutput from call-by-value to "const GimpCoords*"
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gimp] Change coords in GimpDynamicsOutput from call-by-value to "const GimpCoords*"
- Date: Tue, 27 Oct 2009 13:31:16 +0000 (UTC)
commit 0c81d491fbab49e1e085a85f63c15cb14a3fc2b4
Author: Michael Natterer <mitch gimp org>
Date: Tue Oct 27 14:30:20 2009 +0100
Change coords in GimpDynamicsOutput from call-by-value to "const GimpCoords*"
app/core/gimpdynamicsoutput.c | 35 +++++++++++++++++------------------
app/core/gimpdynamicsoutput.h | 6 +++---
app/paint/gimpairbrush.c | 4 ++--
app/paint/gimpbrushcore.c | 14 +++++++-------
app/paint/gimpclone.c | 2 +-
app/paint/gimpconvolve.c | 4 ++--
app/paint/gimpdodgeburn.c | 4 ++--
app/paint/gimperaser.c | 4 ++--
app/paint/gimpheal.c | 2 +-
app/paint/gimppaintbrush.c | 6 +++---
app/paint/gimpsmudge.c | 6 +++---
app/paint/gimpsourcecore.c | 4 ++--
12 files changed, 45 insertions(+), 46 deletions(-)
---
diff --git a/app/core/gimpdynamicsoutput.c b/app/core/gimpdynamicsoutput.c
index 18d484d..7e5ad8e 100644
--- a/app/core/gimpdynamicsoutput.c
+++ b/app/core/gimpdynamicsoutput.c
@@ -242,7 +242,7 @@ gimp_dynamics_output_is_enabled (GimpDynamicsOutput *output)
gdouble
gimp_dynamics_output_get_linear_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point)
{
gdouble total = 0.0;
@@ -251,25 +251,25 @@ gimp_dynamics_output_get_linear_value (GimpDynamicsOutput *output,
if (output->use_pressure)
{
- total += coords.pressure;
+ total += coords->pressure;
factors++;
}
if (output->use_velocity)
{
- total += (1.0 - coords.velocity);
+ total += (1.0 - coords->velocity);
factors++;
}
if (output->use_direction)
{
- total += coords.direction + 0.5;
+ total += coords->direction + 0.5;
factors++;
}
if (output->use_tilt)
{
- total += 1.0 - sqrt (SQR (coords.xtilt) + SQR (coords.ytilt));
+ total += 1.0 - sqrt (SQR (coords->xtilt) + SQR (coords->ytilt));
factors++;
}
@@ -298,7 +298,7 @@ gimp_dynamics_output_get_linear_value (GimpDynamicsOutput *output,
gdouble
gimp_dynamics_output_get_angular_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point)
{
gdouble total = 0.0;
@@ -307,19 +307,19 @@ gimp_dynamics_output_get_angular_value (GimpDynamicsOutput *output,
if (output->use_pressure)
{
- total += coords.pressure;
+ total += coords->pressure;
factors++;
}
if (output->use_velocity)
{
- total += (1.0 - coords.velocity);
+ total += (1.0 - coords->velocity);
factors++;
}
if (output->use_direction)
{
- total += coords.direction;
+ total += coords->direction;
factors++;
}
@@ -328,8 +328,8 @@ gimp_dynamics_output_get_angular_value (GimpDynamicsOutput *output,
*/
if (output->use_tilt)
{
- gdouble tilt_x = coords.xtilt;
- gdouble tilt_y = coords.ytilt;
+ gdouble tilt_x = coords->xtilt;
+ gdouble tilt_y = coords->ytilt;
gdouble tilt = 0.0;
if (tilt_x == 0.0)
@@ -385,10 +385,9 @@ gimp_dynamics_output_get_angular_value (GimpDynamicsOutput *output,
return result;
}
-
gdouble
gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point)
{
gdouble total = 0.0;
@@ -397,13 +396,13 @@ gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
if (output->use_pressure)
{
- total += 2 * coords.pressure;
+ total += 2 * coords->pressure;
factors++;
}
if (output->use_velocity)
{
- total += 2 * coords.velocity;
+ total += 2 * coords->velocity;
factors++;
}
@@ -411,9 +410,9 @@ gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
{
gdouble direction = 0.0;
- direction = fmod (1 + coords.direction, 0.5) / 0.25;
+ direction = fmod (1 + coords->direction, 0.5) / 0.25;
- if ((coords.direction > 0.0) && (coords.direction < 0.5))
+ if ((coords->direction > 0.0) && (coords->direction < 0.5))
direction = 1 / direction;
total += direction;
@@ -422,7 +421,7 @@ gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
if (output->use_tilt)
{
- total += sqrt ((1 - fabs (coords.xtilt)) / (1 - fabs (coords.ytilt)));
+ total += sqrt ((1 - fabs (coords->xtilt)) / (1 - fabs (coords->ytilt)));
factors++;
}
diff --git a/app/core/gimpdynamicsoutput.h b/app/core/gimpdynamicsoutput.h
index b1c07ec..6dac2fe 100644
--- a/app/core/gimpdynamicsoutput.h
+++ b/app/core/gimpdynamicsoutput.h
@@ -64,13 +64,13 @@ GimpDynamicsOutput * gimp_dynamics_output_new (const gchar *name);
gboolean gimp_dynamics_output_is_enabled (GimpDynamicsOutput *output);
gdouble gimp_dynamics_output_get_linear_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point);
gdouble gimp_dynamics_output_get_angular_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point);
gdouble gimp_dynamics_output_get_aspect_value (GimpDynamicsOutput *output,
- GimpCoords coords,
+ const GimpCoords *coords,
gdouble fade_point);
diff --git a/app/paint/gimpairbrush.c b/app/paint/gimpairbrush.c
index 51899a0..feca5b0 100644
--- a/app/paint/gimpairbrush.c
+++ b/app/paint/gimpairbrush.c
@@ -155,7 +155,7 @@ gimp_airbrush_paint (GimpPaintCore *paint_core,
dynamic_rate =
gimp_dynamics_output_get_linear_value (dynamics->rate_output,
- *coords,
+ coords,
fade_point);
timeout = 10000 / (options->rate * dynamic_rate);
@@ -197,7 +197,7 @@ gimp_airbrush_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity = options->pressure / 100.0;
opacity *= gimp_dynamics_output_get_linear_value(GIMP_BRUSH_CORE(paint_core)->dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
diff --git a/app/paint/gimpbrushcore.c b/app/paint/gimpbrushcore.c
index d62239b..871bf15 100644
--- a/app/paint/gimpbrushcore.c
+++ b/app/paint/gimpbrushcore.c
@@ -420,15 +420,15 @@ gimp_brush_core_start (GimpPaintCore *paint_core,
paint_core->pixel_dist);
core->scale *= gimp_dynamics_output_get_linear_value (core->dynamics->size_output,
- *coords,
+ coords,
fade_point);
core->angle += gimp_dynamics_output_get_angular_value (core->dynamics->angle_output,
- *coords,
+ coords,
fade_point);
core->aspect_ratio *= gimp_dynamics_output_get_aspect_value (core->dynamics->aspect_ratio_output,
- *coords,
+ coords,
fade_point);
}
@@ -727,7 +727,7 @@ gimp_brush_core_interpolate (GimpPaintCore *paint_core,
paint_core->pixel_dist);
dyn_jitter = core->jitter * gimp_dynamics_output_get_linear_value (core->dynamics->jitter_output,
- current_coords,
+ ¤t_coords,
fade_point);
jitter_dist = g_rand_double_range (core->rand, 0, dyn_jitter);
@@ -792,15 +792,15 @@ gimp_brush_core_get_paint_area (GimpPaintCore *paint_core,
paint_core->pixel_dist);
core->scale *= gimp_dynamics_output_get_linear_value (core->dynamics->size_output,
- *coords,
+ coords,
fade_point);
core->angle += gimp_dynamics_output_get_angular_value (core->dynamics->angle_output,
- *coords,
+ coords,
fade_point);
core->aspect_ratio *= gimp_dynamics_output_get_aspect_value (core->dynamics->aspect_ratio_output,
- *coords,
+ coords,
fade_point);
}
diff --git a/app/paint/gimpclone.c b/app/paint/gimpclone.c
index f1f0e04..d51c57e 100644
--- a/app/paint/gimpclone.c
+++ b/app/paint/gimpclone.c
@@ -244,7 +244,7 @@ gimp_clone_motion (GimpSourceCore *source_core,
paint_core->pixel_dist);
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
diff --git a/app/paint/gimpconvolve.c b/app/paint/gimpconvolve.c
index 3a22005..e166406 100644
--- a/app/paint/gimpconvolve.c
+++ b/app/paint/gimpconvolve.c
@@ -150,7 +150,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -163,7 +163,7 @@ gimp_convolve_motion (GimpPaintCore *paint_core,
rate = options->rate;
rate *= gimp_dynamics_output_get_linear_value (dynamics->rate_output,
- *coords,
+ coords,
fade_point);
gimp_convolve_calculate_matrix (convolve, options->type,
diff --git a/app/paint/gimpdodgeburn.c b/app/paint/gimpdodgeburn.c
index bc26301..5e5bf39 100644
--- a/app/paint/gimpdodgeburn.c
+++ b/app/paint/gimpdodgeburn.c
@@ -189,7 +189,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -255,7 +255,7 @@ gimp_dodge_burn_motion (GimpPaintCore *paint_core,
g_free (temp_data);
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
/* Replace the newly dodgedburned area (canvas_buf) to the image */
diff --git a/app/paint/gimperaser.c b/app/paint/gimperaser.c
index 1623823..4f90b1c 100644
--- a/app/paint/gimperaser.c
+++ b/app/paint/gimperaser.c
@@ -124,7 +124,7 @@ gimp_eraser_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -145,7 +145,7 @@ gimp_eraser_motion (GimpPaintCore *paint_core,
area->width * area->height, area->bytes);
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
gimp_brush_core_paste_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c
index ac9aaf2..d26cb63 100644
--- a/app/paint/gimpheal.c
+++ b/app/paint/gimpheal.c
@@ -449,7 +449,7 @@ gimp_heal_motion (GimpSourceCore *source_core,
paint_core->pixel_dist);
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
mask_buf = gimp_brush_core_get_brush_mask (GIMP_BRUSH_CORE (source_core),
diff --git a/app/paint/gimppaintbrush.c b/app/paint/gimppaintbrush.c
index a44052f..ab558b4 100644
--- a/app/paint/gimppaintbrush.c
+++ b/app/paint/gimppaintbrush.c
@@ -127,7 +127,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity *= gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -140,7 +140,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
paint_appl_mode = paint_options->application_mode;
grad_point = gimp_dynamics_output_get_linear_value (dynamics->color_output,
- *coords,
+ coords,
fade_point);
/* optionally take the color from the current gradient */
@@ -187,7 +187,7 @@ _gimp_paintbrush_motion (GimpPaintCore *paint_core,
}
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
/* finally, let the brush core paste the colored area on the canvas */
diff --git a/app/paint/gimpsmudge.c b/app/paint/gimpsmudge.c
index 486ab6a..122ce3a 100644
--- a/app/paint/gimpsmudge.c
+++ b/app/paint/gimpsmudge.c
@@ -260,7 +260,7 @@ gimp_smudge_motion (GimpPaintCore *paint_core,
paint_core->pixel_dist);
opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -279,7 +279,7 @@ gimp_smudge_motion (GimpPaintCore *paint_core,
/* Enable dynamic rate */
dynamic_rate = gimp_dynamics_output_get_linear_value (dynamics->rate_output,
- *coords,
+ coords,
fade_point);
rate = (options->rate / 100.0) * dynamic_rate;
@@ -322,7 +322,7 @@ gimp_smudge_motion (GimpPaintCore *paint_core,
copy_region (&tempPR, &destPR);
hardness = gimp_dynamics_output_get_linear_value (dynamics->hardness_output,
- *coords,
+ coords,
fade_point);
gimp_brush_core_replace_canvas (GIMP_BRUSH_CORE (paint_core), drawable,
diff --git a/app/paint/gimpsourcecore.c b/app/paint/gimpsourcecore.c
index 524b338..3e644d3 100644
--- a/app/paint/gimpsourcecore.c
+++ b/app/paint/gimpsourcecore.c
@@ -365,7 +365,7 @@ gimp_source_core_motion (GimpSourceCore *source_core,
paint_core->pixel_dist);
opacity = gimp_dynamics_output_get_linear_value (dynamics->opacity_output,
- *coords,
+ coords,
fade_point);
if (opacity == 0.0)
return;
@@ -385,7 +385,7 @@ gimp_source_core_motion (GimpSourceCore *source_core,
src_pickable = GIMP_PICKABLE (gimp_image_get_projection (src_image));
gimp_item_get_offset (GIMP_ITEM (source_core->src_drawable),
- &off_x, &off_y);
+ &off_x, &off_y);
src_offset_x += off_x;
src_offset_y += off_y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]