d2/align: Move d2::align::diff_stat*::diff_subdomain() to Libale.
[Ale.git] / d2 / align.h
index eaebd45..8c7d7d2 100644 (file)
@@ -1855,105 +1855,4 @@ public:
        }
 };
 
-template<class diff_trans>
-void *d2::align::diff_stat_generic<diff_trans>::diff_subdomain(void *args) {
-
-       subdomain_args *sargs = (subdomain_args *) args;
-
-       struct scale_cluster c = sargs->c;
-       std::vector<run> runs = sargs->runs;
-       int ax_count = sargs->ax_count;
-       int f = sargs->f;
-       int i_min = sargs->i_min;
-       int i_max = sargs->i_max;
-       int j_min = sargs->j_min;
-       int j_max = sargs->j_max;
-       int subdomain = sargs->subdomain;
-
-       assert (reference_image);
-
-       point offset = c.accum->offset();
-
-       for (mc_iterate m(i_min, i_max, j_min, j_max, subdomain); !m.done(); m++) {
-
-               int i = m.get_i();
-               int j = m.get_j();
-
-               /*
-                * Check reference frame definition.
-                */
-
-               if (!((pixel) c.accum->get_pixel(i, j)).finite()
-                || !(((pixel) c.certainty->get_pixel(i, j)).minabs_norm() > 0))
-                       continue;
-
-               /*
-                * Check for exclusion in render coordinates.
-                */
-
-               if (ref_excluded(i, j, offset, c.ax_parameters, ax_count))
-                       continue;
-
-               /*
-                * Transform
-                */
-
-               struct point q, r = point::undefined();
-
-               q = (c.input_scale < 1.0 && interpolant == NULL)
-                 ? runs.back().offset.scaled_inverse_transform(
-                       point(i + offset[0], j + offset[1]))
-                 : runs.back().offset.unscaled_inverse_transform(
-                       point(i + offset[0], j + offset[1]));
-
-               if (runs.size() == 2) {
-                       r = (c.input_scale < 1.0)
-                         ? runs.front().offset.scaled_inverse_transform(
-                               point(i + offset[0], j + offset[1]))
-                         : runs.front().offset.unscaled_inverse_transform(
-                               point(i + offset[0], j + offset[1]));
-               }
-
-               ale_pos ti = q[0];
-               ale_pos tj = q[1];
-
-               /*
-                * Check that the transformed coordinates are within
-                * the boundaries of array c.input and that they
-                * are not subject to exclusion.
-                *
-                * Also, check that the weight value in the accumulated array
-                * is nonzero, unless we know it is nonzero by virtue of the
-                * fact that it falls within the region of the original frame
-                * (e.g. when we're not increasing image extents).
-                */
-
-               if (input_excluded(ti, tj, c.ax_parameters, ax_count))
-                       continue;
-
-               if (input_excluded(r[0], r[1], c.ax_parameters, ax_count))
-                       r = point::undefined();
-
-               /*
-                * Check the boundaries of the input frame
-                */
-
-               if (!(ti >= 0
-                  && ti <= c.input->height() - 1
-                  && tj >= 0
-                  && tj <= c.input->width() - 1))
-                       continue;
-
-               if (!(r[0] >= 0
-                  && r[0] <= c.input->height() - 1
-                  && r[1] >= 0
-                  && r[1] <= c.input->width() - 1))
-                       r = point::undefined();
-
-               sargs->runs.back().sample(f, c, i, j, q, r, runs.front());
-       }
-
-       return NULL;
-}
-
 #endif