Commit 5b2c7dd4 authored by Ell's avatar Ell

transform: round numerical errors in transformation matrix

In the transform ops, round numerical errors in the generated
matrix to the nearest integer.  This is especially important when
using the NEAREST sampler, which is sensitive to boundary

In particular, a perfect 90-deg rotation matrix cannot be generated
naively using the trigonometric functions (since there is no double
x such that cos(x) = 1 exactly), which can cause a single row or
column to be missing from the output in some cases.
parent ddbeefcd
Pipeline #195224 passed with stages
in 27 minutes and 29 seconds
......@@ -306,7 +306,11 @@ gegl_transform_create_matrix (OpTransform *transform,
gegl_matrix3_identity (matrix);
if (OP_TRANSFORM_GET_CLASS (transform))
OP_TRANSFORM_GET_CLASS (transform)->create_matrix (transform, matrix);
OP_TRANSFORM_GET_CLASS (transform)->create_matrix (transform, matrix);
gegl_matrix3_round_error (matrix);
static void
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment