From 9f2174fcdf92e4746d7797902b3d2bd6de328e46 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Wed, 17 Oct 2007 19:25:01 +0000 Subject: [PATCH] sprinkled some const qualifiers. 2007-10-17 Sven Neumann * app/display/gimpdisplayshell-render.c (box_filter): sprinkled some const qualifiers. svn path=/trunk/; revision=23862 --- ChangeLog | 5 +++++ app/display/gimpdisplayshell-render.c | 32 ++++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 871f2ed224..5fd659dadb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-10-17 Sven Neumann + + * app/display/gimpdisplayshell-render.c (box_filter): sprinkled + some const qualifiers. + 2007-10-17 Sven Neumann * app/main.c: added back short versions of --gimprc option and diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c index 1c842ca17b..12f034d91e 100644 --- a/app/display/gimpdisplayshell-render.c +++ b/app/display/gimpdisplayshell-render.c @@ -682,22 +682,21 @@ render_image_init_alpha (gint mult) } static inline void -box_filter (guint left_weight, - guint center_weight, - guint right_weight, - guint top_weight, - guint middle_weight, - guint bottom_weight, - guint sum, +box_filter (const guint left_weight, + const guint center_weight, + const guint right_weight, + const guint top_weight, + const guint middle_weight, + const guint bottom_weight, + const guint sum, const guchar **src, /* the 9 surrounding source pixels */ guchar *dest, - gint bpp) + const gint bpp) { switch (bpp) { gint i; - guint a; case 4: #define ALPHA 3 { @@ -714,9 +713,9 @@ box_filter (guint left_weight, (src[6][ALPHA] * bottom_weight) >> 8 }; - a = (center_weight * (factors[0] + factors[1] + factors[2]) + - right_weight * (factors[3] + factors[4] + factors[5]) + - left_weight * (factors[6] + factors[7] + factors[8])); + guint a = (center_weight * (factors[0] + factors[1] + factors[2]) + + right_weight * (factors[3] + factors[4] + factors[5]) + + left_weight * (factors[6] + factors[7] + factors[8])); dest[ALPHA] = a / sum; @@ -760,9 +759,9 @@ box_filter (guint left_weight, (src[6][ALPHA] * bottom_weight) >> 8 }; - a = (center_weight * (factors[0] + factors[1] + factors[2]) + - right_weight * (factors[3] + factors[4] + factors[5]) + - left_weight * (factors[6] + factors[7] + factors[8])); + guint a = (center_weight * (factors[0] + factors[1] + factors[2]) + + right_weight * (factors[3] + factors[4] + factors[5]) + + left_weight * (factors[6] + factors[7] + factors[8])); dest[ALPHA] = a / sum; @@ -1026,12 +1025,14 @@ render_image_tile_fault (RenderInfo *info) src[5]=src[4]; src[8]=src[7]; } + if (info->src_y + 1 >= source_height) { src[6]=src[3]; src[7]=src[4]; src[8]=src[5]; } + box_filter (left_weight, center_weight, right_weight, top_weight, middle_weight, bottom_weight, info->footarea, src, dest, bpp); @@ -1475,6 +1476,7 @@ render_image_tile_fault_one_row (RenderInfo *info) src[5]=src[4]; src[8]=src[7]; } + box_filter (left_weight, center_weight, right_weight, top_weight, middle_weight, bottom_weight, info->footarea, src, dest, bpp);