[Git][debian-gis-team/jeolib-miallib][master] 5 commits: New upstream version 1.1.5

Francesco Paolo Lovergine (@frankie) gitlab at salsa.debian.org
Wed Sep 25 16:41:29 BST 2024



Francesco Paolo Lovergine pushed to branch master at Debian GIS Project / jeolib-miallib


Commits:
38be1a31 by Francesco Paolo Lovergine at 2024-09-11T12:42:06+02:00
New upstream version 1.1.5
- - - - -
2429314a by Francesco Paolo Lovergine at 2024-09-25T17:36:58+02:00
New upstream version 1.1.6
- - - - -
a93b83c3 by Francesco Paolo Lovergine at 2024-09-25T17:36:59+02:00
Update upstream source from tag 'upstream/1.1.6'

Update to upstream version '1.1.6'
with Debian dir 5225fc699f0084e82907169b80a5d4fcd369ca59
- - - - -
9a3b4da9 by Francesco Paolo Lovergine at 2024-09-25T17:39:21+02:00
Updated to upstream version 1.1.6.

- - - - -
601504d2 by Francesco Paolo Lovergine at 2024-09-25T17:40:55+02:00
Ready for unstable.

- - - - -


7 changed files:

- CMakeLists.txt
- − cmake/modules/FindFFTW.cmake
- core/c/miallib_opclo.h
- core/c/myhull.c → core/c/myhull.cc
- + core/c/myhull.h
- core/c/phase_correlation.c
- debian/changelog


Changes:

=====================================
CMakeLists.txt
=====================================
@@ -32,11 +32,11 @@ set(MIALLIB_LIB_NAME miallib)
 
 set (MIALLIB_VERSION_MAJOR 1)
 set (MIALLIB_VERSION_MINOR 1)
-set (MIALLIB_VERSION_PATCH 5)
+set (MIALLIB_VERSION_PATCH 6)
 set (MIALLIB_VERSION "${MIALLIB_VERSION_MAJOR}.${MIALLIB_VERSION_MINOR}.${MIALLIB_VERSION_PATCH}")
 set (MIALLIB_SOVERSION "${MIALLIB_VERSION_MAJOR}")
 
-set(PROCESS_IN_PARALLEL FALSE CACHE BOOL "Choose if miallib should be run in parallel")
+set(PROCESS_IN_PARALLEL TRUE CACHE BOOL "Choose if miallib should be run in parallel")
 
 # build a CPack driven installer package
 INCLUDE (InstallRequiredSystemLibraries)
@@ -100,6 +100,7 @@ set(MIALLIB_H
   ${MIALLIB_SRC_DIR}/miallib_stats.h
   ${MIALLIB_SRC_DIR}/miallib_swig.h
   ${MIALLIB_SRC_DIR}/mialtypes.h
+  ${MIALLIB_SRC_DIR}/myhull.h
   ${MIALLIB_SRC_DIR}/op.h
   )
 
@@ -197,7 +198,8 @@ set(SOURCES
   ${MIALLIB_SRC_DIR}/mslabel.h
   ${MIALLIB_SRC_DIR}/msmm.c
   ${MIALLIB_SRC_DIR}/mspa.c
-  ${MIALLIB_SRC_DIR}/myhull.c
+  ${MIALLIB_SRC_DIR}/myhull.cc
+  ${MIALLIB_SRC_DIR}/myhull.h
   ${MIALLIB_SRC_DIR}/natngbint.c
   ${MIALLIB_SRC_DIR}/newlabelcc.c
   ${MIALLIB_SRC_DIR}/oiht.c
@@ -344,8 +346,13 @@ target_link_libraries(${MIALLIB_LIB_NAME} ${CMAKE_DL_LIBS})
 
 ### BEGIN FFTW
 
-find_package(FFTW REQUIRED)
+pkg_search_module(FFTW REQUIRED fftw3 IMPORTED_TARGET)
+include_directories(PkgConfig::FFTW)
+link_libraries(PkgConfig::FFTW)
+
+#find_package(FFTW REQUIRED)
 message(STATUS "Found FFTW_LIBRARIES: ${FFTW_LIBRARIES}")
+message(STATUS "Found FFTW_INCLUDE_DIRS: ${FFTW_INCLUDE_DIRS}")
 target_link_libraries(${MIALLIB_LIB_NAME} ${FFTW_LIBRARIES})
 
 if(PROCESS_IN_PARALLEL)


=====================================
cmake/modules/FindFFTW.cmake deleted
=====================================
@@ -1,178 +0,0 @@
-# - Find the FFTW library
-#
-# Usage:
-#   find_package(FFTW [REQUIRED] [QUIET] )
-#
-# It sets the following variables:
-#   FFTW_FOUND               ... true if fftw is found on the system
-#   FFTW_LIBRARIES           ... full path to fftw library
-#   FFTW_INCLUDES            ... fftw include directory
-#   FFTW_OMP_PRESENT         ... OpenMP specific libraries are present and included in FFTW_LIBRARIES
-#
-# The following variables will be checked by the function
-#   FFTW_USE_STATIC_LIBS    ... if true, only static libraries are found
-#   FFTW_ROOT               ... if set, the libraries are exclusively searched
-#                               under this path
-#   FFTW_LIBRARY            ... fftw library to use
-#   FFTW_INCLUDE_DIR        ... fftw include directory
-#   ENABLE_OPENMP_FFTW      ... if true, OpenMP specific libraries will be searched and used if possible
-#   ENABLE_OPENMP           ... used as a default value of ENABLE_OPENMP_FFTW, if not defined
-#
-
-#If environment variable FFTWDIR is specified, it has same effect as FFTW_ROOT
-if( NOT FFTW_ROOT AND ENV{FFTWDIR} )
-  set( FFTW_ROOT $ENV{FFTWDIR} )
-endif()
-
-# Check if we can use PkgConfig
-find_package(PkgConfig)
-
-#Determine from PKG
-if( PKG_CONFIG_FOUND AND NOT FFTW_ROOT )
-  pkg_check_modules( PKG_FFTW QUIET "fftw3" )
-endif()
-
-#Check whether to search static or dynamic libs
-set( CMAKE_FIND_LIBRARY_SUFFIXES_SAV ${CMAKE_FIND_LIBRARY_SUFFIXES} )
-
-if( ${FFTW_USE_STATIC_LIBS} )
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX} )
-else()
-  set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX} )
-endif()
-
-if( FFTW_ROOT )
-
-  #find libs
-  find_library(
-    FFTW_LIB
-    NAMES "fftw3"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTW_LIB_OMP
-    NAMES "fftw3_omp"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-    NO_DEFAULT_PATH
-  )
-
-  find_library(
-    FFTWF_LIB_OMP
-    NAMES "fftw3f_omp"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "lib" "lib64" "lib/x86_64-linux-gnu"
-    NO_DEFAULT_PATH
-  )
-
-
-  #find includes
-  find_path(
-    FFTW_INCLUDES
-    NAMES "fftw3.h"
-    PATHS ${FFTW_ROOT}
-    PATH_SUFFIXES "include"
-    NO_DEFAULT_PATH
-  )
-
-else()
-
-  find_library(
-    FFTW_LIB
-    NAMES "fftw3"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWF_LIB
-    NAMES "fftw3f"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTW_LIB_OMP
-    NAMES "fftw3_omp"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWF_LIB_OMP
-    NAMES "fftw3f_omp"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_library(
-    FFTWL_LIB
-    NAMES "fftw3l"
-    PATHS ${PKG_FFTW_LIBRARY_DIRS} ${LIB_INSTALL_DIR}
-  )
-
-  find_path(
-    FFTW_INCLUDES
-    NAMES "fftw3.h"
-    PATHS ${PKG_FFTW_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR}
-  )
-
-endif( FFTW_ROOT )
-
-set(FFTW_LIBRARIES ${FFTW_LIB} ${FFTWF_LIB})
-
-if(FFTWL_LIB)
-  set(FFTW_LIBRARIES ${FFTW_LIBRARIES} ${FFTWL_LIB})
-endif()
-
-# we need ENABLE_OPENMP_FFTW
-set (ENABLE_OPENMP_FFTW ON)
-message(STATUS "ENABLE_OPENMP_FFTW is ${ENABLE_OPENMP_FFTW}")
-# option (ENABLE_OPENMP_FFTW "Enable usage of OpenMP in FFTW, if possible" ${ENABLE_OPENMP})
-# set (ENABLE_OPENMP_FFTW "Enable usage of OpenMP in FFTW, if possible" ${ENABLE_OPENMP})
-
-if (FFTW_LIB_OMP AND ENABLE_OPENMP_FFTW)
-  set(FFTW_LIBRARIES ${FFTW_LIB_OMP} ${FFTW_LIBRARIES})
-endif()
-
-if (FFTWF_LIB_OMP AND ENABLE_OPENMP_FFTW)
-  set(FFTW_LIBRARIES ${FFTWF_LIB_OMP} ${FFTW_LIBRARIES})
-endif()
-
-if ( (FFTW_LIB_OMP OR FFTWF_LIB_OMP) AND ENABLE_OPENMP_FFTW )
-  set(FFTW_OMP_PRESENT YES)
-  message(STATUS "Usage of OpenMP is enabled in FFTW")
-  if ( NOT FFTW_LIB_OMP OR NOT FFTWF_LIB_OMP )
-      message (FATAL_ERROR "It looks like only single or double precision version of OpenMP FFTW extensions is present")
-  endif()
-else()
-  set(FFTW_OMP_PRESENT NO)
-  if (ENABLE_OPENMP_FFTW)
-    message(STATUS "OpenMP-specific FFTW libraries are not found")
-  else()
-    message(STATUS "Usage of OpenMP is disabled in FFTW")
-  endif()
-endif()
-
-set( CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAV} )
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(FFTW DEFAULT_MSG
-                                  FFTW_INCLUDES FFTW_LIBRARIES)
-
-mark_as_advanced(FFTW_INCLUDES FFTW_LIBRARIES FFTW_LIB FFTWF_LIB FFTWL_LIB FFTW_LIB_OMP FFTWF_LIB_OMP)


=====================================
core/c/miallib_opclo.h
=====================================
@@ -31,7 +31,7 @@ extern IMAGE *GreyAreaOpeningROI(IMAGE *imliiar, int lambdaVal, int graph);
 extern IMAGE *GreyAreaClosingROI(IMAGE *imliiar, int lambdaVal, int graph);
 
 /* myhull.c  */
-extern IMAGE *chull(IMAGE *ilbl, int graph);
+// extern IMAGE *chull(IMAGE *ilbl, int graph);
 
 /* hull.c */
 extern IMAGE *hpclose(IMAGE *im, int dx, int dy);


=====================================
core/c/myhull.c → core/c/myhull.cc
=====================================
@@ -1,6 +1,8 @@
 /***********************************************************************
 Author(s): Pierre Soille
-Copyright (C) 2010-2020 European Union (Joint Research Centre)
+           Pieter Kempeneers (repaced ut_vector with std::vector and
+                             re-implemented chainHull_2D for license)
+Copyright (C) 2010-2024 European Union (Joint Research Centre)
 
 This file is part of miallib.
 
@@ -23,19 +25,57 @@ along with miallib.  If not, see <https://www.gnu.org/licenses/>.
 #include <stdio.h>
 #include <stdlib.h>
 #include <math.h>
+#include <vector>
+#include <string>
+#include <algorithm>
+#include <iostream>
+
+#include "myhull.h"
+extern "C" {
 #include "miallib.h"
 #include "fifo.h"
+}
 #ifdef OPENMP
 #include <omp.h>
 #endif
 
-/* for point with integer coordinates */
-typedef struct {
-    INT32 a;
-    INT32 b;
-} intpair_t;
+// Function to find the convex hull using Andrew's monotone chain algorithm
+std::vector<intpair_t> chainHull_2D(std::vector<intpair_t>& points){
+    std::sort(points.begin(), points.end(), [](const intpair_t& a, const intpair_t& b) {
+        return a.a < b.a || (a.a == b.a && a.b < b.b);
+    });
+
+    auto orientation = [](intpair_t p, intpair_t q, intpair_t r){
+        return (q.b - p.b) * (r.a - q.a) - (q.a - p.a) * (r.b - q.b);
+    };
+
+    std::vector<intpair_t> hull;
+    
+    // Build lower hull
+    for (const intpair_t& p : points){
+        while (hull.size() >= 2 && orientation(hull[hull.size() - 2], hull[hull.size() - 1], p) <= 0){
+            hull.pop_back();
+        }
+        hull.push_back(p);
+    }
+
+    // Build upper hull
+    for (int i = points.size() - 2, t = hull.size() + 1; i >= 0; i--){
+        const intpair_t& p = points[i];
+        while (hull.size() >= t && orientation(hull[hull.size() - 2], hull[hull.size() - 1], p) <= 0){
+            hull.pop_back();
+        }
+        hull.push_back(p);
+    }
+
+    // Remove duplicates from hull
+    hull.pop_back();
+    
+    return hull;
+}
 
-#include <utarray.h>
+
+// #include <utarray.h>
 
 int intsort(const void *a,const void*b) {
     int _a = *(int*)a;
@@ -43,14 +83,14 @@ int intsort(const void *a,const void*b) {
     return _a - _b;
 }
 
-int intpairsort(const void *a,const void*b) {
-    intpair_t _a = *(intpair_t*)a;
-    intpair_t _b = *(intpair_t*)b;
-    return _a.a < _b.a || (_a.a == _b.a && _a.b < _b.b);
-}
+// int intpairsort(const void *a,const void*b) {
+//     intpair_t _a = *(intpair_t*)a;
+//     intpair_t _b = *(intpair_t*)b;
+//     return _a.a < _b.a || (_a.a == _b.a && _a.b < _b.b);
+// }
 
-extern double polygonArea(intpair_t *P, int points);
-extern int chainHull_2D( intpair_t * P, int n, intpair_t * H );
+// extern double polygonArea(intpair_t *P, int points);
+// extern int chainHull_2D( intpair_t * P, int n, intpair_t * H );
 
 
 /** \addtogroup group_opclo
@@ -70,9 +110,8 @@ IMAGE *u32_chull(IMAGE *ilbl, int graph)
      assumes border is set to zero to avoid border overflow.
      Pierre Soille
      First 20100930 (for building footprint characterisation)
-
-     Use utarray for convex hull computations: beware that it exits in case
-     not enough memory is availbale for the dynamic memory allocation!
+     Pieter Kempeneers 13/09/2024: replace utarray with c++ std::vector
+     and reimplement hull for license issue
 
      based on Moore's contour tracing algorithm with Jacob's condition, see
      http://www.thebigblob.com/moore-neighbor-contour-tracing-algorithm-in-c/
@@ -171,12 +210,16 @@ IMAGE *u32_chull(IMAGE *ilbl, int graph)
     int n = 0; // number of points with change of direction
     int nh = 0; // number of points in convex hull
 
-    UT_array *pairs;
-    UT_icd intpair_icd = {sizeof(intpair_t), NULL, NULL, NULL};
-    intpair_t ip, *ph, *phori;
+    // UT_array *pairs;
+    // UT_icd intpair_icd = {sizeof(intpair_t), NULL, NULL, NULL};
+    // intpair_t ip, *ph, *phori;
+    intpair_t ip;
+    std::vector<intpair_t> ph;
     int j;
 
-    utarray_new(pairs,&intpair_icd);
+    // utarray_new(pairs,&intpair_icd);
+    std::vector<intpair_t> pairs;
+    // utarray_new(pairs,&intpair_icd);
 
     if (startPos!=0){
       lbl=plbl[startPos];
@@ -186,86 +229,95 @@ IMAGE *u32_chull(IMAGE *ilbl, int graph)
 
       // Trace around the neighborhood
       while(1){
-	checkPosition = pos + neighborhood[checkLocationNr-1][0];
-	newCheckLocationNr = neighborhood[checkLocationNr-1][1];
-
-	if( plbl[checkPosition] == lbl) { // Next border point found
-	  if(checkPosition == startPos){
-
-	    pout[pos]=checkLocationNr; // direction of next border point
-
-	    // set to 9 if point of change of direction
-	    if (checkLocationNr!=prevCheckLocationNr){
-	      pout[pos]=9;
-	      pout[checkPosition]=9;
-	      prevCheckLocationNr=checkLocationNr;
-	      ip.a=pos%nx;  // x coor
-	      ip.b=pos/nx;  // y coor
-	      utarray_push_back(pairs, &ip);
-	      n++;
-	    }
-
-	    counter ++;
-	    // Stopping criterion (jacob)
-	    if(newCheckLocationNr == 1 || counter >= 1) { // Close loop
-	      break;
-	    }
-	  }
-	  pout[pos]=checkLocationNr; // direction of next border point
-
-	  // set to 9 if point of change of direction
-	  if (checkLocationNr!=prevCheckLocationNr){
-	      pout[pos]=9;
-	      pout[checkPosition]=9;
-	      prevCheckLocationNr=checkLocationNr;
-	      ip.a=pos%nx;  // x coor
-	      ip.b=pos/nx;  // y coor
-	      utarray_push_back(pairs, &ip);
-	      n++;
-	  }
-
-	  checkLocationNr = newCheckLocationNr;// Update which neighborhood position we should check next
-	  pos = checkPosition;
-	  counter2 = 0;    // Reset the counter that keeps track of how many neighbors we have visited
-	}
-	else{
-	  // Rotate clockwise in the neighborhood
-	  checkLocationNr = 1 + (checkLocationNr % graph);
-	  if(counter2 > graph){
-	    // If counter2 is above 8 we have traced around the neighborhood and
-	    // therefore the border is a single black pixel and we can exit
-	    counter2 = 0;
-	      ip.a=pos%nx;  // x coor
-	      ip.b=pos/nx;  // y coor
-	      utarray_push_back(pairs, &ip);
-	      n++;
-	    break;
-	  }
-	  else{
-	    counter2 ++;
-	  }
-	}
+        checkPosition = pos + neighborhood[checkLocationNr-1][0];
+        newCheckLocationNr = neighborhood[checkLocationNr-1][1];
+
+        if( plbl[checkPosition] == lbl) { // Next border point found
+          if(checkPosition == startPos){
+
+            pout[pos]=checkLocationNr; // direction of next border point
+
+            // set to 9 if point of change of direction
+            if (checkLocationNr!=prevCheckLocationNr){
+              pout[pos]=9;
+              pout[checkPosition]=9;
+              prevCheckLocationNr=checkLocationNr;
+              ip.a=pos%nx;  // x coor
+              ip.b=pos/nx;  // y coor
+              pairs.push_back(ip);
+              // utarray_push_back(pairs, &ip);
+              n++;
+            }
+
+            counter ++;
+            // Stopping criterion (jacob)
+            if(newCheckLocationNr == 1 || counter >= 1) { // Close loop
+              break;
+            }
+          }
+          pout[pos]=checkLocationNr; // direction of next border point
+
+          // set to 9 if point of change of direction
+          if (checkLocationNr!=prevCheckLocationNr){
+              pout[pos]=9;
+              pout[checkPosition]=9;
+              prevCheckLocationNr=checkLocationNr;
+              ip.a=pos%nx;  // x coor
+              ip.b=pos/nx;  // y coor
+              pairs.push_back(ip);
+              // utarray_push_back(pairs, &ip);
+              n++;
+          }
+
+          checkLocationNr = newCheckLocationNr;// Update which neighborhood position we should check next
+          pos = checkPosition;
+          counter2 = 0;    // Reset the counter that keeps track of how many neighbors we have visited
+        }
+        else{
+          // Rotate clockwise in the neighborhood
+          checkLocationNr = 1 + (checkLocationNr % graph);
+          if(counter2 > graph){
+            // If counter2 is above 8 we have traced around the neighborhood and
+            // therefore the border is a single black pixel and we can exit
+            counter2 = 0;
+              ip.a=pos%nx;  // x coor
+              ip.b=pos/nx;  // y coor
+              pairs.push_back(ip);
+              // utarray_push_back(pairs, &ip);
+              n++;
+            break;
+          }
+          else{
+            counter2 ++;
+          }
+        }
       }
       //printf("n=%d\n", n);
 
-      ph=phori=(intpair_t *)calloc((size_t) n+1, sizeof(intpair_t));
+      // ph=phori=(intpair_t *)calloc((size_t) n+1, sizeof(intpair_t));
+      ph.resize(n+1);
 
-      if (ph==NULL){
-	printf("cannot allocate %ld bytes for point array in convex hull computation of lbl=%ud\n", \
-	       (n+1)*sizeof(intpair_t), lbl);
-        utarray_free(pairs);
-	continue;
-      }
-      utarray_sort(pairs, &intpairsort);
-      nh=chainHull_2D( (intpair_t *)utarray_eltptr(pairs, 0), n,  ph );
+      // if (ph==NULL){
+      //   printf("cannot allocate %ld bytes for point array in convex hull computation of lbl=%ud\n", \
+      //   (n+1)*sizeof(intpair_t), lbl);
+      //   utarray_free(pairs);
+      //   continue;
+      // }
+      // utarray_sort(pairs, &intpairsort);
+      // nh=chainHull_2D( (intpair_t *)utarray_eltptr(pairs, 0), n,  ph );
+
+      ph = chainHull_2D(pairs);
       //printf("nh=%d\n", nh);
 
-      for(j=0; j<nh; j++)
-	pout[ph[j].a + ph[j].b * nx]=10;
+      for (auto it = ph.begin(); it!=ph.end(); ++it)
+        pout[it->a + it->b *nx] = 10;
+
+      // for(j=0; j<nh; j++)
+      //   pout[ph[j].a + ph[j].b * nx]=10;
 
-      free(phori);
+      // free(phori);
 
-      utarray_free(pairs);
+      // utarray_free(pairs);
     } // startPos != 0
   } // for each label
   free_image(lut);
@@ -288,8 +340,9 @@ IMAGE *chull(IMAGE *ilbl, int graph)
     break;
 
   default:
-    (void)sprintf(buf, "ERROR in chull(IMAGE *ilbl, int graph): \
-                invalid ImDataType\n"); errputstr(buf);
+    std::cerr << "ERROR in chull chull(IMAGE *ilbl, int graph): invalid ImDataType" << std::endl;
+    // (void)sprintf(buf, "ERROR in chull(IMAGE *ilbl, int graph): \
+    //             invalid ImDataType\n"); errputstr(buf);
     return(NULL);
   }
 }


=====================================
core/c/myhull.h
=====================================
@@ -0,0 +1,38 @@
+/***********************************************************************
+Author(s): Pieter Kempeneers
+Copyright (C) 2000-2024 European Union (Joint Research Centre)
+
+This file is part of miallib.
+
+miallib is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+miallib is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with miallib.  If not, see <https://www.gnu.org/licenses/>.
+***********************************************************************/
+
+/*
+** Header file for myhull.cc
+*/
+
+#ifndef _MYHULL_H
+#define _MYHULL_H
+
+#include <vector>
+
+/* for point with integer coordinates */
+typedef struct {
+    int a;
+    int b;
+} intpair_t;
+
+std::vector<intpair_t> chainHull_2D(std::vector<intpair_t>& points);
+
+#endif /* _MYHULL_H */
\ No newline at end of file


=====================================
core/c/phase_correlation.c
=====================================
@@ -31,9 +31,9 @@ along with miallib.  If not, see <https://www.gnu.org/licenses/>.
 #include <string.h>
 #include <math.h>
 #include "config_miallib.h"
-#ifdef OPENMP
-#include <omp.h>
-#endif
+//#ifdef OPENMP
+//#include <omp.h>
+//#endif
 #include <fftw3.h>
 #include "miallib.h"
 
@@ -81,9 +81,9 @@ IMAGE *uc_phase_correlation(IMAGE *im, IMAGE *im_template)
   pout=(double *)GetImPtr(imout);
 
   // data alloc
-#ifdef OPENMP
-  int fftw_init_threads(void);
-#endif
+//#ifdef OPENMP
+//  int fftw_init_threads(void);
+//#endif
   image_data        = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * size );
   image_fft_result  = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * size );
   templ_data        = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * size );
@@ -91,17 +91,17 @@ IMAGE *uc_phase_correlation(IMAGE *im, IMAGE *im_template)
   mul_result        = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * size );
   ifft_result       = ( fftw_complex* ) fftw_malloc( sizeof( fftw_complex ) * size );
 
-#ifdef OPENMP
-  fftw_plan_with_nthreads(omp_get_max_threads());
-#endif
+//#ifdef OPENMP
+//  fftw_plan_with_nthreads(omp_get_max_threads());
+//#endif
   image_plan_forward_2d  = fftw_plan_dft_2d( size_w, size_h, image_data, image_fft_result, FFTW_FORWARD,  FFTW_ESTIMATE );
-#ifdef OPENMP
-  fftw_plan_with_nthreads(omp_get_max_threads());
-#endif
+//#ifdef OPENMP
+//  fftw_plan_with_nthreads(omp_get_max_threads());
+//#endif
   templ_plan_forward_2d  = fftw_plan_dft_2d( size_w, size_h, templ_data, templ_fft_result, FFTW_FORWARD,  FFTW_ESTIMATE );
-#ifdef OPENMP
-  fftw_plan_with_nthreads(omp_get_max_threads());
-#endif
+//#ifdef OPENMP
+//  fftw_plan_with_nthreads(omp_get_max_threads());
+//#endif
   plan_backward_2d       = fftw_plan_dft_2d( size_w, size_h, mul_result, ifft_result,      FFTW_BACKWARD, FFTW_ESTIMATE );
 
   /* CAUTION (from FFTW documentation):
@@ -162,9 +162,9 @@ IMAGE *uc_phase_correlation(IMAGE *im, IMAGE *im_template)
   fftw_free(templ_fft_result);
   fftw_free(ifft_result );
 
-#ifdef OPENMP
-  void fftw_cleanup_threads(void);
-#endif
+//#ifdef OPENMP
+//  void fftw_cleanup_threads(void);
+//#endif
 
   return(imout);
 }


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+jeolib-miallib (1.1.6-1) unstable; urgency=medium
+
+  * New upstream release with more changes to original myhull.c module.
+
+ -- Francesco Paolo Lovergine <frankie at debian.org>  Wed, 25 Sep 2024 17:40:48 +0200
+
 jeolib-miallib (1.1.5-2) unstable; urgency=medium
 
   * Updated d/copyright to reflect removing of non-free chull.c source file.



View it on GitLab: https://salsa.debian.org/debian-gis-team/jeolib-miallib/-/compare/36c0d1e729d9dc387dad74ce48c7692de9350389...601504d23dbefe497c96ad29889b5806e34b06dd

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/jeolib-miallib/-/compare/36c0d1e729d9dc387dad74ce48c7692de9350389...601504d23dbefe497c96ad29889b5806e34b06dd
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20240925/77d8ca6d/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list