[gegl] transform-core.c: comment explaining how to restore the 'boundary between pixels is owned by right/b
- From: Nicolas Robidoux <nrobidoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] transform-core.c: comment explaining how to restore the 'boundary between pixels is owned by right/b
- Date: Thu, 6 Dec 2012 17:02:09 +0000 (UTC)
commit 8acd9bd4086f3a51bca29fbd3dac3ffb5d16d0a0
Author: Nicolas Robidoux <nrobidoux git gnome org>
Date: Thu Dec 6 12:02:05 2012 -0500
transform-core.c: comment explaining how to restore the 'boundary between pixels is owned by right/bottom' policy in bounding box computation
operations/transform/transform-core.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/operations/transform/transform-core.c b/operations/transform/transform-core.c
index 15ebd66..8a8a2be 100644
--- a/operations/transform/transform-core.c
+++ b/operations/transform/transform-core.c
@@ -387,6 +387,11 @@ gegl_transform_bounding_box (const gdouble *points,
/*
* Warning: width may be 0 when min_x=max_x=integer. Same with
* height.
+ *
+ * If you decide to enforce the "boundary between two pixels is
+ * owned by the right/bottom one" policy, replace ceil by floor +
+ * (gint) 1. This often enlarges result by one pixel at the right
+ * and bottom.
*/
output->width = (gint) ceil ((double) max_x) - output->x;
output->height = (gint) ceil ((double) max_y) - output->y;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]