gimp r26582 - in trunk: . plug-ins/common
- From: neo svn gnome org
- To: svn-commits-list gnome org
- Subject: gimp r26582 - in trunk: . plug-ins/common
- Date: Fri, 15 Aug 2008 21:46:09 +0000 (UTC)
Author: neo
Date: Fri Aug 15 21:46:09 2008
New Revision: 26582
URL: http://svn.gnome.org/viewvc/gimp?rev=26582&view=rev
Log:
2008-08-15 Sven Neumann <sven gimp org>
* plug-ins/common/pixelize.c: formatting.
Modified:
trunk/ChangeLog
trunk/plug-ins/common/pixelize.c
Modified: trunk/plug-ins/common/pixelize.c
==============================================================================
--- trunk/plug-ins/common/pixelize.c (original)
+++ trunk/plug-ins/common/pixelize.c Fri Aug 15 21:46:09 2008
@@ -480,8 +480,10 @@
gimp_pixel_rgn_init (&src_rgn, drawable,
x, y, x_step, y_step, FALSE, FALSE);
+
for (b = 0; b < bpp; b++)
average[b] = 0;
+
count = 0;
for (pr = gimp_pixel_rgns_register (1, &src_rgn);
@@ -489,9 +491,11 @@
pr = gimp_pixel_rgns_process (pr))
{
src_row = src_rgn.data;
+
for (row = 0; row < src_rgn.h; row++)
{
src = src_row;
+
if (has_alpha)
{
for (col = 0; col < src_rgn.w; col++)
@@ -513,14 +517,18 @@
src += src_rgn.bpp;
}
}
+
src_row += src_rgn.rowstride;
}
+
count += src_rgn.w * src_rgn.h;
+
if (!preview)
{
/* Update progress */
progress += src_rgn.w * src_rgn.h;
- gimp_progress_update ((double) progress / (double) max_progress);
+ gimp_progress_update ((gdouble) progress /
+ (gdouble) max_progress);
}
}
@@ -544,6 +552,7 @@
if (preview)
{
dest_row = dest + ((y - y1) * width + (x - x1)) * bpp;
+
for (j = 0; j < y_step; j++)
{
d = dest_row;
@@ -558,27 +567,33 @@
gimp_pixel_rgn_init (&dest_rgn, drawable,
x, y, x_step, y_step,
TRUE, TRUE);
+
for (pr = gimp_pixel_rgns_register (1, &dest_rgn);
pr != NULL;
pr = gimp_pixel_rgns_process (pr))
{
dest_row = dest_rgn.data;
+
for (row = 0; row < dest_rgn.h; row++)
{
- dest = dest_row;
- for (col = 0; col < dest_rgn.w; col++)
- {
- for (b = 0; b < bpp; b++)
- dest[b] = average[b];
-
- dest += dest_rgn.bpp;
- }
- dest_row += dest_rgn.rowstride;
- }
- /* Update progress */
- progress += dest_rgn.w * dest_rgn.h;
- gimp_progress_update ((double) progress / (double) max_progress);
- }
+ dest = dest_row;
+
+ for (col = 0; col < dest_rgn.w; col++)
+ {
+ for (b = 0; b < bpp; b++)
+ dest[b] = average[b];
+
+ dest += dest_rgn.bpp;
+ }
+
+ dest_row += dest_rgn.rowstride;
+ }
+
+ /* Update progress */
+ progress += dest_rgn.w * dest_rgn.h;
+ gimp_progress_update ((gdouble) progress /
+ (gdouble) max_progress);
+ }
}
}
}
@@ -657,7 +672,7 @@
/* Update progress */
progress += area.w * area.h;
gimp_progress_update ((double) progress / (double) max_progress);
- }
+ }
}
g_free(area.data);
@@ -701,6 +716,7 @@
for (i = 0; i < bpp; i++)
average[i] = 0;
+
count = 0;
/* Read */
@@ -709,6 +725,7 @@
for (row = 0; row < h; row++)
{
buf = buf_row;
+
if (has_alpha)
{
for (col = 0; col < w; col++)
@@ -716,8 +733,10 @@
gulong alpha = buf[bpp-1];
average[bpp-1] += alpha;
+
for (i = 0; i < bpp-1; i++)
- average[i] += buf[i] * alpha;
+ average[i] += buf[i] * alpha;
+
buf += bpp;
}
}
@@ -726,14 +745,16 @@
for (col = 0; col < w; col++)
{
for (i = 0; i < bpp; i++)
- average[i] += buf[i];
+ average[i] += buf[i];
+
buf += bpp;
}
}
+
buf_row += rowstride;
}
- count += w*h;
+ count += w * h;
/* Average */
if (count > 0)
@@ -761,6 +782,7 @@
for (row = 0; row < h; row++)
{
buf = buf_row;
+
for (col = 0; col < w; col++)
{
for (i = 0; i < bpp; i++)
@@ -769,6 +791,7 @@
count++;
buf += bpp;
}
+
buf_row += rowstride;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]