From 137607746cd6dbbd09ac077354d65595bf82e1fa40613ee33a422ce220a8bd3d Mon Sep 17 00:00:00 2001 From: Kurt Garloff Date: Sat, 13 Sep 2014 06:03:29 +0000 Subject: [PATCH] Accepting request 248864 from home:garloff:branches:graphics Upgrade to 1.6.0.0 OBS-URL: https://build.opensuse.org/request/show/248864 OBS-URL: https://build.opensuse.org/package/show/graphics/gmic?expand=0&rev=3 --- gmic-cflags.diff | 212 ++-- gmic-docdir.diff | 45 +- gmic-magick.diff | 20 - gmic-make-zart.diff | 41 +- gmic-opencv-old.diff | 18 - gmic-opencv.diff | 35 +- gmic-openmp-gcc43.diff | 2247 ++++++++++++++++++++++++++++++++++- gmic-openmp.diff | 49 +- gmic-opt-parallel-make.diff | 15 - gmic-overflow.diff | 10 +- gmic-unstrip.diff | 57 +- gmic-x11opts.diff | 80 +- gmic-zart-qmake.diff | 40 +- gmic.changes | 79 ++ gmic.spec | 157 ++- gmic_1.5.8.4.tar.bz2 | 3 - gmic_1.6.0.0.tar.bz2 | 3 + gmic_reference.pdf | 4 +- 18 files changed, 2637 insertions(+), 478 deletions(-) delete mode 100644 gmic-magick.diff delete mode 100644 gmic-opencv-old.diff delete mode 100644 gmic-opt-parallel-make.diff delete mode 100644 gmic_1.5.8.4.tar.bz2 create mode 100644 gmic_1.6.0.0.tar.bz2 diff --git a/gmic-cflags.diff b/gmic-cflags.diff index dd51a9f..28369d9 100644 --- a/gmic-cflags.diff +++ b/gmic-cflags.diff @@ -1,134 +1,80 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -75,10 +75,10 @@ endif - # Flags to enable 'beta' version. - IS_BETA_CFLAGS = - - # Flags that are mandatory to compile 'gmic'. --MANDATORY_CFLAGS += -Dgmic_build -I$(USR)/include --MANDATORY_LDFLAGS += -L$(USR)/lib -+MANDATORY_CFLAGS += $(CFLAGS) -Dgmic_build -I$(USR)/include -+MANDATORY_LDFLAGS += -L$(USR)/$(LIB) - ifeq ($(CC),g++) - MANDATORY_CFLAGS += -Wall -W - MANDATORY_LDFLAGS += -lm - endif -@@ -94,9 +94,9 @@ endif - DEBUG_CFLAGS = -Dcimg_verbosity=3 -g - - # Flags to enable optimizations. - ifeq ($(CC),g++) --OPT_CFLAGS = -O3 -mtune=generic # -fno-tree-pre # -ffast-math -+OPT_CFLAGS = -O3 # -mtune=generic # -fno-tree-pre # -ffast-math - endif - ifeq ($(CC),clang++) - OPT_CFLAGS = -O1 - endif -@@ -121,15 +121,15 @@ endif - # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). - # This requires the presence of the X11 include and library files. - # (package 'libx11-dev' on Debian). - X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr --X11_LDFLAGS = -L/usr/X11R6/lib -lX11 -lpthread #-lXrandr -+X11_LDFLAGS = -L/usr/X11R6/$(LIB) -lX11 -lpthread #-lXrandr - - # Flags to enable fast display, using XShm. - # This requires the presence of the X11 extension include and library files. - # (package 'libx11-dev' on Debian). - XSHM_CFLAGS = -Dcimg_use_xshm --XSHM_LDFLAGS = -L$(USR)/X11R6/lib -lXext -+XSHM_LDFLAGS = -L$(USR)/X11R6/$(LIB) -lXext - - # Flags to enable image display, using GDI32. - # This requires the presence of the GDI32 include and library files. - GDI32_CFLAGS = -Dcimg_display=2 -Dcimg_appname=\\\"gmic\\\" -@@ -232,9 +232,9 @@ MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS - MINIMAL_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) \ - ${TIFF_LDFLAGS} ${PNG_LDFLAGS} $(ZLIB_LDFLAGS) $(FFTW_LDFLAGS) # $(OPENCV_LDFLAGS) - - # Unix : Static build. --STATIC_PATH = /usr/lib/ -+STATIC_PATH = /usr/$(LIB)/ - STATIC_EXTRA = - STATIC_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) $(FFTW_CFLAGS) -Dcimg_display=0 - STATIC_UNIX_LDFLAGS = $(PARALLEL_LDFLAGS) \ - $(STATIC_PATH)/libpng.a \ -@@ -279,9 +279,9 @@ STD_LIB_CFLAGS = $(MANDATORY_CFLAGS) $(C - STD_LIB_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(FFTW_LDFLAGS) - - # GMICol : Standard build. - GMICOL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(ZLIB_CFLAGS) $(FFTW_CFLAGS) -Dcimg_display=0 --GMICOL_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(PNG_LDFLAGS) $(JPEG_LDFLAGS) $(ZLIB_LDFLAGS) /usr/lib/x86_64-linux-gnu/libfftw3.a /usr/lib/x86_64-linux-gnu/libfftw3_threads.a -+GMICOL_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(PNG_LDFLAGS) $(JPEG_LDFLAGS) $(ZLIB_LDFLAGS) /usr/$(LIB)/libfftw3.a /usr/$(LIB)/libfftw3_threads.a - - #-------------------------- - # Define Makefile entries. - #-------------------------- -@@ -307,9 +307,9 @@ else - endif - endif - - gimp: -- $(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_GIMP_LDFLAGS) $(OPT_LDFLAGS)" "STRIP_EXE=1" gmic_gimp -+ $(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_GIMP_LDFLAGS) $(OPT_LDFLAGS)" gmic_gimp - - lib: - $(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_LIB_LDFLAGS) $(OPT_LDFLAGS)" gmic_lib - -@@ -330,15 +330,15 @@ static: - minimal: - $(MAKE) "CFLAGS+=$(MINIMAL_UNIX_CFLAGS)" "LDFLAGS+=$(MINIMAL_UNIX_LDFLAGS)" gmic_cli_standard - - linux: -- $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS)" "STRIP_EXE=1" gmic_cli_standard -+ $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS)" gmic_cli_standard - - linux_alltypes: -- $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS)" "STRIP_EXE=1" gmic_cli_alltypes -+ $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS)" gmic_cli_alltypes - - custom: -- $(MAKE) "CFLAGS=$(CUST_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(CUST_UNIX_LDFLAGS)" "STRIP_EXE=1" gmic_cli_alltypes -+ $(MAKE) "CFLAGS=$(CUST_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(CUST_UNIX_LDFLAGS)" gmic_cli_alltypes - - solaris: - $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_UNIX_LDFLAGS) -R$(USR)/X11R6/lib -lrt -lnsl -lsocket" "STRIP_EXE=1" gmic_cli_standard - -@@ -415,13 +415,13 @@ install: - ifneq ($(OS),Darwin) - mkdir -p $(DESTDIR)$(USR)/share - # mkdir -p $(DESTDIR)$(USR)/share/zart - # cp -f ../zart/zart $(DESTDIR)$(USR)/bin/zart -- mkdir -p $(DESTDIR)$(USR)/lib -- cp -f libgmic.so $(DESTDIR)$(USR)/lib/libgmic.so.1.5.8 -- ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/lib/libgmic.so.1 --# ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/lib/libgmic.so.1 -- ln -s libgmic.so.1 $(DESTDIR)$(USR)/lib/libgmic.so -+ mkdir -p $(DESTDIR)$(USR)/$(LIB) -+ cp -f libgmic.so $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5.8 -+ ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 -+# ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 -+ ln -s libgmic.so.1 $(DESTDIR)$(USR)/$(LIB)/libgmic.so - endif - mkdir -p $(DESTDIR)$(USR)/share/man/ - mkdir -p $(DESTDIR)$(USR)/share/man/man1/ - mkdir -p $(DESTDIR)$(USR)/share/man/fr/man1/ -@@ -432,12 +432,12 @@ endif - - uninstall: - rm -f $(DESTDIR)$(USR)/bin/gmic - rm -f $(DESTDIR)$(USR)/include/gmic.h -- rm -f $(DESTDIR)$(USR)/lib/libgmic.so.1.5.8 --# rm -f $(DESTDIR)$(USR)/lib/libgmic.so.1.5 -- rm -f $(DESTDIR)$(USR)/lib/libgmic.so.1 -- rm -f $(DESTDIR)$(USR)/lib/libgmic.so -+ rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5.8 -+# rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5 -+ rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 -+ rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so - rm -rf $(DESTDIR)$(USR)/share/doc/gmic/ - rm -f $(DESTDIR)$(USR)/share/man/man1/gmic.1.gz - rm -f $(DESTDIR)$(USR)/share/man/fr/man1/gmic.1.gz - # rm -f $(DESTDIR)$(USR)/bin/zart +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -80,7 +80,7 @@ INCLUDE=include + IS_BETA_CFLAGS = + + # Flags that are mandatory to compile 'gmic'. +-MANDATORY_CFLAGS += -Dgmic_build -I$(USR)/$(INCLUDE) ++MANDATORY_CFLAGS += $(CFLAGS) -Dgmic_build -I$(USR)/$(INCLUDE) + MANDATORY_LIBS += -L$(USR)/$(LIB) + ifeq ($(CC),g++) + MANDATORY_CFLAGS += -Wall -W +@@ -99,7 +99,7 @@ DEBUG_CFLAGS = -Dcimg_verbosity=3 -g + + # Flags to enable optimizations. + ifeq ($(CC),g++) +-OPT_CFLAGS = -O2 -fno-ipa-sra -mtune=generic # -fno-tree-pre # -ffast-math ++OPT_CFLAGS = -O2 # -mtune=generic # -fno-tree-pre # -ffast-math + endif + ifeq ($(CC),clang++) + OPT_CFLAGS = -O2 +@@ -130,13 +130,13 @@ OPENMP_LIBS = -lgomp + # This requires the presence of the X11 include and library files. + # (package 'libx11-dev' on Debian). + X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr +-X11_LIBS = -L/usr/X11R6/lib -lX11 -lpthread #-lXrandr ++X11_LIBS = -L/usr/X11R6/$(LIB) -lX11 -lpthread #-lXrandr + + # Flags to enable fast display, using XShm. + # This requires the presence of the X11 extension include and library files. + # (package 'libx11-dev' on Debian). + XSHM_CFLAGS = -Dcimg_use_xshm +-XSHM_LIBS = -L$(USR)/X11R6/lib -lXext ++XSHM_LIBS = -L$(USR)/X11R6/$(LIB) -lXext + + # Flags to enable image display, using GDI32. + # This requires the presence of the GDI32 include and library files. +@@ -241,7 +241,8 @@ MINIMAL_UNIX_LIBS = $(MANDATORY_LIBS) $( + ${TIFF_LIBS} ${PNG_LIBS} $(ZLIB_LIBS) $(FFTW_LIBS) # $(OPENCV_LIBS) + + # Unix : Static build. +-STATIC_PATH = $(USR)/${LIB}/x86_64-linux-gnu ++#STATIC_PATH = $(USR)/${LIB}/x86_64-linux-gnu ++STATIC_PATH=$(USR)/$(LIB) + STATIC_EXTRA = + STATIC_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(ZLIB_CFLAGS) $(FFTW_CFLAGS) -Dcimg_display=0 + STATIC_UNIX_LIBS = $(PARALLEL_LIBS) \ +@@ -279,12 +280,11 @@ STD_LIB_LIBS = $(MANDATORY_LIBS) $(PARAL + + # GMICol : Standard build. + GMICOL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(ZLIB_CFLAGS) $(FFTW_CFLAGS) -Dcimg_display=0 +-GMICOL_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(ZLIB_LIBS) /usr/lib/x86_64-linux-gnu/libfftw3.a /usr/lib/x86_64-linux-gnu/libfftw3_threads.a ++GMICOL_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(ZLIB_LIBS) /usr/$(LIB)/libfftw3.a /usr/$(LIB)/libfftw3_threads.a + + #-------------------------- + # Define Makefile entries. + #-------------------------- +- + # Main entries + all: + ifeq ($(OS),Unix) +@@ -307,7 +307,7 @@ endif + endif + + gimp: +- $(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_GIMP_LIBS) $(OPT_LIBS)" "STRIP_EXE=1" gmic_gimp ++ $(MAKE) "CFLAGS=$(STD_GIMP_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_GIMP_LIBS) $(OPT_LIBS)" gmic_gimp + + lib: + $(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_LIB_LIBS) $(OPT_LIBS)" gmic_lib +@@ -321,7 +321,7 @@ endif + + # Entries for other configurations. + linux: +- $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS=$(STD_UNIX_LIBS)" "STRIP_EXE=1" gmic ++ $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS=$(STD_UNIX_LIBS)" gmic + + solaris: + $(MAKE) "CFLAGS=$(STD_UNIX_CFLAGS) $(OPT_CFLAGS)" "LIBS=$(STD_UNIX_LIBS) -R$(USR)/X11R6/lib -lrt -lnsl -lsocket" "STRIP_EXE=1" gmic diff --git a/gmic-docdir.diff b/gmic-docdir.diff index 1221cc4..912f76a 100644 --- a/gmic-docdir.diff +++ b/gmic-docdir.diff @@ -1,26 +1,21 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -67,8 +67,10 @@ endif - ifeq ($(OSTYPE),msys) - EXE = .exe - endif - -+DOCDIR = $(USR)/share/doc -+ - #------------------------------------------------ - # Set compilation flags for build customization. - #------------------------------------------------ - -@@ -436,9 +438,9 @@ uninstall: - rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5.8 - # rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5 - rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 - rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so -- rm -rf $(DESTDIR)$(USR)/share/doc/gmic/ -+ rm -rf $(DESTDIR)$(DOCDIR)/gmic/ - rm -f $(DESTDIR)$(USR)/share/man/man1/gmic.1.gz - rm -f $(DESTDIR)$(USR)/share/man/fr/man1/gmic.1.gz - # rm -f $(DESTDIR)$(USR)/bin/zart - # rm -rf $(DESTDIR)$(USR)/share/zart/ +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -71,6 +71,7 @@ endif + LIB=lib + BIN=bin + INCLUDE=include ++DOCDIR = $(USR)/share/doc + + #------------------------------------------------ + # Set compilation flags for build customization. +@@ -415,7 +416,7 @@ uninstall: + rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.6.0 + rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 + rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so +- rm -rf $(DESTDIR)$(USR)/share/doc/gmic/ ++ rm -rf $(DESTDIR)$(DOCDIR)/gmic/ + rm -f $(DESTDIR)$(USR)/share/man/man1/gmic.1.gz + rm -f $(DESTDIR)$(USR)/share/man/fr/man1/gmic.1.gz + diff --git a/gmic-magick.diff b/gmic-magick.diff deleted file mode 100644 index 2366681..0000000 --- a/gmic-magick.diff +++ /dev/null @@ -1,20 +0,0 @@ -Index: gmic-1.5.5.2/src/Makefile -=================================================================== ---- gmic-1.5.5.2.orig/src/Makefile -+++ gmic-1.5.5.2/src/Makefile -@@ -204,13 +204,13 @@ BOARD_LDFLAGS = -lboard - # Sets of flags for building different configurations. - STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ - $(EXR_CFLAGS) $(FFTW_CFLAGS) $(OPENMP_CFLAGS) \ -- $(OPENCV_CFLAGS) # $(FFMPEG_CFLAGS) # $(XSHM_CFLAGS) # $(MAGICK_CFLAGS) -+ $(OPENCV_CFLAGS) $(MAGICK_CFLAGS) # $(FFMPEG_CFLAGS) # $(XSHM_CFLAGS) - STD_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) $(PNG_LDFLAGS) \ - $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(ZLIB_LDFLAGS) \ - $(EXR_LDFLAGS) $(FFTW_LDFLAGS) $(OPENMP_LDFLAGS) \ -- $(OPENCV_LDFLAGS) # $(FFMPEG_LDFLAGS) # $(XSHM_LDFLAGS) # $(MAGICK_LDFLAGS) -+ $(OPENCV_LDFLAGS) $(MAGICK_LDFLAGS) # $(FFMPEG_LDFLAGS) # $(XSHM_LDFLAGS) - - CUST_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ - $(FFTW_CFLAGS) $(EXR_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) $(BOARD_CFLAGS) $(MINC2_CFLAGS) $(OPENCV_CFLAGS) diff --git a/gmic-make-zart.diff b/gmic-make-zart.diff index 9fcb842..1b3b675 100644 --- a/gmic-make-zart.diff +++ b/gmic-make-zart.diff @@ -1,28 +1,15 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -422,10 +422,8 @@ install: - mkdir -p $(DESTDIR)$(USR)/include/ - cp -f gmic.h $(DESTDIR)$(USR)/include/ - ifneq ($(OS),Darwin) - mkdir -p $(DESTDIR)$(USR)/share --# mkdir -p $(DESTDIR)$(USR)/share/zart --# cp -f ../zart/zart $(DESTDIR)$(USR)/bin/zart - mkdir -p $(DESTDIR)$(USR)/$(LIB) - cp -f libgmic.so $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5.8 - ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 - # ln -s libgmic.so.1.5.8 $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1 -@@ -438,8 +436,12 @@ endif - cp -f ../man/gmic.1.gz $(DESTDIR)$(USR)/share/man/fr/man1/gmic.1.gz - if test -d /etc/bash_completion.d/; then mkdir -p $(DESTDIR)/etc/bash_completion.d/; cp -f gmic_bashcompletion.sh $(DESTDIR)/etc/bash_completion.d/gmic; fi - if test -d /opt/local/etc/bash_completion.d/; then mkdir -p $(DESTDIR)/opt/local/etc/bash_completion.d/; cp -f gmic_bashcompletion.sh $(DESTDIR)/opt/local/etc/bash_completion.d/gmic; fi - -+install-zart: zart -+ mkdir -p $(DESTDIR)$(USR)/share/zart -+ cp -f ../zart/zart $(DESTDIR)$(USR)/bin/zart -+ - uninstall: - rm -f $(DESTDIR)$(USR)/bin/gmic - rm -f $(DESTDIR)$(USR)/include/gmic.h - rm -f $(DESTDIR)$(USR)/$(LIB)/libgmic.so.1.5.8 +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -412,6 +412,10 @@ endif + if [ -d /etc/bash_completion.d/ ]; then mkdir -p $(DESTDIR)/etc/bash_completion.d/; cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/etc/bash_completion.d/gmic; fi + if [ -d /opt/local/etc/bash_completion.d/ ]; then mkdir -p $(DESTDIR)/opt/local/etc/bash_completion.d/; cp -f ../resources/gmic_bashcompletion.sh $(DESTDIR)/opt/local/etc/bash_completion.d/gmic; fi + ++install-zart: zart ++ mkdir -p $(DESTDIR)$(USR)/share/zart ++ cp -f ../zart/zart $(DESTDIR)$(USR)/bin/zart ++ + uninstall: + rm -f $(DESTDIR)$(USR)/$(BIN)/gmic + rm -f $(DESTDIR)$(USR)/$(INCLUDE)/gmic.h diff --git a/gmic-opencv-old.diff b/gmic-opencv-old.diff deleted file mode 100644 index ed8bc1b..0000000 --- a/gmic-opencv-old.diff +++ /dev/null @@ -1,18 +0,0 @@ -Index: gmic-1.5.5.2/src/Makefile -=================================================================== ---- gmic-1.5.5.2.orig/src/Makefile -+++ gmic-1.5.5.2/src/Makefile -@@ -159,10 +159,10 @@ ifeq ($(OS),Darwin) - OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/include -I$(USR)/include/opencv - OPENCV_LDFLAGS = `pkg-config opencv --libs` #-> Use this for OpenCV 2.2.0 ! - else - OPENCV_CFLAGS = -Dcimg_use_opencv -I$(USR)/include -I$(USR)/include/opencv --# OPENCV_LDFLAGS = -lcv -lhighgui --OPENCV_LDFLAGS = -lopencv_core -lopencv_highgui #-> Use this for OpenCV >= 2.2.0 ! -+OPENCV_LDFLAGS = -lcv -lhighgui -+#OPENCV_LDFLAGS = -lopencv_core -lopencv_highgui #-> Use this for OpenCV >= 2.2.0 ! - endif - - # Flags to enable native support of most classical image file formats, using the GraphicsMagick++ library. - # This requires the presence of the GraphicsMagick++ include and library files. - diff --git a/gmic-opencv.diff b/gmic-opencv.diff index 5d2f24c..3ae71b2 100644 --- a/gmic-opencv.diff +++ b/gmic-opencv.diff @@ -1,20 +1,17 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -226,13 +226,13 @@ BOARD_LDFLAGS = -lboard - # Unix : Standard build. - STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ - $(EXR_CFLAGS) $(FFTW_CFLAGS) $(OPENMP_CFLAGS) \ -- # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) -+ $(OPENCV_CFLAGS) # $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) - STD_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) $(PNG_LDFLAGS) \ - $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(ZLIB_LDFLAGS) \ - $(EXR_LDFLAGS) $(FFTW_LDFLAGS) $(OPENMP_LDFLAGS) \ -- # $(OPENCV_LDFLAGS) $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) -+ $(OPENCV_LDFLAGS) # $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) - - # Unix : Minimal build. - MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) \ - ${TIFF_CFLAGS} ${PNG_CFLAGS} $(ZLIB_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -230,10 +230,10 @@ BOARD_LIBS = -lboard + # Unix : Standard build. + STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ + $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ +- $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) ++ $(EXR_CFLAGS) $(FFTW_CFLAGS) $(OPENCV_CFLAGS) # $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) + STD_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(OPENMP_LIBS) $(X11_LIBS) $(XSHM_LIBS) $(PNG_LIBS) \ + $(JPEG_LIBS) $(TIFF_LIBS) $(ZLIB_LIBS) \ +- $(EXR_LIBS) $(FFTW_LIBS) # $(OPENCV_LIBS) $(FFMPEG_LIBS) # $(MAGICK_LIBS) ++ $(EXR_LIBS) $(FFTW_LIBS) $(OPENCV_LIBS) # $(FFMPEG_LIBS) # $(MAGICK_LIBS) + + # Unix : Minimal build. + MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) \ diff --git a/gmic-openmp-gcc43.diff b/gmic-openmp-gcc43.diff index 334283d..a4d3dd6 100644 --- a/gmic-openmp-gcc43.diff +++ b/gmic-openmp-gcc43.diff @@ -1,12 +1,12 @@ -Index: gmic-1.5.8.4/src/CImg.h +Index: gmic-1.6.0.0/src/CImg.h =================================================================== ---- gmic-1.5.8.4.orig/src/CImg.h -+++ gmic-1.5.8.4/src/CImg.h +--- gmic-1.6.0.0.orig/src/CImg.h ++++ gmic-1.6.0.0/src/CImg.h @@ -220,8 +220,13 @@ // OpenMP directives may be used in a (very) few CImg functions to get // advantages of multi-core CPUs. #ifdef cimg_use_openmp - #include "omp.h" + #include +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) +#define COLLAPSE(x) collapse(x) +#else @@ -16,35 +16,2244 @@ Index: gmic-1.5.8.4/src/CImg.h // Configure OpenCV support. // (http://opencv.willowgarage.com/wiki/) -@@ -24304,27 +24309,27 @@ namespace cimg_library_suffixed { +@@ -10548,9 +10553,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator+=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd + value); + return *this; +@@ -10579,9 +10584,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd + lmp(x,y,z,c)); ++ptrd; } + } +@@ -10639,9 +10644,9 @@ namespace cimg_library_suffixed { + - Writing \c ++img is equivalent to \c img+=1. + **/ + CImg& operator++() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) ++*ptrd; + return *this; +@@ -10708,9 +10713,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator-=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd - value); + return *this; +@@ -10735,9 +10740,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd - lmp(x,y,z,c)); ++ptrd; } + } +@@ -10777,9 +10782,9 @@ namespace cimg_library_suffixed { + Similar to operator++(), except that it performs a decrement instead of an increment. + **/ + CImg& operator--() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) *ptrd = *ptrd-(T)1; + return *this; +@@ -10848,9 +10853,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator*=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=262144) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd * value); + return *this; +@@ -10875,9 +10880,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd * lmp(x,y,z,c)); ++ptrd; } + } +@@ -10949,9 +10954,9 @@ namespace cimg_library_suffixed { + cimg_instance, + img._width,img._height,img._depth,img._spectrum,img._data); + CImg<_cimg_Tt> res(img._width,_height); + #ifdef cimg_use_openmp +-#pragma omp parallel for if (size()>1024 && img.size()>1024) collapse(2) ++#pragma omp parallel for if (size()>1024 && img.size()>1024) COLLAPSE(2) + cimg_forXY(res,i,j) { + _cimg_Ttdouble value = 0; cimg_forX(*this,k) value+=(*this)(k,j)*img(i,k); res(i,j) = (_cimg_Tt)value; + } + #else +@@ -10969,9 +10974,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator/=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd / value); + return *this; +@@ -10996,9 +11001,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd / lmp(x,y,z,c)); ++ptrd; } + } +@@ -11066,9 +11071,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator%=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=16384) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)cimg::mod(*ptrd,(T)value); + return *this; +@@ -11093,9 +11098,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)cimg::mod(*ptrd,(T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -11165,9 +11170,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator&=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)((unsigned long)*ptrd & (unsigned long)value); + return *this; +@@ -11194,9 +11199,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)((unsigned long)*ptrd & (unsigned long)lmp(x,y,z,c)); ++ptrd; } + } +@@ -11266,9 +11271,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator|=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)((unsigned long)*ptrd | (unsigned long)value); + return *this; +@@ -11295,9 +11300,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)((unsigned long)*ptrd | (unsigned long)lmp(x,y,z,c)); ++ptrd; } + } +@@ -11369,9 +11374,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator^=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)((unsigned long)*ptrd ^ (unsigned long)value); + return *this; +@@ -11400,9 +11405,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)((unsigned long)*ptrd ^ (unsigned long)lmp(x,y,z,c)); ++ptrd; } + } +@@ -11474,9 +11479,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator<<=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(((long)*ptrd) << (int)value); + return *this; +@@ -11501,9 +11506,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)((long)*ptrd << (int)lmp(x,y,z,c)); ++ptrd; } + } +@@ -11574,9 +11579,9 @@ namespace cimg_library_suffixed { + **/ + template + CImg& operator>>=(const t value) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(((long)*ptrd) >> (int)value); + return *this; +@@ -11601,9 +11606,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)((long)*ptrd >> (int)lmp(x,y,z,c)); ++ptrd; } + } +@@ -14947,9 +14952,9 @@ namespace cimg_library_suffixed { + \image html ref_sqr.jpg + **/ + CImg& sqr() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(val*val); }; + return *this; +@@ -14974,9 +14979,9 @@ namespace cimg_library_suffixed { + \image html ref_sqrt.jpg + **/ + CImg& sqrt() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::sqrt((double)*ptrd); + return *this; +@@ -14995,9 +15000,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& exp() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=4096) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::exp((double)*ptrd); + return *this; +@@ -15017,9 +15022,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& log() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=262144) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::log((double)*ptrd); + return *this; +@@ -15039,9 +15044,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& log2() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=4096) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)cimg::log2((double)*ptrd); + return *this; +@@ -15061,9 +15066,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& log10() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=4096) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::log10((double)*ptrd); + return *this; +@@ -15082,9 +15087,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& abs() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=524288) + #endif + cimg_rof(*this,ptrd,T) *ptrd = cimg::abs(*ptrd); + return *this; +@@ -15108,9 +15113,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& sign() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = cimg::sign(*ptrd); + return *this; +@@ -15130,9 +15135,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& cos() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::cos((double)*ptrd); + return *this; +@@ -15152,9 +15157,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& sin() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::sin((double)*ptrd); + return *this; +@@ -15175,9 +15180,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& sinc() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=2048) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)cimg::sinc((double)*ptrd); + return *this; +@@ -15197,9 +15202,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& tan() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=2048) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::tan((double)*ptrd); + return *this; +@@ -15219,9 +15224,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& cosh() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=2048) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::cosh((double)*ptrd); + return *this; +@@ -15241,9 +15246,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& sinh() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=2048) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::sinh((double)*ptrd); + return *this; +@@ -15263,9 +15268,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& tanh() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=2048) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::tanh((double)*ptrd); + return *this; +@@ -15285,9 +15290,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& acos() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::acos((double)*ptrd); + return *this; +@@ -15307,9 +15312,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& asin() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::asin((double)*ptrd); + return *this; +@@ -15329,9 +15334,9 @@ namespace cimg_library_suffixed { + - The \newinstance returns a \c CImg image, if the pixel type \c T is \e not float-valued. + **/ + CImg& atan() { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::atan((double)*ptrd); + return *this; +@@ -15458,37 +15463,37 @@ namespace cimg_library_suffixed { + **/ + CImg& pow(const double p) { + if (is_empty()) return *this; + if (p==-4) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(1.0/(val*val*val*val)); } + return *this; + } + if (p==-3) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(1.0/(val*val*val)); } + return *this; + } + if (p==-2) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(1.0/(val*val)); } + return *this; + } + if (p==-1) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(1.0/val); } + return *this; + } + if (p==-0.5) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = (T)(1/std::sqrt((double)val)); } + return *this; +@@ -15497,22 +15502,22 @@ namespace cimg_library_suffixed { + if (p==0.5) return sqrt(); + if (p==1) return *this; + if (p==2) return sqr(); + if (p==3) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=262144) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = val*val*val; } + return *this; + } + if (p==4) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) { const T val = *ptrd; *ptrd = val*val*val*val; } + return *this; + } +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=1024) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)std::pow((double)*ptrd,p); + return *this; +@@ -15543,9 +15548,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)std::pow((double)*ptrd,lmp(x,y,z,c)); ++ptrd; } + } +@@ -15602,9 +15607,9 @@ namespace cimg_library_suffixed { + Similar to operator<<=(unsigned int), except that it performs a left rotation instead of a left shift. + **/ + CImg& rol(const unsigned int n=1) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)cimg::rol(*ptrd,n); + return *this; +@@ -15636,9 +15641,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)cimg::rol(*ptrd,(unsigned int)lmp(x,y,z,c)); ++ptrd; } + } +@@ -15695,9 +15700,9 @@ namespace cimg_library_suffixed { + Similar to operator>>=(unsigned int), except that it performs a right rotation instead of a right shift. + **/ + CImg& ror(const unsigned int n=1) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)cimg::ror(*ptrd,n); + return *this; +@@ -15729,9 +15734,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)cimg::ror(*ptrd,(unsigned int)lmp(x,y,z,c)); ++ptrd; } + } +@@ -15790,9 +15795,9 @@ namespace cimg_library_suffixed { + \f$\mathrm{min}(I_{(x,y,z,c)},\mathrm{val})\f$. + **/ + CImg& min(const T val) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = cimg::min(*ptrd,val); + return *this; +@@ -15850,9 +15855,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)cimg::min(*ptrd,(T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -15887,9 +15892,9 @@ namespace cimg_library_suffixed { + \f$\mathrm{max}(I_{(x,y,z,c)},\mathrm{val})\f$. + **/ + CImg& max(const T val) { + if (is_empty()) return *this; +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = cimg::max(*ptrd,val); + return *this; +@@ -15947,9 +15952,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)cimg::max(*ptrd,(T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -18509,9 +18514,9 @@ namespace cimg_library_suffixed { + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) *ptrd++ = (T)lmp(x,y,z,c); + } +@@ -18744,9 +18749,9 @@ namespace cimg_library_suffixed { + - \c 1: Forward. + **/ + CImg& round(const double y=1, const int rounding_type=0) { + if (y>0) +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)) + #pragma omp parallel for if (size()>=8192) + #endif + cimg_rof(*this,ptrd,T) *ptrd = cimg::round(*ptrd,y,rounding_type); + return *this; +@@ -18855,9 +18860,9 @@ namespace cimg_library_suffixed { + T m, M = max_min(m); + const Tfloat fm = (Tfloat)m, fM = (Tfloat)M; + if (m==M) return fill(min_value); + if (m!=a || M!=b) +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)((*ptrd-fm)/(fM-fm)*(b-a)+a); + return *this; +@@ -18879,9 +18884,9 @@ namespace cimg_library_suffixed { + **/ + CImg& normalize() { + const unsigned long whd = (unsigned long)_width*_height*_depth; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=512 && _height*_depth>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=512 && _height*_depth>=16) + #endif + cimg_forYZ(*this,y,z) { + T *ptrd = data(0,y,z,0); + cimg_forX(*this,x) { +@@ -18925,9 +18930,9 @@ namespace cimg_library_suffixed { + CImg res(_width,_height,_depth); + switch (norm_type) { + case -1 : { // Linf norm + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=512 && _height*_depth>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=512 && _height*_depth>=16) + #endif + cimg_forYZ(*this,y,z) { + const unsigned long off = offset(0,y,z); + const T *ptrs = _data + off; +@@ -18941,9 +18946,9 @@ namespace cimg_library_suffixed { + } + } break; + case 1 : { // L1 norm + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=512 && _height*_depth>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=512 && _height*_depth>=16) + #endif + cimg_forYZ(*this,y,z) { + const unsigned long off = offset(0,y,z); + const T *ptrs = _data + off; +@@ -18957,9 +18962,9 @@ namespace cimg_library_suffixed { + } + } break; + default : { // L2 norm + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=512 && _height*_depth>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=512 && _height*_depth>=16) + #endif + cimg_forYZ(*this,y,z) { + const unsigned long off = offset(0,y,z); + const T *ptrs = _data + off; +@@ -18989,9 +18994,9 @@ namespace cimg_library_suffixed { + **/ + CImg& cut(const T min_value, const T max_value) { + if (is_empty()) return *this; + const T a = min_value=32768) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (*ptrdb)?b:*ptrd); + return *this; +@@ -19022,16 +19027,16 @@ namespace cimg_library_suffixed { + if (is_empty()) return *this; + Tfloat m, M = (Tfloat)max_min(m), range = M - m; + if (range>0) { + if (keep_range) +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { + const unsigned int val = (unsigned int)((*ptrd-m)*nb_levels/range); + *ptrd = (T)(m + cimg::min(val,nb_levels-1)*range/nb_levels); + } else +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { + const unsigned int val = (unsigned int)((*ptrd-m)*nb_levels/range); +@@ -19061,27 +19066,27 @@ namespace cimg_library_suffixed { + CImg& threshold(const T value, const bool soft_threshold=false, const bool strict_threshold=false) { + if (is_empty()) return *this; + if (strict_threshold) { + if (soft_threshold) +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { const T v = *ptrd; *ptrd = v>value?(T)(v-value):v<-(float)value?(T)(v+value):(T)0; } + else +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = *ptrd>value?(T)1:(T)0; + } else { + if (soft_threshold) +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=32768) + #endif + cimg_rof(*this,ptrd,T) { + const T v = *ptrd; *ptrd = v>=value?(T)(v-value):v<=-(float)value?(T)(v+value):(T)0; + } + else +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=65536) + #endif + cimg_rof(*this,ptrd,T) *ptrd = *ptrd>=value?(T)1:(T)0; + } +@@ -19158,9 +19163,9 @@ namespace cimg_library_suffixed { + T vmin = min_value hist = get_histogram(nb_levels,vmin,vmax); + unsigned long cumul = 0; + cimg_forX(hist,pos) { cumul+=hist[pos]; hist[pos] = cumul; } +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=1048576) + #endif + cimg_rof(*this,ptrd,T) { + const int pos = (int)((*ptrd-vmin)*(nb_levels-1)/(vmax-vmin)); +@@ -19374,9 +19379,9 @@ namespace cimg_library_suffixed { + } else { // Non-dithered versions + switch (_spectrum) { + case 1 : { // Optimized for scalars. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) + #endif + cimg_forYZ(*this,y,z) { + tuint *ptrd = res.data(0,y,z); + for (const T *ptrs0 = data(0,y,z), *ptrs_end = ptrs0 + _width; ptrs0=64 && _height*_depth>=16 && pwhd>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) + #endif + cimg_forYZ(*this,y,z) { + tuint *ptrd = res.data(0,y,z), *ptrd1 = ptrd + whd; + for (const T *ptrs0 = data(0,y,z), *ptrs1 = ptrs0 + whd, *ptrs_end = ptrs0 + _width; ptrs0=64 && _height*_depth>=16 && pwhd>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) + #endif + cimg_forYZ(*this,y,z) { + tuint *ptrd = res.data(0,y,z), *ptrd1 = ptrd + whd, *ptrd2 = ptrd1 + whd; + for (const T *ptrs0 = data(0,y,z), *ptrs1 = ptrs0 + whd, *ptrs2 = ptrs1 + whd, +@@ -19438,9 +19443,9 @@ namespace cimg_library_suffixed { + } + } break; + default : // Generic version. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=64 && _height*_depth>=16 && pwhd>=16) + #endif + cimg_forYZ(*this,y,z) { + tuint *ptrd = res.data(0,y,z); + for (const T *ptrs = data(0,y,z), *ptrs_end = ptrs + _width; ptrs=65536) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=65536) + #endif + for (int c = c0; c<(int)sc; c+=spectrum()) + for (int z = z0; z<(int)sz; z+=depth()) + for (int y = y0; y<(int)sy; y+=height()) +@@ -21163,9 +21168,9 @@ namespace cimg_library_suffixed { + curr+=fx; + *(poff++) = (unsigned int)curr - (unsigned int)old; + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resx.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resx.size()>=65536) + #endif + cimg_forYZC(resx,y,z,c) { + const T *ptrs = data(0,y,z,c), *const ptrsmax = ptrs + (_width-1); + T *ptrd = resx.data(0,y,z,c); +@@ -21198,9 +21203,9 @@ namespace cimg_library_suffixed { + curr+=fy; + *(poff++) = sx*((unsigned int)curr-(unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resy.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resy.size()>=65536) + #endif + cimg_forXZC(resy,x,z,c) { + const T *ptrs = resx.data(x,0,z,c), *const ptrsmax = ptrs + (_height-1)*sx; + T *ptrd = resy.data(x,0,z,c); +@@ -21236,9 +21241,9 @@ namespace cimg_library_suffixed { + curr+=fz; + *(poff++) = sxy*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resz.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resz.size()>=65536) + #endif + cimg_forXYC(resz,x,y,c) { + const T *ptrs = resy.data(x,y,0,c), *const ptrsmax = ptrs + (_depth-1)*sxy; + T *ptrd = resz.data(x,y,0,c); +@@ -21275,9 +21280,9 @@ namespace cimg_library_suffixed { + curr+=fc; + *(poff++) = sxyz*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resc.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resc.size()>=65536) + #endif + cimg_forXYZ(resc,x,y,z) { + const T *ptrs = resz.data(x,y,z,0), *const ptrsmax = ptrs + (_spectrum-1)*sxyz; + T *ptrd = resc.data(x,y,z,0); +@@ -21388,9 +21393,9 @@ namespace cimg_library_suffixed { + curr+=fx; + *(poff++) = (unsigned int)curr - (unsigned int)old; + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resx.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resx.size()>=65536) + #endif + cimg_forYZC(resx,y,z,c) { + const T *const ptrs0 = data(0,y,z,c), *ptrs = ptrs0, *const ptrsmax = ptrs + (_width-2); + T *ptrd = resx.data(0,y,z,c); +@@ -21429,9 +21434,9 @@ namespace cimg_library_suffixed { + curr+=fy; + *(poff++) = sx*((unsigned int)curr-(unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resy.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resy.size()>=65536) + #endif + cimg_forXZC(resy,x,z,c) { + const T *const ptrs0 = resx.data(x,0,z,c), *ptrs = ptrs0, *const ptrsmax = ptrs + (_height-2)*sx; + T *ptrd = resy.data(x,0,z,c); +@@ -21473,9 +21478,9 @@ namespace cimg_library_suffixed { + curr+=fz; + *(poff++) = sxy*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resz.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resz.size()>=65536) + #endif + cimg_forXYC(resz,x,y,c) { + const T *const ptrs0 = resy.data(x,y,0,c), *ptrs = ptrs0, *const ptrsmax = ptrs + (_depth-2)*sxy; + T *ptrd = resz.data(x,y,0,c); +@@ -21518,9 +21523,9 @@ namespace cimg_library_suffixed { + curr+=fc; + *(poff++) = sxyz*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resc.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resc.size()>=65536) + #endif + cimg_forXYZ(resc,x,y,z) { + const T *const ptrs0 = resz.data(x,y,z,0), *ptrs = ptrs0, *const ptrsmax = ptrs + (_spectrum-2)*sxyz; + T *ptrd = resc.data(x,y,z,0); +@@ -21572,9 +21577,9 @@ namespace cimg_library_suffixed { + curr+=fx; + *(poff++) = (unsigned int)curr - (unsigned int)old; + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resx.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resx.size()>=65536) + #endif + cimg_forYZC(resx,y,z,c) { + const T *const ptrs0 = data(0,y,z,c), *ptrs = ptrs0, *const ptrsmin = ptrs0 + 1, + *const ptrsmax = ptrs0 + (_width-2); +@@ -21620,9 +21625,9 @@ namespace cimg_library_suffixed { + curr+=fy; + *(poff++) = sx*((unsigned int)curr-(unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resy.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resy.size()>=65536) + #endif + cimg_forXZC(resy,x,z,c) { + const T *const ptrs0 = resx.data(x,0,z,c), *ptrs = ptrs0, *const ptrsmin = ptrs0 + sx, + *const ptrsmax = ptrs0 + (_height-2)*sx; +@@ -21671,9 +21676,9 @@ namespace cimg_library_suffixed { + curr+=fz; + *(poff++) = sxy*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resz.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resz.size()>=65536) + #endif + cimg_forXYC(resz,x,y,c) { + const T *const ptrs0 = resy.data(x,y,0,c), *ptrs = ptrs0, *const ptrsmin = ptrs0 + sxy, + *const ptrsmax = ptrs0 + (_depth-2)*sxy; +@@ -21723,9 +21728,9 @@ namespace cimg_library_suffixed { + curr+=fc; + *(poff++) = sxyz*((unsigned int)curr - (unsigned int)old); + } + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (resc.size()>=65536) ++#pragma omp parallel for COLLAPSE(3) if (resc.size()>=65536) + #endif + cimg_forXYZ(resc,x,y,z) { + const T *const ptrs0 = resz.data(x,y,z,0), *ptrs = ptrs0, *const ptrsmin = ptrs0 + sxyz, + *const ptrsmax = ptrs + (_spectrum-2)*sxyz; +@@ -22560,25 +22565,25 @@ namespace cimg_library_suffixed { + case 0 : { // Dirichlet boundaries. + switch (interpolation) { + case 2 : { // Cubic interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = cubic_atXY(w2 + (x-dw2)*ca + (y-dh2)*sa,h2 - (x-dw2)*sa + (y-dh2)*ca,z,c,0); + res(x,y,z,c) = (T)(valvmax?vmax:val); + } + } break; + case 1 : { // Linear interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)linear_atXY(w2 + (x-dw2)*ca + (y-dh2)*sa,h2 - (x-dw2)*sa + (y-dh2)*ca,z,c,0); + } break; + default : { // Nearest-neighbor interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = atXY((int)(w2 + (x-dw2)*ca + (y-dh2)*sa),(int)(h2 - (x-dw2)*sa + (y-dh2)*ca),z,c,0); + } +@@ -22587,25 +22592,25 @@ namespace cimg_library_suffixed { + case 1 : { // Neumann boundaries. + switch (interpolation) { + case 2 : { // Cubic interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = _cubic_atXY(w2 + (x-dw2)*ca + (y-dh2)*sa,h2 - (x-dw2)*sa + (y-dh2)*ca,z,c); + res(x,y,z,c) = (T)(valvmax?vmax:val); + } + } break; + case 1 : { // Linear interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)_linear_atXY(w2 + (x-dw2)*ca + (y-dh2)*sa,h2 - (x-dw2)*sa + (y-dh2)*ca,z,c); + } break; + default : { // Nearest-neighbor interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = _atXY((int)(w2 + (x-dw2)*ca + (y-dh2)*sa),(int)(h2 - (x-dw2)*sa + (y-dh2)*ca),z,c); + } +@@ -22614,9 +22619,9 @@ namespace cimg_library_suffixed { + case 2 : { // Periodic boundaries. + switch (interpolation) { + case 2 : { // Cubic interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = _cubic_atXY(cimg::mod(w2 + (x-dw2)*ca + (y-dh2)*sa,(float)width()), + cimg::mod(h2 - (x-dw2)*sa + (y-dh2)*ca,(float)height()),z,c); +@@ -22624,17 +22629,17 @@ namespace cimg_library_suffixed { + } + } break; + case 1 : { // Linear interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)_linear_atXY(cimg::mod(w2 + (x-dw2)*ca + (y-dh2)*sa,(float)width()), + cimg::mod(h2 - (x-dw2)*sa + (y-dh2)*ca,(float)height()),z,c); + } break; + default : { // Nearest-neighbor interpolation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (*this)(cimg::mod((int)(w2 + (x-dw2)*ca + (y-dh2)*sa),width()), + cimg::mod((int)(h2 - (x-dw2)*sa + (y-dh2)*ca),height()),z,c); +@@ -22686,25 +22691,25 @@ namespace cimg_library_suffixed { + case 0 : { + switch (interpolation) { + case 2 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = cubic_atXY(cx + (x-cx)*ca + (y-cy)*sa,cy - (x-cx)*sa + (y-cy)*ca,z,c,0); + res(x,y,z,c) = (T)(valvmax?vmax:val); + } + } break; + case 1 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)linear_atXY(cx + (x-cx)*ca + (y-cy)*sa,cy - (x-cx)*sa + (y-cy)*ca,z,c,0); + } break; + default : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = atXY((int)(cx + (x-cx)*ca + (y-cy)*sa),(int)(cy - (x-cx)*sa + (y-cy)*ca),z,c,0); + } +@@ -22713,25 +22718,25 @@ namespace cimg_library_suffixed { + case 1 : { + switch (interpolation) { + case 2 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = _cubic_atXY(cx + (x-cx)*ca + (y-cy)*sa,cy - (x-cx)*sa + (y-cy)*ca,z,c); + res(x,y,z,c) = (T)(valvmax?vmax:val); + } + } break; + case 1 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)_linear_atXY(cx + (x-cx)*ca + (y-cy)*sa,cy - (x-cx)*sa + (y-cy)*ca,z,c); + } break; + default : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = _atXY((int)(cx + (x-cx)*ca + (y-cy)*sa),(int)(cy - (x-cx)*sa + (y-cy)*ca),z,c); + } +@@ -22740,9 +22745,9 @@ namespace cimg_library_suffixed { + case 2 : { + switch (interpolation) { + case 2 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) { + const Tfloat val = _cubic_atXY(cimg::mod(cx + (x-cx)*ca + (y-cy)*sa,(float)width()), + cimg::mod(cy - (x-cx)*sa + (y-cy)*ca,(float)height()),z,c); +@@ -22750,17 +22755,17 @@ namespace cimg_library_suffixed { + } + } break; + case 1 : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (T)_linear_atXY(cimg::mod(cx + (x-cx)*ca + (y-cy)*sa,(float)width()), + cimg::mod(cy - (x-cx)*sa + (y-cy)*ca,(float)height()),z,c); + } break; + default : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=2048) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=2048) + #endif + cimg_forXYZC(res,x,y,z,c) + res(x,y,z,c) = (*this)(cimg::mod((int)(cx + (x-cx)*ca + (y-cy)*sa),width()), + cimg::mod((int)(cy - (x-cx)*sa + (y-cy)*ca),height()),z,c); +@@ -22808,50 +22813,50 @@ namespace cimg_library_suffixed { + if (is_relative) { // Relative warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atX(cimg::mod(x - (float)*(ptrs0++),(float)_width),y,z,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atX(x - (float)*(ptrs0++),y,z,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)cubic_atX(x - (float)*(ptrs0++),y,z,c,0); + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atX(cimg::mod(x - (float)*(ptrs0++),(float)_width),y,z,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atX(x - (float)*(ptrs0++),y,z,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)linear_atX(x - (float)*(ptrs0++),y,z,c,0); +@@ -22876,50 +22881,50 @@ namespace cimg_library_suffixed { + } else { // Absolute warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atX(cimg::mod((float)*(ptrs0++),(float)_width),0,0,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atX((float)*(ptrs0++),0,0,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)cubic_atX((float)*(ptrs0++),0,0,c,0); + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atX(cimg::mod((float)*(ptrs0++),(float)_width),0,0,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atX((float)*(ptrs0++),0,0,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)linear_atX((float)*(ptrs0++),0,0,c,0); +@@ -22947,52 +22952,52 @@ namespace cimg_library_suffixed { + if (is_relative) { // Relative warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atXY(cimg::mod(x - (float)*(ptrs0++),(float)_width), + cimg::mod(y - (float)*(ptrs1++),(float)_height),z,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atXY(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)cubic_atXY(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z,c,0); + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atXY(cimg::mod(x - (float)*(ptrs0++),(float)_width), + cimg::mod(y - (float)*(ptrs1++),(float)_height),z,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atXY(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)linear_atXY(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z,c,0); +@@ -23018,52 +23023,52 @@ namespace cimg_library_suffixed { + } else { // Absolute warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atXY(cimg::mod((float)*(ptrs0++),(float)_width), + cimg::mod((float)*(ptrs1++),(float)_height),0,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atXY((float)*(ptrs0++),(float)*(ptrs1++),0,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)cubic_atXY((float)*(ptrs0++),(float)*(ptrs1++),0,c,0); + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atXY(cimg::mod((float)*(ptrs0++),(float)_width), + cimg::mod((float)*(ptrs1++),(float)_height),0,c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atXY((float)*(ptrs0++),(float)*(ptrs1++),0,c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1); T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)linear_atXY((float)*(ptrs0++),(float)*(ptrs1++),0,c,0); +@@ -23092,9 +23097,9 @@ namespace cimg_library_suffixed { + if (is_relative) { // Relative warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23103,9 +23108,9 @@ namespace cimg_library_suffixed { + cimg::mod(z - (float)*(ptrs2++),(float)_depth),c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23113,9 +23118,9 @@ namespace cimg_library_suffixed { + *(ptrd++) = (T)_cubic_atXYZ(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z - (float)*(ptrs2++),c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23124,9 +23129,9 @@ namespace cimg_library_suffixed { + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23135,9 +23140,9 @@ namespace cimg_library_suffixed { + cimg::mod(z - (float)*(ptrs2++),(float)_depth),c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23145,9 +23150,9 @@ namespace cimg_library_suffixed { + *(ptrd++) = (T)_linear_atXYZ(x - (float)*(ptrs0++),y - (float)*(ptrs1++),z - (float)*(ptrs2++),c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23179,9 +23184,9 @@ namespace cimg_library_suffixed { + } else { // Absolute warp. + if (interpolation==2) { // Cubic interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23190,18 +23195,18 @@ namespace cimg_library_suffixed { + cimg::mod((float)*(ptrs2++),(float)_depth),c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_cubic_atXYZ((float)*(ptrs0++),(float)*(ptrs1++),(float)*(ptrs2++),c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=4096) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=4096) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23209,9 +23214,9 @@ namespace cimg_library_suffixed { + } + } else if (interpolation==1) { // Linear interpolation. + if (boundary_conditions==2) // Periodic boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -23220,18 +23225,18 @@ namespace cimg_library_suffixed { + cimg::mod((float)*(ptrs2++),(float)_depth),c); + } + else if (boundary_conditions==1) // Neumann boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); + cimg_forX(res,x) *(ptrd++) = (T)_linear_atXYZ((float)*(ptrs0++),(float)*(ptrs1++),(float)*(ptrs2++),c); + } + else // Dirichlet boundaries. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (res.size()>=1048576) ++#pragma omp parallel for COLLAPSE(3) if (res.size()>=1048576) + #endif + cimg_forYZC(res,y,z,c) { + const t *ptrs0 = warp.data(0,y,z,0), *ptrs1 = warp.data(0,y,z,1), *ptrs2 = warp.data(0,y,z,2); + T *ptrd = res.data(0,y,z,c); +@@ -24547,9 +24552,9 @@ namespace cimg_library_suffixed { + const CImg _mask = mask.get_shared_channel(c%mask._spectrum); + if (is_normalized) { // Normalized correlation. + const Ttfloat _M = (Ttfloat)_mask.magnitude(2), M = _M*_M; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=32768) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=32768) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Ttfloat val = 0, N = 0; +@@ -24582,9 +24587,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = (Ttfloat)(N?val/std::sqrt(N):0); + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Ttfloat val = 0, N = 0; +@@ -24599,9 +24604,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = (Ttfloat)(N?val/std::sqrt(N):0); + } + } else { // Classical correlation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=32768) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=32768) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Ttfloat val = 0; +@@ -24626,9 +24631,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = (Ttfloat)val; + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Ttfloat val = 0; +@@ -24699,9 +24704,9 @@ namespace cimg_library_suffixed { + const CImg _img = get_shared_channel(c%_spectrum); + const CImg _mask = mask.get_shared_channel(c%mask._spectrum); + if (is_normalized) { // Normalized erosion. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=32768) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=32768) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt min_val = cimg::type::max(); +@@ -24732,9 +24737,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = min_val; + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt min_val = cimg::type::max(); +@@ -24749,9 +24754,9 @@ namespace cimg_library_suffixed { + } + + } else { // Classical erosion. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=32768) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=32768) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt min_val = cimg::type::max(); +@@ -24780,9 +24785,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = min_val; + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt min_val = cimg::type::max(); +@@ -24810,9 +24815,9 @@ namespace cimg_library_suffixed { + if (sx>1 && _width>1) { // Along X-axis. + const int L = width(), off = 1, s = (int)sx, _s1 = s/2, _s2 = s - _s1, s1 = _s1>L?L:_s1, s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forYZC(*this,y,z,c) { + T *const ptrdb = buf._data, *ptrd = buf._data, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(0,y,z,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -24853,9 +24858,9 @@ namespace cimg_library_suffixed { + const int L = height(), off = width(), s = (int)sy, _s1 = s/2, _s2 = s - _s1, s1 = _s1>L?L:_s1, + s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forXZC(*this,x,z,c) { + T *const ptrdb = buf._data, *ptrd = ptrdb, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(x,0,z,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -24897,9 +24902,9 @@ namespace cimg_library_suffixed { + const int L = depth(), off = width()*height(), s = (int)sz, _s1 = s/2, _s2 = s - _s1, s1 = _s1>L?L:_s1, + s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forXYC(*this,x,y,c) { + T *const ptrdb = buf._data, *ptrd = ptrdb, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(x,y,0,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -24988,9 +24993,9 @@ namespace cimg_library_suffixed { + const CImg _img = get_shared_channel(c%_spectrum); + const CImg _mask = mask.get_shared_channel(c%mask._spectrum); + if (is_normalized) { // Normalized dilation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=32768) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=32768) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt max_val = cimg::type::min(); +@@ -25021,9 +25026,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = max_val; + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(*this,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt max_val = cimg::type::min(); +@@ -25037,9 +25042,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = max_val; + } + } else { // Classical dilation. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth>=128) + #endif + for (int z = mz1; z=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt max_val = cimg::type::min(); +@@ -25068,9 +25073,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = max_val; + } + else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=128) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=128) + #endif + cimg_forYZ(res,y,z) + for (int x = 0; x=mye || z=mze)?++x:((x=mxe)?++x:(x=mxe))) { + Tt max_val = cimg::type::min(); +@@ -25098,9 +25103,9 @@ namespace cimg_library_suffixed { + if (sx>1 && _width>1) { // Along X-axis. + const int L = width(), off = 1, s = (int)sx, _s2 = s/2 + 1, _s1 = s - _s2, s1 = _s1>L?L:_s1, s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forYZC(*this,y,z,c) { + T *const ptrdb = buf._data, *ptrd = ptrdb, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(0,y,z,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -25142,9 +25147,9 @@ namespace cimg_library_suffixed { + const int L = height(), off = width(), s = (int)sy, _s2 = s/2 + 1, _s1 = s - _s2, s1 = _s1>L?L:_s1, + s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forXZC(*this,x,z,c) { + T *const ptrdb = buf._data, *ptrd = ptrdb, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(x,0,z,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -25186,9 +25191,9 @@ namespace cimg_library_suffixed { + const int L = depth(), off = width()*height(), s = (int)sz, _s2 = s/2 + 1, _s1 = s - _s2, s1 = _s1>L?L:_s1, + s2 = _s2>L?L:_s2; + CImg buf(L); + #ifdef cimg_use_opemp +-#pragma omp parallel for collapse(3) firstprivate(buf) if (size()>524288) ++#pragma omp parallel for COLLAPSE(3) firstprivate(buf) if (size()>524288) + #endif + cimg_forXYC(*this,x,y,c) { + T *const ptrdb = buf._data, *ptrd = ptrdb, *const ptrde = buf._data + L - 1; + const T *const ptrsb = data(x,y,0,c), *ptrs = ptrsb, *const ptrse = ptrs + L*off - off; +@@ -25507,33 +25512,33 @@ namespace cimg_library_suffixed { + case 'x' : { + const int N = _width; + const unsigned long off = 1U; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) + #endif + cimg_forYZC(*this,y,z,c) { T *ptrX = data(0,y,z,c); _cimg_deriche_apply; } + } break; + case 'y' : { + const int N = _height; + const unsigned long off = (unsigned long)_width; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) + #endif + cimg_forXZC(*this,x,z,c) { T *ptrX = data(x,0,z,c); _cimg_deriche_apply; } + } break; + case 'z' : { + const int N = _depth; + const unsigned long off = (unsigned long)_width*_height; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) + #endif + cimg_forXYC(*this,x,y,c) { T *ptrX = data(x,y,0,c); _cimg_deriche_apply; } + } break; + default : { + const int N = _spectrum; + const unsigned long off = (unsigned long)_width*_height*_depth; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) + #endif + cimg_forXYZ(*this,x,y,z) { T *ptrX = data(x,y,z,0); _cimg_deriche_apply; } + } + } +@@ -25663,31 +25668,31 @@ namespace cimg_library_suffixed { switch (naxis) { case 'x' : { #ifdef cimg_use_openmp --#pragma omp parallel for collapse(3) -+#pragma omp parallel for COLLAPSE(3) +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) #endif - cimg_forYZC(*this,y,z,c) _cimg_recursive_apply<4>(data(0,y,z,c),filter,_width,1U,order,boundary_conditions); + cimg_forYZC(*this,y,z,c) + _cimg_recursive_apply<4>(data(0,y,z,c),filter,_width,1U,order,boundary_conditions); } break; case 'y' : { #ifdef cimg_use_openmp --#pragma omp parallel for collapse(3) -+#pragma omp parallel for COLLAPSE(3) +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) #endif - cimg_forXZC(*this,x,z,c) _cimg_recursive_apply<4>(data(x,0,z,c),filter,_height,(unsigned long)_width,order,boundary_conditions); + cimg_forXZC(*this,x,z,c) + _cimg_recursive_apply<4>(data(x,0,z,c),filter,_height,(unsigned long)_width,order,boundary_conditions); } break; case 'z' : { #ifdef cimg_use_openmp --#pragma omp parallel for collapse(3) -+#pragma omp parallel for COLLAPSE(3) +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) #endif - cimg_forXYC(*this,x,y,c) _cimg_recursive_apply<4>(data(x,y,0,c),filter,_depth,(unsigned long)(_width*_height),order,boundary_conditions); + cimg_forXYC(*this,x,y,c) + _cimg_recursive_apply<4>(data(x,y,0,c),filter,_depth,(unsigned long)(_width*_height), + order,boundary_conditions); } break; default : { #ifdef cimg_use_openmp --#pragma omp parallel for collapse(3) -+#pragma omp parallel for COLLAPSE(3) +-#pragma omp parallel for collapse(3) if (_width>=256 && _height*_depth*_spectrum>=16) ++#pragma omp parallel for COLLAPSE(3) if (_width>=256 && _height*_depth*_spectrum>=16) #endif - cimg_forXYZ(*this,x,y,z) _cimg_recursive_apply<4>(data(x,y,z,0),filter,_spectrum,(unsigned long)(_width*_height*_depth),order,boundary_conditions); - } - } + cimg_forXYZ(*this,x,y,z) + _cimg_recursive_apply<4>(data(x,y,z,0),filter,_spectrum,(unsigned long)(_width*_height*_depth), + order,boundary_conditions); +@@ -25850,9 +25855,9 @@ namespace cimg_library_suffixed { + *(pd3++) = (Tfloat)n; + } + + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=256 && _height*_depth>=2) firstprivate(val) ++#pragma omp parallel for COLLAPSE(2) if (_width>=256 && _height*_depth>=2) firstprivate(val) + #endif + cimg_forXYZ(*this,x,y,z) { + val.fill(0); + const float +@@ -26325,9 +26330,9 @@ namespace cimg_library_suffixed { + default : { + const int psize2 = (int)patch_size/2, psize1 = (int)patch_size - psize2 - 1; + if (is_fast_approx) + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (res._width>=32 && res._height*res._depth>=4) private(P,Q) ++#pragma omp parallel for COLLAPSE(2) if (res._width>=32 && res._height*res._depth>=4) private(P,Q) + #endif + cimg_forXYZ(res,x,y,z) { // Fast + P = img.get_crop(x - psize1,y - psize1,z - psize1,x + psize2,y + psize2,z + psize2,true); + const int x0 = x - rsize1, y0 = y - rsize1, z0 = z - rsize1, +@@ -26345,9 +26350,9 @@ namespace cimg_library_suffixed { + if (sum_weights>0) cimg_forC(res,c) res(x,y,z,c)/=sum_weights; + else cimg_forC(res,c) res(x,y,z,c) = (Tfloat)((*this)(x,y,z,c)); + } else + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (res._width>=32 && res._height*res._depth>=4) firstprivate(P,Q) ++#pragma omp parallel for COLLAPSE(2) if (res._width>=32 && res._height*res._depth>=4) firstprivate(P,Q) + #endif + cimg_forXYZ(res,x,y,z) { // Exact + P = img.get_crop(x - psize1,y - psize1,z - psize1,x + psize2,y + psize2,z + psize2,true); + const int x0 = x - rsize1, y0 = y - rsize1, z0 = z - rsize1, +@@ -26444,9 +26449,9 @@ namespace cimg_library_suffixed { + const int hl = n/2, hr = hl - 1 + n%2; + if (res._depth!=1) { // 3d + if (threshold>0) + #if cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=16 && _height*_depth*_spectrum>=4) ++#pragma omp parallel for COLLAPSE(3) if (_width>=16 && _height*_depth*_spectrum>=4) + #endif + cimg_forXYZC(*this,x,y,z,c) { // With threshold. + const int + x0 = x - hl, y0 = y - hl, z0 = z-hl, x1 = x + hr, y1 = y + hr, z1 = z+hr, +@@ -26461,9 +26466,9 @@ namespace cimg_library_suffixed { + res(x,y,z,c) = values.get_shared_points(0,nb_values-1).median(); + } + else + #if cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width>=16 && _height*_depth*_spectrum>=4) ++#pragma omp parallel for COLLAPSE(3) if (_width>=16 && _height*_depth*_spectrum>=4) + #endif + cimg_forXYZC(*this,x,y,z,c) { // Without threshold. + const int + x0 = x - hl, y0 = y - hl, z0 = z-hl, x1 = x + hr, y1 = y + hr, z1 = z+hr, +@@ -26475,9 +26480,9 @@ namespace cimg_library_suffixed { + #define _cimg_median_sort(a,b) if ((a)>(b)) cimg::swap(a,b) + if (res._height!=1) { // 2d + if (threshold>0) + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=16 && _height*_spectrum>=4) ++#pragma omp parallel for COLLAPSE(2) if (_width>=16 && _height*_spectrum>=4) + #endif + cimg_forXYC(*this,x,y,c) { // With threshold. + const int + x0 = x - hl, y0 = y - hl, x1 = x + hr, y1 = y + hr, +@@ -26559,9 +26564,9 @@ namespace cimg_library_suffixed { + } + } break; + default : { + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=16 && _height*_spectrum>=4) ++#pragma omp parallel for COLLAPSE(2) if (_width>=16 && _height*_spectrum>=4) + #endif + cimg_forXYC(*this,x,y,c) { + const int + x0 = x - hl, y0 = y - hl, x1 = x + hr, y1 = y + hr, +@@ -26645,9 +26650,9 @@ namespace cimg_library_suffixed { + if (sharpen_type) { // Shock filters. + CImg G = (alpha>0?get_blur(alpha).get_structure_tensors():get_structure_tensors()); + if (sigma>0) G.blur(sigma); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=32 && _height*_depth>=16) ++#pragma omp parallel for COLLAPSE(2) if (_width>=32 && _height*_depth>=16) + #endif + cimg_forYZ(G,y,z) { + Tfloat *ptrG0 = G.data(0,y,z,0), *ptrG1 = G.data(0,y,z,1), + *ptrG2 = G.data(0,y,z,2), *ptrG3 = G.data(0,y,z,3); +@@ -26864,9 +26869,9 @@ namespace cimg_library_suffixed { + } + } else switch (scheme) { // 2d. + case -1 : { // Backward finite differences. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = grad[0]._data + off, *ptrd1 = grad[1]._data + off; +@@ -26878,9 +26883,9 @@ namespace cimg_library_suffixed { + } + } break; + case 1 : { // Forward finite differences. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = grad[0]._data + off, *ptrd1 = grad[1]._data + off; +@@ -26892,9 +26897,9 @@ namespace cimg_library_suffixed { + } + } break; + case 2 : { // Sobel scheme. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = grad[0]._data + off, *ptrd1 = grad[1]._data + off; +@@ -26906,9 +26911,9 @@ namespace cimg_library_suffixed { + } + } break; + case 3 : { // Rotation invariant mask. + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = grad[0]._data + off, *ptrd1 = grad[1]._data + off; +@@ -26929,9 +26934,9 @@ namespace cimg_library_suffixed { + grad[1] = get_vanvliet(0,1,'y'); + } break; + default : { // Central finite differences + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = grad[0]._data + off, *ptrd1 = grad[1]._data + off; +@@ -26994,9 +26999,9 @@ namespace cimg_library_suffixed { + } + } + } else if (!cimg::strcasecmp(naxes,def_axes2d)) { // 2d + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + const unsigned long off = c*_width*_height*_depth + z*_width*_height; + Tfloat *ptrd0 = res[0]._data + off, *ptrd1 = res[1]._data + off, *ptrd2 = res[2]._data + off; +@@ -27014,9 +27019,9 @@ namespace cimg_library_suffixed { + bool valid_axis = false; + if (axis1=='x' && axis2=='x') { // Ixx + valid_axis = true; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + Tfloat *ptrd = res[l2].data(0,0,z,c); + CImg_3x3(I,Tfloat); +@@ -27025,9 +27030,9 @@ namespace cimg_library_suffixed { + } + else if (axis1=='x' && axis2=='y') { // Ixy + valid_axis = true; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + Tfloat *ptrd = res[l2].data(0,0,z,c); + CImg_3x3(I,Tfloat); +@@ -27047,9 +27052,9 @@ namespace cimg_library_suffixed { + } + else if (axis1=='y' && axis2=='y') { // Iyy + valid_axis = true; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) ++#pragma omp parallel for COLLAPSE(2) if (_width*_height>=1048576 && _depth*_spectrum>=2) + #endif + cimg_forZC(*this,z,c) { + Tfloat *ptrd = res[l2].data(0,0,z,c); + CImg_3x3(I,Tfloat); +@@ -27290,9 +27295,9 @@ namespace cimg_library_suffixed { + + if (_depth>1) { // 3d + get_structure_tensors().move_to(res).blur(sigma); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if(_width>=256 && _height*_depth>=256) ++#pragma omp parallel for COLLAPSE(2) if(_width>=256 && _height*_depth>=256) + #endif + cimg_forYZ(*this,y,z) { + Tfloat + *ptrd0 = res.data(0,y,z,0), *ptrd1 = res.data(0,y,z,1), *ptrd2 = res.data(0,y,z,2), +@@ -27610,9 +27615,9 @@ namespace cimg_library_suffixed { + cimg_forC(*this,c) { + CImg g(_width), dt(_width), s(_width), t(_width); + CImg img = get_shared_channel(c); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_width>=512 && _height*_depth>=16) firstprivate(g,dt,s,t) ++#pragma omp parallel for COLLAPSE(2) if (_width>=512 && _height*_depth>=16) firstprivate(g,dt,s,t) + #endif + cimg_forYZ(*this,y,z) { // Over X-direction. + cimg_forX(*this,x) g[x] = (long)img(x,y,z,0,wh); + _distance_scan(_width,g,sep,f,s,t,dt); +@@ -27620,9 +27625,9 @@ namespace cimg_library_suffixed { + } + if (_height>1) { + g.assign(_height); dt.assign(_height); s.assign(_height); t.assign(_height); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_height>=512 && _width*_depth>=16) firstprivate(g,dt,s,t) ++#pragma omp parallel for COLLAPSE(2) if (_height>=512 && _width*_depth>=16) firstprivate(g,dt,s,t) + #endif + cimg_forXZ(*this,x,z) { // Over Y-direction. + cimg_forY(*this,y) g[y] = (long)img(x,y,z,0,wh); + _distance_scan(_height,g,sep,f,s,t,dt); +@@ -27631,9 +27636,9 @@ namespace cimg_library_suffixed { + } + if (_depth>1) { + g.assign(_depth); dt.assign(_depth); s.assign(_depth); t.assign(_depth); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if (_depth>=512 && _width*_height>=16) firstprivate(g,dt,s,t) ++#pragma omp parallel for COLLAPSE(2) if (_depth>=512 && _width*_height>=16) firstprivate(g,dt,s,t) + #endif + cimg_forXY(*this,x,y) { // Over Z-direction. + cimg_forZ(*this,z) g[z] = (long)img(x,y,z,0,wh); + _distance_scan(_depth,g,sep,f,s,t,dt); +@@ -27662,9 +27667,9 @@ namespace cimg_library_suffixed { + #endif + cimg_forC(*this,c) { + CImg img = get_shared_channel(c); + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(3) if (_width*_height*_depth>=1024) ++#pragma omp parallel for COLLAPSE(3) if (_width*_height*_depth>=1024) + #endif + cimg_forXYZ(metric_mask,dx,dy,dz) { + const t weight = metric_mask(dx,dy,dz); + if (weight) { +@@ -35380,9 +35385,9 @@ namespace cimg_library_suffixed { + _y0 = y0<0?0:y0>=height()?height()-1:y0, + _x1 = x1<0?1:x1>=width()?width()-1:x1, + _y1 = y1<0?1:y1>=height()?height()-1:y1; + #ifdef cimg_use_openmp +-#pragma omp parallel for collapse(2) if ((1+_x1-_x0)*(1+_y1-_y0)>=2048) ++#pragma omp parallel for COLLAPSE(2) if ((1+_x1-_x0)*(1+_y1-_y0)>=2048) + #endif + for (int q = _y0; q<=_y1; ++q) + for (int p = _x0; p<=_x1; ++p) { + unsigned int iteration = 0; +Index: gmic-1.6.0.0/src/gmic.cpp +=================================================================== +--- gmic-1.6.0.0.orig/src/gmic.cpp ++++ gmic-1.6.0.0/src/gmic.cpp +@@ -41,8 +41,17 @@ + # knowledge of the CeCILL license and that you accept its terms. + # + */ + ++#ifdef cimg_use_openmp ++#include ++#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) ++#define _COLLAPSE(x) collapse(x) ++#else ++#define _COLLAPSE(x) ++#endif ++#endif ++ + // Add G'MIC-specific methods to the CImg library. + //------------------------------------------------ + #ifdef cimg_plugin + +@@ -78,9 +87,9 @@ CImg get_gmic_invert_endianness(const + } + + template + CImg& operator_eq(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd == (T)val); + return *this; +@@ -101,9 +110,9 @@ CImg& operator_eq(const char *const e + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd == (T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -138,9 +147,9 @@ CImg& operator_eq(const CImg& img) + } + + template + CImg& operator_neq(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd != (T)val); + return *this; +@@ -161,9 +170,9 @@ CImg& operator_neq(const char *const + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd != (T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -198,9 +207,9 @@ CImg& operator_neq(const CImg& img + } + + template + CImg& operator_gt(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd > (T)val); + return *this; +@@ -221,9 +230,9 @@ CImg& operator_gt(const char *const e + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd > (T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -258,9 +267,9 @@ CImg& operator_gt(const CImg& img) + } + + template + CImg& operator_ge(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd >= (T)val); + return *this; +@@ -281,9 +290,9 @@ CImg& operator_ge(const char *const e + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd >= (T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -318,9 +327,9 @@ CImg& operator_ge(const CImg& img) + } + + template + CImg& operator_lt(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd < (T)val); + return *this; +@@ -341,9 +350,9 @@ CImg& operator_lt(const char *const e + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd < (T)lmp(x,y,z,c)); ++ptrd; } + } +@@ -378,9 +387,9 @@ CImg& operator_lt(const CImg& img) + } + + template + CImg& operator_le(const t val) { +-#ifdef cimg_use_openmp ++#if defined(cimg_use_openmp) && !(defined(__GNUC__) && __GNUC__ == 4 && __GNUC_MINOR__ <= 3) + #pragma omp parallel for if (size()>=131072) + #endif + cimg_rof(*this,ptrd,T) *ptrd = (T)(*ptrd <= (T)val); + return *this; +@@ -401,9 +410,9 @@ CImg& operator_le(const char *const e + if (_width>=512 && _height*_depth*_spectrum>=2 && std::strlen(expression)>=6) + #pragma omp parallel + { + _cimg_math_parser _mp = omp_get_thread_num()?mp:_cimg_math_parser(), &lmp = omp_get_thread_num()?_mp:mp; +-#pragma omp for collapse(3) ++#pragma omp for _COLLAPSE(3) + cimg_forYZC(*this,y,z,c) { + T *ptrd = data(0,y,z,c); + cimg_forX(*this,x) { *ptrd = (T)(*ptrd <= (T)lmp(x,y,z,c)); ++ptrd; } + } diff --git a/gmic-openmp.diff b/gmic-openmp.diff index 0525bd9..33b06d4 100644 --- a/gmic-openmp.diff +++ b/gmic-openmp.diff @@ -1,33 +1,18 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -209,8 +209,11 @@ FFTW_LDFLAGS = -lfftw3 -lfftw3_threads - ifeq ($(OSTYPE),msys) - FFTW_LDFLAGS = -lfftw3-3 - endif - -+OPENMP_CFLAGS = -fopenmp -Dcimg_use_openmp -+OPENMP_LDFLAGS = -fopenmp -+ - # Flags to enable the use of the BOARD library. - # This requires the presence of the BOARD include and library files. - # (no packages exist for Debian at this time). - BOARD_CFLAGS = -Dcimg_use_board -@@ -222,12 +225,14 @@ BOARD_LDFLAGS = -lboard - - # Unix : Standard build. - STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ -- $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) -+ $(EXR_CFLAGS) $(FFTW_CFLAGS) $(OPENMP_CFLAGS) \ -+ # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) - STD_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) $(PNG_LDFLAGS) \ - $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(ZLIB_LDFLAGS) \ -- $(EXR_LDFLAGS) $(FFTW_LDFLAGS) # $(OPENCV_LDFLAGS) $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) -+ $(EXR_LDFLAGS) $(FFTW_LDFLAGS) $(OPENMP_LDFLAGS) \ -+ # $(OPENCV_LDFLAGS) $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) - - # Unix : Minimal build. - MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) \ - ${TIFF_CFLAGS} ${PNG_CFLAGS} $(ZLIB_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -121,11 +121,13 @@ endif + ifneq ($(OS),Darwin) + CHECKIMAGE_CFLAGS = -Dgmic_check_image + endif + ++ifndef NO_OPENMP + # Flags to enable parallelization using OpenMP. + OPENMP_CFLAGS = -fopenmp -Dcimg_use_openmp + OPENMP_LIBS = -lgomp ++endif + + # Flags to enable image display, using X11 + # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). + # This requires the presence of the X11 include and library files. diff --git a/gmic-opt-parallel-make.diff b/gmic-opt-parallel-make.diff deleted file mode 100644 index 4efebe2..0000000 --- a/gmic-opt-parallel-make.diff +++ /dev/null @@ -1,15 +0,0 @@ -Index: gmic-1.5.8.4/src/Makefile -=================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -395,9 +395,9 @@ gmic_int.o: gmic.cpp - gmic_float.o: gmic.cpp - $(CC) -o gmic_float.o -c gmic.cpp $(CFLAGS) -Dgmic_split_compilation -Dgmic_float -Dgmic_main - gmic_double.o: gmic.cpp - $(CC) -o gmic_double.o -c gmic.cpp $(CFLAGS) -Dgmic_split_compilation -Dgmic_double --gmic_cli_alltypes: gmic_bool.o gmic_uchar.o gmic_char.o gmic_ushort.o gmic_short.o gmic_uint.o gmic_int.o gmic_float.o gmic_double.o gmic_def.h -+gmic_cli_alltypes: gmic_float.o gmic_uchar.o gmic_char.o gmic_uint.o gmic_int.o gmic_double.o gmic_bool.o gmic_ushort.o gmic_short.o gmic_def.h - $(CC) -o gmic gmic_bool.o gmic_uchar.o gmic_char.o gmic_ushort.o gmic_short.o gmic_uint.o gmic_int.o gmic_float.o gmic_double.o $(LDFLAGS) - strip gmic$(EXE) - - gmic_cli_standard: gmic.cpp diff --git a/gmic-overflow.diff b/gmic-overflow.diff index d93ac81..a95f0cc 100644 --- a/gmic-overflow.diff +++ b/gmic-overflow.diff @@ -1,9 +1,8 @@ -Index: gmic-1.5.8.4/src/CImg.h +Index: gmic-1.6.0.0/src/CImg.h =================================================================== ---- gmic-1.5.8.4.orig/src/CImg.h -+++ gmic-1.5.8.4/src/CImg.h -@@ -45929,9 +45929,9 @@ namespace cimg_library_suffixed { - filename?filename:"(FILE*)"); +--- gmic-1.6.0.0.orig/src/CImg.h ++++ gmic-1.6.0.0/src/CImg.h +@@ -48529,7 +48529,7 @@ namespace cimg_library_suffixed { #endif std::FILE *const nfile = file?file:cimg::fopen(filename,"wb"); const char *const ptype = pixel_type(), *const etype = cimg::endianness()?"big":"little"; @@ -12,4 +11,3 @@ Index: gmic-1.5.8.4/src/CImg.h else std::fprintf(nfile,"%u %s %s_endian\n",_width,ptype,etype); cimglist_for(*this,l) { const CImg& img = _data[l]; - std::fprintf(nfile,"%u %u %u %u",img._width,img._height,img._depth,img._spectrum); diff --git a/gmic-unstrip.diff b/gmic-unstrip.diff index b885e13..213d24a 100644 --- a/gmic-unstrip.diff +++ b/gmic-unstrip.diff @@ -1,37 +1,22 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -323,9 +323,9 @@ lib: - QMAKE = qmake - - zart: lib - ifneq ($(OS),Darwin) -- cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip zart -+ cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip -S zart - else - cd ../zart && $(QMAKE) zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_MACOSX_LDFLAGS) $(OPT_LDFLAGS)" - endif - -@@ -375,9 +375,9 @@ endif - gmic_gimp.o: gmic.cpp gmic_def.h - $(CC) -o gmic_gimp.o -c gmic.cpp $(CFLAGS) -Dgmic_gimp -Dgmic_float_only - gmic_gimp : gmic_gimp.o gmic_gimp.cpp - $(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) `gimptool-2.0$(EXE) --libs` $(LDFLAGS) -- strip gmic_gimp$(EXE) -+ strip -S gmic_gimp$(EXE) - - gmic_bool.o: gmic.cpp - $(CC) -o gmic_bool.o -c gmic.cpp $(CFLAGS) -Dgmic_split_compilation -Dgmic_bool - gmic_uchar.o: gmic.cpp -@@ -397,9 +397,9 @@ gmic_float.o: gmic.cpp - gmic_double.o: gmic.cpp - $(CC) -o gmic_double.o -c gmic.cpp $(CFLAGS) -Dgmic_split_compilation -Dgmic_double - gmic_cli_alltypes: gmic_float.o gmic_uchar.o gmic_char.o gmic_uint.o gmic_int.o gmic_double.o gmic_bool.o gmic_ushort.o gmic_short.o gmic_def.h - $(CC) -o gmic gmic_bool.o gmic_uchar.o gmic_char.o gmic_ushort.o gmic_short.o gmic_uint.o gmic_int.o gmic_float.o gmic_double.o $(LDFLAGS) -- strip gmic$(EXE) -+ strip -S gmic$(EXE) - - gmic_cli_standard: gmic.cpp - $(CC) -o gmic gmic.cpp $(CFLAGS) -Dgmic_float_only -Dgmic_main $(LDFLAGS) - +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -317,7 +317,7 @@ QMAKE = qmake + + zart: lib + ifneq ($(OS),Darwin) +- cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip zart ++ cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip -S zart + else + cd ../zart && $(QMAKE) zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "SUBLIBS=$(STD_MACOSX_LIBS) $(OPT_LIBS)" + endif +@@ -363,7 +363,7 @@ gmic_gimp.o: gmic.cpp CImg.h + $(CC) -o gmic_gimp.o -c gmic.cpp $(CFLAGS) -Dgmic_gimp + gmic_gimp : gmic_gimp.o gmic_gimp.cpp + $(CC) -o gmic_gimp gmic_gimp.cpp gmic_gimp.o `gimptool-2.0$(EXE) --cflags` $(CFLAGS) `gimptool-2.0$(EXE) --libs` $(LIBS) +- strip gmic_gimp$(EXE) ++ strip -S gmic_gimp$(EXE) + + gmic: gmic.cpp gmic.h CImg.h + $(CC) -o gmic gmic.cpp $(CFLAGS) -Dgmic_main $(LIBS) diff --git a/gmic-x11opts.diff b/gmic-x11opts.diff index 5fe86aa..20f8b3e 100644 --- a/gmic-x11opts.diff +++ b/gmic-x11opts.diff @@ -1,43 +1,39 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -122,10 +122,10 @@ endif - # Flags to enable image display, using X11 - # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). - # This requires the presence of the X11 include and library files. - # (package 'libx11-dev' on Debian). --X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr --X11_LDFLAGS = -L/usr/X11R6/$(LIB) -lX11 -lpthread #-lXrandr -+X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include -Dcimg_use_xrandr -+X11_LDFLAGS = -L/usr/X11R6/$(LIB) -lX11 -lpthread -lXrandr - - # Flags to enable fast display, using XShm. - # This requires the presence of the X11 extension include and library files. - # (package 'libx11-dev' on Debian). -@@ -220,19 +220,19 @@ BOARD_LDFLAGS = -lboard - # Predefined sets of flags for different default configurations. - #---------------------------------------------------------------- - - # Unix : Standard build. --STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(X11_CFLAGS) $(PNG_CFLAGS) \ -+STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ - $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ -- $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(XSHM_CFLAGS) $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) --STD_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) $(PNG_LDFLAGS) \ -+ $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) -+STD_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) $(PNG_LDFLAGS) \ - $(JPEG_LDFLAGS) $(TIFF_LDFLAGS) $(ZLIB_LDFLAGS) \ -- $(EXR_LDFLAGS) $(FFTW_LDFLAGS) # $(XSHM_LDFLAGS) $(OPENCV_LDFLAGS) $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) -+ $(EXR_LDFLAGS) $(FFTW_LDFLAGS) # $(OPENCV_LDFLAGS) $(FFMPEG_LDFLAGS) # $(MAGICK_LDFLAGS) - - # Unix : Minimal build. --MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) \ -+MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(CHECKIMAGE_CFLAGS) $(PARALLEL_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) \ - ${TIFF_CFLAGS} ${PNG_CFLAGS} $(ZLIB_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) --MINIMAL_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) \ -+MINIMAL_UNIX_LDFLAGS = $(MANDATORY_LDFLAGS) $(PARALLEL_LDFLAGS) $(X11_LDFLAGS) $(XSHM_LDFLAGS) \ - ${TIFF_LDFLAGS} ${PNG_LDFLAGS} $(ZLIB_LDFLAGS) $(FFTW_LDFLAGS) # $(OPENCV_LDFLAGS) - - # Unix : Static build. - STATIC_PATH = /usr/$(LIB)/ +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -130,8 +130,8 @@ OPENMP_LIBS = -lgomp + # (keep /usr/ dirname here since X11 is located in /usr/ on Mac too). + # This requires the presence of the X11 include and library files. + # (package 'libx11-dev' on Debian). +-X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include #-Dcimg_use_xrandr +-X11_LIBS = -L/usr/X11R6/$(LIB) -lX11 -lpthread #-lXrandr ++X11_CFLAGS = -Dcimg_display=1 -Dcimg_appname=\\\"gmic\\\" -I/usr/X11R6/include -Dcimg_use_xrandr ++X11_LIBS = -L/usr/X11R6/$(LIB) -lX11 -lpthread -lXrandr + + # Flags to enable fast display, using XShm. + # This requires the presence of the X11 extension include and library files. +@@ -228,17 +228,17 @@ BOARD_LIBS = -lboard + #---------------------------------------------------------------- + + # Unix : Standard build. +-STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(X11_CFLAGS) $(PNG_CFLAGS) \ ++STD_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) $(PNG_CFLAGS) \ + $(JPEG_CFLAGS) $(TIFF_CFLAGS) $(ZLIB_CFLAGS) \ +- $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(XSHM_CFLAGS) $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) +-STD_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(OPENMP_LIBS) $(X11_LIBS) $(PNG_LIBS) \ ++ $(EXR_CFLAGS) $(FFTW_CFLAGS) # $(OPENCV_CFLAGS) $(FFMPEG_CFLAGS) # $(MAGICK_CFLAGS) ++STD_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(OPENMP_LIBS) $(X11_LIBS) $(XSHM_LIBS) $(PNG_LIBS) \ + $(JPEG_LIBS) $(TIFF_LIBS) $(ZLIB_LIBS) \ +- $(EXR_LIBS) $(FFTW_LIBS) # $(XSHM_LIBS) $(OPENCV_LIBS) $(FFMPEG_LIBS) # $(MAGICK_LIBS) ++ $(EXR_LIBS) $(FFTW_LIBS) # $(OPENCV_LIBS) $(FFMPEG_LIBS) # $(MAGICK_LIBS) + + # Unix : Minimal build. +-MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) \ ++MINIMAL_UNIX_CFLAGS = $(MANDATORY_CFLAGS) $(PARALLEL_CFLAGS) $(OPENMP_CFLAGS) $(DEBUG_CFLAGS) $(X11_CFLAGS) $(XSHM_CFLAGS) \ + ${TIFF_CFLAGS} ${PNG_CFLAGS} $(ZLIB_CFLAGS) $(FFTW_CFLAGS) $(CHECKIMAGE_CFLAGS) # $(OPENCV_CFLAGS) +-MINIMAL_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(OPENMP_LIBS) $(X11_LIBS) \ ++MINIMAL_UNIX_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(OPENMP_LIBS) $(X11_LIBS) $(XSHM_LIBS) \ + ${TIFF_LIBS} ${PNG_LIBS} $(ZLIB_LIBS) $(FFTW_LIBS) # $(OPENCV_LIBS) + + # Unix : Static build. diff --git a/gmic-zart-qmake.diff b/gmic-zart-qmake.diff index 5a98e5c..67fae23 100644 --- a/gmic-zart-qmake.diff +++ b/gmic-zart-qmake.diff @@ -1,22 +1,20 @@ -Index: gmic-1.5.8.4/src/Makefile +Index: gmic-1.6.0.0/src/Makefile =================================================================== ---- gmic-1.5.8.4.orig/src/Makefile -+++ gmic-1.5.8.4/src/Makefile -@@ -319,13 +319,15 @@ gimp: - - lib: - $(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS+=$(STD_LIB_LDFLAGS) $(OPT_LDFLAGS)" gmic_lib - -+QMAKE = qmake -+ - zart: lib - ifneq ($(OS),Darwin) -- cd ../zart && qmake-qt4 zart.pro && $(MAKE) && strip zart -+ cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip zart - else -- cd ../zart && qmake zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_MACOSX_LDFLAGS) $(OPT_LDFLAGS)" -+ cd ../zart && $(QMAKE) zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "LDFLAGS=$(STD_MACOSX_LDFLAGS) $(OPT_LDFLAGS)" - endif - - # Entries for other configurations. - gmicol: +--- gmic-1.6.0.0.orig/src/Makefile ++++ gmic-1.6.0.0/src/Makefile +@@ -313,11 +313,13 @@ gimp: + lib: + $(MAKE) "CFLAGS=$(STD_LIB_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(STD_LIB_LIBS) $(OPT_LIBS)" gmic_lib + ++QMAKE = qmake ++ + zart: lib + ifneq ($(OS),Darwin) +- cd ../zart && qmake-qt4 zart.pro && $(MAKE) && strip zart ++ cd ../zart && $(QMAKE) zart.pro && $(MAKE) && strip zart + else +- cd ../zart && qmake zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "SUBLIBS=$(STD_MACOSX_LIBS) $(OPT_LIBS)" ++ cd ../zart && $(QMAKE) zart.pro && $(MAKE) "CFLAGS=$(STD_MACOSX_CFLAGS) $(OPT_CFLAGS)" "SUBLIBS=$(STD_MACOSX_LIBS) $(OPT_LIBS)" + endif + + # Entries for other configurations. diff --git a/gmic.changes b/gmic.changes index 8dead19..a4851d1 100644 --- a/gmic.changes +++ b/gmic.changes @@ -1,3 +1,82 @@ +------------------------------------------------------------------- +Sun Sep 7 12:08:18 CEST 2014 - kurt@garloff.de + +- Add more workarounds for limited openMP support in gcc-4.3. +- Disable openMP for gcc-4.8.1 (openSUSE-13.1, FC19/20); it produces + ICEs (see https://bugzilla.redhat.com/show_bug.cgi?id=1107972). + +------------------------------------------------------------------- +Sat Sep 6 23:59:57 CEST 2014 - kurt@garloff.de + +- Update to gmic-1.6.0.0: + * New commands -pass, -noargs, -is_image_arg, -gimp_error_preview, + -outputx (-ox), -names (-nms), -mul_channels. -oneminus. + * Source ~/.gmic on startup. + * Colors for gmic -h (with bash). + * New filters Film emulation / Various (color presets) and + Details / Mighty details. + * New filters for zart. + * Only support image datatypes with floats (thus remove -type), + but optionally do conversion in -input and -output. + * Supply boundary values in -map derived with + neumann/dirichlet/periodic. + * More -blend paramaters. + * -apply_pose3d renamed to -pose3d. + * Remove -background3d (use enahnced -display3d and -snapshot3d + to replace). + * Better exception handling (-onfail). + * gmic -h command suggests corrections for misspelled cmds. + * -median support thresholds. + * -threshold2 (-t2) renames to -inrange (-ir). + * Bugfixes for merging very large 3d objects, spurious EOF on + stdout with -output, maintaining shared state with -keep, + -erode and -dilate, line number of errors. +- Update to gmic-1.5.9.3: + * Official support for parallelization with OpenMP. + * New commands -variance_patch and -skeleton3d. + * New filter Artistic / Circle abstraction. + * Shortcuts for -and (-&) and -or (-|). + * Bugfix loading .tiff with 3 channels signed char. +- Update to gmic-1.5.9.2: + * New filter Artistic / Cutout. + * Speedup of complex math evaluations. + * Improvements on -circles3d and -primitives3d. + * Default window sizes (3d) now based on screen size. + * Adjust down GIMP preview size. +- Update to gmic-1.5.9.1: + * New command -seamcarve (Deformation / Seamcarve). + * New command -montage (Arrays & tiles / Montage). + * New command -inpaint_holes (Repair / Inpaint [holes]). + * -window now normalizes images individually. + * multipage TIFF output with is_multipage. + * remove slow image pointer check. + * -discard optimization. + * bug fix with -structuretensors (2d, scheme=1). +- Update to gmic-1.5.9.0: + * New command -blend_seamless (Layers / Blend [seamless]). + * New commands -sub_alpha and -montage. + * New filter Details / Split details [layers]. + * Larger default preview in GIMP plugin. + * Fixes for -split, -histogram, -equalize, -graph, -display +- Update to gmic-1.5.8.6: + * New plugins Film emulation / Add grain. + * New command -syntexturize (Patterns / Resynthesize texture). + * New command -fractalize (Artistic / Fractalize). + * New command -img2ascii (Arrays & tiles / Ascii art). + * New command -periodize_poisson (Patterns / Make seamless). + * New command -x_2048 -- launches famour 2048 game. + * Bug fixes for -minimal_path and -test + * @{-1,t} now always returns a string + * Disable sharing global vars between threads + * -uncommand and -command improvements +- Update to gmic-1.5.8.5 + * Support for PANDORE-5 (.pan) output files. + * Improve and optmize -replace-seq. + * Support for is_binary_data and maximum_sequence_length in + -compress-rle. + * Recoded and improved -text. + * Bugfixes for -output and math expressions starting with < or >. + ------------------------------------------------------------------- Sat Mar 8 19:47:38 CET 2014 - kurt@garloff.de diff --git a/gmic.spec b/gmic.spec index 88721cb..0d6f088 100644 --- a/gmic.spec +++ b/gmic.spec @@ -16,64 +16,64 @@ # -Name: gmic -Version: 1.5.8.4 -Release: 0 -Url: http://gmic.sourceforge.net/ -Source: %{name}_%{version}.tar.bz2 -Source1: http://gmic.sourceforge.net/gmic_reference.pdf -Patch1: gmic-cflags.diff -Patch2: gmic-docdir.diff -Patch3: gmic-overflow.diff -Patch10: gmic-x11opts.diff -Patch11: gmic-openmp.diff -Patch12: gmic-openmp-gcc43.diff -Patch15: gmic-opencv.diff -Patch16: gmic-opencv-old.diff -Patch17: gmic-magick.diff -Patch20: gmic-zart-qmake.diff -Patch21: gmic-make-zart.diff -Patch30: gmic-opt-parallel-make.diff -Patch31: gmic-unstrip.diff -Summary: GREYC's Magick for Image Computing (denoise and others) -License: CECILL v.2.0 (GPL compatible) -Group: Productivity/Graphics/Bitmap Editors -Prefix: /usr -BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: OpenEXR-devel -BuildRequires: dos2unix -BuildRequires: fftw3-devel -BuildRequires: gcc-c++ -BuildRequires: libqt4-devel -BuildRequires: libstdc++-devel -BuildRequires: procps +Name: gmic +Version: 1.6.0.0 +Release: 0 +Group: Productivity/Graphics/Bitmap Editors +URL: http://gmic.sourceforge.net/ +Packager: kurt@garloff.de +Source: %{name}_%{version}.tar.bz2 +Source1: http://gmic.sourceforge.net/gmic_reference.pdf +Patch1: gmic-cflags.diff +Patch2: gmic-docdir.diff +Patch3: gmic-overflow.diff +Patch10: gmic-x11opts.diff +Patch11: gmic-openmp.diff +Patch12: gmic-openmp-gcc43.diff +Patch15: gmic-opencv.diff +Patch20: gmic-zart-qmake.diff +Patch21: gmic-make-zart.diff +Patch31: gmic-unstrip.diff +Summary: GREYC's Magick for Image Computing (denoise and others) +License: CECILL v.2.0 (GPL compatible) +Prefix: /usr +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildRequires: procps +BuildRequires: fftw3-devel +BuildRequires: gcc-c++ +BuildRequires: libstdc++-devel +BuildRequires: dos2unix +BuildRequires: OpenEXR-devel +BuildRequires: libqt4-devel %if 0%{?suse_version} >= 1110 -BuildRequires: fftw3-threads-devel -BuildRequires: libjasper1 -BuildRequires: libjpeg-devel -BuildRequires: libtiff-devel +BuildRequires: libjpeg-devel +BuildRequires: libtiff-devel +BuildRequires: fftw3-threads-devel +%if 0%{?suse_version} >= 1120 BuildRequires: opencv-devel -#BuildRequires: GraphicsMagick-devel +BuildRequires: libjasper1 +%endif +#BuildRequires:cuGraphicsMagick-devel %else %if 0%{?fedora_version} > 16 -BuildRequires: jasper-libs -BuildRequires: libjpeg-devel -BuildRequires: libtiff-devel -BuildRequires: opencv-devel +BuildRequires: libjpeg-devel +BuildRequires: libtiff-devel +BuildRequires: opencv-devel +BuildRequires: jasper-libs #BuildRequires: fftw-libs-threads %else %if 0%{?mandriva_version} > 0 -BuildRequires: libtiff-devel +BuildRequires: libtiff-devel %endif %endif %endif %if 0%{?suse_version} == 1030 -BuildRequires: gimp-unstable-devel +BuildRequires: gimp-unstable-devel %else -BuildRequires: gimp-devel +BuildRequires: gimp-devel %endif %if 0%{?sles_version} == 11 -BuildRequires: glib2-branding-SLES +BuildRequires: glib2-branding-SLES %endif %define openSUSE_submit 1 @@ -142,6 +142,7 @@ Group: Productivity/Graphics/Bitmap Editors This is a plugin for gimp that exposes many of the nice gmic features for interactive use in gimp. +%if 0%{?suse_version} == 0 %package zart Summary: Real-time web cam video stream manipulation Group: Productivity/Graphics/Bitmap editors @@ -149,6 +150,17 @@ Group: Productivity/Graphics/Bitmap editors %description zart This program allows you to capture video from a web cam and apply (real time) gmic image manipulations on the video stream. +%else +%if 0%{?suse_version} >= 1120 +%endif +%package zart +Summary: Real-time web cam video stream manipulation +Group: Productivity/Graphics/Bitmap editors + +%description zart +This program allows you to capture video from a web cam and apply +(real time) gmic image manipulations on the video stream. +%endif %package doc Summary: GMIC reference documentation @@ -165,19 +177,17 @@ This is the reference documentation for G'MIC in .pdf format. %patch10 -p1 %patch11 -p1 %patch12 -p1 -# More gmic features ... +# More gmic features ... opencv +%if 0%{?suse_version} > 0 +%if 0%{?suse_version} >= 1120 %patch15 -p1 -%if 0%{?fedora_version} > 16 -#nothing -%else -%if 0%{?suse_version} < 1100 -%patch16 -p1 %endif +%else +%patch15 -p1 %endif #%patch17 -p1 %patch20 -p1 %patch21 -p1 -%patch30 -p1 %patch31 -p1 # Remove build time references so build-compare can do its work FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M') @@ -200,7 +210,11 @@ cp -p %{SOURCE1} . %build RPM_OPT_FLAGS="`echo $RPM_OPT_FLAGS | sed 's/-fstack-protector//'`" -RPM_OPT_FLAGS="$RPM_OPT_FLAGS -O3 -ffast-math -ftree-vectorize" +#RPM_OPT_FLAGS="$RPM_OPT_FLAGS -O3 -ffast-math -ftree-vectorize" +RPM_OPT_FLAGS="$RPM_OPT_FLAGS -ffast-math" +GCCVER=`gcc -v 2>&1 | tail -n1 | sed -e 's/^gcc version \([^ ]*\) .*$/\1/' -e 's/\.//g'` +if test $GCCVER -ge 480; then RPM_OPT_FLAGS="$RPM_OPT_FLAGS -fno-ipa-sra"; fi +if test $GCCVER -ge 480 -a $GCCVER -le 482; then MAKEFLAGS="NO_OPENMP=1"; fi # Compile times are exorbitant as are, -funroll-loops makes it worse #RPM_OPT_FLAGS="$RPM_OPT_FLAGS -funroll-loops" %ifarch %{ix86} x86_64 @@ -239,17 +253,19 @@ fi #make CFLAGS="$RPM_OPT_FLAGS" cd src %if 0%{?fedora_version} > 16 -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 linux_alltypes -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 gimp lib -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 zart +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 linux +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 gimp lib +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} QMAKE=qmake-qt4 zart %else -%if 0%{?openSUSE_submit} == 0 -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} linux_alltypes +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} linux +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} gimp lib +%if 0%{?suse_version} == 0 +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} zart %else -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} linux +%if 0%{?suse_version} >= 1120 +make $JOBS $MAKEFLAGS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} zart +%endif %endif -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} gimp lib -make $JOBS CFLAGS="$RPM_OPT_FLAGS" LIB=%{_lib} zart %endif #make %{?jobs:-j%jobs} CFLAGS="$RPM_OPT_FLAGS" gimp free -m @@ -262,7 +278,13 @@ make install DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} MANDIR=%{_mandir} LIB=%{_ %if 0%{?fedora_version} > 16 make install-zart DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} MANDIR=%{_mandir} LIB=%{_lib} QMAKE=qmake-qt4 %else +%if 0%{?suse_version} == 0 make install-zart DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} MANDIR=%{_mandir} LIB=%{_lib} +%else +%if 0%{?suse_version} >= 1120 +make install-zart DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} MANDIR=%{_mandir} LIB=%{_lib} +%endif +%endif %endif #mkdir -p $RPM_BUILD_ROOT%{_docdir}/gmic/html #for name in images res js slides thumbs; do @@ -274,7 +296,13 @@ make install-zart DESTDIR=$RPM_BUILD_ROOT DOCDIR=%{_docdir} MANDIR=%{_mandir} LI strip -S $RPM_BUILD_ROOT/usr/bin/gmic strip -S $RPM_BUILD_ROOT/usr/%{_lib}/gimp/2.0/plug-ins/gmic_gimp # ZART +%if 0%{?suse_version} == 0 strip -S $RPM_BUILD_ROOT/usr/bin/zart +%else +%if 0%{?suse_version} >= 1120 +strip -S $RPM_BUILD_ROOT/usr/bin/zart +%endif +%endif # Duplicate man page ... rm $RPM_BUILD_ROOT/%{_mandir}/fr/man1/gmic.1.gz # Reference manual @@ -302,10 +330,19 @@ rm $RPM_BUILD_ROOT/%{_mandir}/fr/man1/gmic.1.gz %doc README COPYING index.html %config %attr(0644,root,root) /etc/bash_completion.d/gmic +%if 0%{?suse_version} == 0 %files zart %defattr(-,root,root) /usr/bin/zart %doc zart/Licence_CeCILL_V2-en.html zart/README.zart +%else +%if 0%{?suse_version} >= 1120 +%files zart +%defattr(-,root,root) +/usr/bin/zart +%doc zart/Licence_CeCILL_V2-en.html zart/README.zart +%endif +%endif %files gimp %defattr(-,root,root) diff --git a/gmic_1.5.8.4.tar.bz2 b/gmic_1.5.8.4.tar.bz2 deleted file mode 100644 index 25d1d55..0000000 --- a/gmic_1.5.8.4.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:18c4fc427b7f620b9143115b4f2b5cb0b2d825c444c6969b19367b038b7fb056 -size 1676335 diff --git a/gmic_1.6.0.0.tar.bz2 b/gmic_1.6.0.0.tar.bz2 new file mode 100644 index 0000000..7157ae4 --- /dev/null +++ b/gmic_1.6.0.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:63b98c5b71c6ac41167416ff6c512d0fc7d39528bd864c1383d7e9bdc7ebd12a +size 1932765 diff --git a/gmic_reference.pdf b/gmic_reference.pdf index a925538..68885d8 100644 --- a/gmic_reference.pdf +++ b/gmic_reference.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e0ea576f2ad1a444b9559025bb31f984b8d056ff0ba12d3473fd05fe02bc2e86 -size 24650031 +oid sha256:2c9c74fbeaf7f972205e0659608d76fcee761fa19935ad3c6934ac2f342af152 +size 25373035