[gimp] libgimpmath: remove gimp_matrix3_will_explode()



commit 23f6369658fc9e53959d5b87215e586b74b8e566
Author: Ell <ell_se yahoo com>
Date:   Sun Jan 28 14:58:51 2018 -0500

    libgimpmath: remove gimp_matrix3_will_explode()
    
    It's no longer needed since last commit, and since it's new in
    2.10, we might as well remove it.
    
    This reverts the rest of 768d06614f203bf555bbda1f6186d4730ae2f8b5.

 libgimpmath/gimpmath.def |    1 -
 libgimpmath/gimpmatrix.c |   36 ------------------------------------
 libgimpmath/gimpmatrix.h |    6 ------
 3 files changed, 0 insertions(+), 43 deletions(-)
---
diff --git a/libgimpmath/gimpmath.def b/libgimpmath/gimpmath.def
index 039a03d..1a48940 100644
--- a/libgimpmath/gimpmath.def
+++ b/libgimpmath/gimpmath.def
@@ -16,7 +16,6 @@ EXPORTS
        gimp_matrix3_scale
        gimp_matrix3_transform_point
        gimp_matrix3_translate
-       gimp_matrix3_will_explode
        gimp_matrix3_xshear
        gimp_matrix3_yshear
        gimp_matrix4_to_deg
diff --git a/libgimpmath/gimpmatrix.c b/libgimpmath/gimpmatrix.c
index bef9927..48c2210 100644
--- a/libgimpmath/gimpmatrix.c
+++ b/libgimpmath/gimpmatrix.c
@@ -866,42 +866,6 @@ gimp_matrix3_is_simple (const GimpMatrix3 *matrix)
 }
 
 /**
- * gimp_matrix3_will_explode:
- * @matrix: The matrix that is to be tested.
- * @u1:     The rectangle's left coordinate.
- * @v1:     The rectangle's top coordinate.
- * @u2:     The rectangle's right coordinate.
- * @v2:     The rectangle's bottom coordinate.
- *
- * Checks if the given transformation maps a point of the rectangle to
- * infinity, or something equally stupid.
- *
- * Returns: %TRUE if the transformation will fail, %FALSE otherwise
- *
- * Since: 2.10
- */
-gboolean
-gimp_matrix3_will_explode (const GimpMatrix3 *matrix,
-                           gdouble            u1,
-                           gdouble            v1,
-                           gdouble            u2,
-                           gdouble            v2)
-{
-  const gdouble a  = matrix->coeff[2][0];
-  const gdouble b  = matrix->coeff[2][1];
-  const gdouble c  = matrix->coeff[2][2];
-  const gdouble d1 = a * u1 + b * v1 + c;
-  const gdouble d2 = a * u1 + b * v2 + c;
-  const gdouble d3 = a * u2 + b * v1 + c;
-  const gdouble d4 = a * u2 + b * v2 + c;
-
-  /* We are safe if all 4 corners of the region are on the same side
-   * of the a.u+b.v+c=0 line, ie. if d1..d4 have the same sign.
-   */
-  return ! (d1 * d2 > 0 && d1 * d3 > 0 && d1 * d4 > 0);
-}
-
-/**
  * gimp_matrix4_to_deg:
  * @matrix:
  * @a:
diff --git a/libgimpmath/gimpmatrix.h b/libgimpmath/gimpmatrix.h
index 23a7587..e435d88 100644
--- a/libgimpmath/gimpmatrix.h
+++ b/libgimpmath/gimpmatrix.h
@@ -111,12 +111,6 @@ gboolean      gimp_matrix3_is_diagonal     (const GimpMatrix3 *matrix);
 gboolean      gimp_matrix3_is_affine       (const GimpMatrix3 *matrix);
 gboolean      gimp_matrix3_is_simple       (const GimpMatrix3 *matrix);
 
-gboolean      gimp_matrix3_will_explode    (const GimpMatrix3 *matrix,
-                                            gdouble            u1,
-                                            gdouble            v1,
-                                            gdouble            u2,
-                                            gdouble            v2);
-
 void          gimp_matrix3_transform_point (const GimpMatrix3 *matrix,
                                             gdouble            x,
                                             gdouble            y,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]