[gegl] spherize: shift input coords to the middle of pixels
- From: N/A <ell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] spherize: shift input coords to the middle of pixels
- Date: Sun, 1 Oct 2017 18:34:28 +0000 (UTC)
commit fde0c2fbf07335fc62170a734b6b281cc5544374
Author: Ell <ell_se yahoo com>
Date: Sun Oct 1 14:31:51 2017 -0400
spherize: shift input coords to the middle of pixels
operations/workshop/spherize.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/operations/workshop/spherize.c b/operations/workshop/spherize.c
index 9e71e50..21033eb 100644
--- a/operations/workshop/spherize.c
+++ b/operations/workshop/spherize.c
@@ -224,11 +224,11 @@ process (GeglOperation *operation,
const gfloat *in_pixel = iter->data[1];
gfloat x, y;
- y = dy * (iter->roi->y - cy);
+ y = dy * (iter->roi->y + 0.5 - cy);
for (j = iter->roi->y; j < iter->roi->y + iter->roi->height; j++, y += dy)
{
- x = dx * (iter->roi->x - cx);
+ x = dx * (iter->roi->x + 0.5 - cx);
for (i = iter->roi->x; i < iter->roi->x + iter->roi->width; i++, x += dx)
{
@@ -248,8 +248,8 @@ process (GeglOperation *operation,
else
src_d = f * d / (f_h - sqrt (r2 - d2));
- src_x = i;
- src_y = j;
+ src_x = i + 0.5;
+ src_y = j + 0.5;
if (d)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]