gimp r26395 - in trunk: . app/display
- From: mitch svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26395 - in trunk: . app/display
- Date: Tue, 5 Aug 2008 17:50:32 +0000 (UTC)
Author: mitch
Date: Tue Aug 5 17:50:32 2008
New Revision: 26395
URL: http://svn.gnome.org/viewvc/gimp?rev=26395&view=rev
Log:
2008-08-05 Michael Natterer <mitch gimp org>
* app/display/gimpdisplayshell-scroll.[ch]
* app/display/gimpdisplayshell-draw.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-transform.c: get rid of the "image"
part in all instances of "scaled_image_viewport_offset", we call
it simply "viewport" in all other places and it makes the code
more readable.
Modified:
trunk/ChangeLog
trunk/app/display/gimpdisplayshell-draw.c
trunk/app/display/gimpdisplayshell-scale.c
trunk/app/display/gimpdisplayshell-scroll.c
trunk/app/display/gimpdisplayshell-scroll.h
trunk/app/display/gimpdisplayshell-transform.c
Modified: trunk/app/display/gimpdisplayshell-draw.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-draw.c (original)
+++ trunk/app/display/gimpdisplayshell-draw.c Tue Aug 5 17:50:32 2008
@@ -510,7 +510,7 @@
if (! shell->display->image)
return;
- gimp_display_shell_get_scaled_image_viewport_offset (shell, &sx, &sy);
+ gimp_display_shell_get_scaled_viewport_offset (shell, &sx, &sy);
gimp_display_shell_get_scaled_image_size (shell, &sw, &sh);
/* check if the passed in area intersects with
Modified: trunk/app/display/gimpdisplayshell-scale.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-scale.c (original)
+++ trunk/app/display/gimpdisplayshell-scale.c Tue Aug 5 17:50:32 2008
@@ -149,8 +149,8 @@
gdouble vertical_lower;
gdouble vertical_upper;
gdouble vertical_max_size;
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
/* Initialize values */
@@ -182,23 +182,23 @@
/* Adjust due to scrolling */
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
horizontal_lower -= img2real (shell, TRUE,
FUNSCALEX (shell,
- (gdouble) scaled_image_viewport_offset_x));
+ (gdouble) scaled_viewport_offset_x));
horizontal_upper -= img2real (shell, TRUE,
FUNSCALEX (shell,
- (gdouble) scaled_image_viewport_offset_x));
+ (gdouble) scaled_viewport_offset_x));
vertical_lower -= img2real (shell, FALSE,
FUNSCALEY (shell,
- (gdouble) scaled_image_viewport_offset_y));
+ (gdouble) scaled_viewport_offset_y));
vertical_upper -= img2real (shell, FALSE,
FUNSCALEY (shell,
- (gdouble) scaled_image_viewport_offset_y));
+ (gdouble) scaled_viewport_offset_y));
/* Finally setup the actual rulers */
Modified: trunk/app/display/gimpdisplayshell-scroll.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-scroll.c (original)
+++ trunk/app/display/gimpdisplayshell-scroll.c Tue Aug 5 17:50:32 2008
@@ -223,16 +223,16 @@
gint *w,
gint *h)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
- if (x) *x = -scaled_image_viewport_offset_x;
- if (y) *y = -scaled_image_viewport_offset_y;
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
+ if (x) *x = -scaled_viewport_offset_x;
+ if (y) *y = -scaled_viewport_offset_y;
if (w) *w = shell->disp_width;
if (h) *h = shell->disp_height;
}
@@ -264,7 +264,7 @@
}
/**
- * gimp_display_shell_get_scaled_image_viewport_offset:
+ * gimp_display_shell_get_scaled_viewport_offset:
* @shell:
* @x:
* @y:
@@ -273,9 +273,9 @@
*
**/
void
-gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
- gint *x,
- gint *y)
+gimp_display_shell_get_scaled_viewport_offset (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y)
{
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
Modified: trunk/app/display/gimpdisplayshell-scroll.h
==============================================================================
--- trunk/app/display/gimpdisplayshell-scroll.h (original)
+++ trunk/app/display/gimpdisplayshell-scroll.h Tue Aug 5 17:50:32 2008
@@ -20,44 +20,44 @@
#define __GIMP_DISPLAY_SHELL_SCROLL_H__
-void gimp_display_shell_center_around_image_coordinate (GimpDisplayShell *shell,
- gdouble image_x,
- gdouble image_y);
-
-void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
-
-void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
- gint *x,
- gint *y,
- gint *w,
- gint *h);
-
-void gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
- gdouble *x,
- gdouble *y,
- gdouble *w,
- gdouble *h);
-
-void gimp_display_shell_get_scaled_image_viewport_offset (const GimpDisplayShell *shell,
- gint *x,
- gint *y);
-
-void gimp_display_shell_get_scaled_image_size (const GimpDisplayShell *shell,
- gint *w,
- gint *h);
-
-void gimp_display_shell_get_disp_offset (const GimpDisplayShell *shell,
- gint *disp_xoffset,
- gint *disp_yoffset);
-
-void gimp_display_shell_get_render_start_offset (const GimpDisplayShell *shell,
- gint *offset_x,
- gint *offset_y);
-
-void gimp_display_shell_setup_hscrollbar_with_value (GimpDisplayShell *shell,
- gdouble value);
-void gimp_display_shell_setup_vscrollbar_with_value (GimpDisplayShell *shell,
- gdouble value);
+void gimp_display_shell_center_around_image_coordinate (GimpDisplayShell *shell,
+ gdouble image_x,
+ gdouble image_y);
+
+void gimp_display_shell_scroll_clamp_offsets (GimpDisplayShell *shell);
+
+void gimp_display_shell_get_scaled_viewport (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y,
+ gint *w,
+ gint *h);
+
+void gimp_display_shell_get_viewport (const GimpDisplayShell *shell,
+ gdouble *x,
+ gdouble *y,
+ gdouble *w,
+ gdouble *h);
+
+void gimp_display_shell_get_scaled_viewport_offset (const GimpDisplayShell *shell,
+ gint *x,
+ gint *y);
+
+void gimp_display_shell_get_scaled_image_size (const GimpDisplayShell *shell,
+ gint *w,
+ gint *h);
+
+void gimp_display_shell_get_disp_offset (const GimpDisplayShell *shell,
+ gint *disp_xoffset,
+ gint *disp_yoffset);
+
+void gimp_display_shell_get_render_start_offset (const GimpDisplayShell *shell,
+ gint *offset_x,
+ gint *offset_y);
+
+void gimp_display_shell_setup_hscrollbar_with_value (GimpDisplayShell *shell,
+ gdouble value);
+void gimp_display_shell_setup_vscrollbar_with_value (GimpDisplayShell *shell,
+ gdouble value);
#endif /* __GIMP_DISPLAY_SHELL_SCROLL_H__ */
Modified: trunk/app/display/gimpdisplayshell-transform.c
==============================================================================
--- trunk/app/display/gimpdisplayshell-transform.c (original)
+++ trunk/app/display/gimpdisplayshell-transform.c Tue Aug 5 17:50:32 2008
@@ -49,8 +49,8 @@
GimpCoords *image_coords,
GimpCoords *display_coords)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (image_coords != NULL);
@@ -61,12 +61,12 @@
display_coords->x = SCALEX (shell, image_coords->x);
display_coords->y = SCALEY (shell, image_coords->y);
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
- display_coords->x += scaled_image_viewport_offset_x;
- display_coords->y += scaled_image_viewport_offset_y;
+ display_coords->x += scaled_viewport_offset_x;
+ display_coords->y += scaled_viewport_offset_y;
}
/**
@@ -83,8 +83,8 @@
GimpCoords *display_coords,
GimpCoords *image_coords)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (display_coords != NULL);
@@ -92,12 +92,12 @@
*image_coords = *display_coords;
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
- image_coords->x = display_coords->x - scaled_image_viewport_offset_x;
- image_coords->y = display_coords->y - scaled_image_viewport_offset_y;
+ image_coords->x = display_coords->x - scaled_viewport_offset_x;
+ image_coords->y = display_coords->y - scaled_viewport_offset_y;
image_coords->x /= shell->scale_x;
image_coords->y /= shell->scale_y;
@@ -111,8 +111,8 @@
gint *ny,
gboolean use_offsets)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
gint64 tx;
@@ -136,11 +136,11 @@
tx = ((gint64) x * shell->x_src_dec) / shell->x_dest_inc;
ty = ((gint64) y * shell->y_src_dec) / shell->y_dest_inc;
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
- tx += scaled_image_viewport_offset_x;
- ty += scaled_image_viewport_offset_y;
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
+ tx += scaled_viewport_offset_x;
+ ty += scaled_viewport_offset_y;
/* The projected coordinates might overflow a gint in the case of big
images at high zoom levels, so we clamp them here to avoid problems. */
@@ -173,8 +173,8 @@
gboolean round,
gboolean use_offsets)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
gint64 tx;
@@ -192,11 +192,11 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
- tx = (gint64) x - scaled_image_viewport_offset_x;
- ty = (gint64) y - scaled_image_viewport_offset_y;
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
+ tx = (gint64) x - scaled_viewport_offset_x;
+ ty = (gint64) y - scaled_viewport_offset_y;
tx *= shell->x_dest_inc;
ty *= shell->y_dest_inc;
@@ -232,8 +232,8 @@
gdouble *ny,
gboolean use_offsets)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
@@ -249,12 +249,12 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
- *nx = SCALEX (shell, x + offset_x) + scaled_image_viewport_offset_x;
- *ny = SCALEY (shell, y + offset_y) + scaled_image_viewport_offset_y;
+ *nx = SCALEX (shell, x + offset_x) + scaled_viewport_offset_x;
+ *ny = SCALEY (shell, y + offset_y) + scaled_viewport_offset_y;
}
/**
@@ -279,8 +279,8 @@
gdouble *ny,
gboolean use_offsets)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gint offset_x = 0;
gint offset_y = 0;
@@ -296,12 +296,12 @@
gimp_item_offsets (item, &offset_x, &offset_y);
}
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
- *nx = (x - scaled_image_viewport_offset_x) / shell->scale_x - offset_x;
- *ny = (y - scaled_image_viewport_offset_y) / shell->scale_y - offset_y;
+ *nx = (x - scaled_viewport_offset_x) / shell->scale_x - offset_x;
+ *ny = (y - scaled_viewport_offset_y) / shell->scale_y - offset_y;
}
/**
@@ -339,22 +339,21 @@
for (i = 0; i < n_points ; i++)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gdouble x = points[i].x + offset_x;
gdouble y = points[i].y + offset_y;
x = x * shell->x_src_dec / shell->x_dest_inc;
y = y * shell->y_src_dec / shell->y_dest_inc;
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
- coords[i].x = CLAMP (PROJ_ROUND64 (x) +
- scaled_image_viewport_offset_x,
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
+
+ coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
G_MININT, G_MAXINT);
- coords[i].y = CLAMP (PROJ_ROUND64 (y) +
- scaled_image_viewport_offset_y,
+ coords[i].y = CLAMP (PROJ_ROUND64 (y) + scaled_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
@@ -394,22 +393,21 @@
for (i = 0; i < n_coords ; i++)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gdouble x = image_coords[i].x + offset_x;
gdouble y = image_coords[i].y + offset_y;
x = x * shell->x_src_dec / shell->x_dest_inc;
y = y * shell->y_src_dec / shell->y_dest_inc;
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
- disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) +
- scaled_image_viewport_offset_x,
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
+
+ disp_coords[i].x = CLAMP (PROJ_ROUND64 (x) + scaled_viewport_offset_x,
G_MININT, G_MAXINT);
- disp_coords[i].y = CLAMP (PROJ_ROUND64 (y) +
- scaled_image_viewport_offset_y,
+ disp_coords[i].y = CLAMP (PROJ_ROUND64 (y) + scaled_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
@@ -449,8 +447,8 @@
for (i = 0; i < n_segs ; i++)
{
- gint scaled_image_viewport_offset_x;
- gint scaled_image_viewport_offset_y;
+ gint scaled_viewport_offset_x;
+ gint scaled_viewport_offset_y;
gint64 x1, x2;
gint64 y1, y2;
@@ -464,17 +462,17 @@
y1 = (y1 * shell->y_src_dec) / shell->y_dest_inc;
y2 = (y2 * shell->y_src_dec) / shell->y_dest_inc;
- gimp_display_shell_get_scaled_image_viewport_offset (shell,
- &scaled_image_viewport_offset_x,
- &scaled_image_viewport_offset_y);
+ gimp_display_shell_get_scaled_viewport_offset (shell,
+ &scaled_viewport_offset_x,
+ &scaled_viewport_offset_y);
- dest_segs[i].x1 = CLAMP (x1 + scaled_image_viewport_offset_x,
+ dest_segs[i].x1 = CLAMP (x1 + scaled_viewport_offset_x,
G_MININT, G_MAXINT);
- dest_segs[i].x2 = CLAMP (x2 + scaled_image_viewport_offset_x,
+ dest_segs[i].x2 = CLAMP (x2 + scaled_viewport_offset_x,
G_MININT, G_MAXINT);
- dest_segs[i].y1 = CLAMP (y1 + scaled_image_viewport_offset_y,
+ dest_segs[i].y1 = CLAMP (y1 + scaled_viewport_offset_y,
G_MININT, G_MAXINT);
- dest_segs[i].y2 = CLAMP (y2 + scaled_image_viewport_offset_y,
+ dest_segs[i].y2 = CLAMP (y2 + scaled_viewport_offset_y,
G_MININT, G_MAXINT);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]