/Inc/CImg.h
C++ Header | 7837 lines | 7298 code | 240 blank | 299 comment | 568 complexity | 8c7492f19b329e8d0013faaf6d9d3510 MD5 | raw file
Large files files are truncated, but you can click here to view the full file
- /*
- #
- # File : CImg.h
- # ( C++ header file )
- #
- # Description : The C++ Template Image Processing Library.
- # This file is the main part of the CImg Library project.
- # ( http://cimg.sourceforge.net )
- #
- # Project manager : David Tschumperle.
- # ( http://www.greyc.ensicaen.fr/~dtschump/ )
- #
- # The complete contributor list can be seen in the 'README.txt' file.
- #
- # Licenses : This file is "dual-licensed", you have to choose one
- # of the two licenses below to apply on this file.
- #
- # CeCILL-C
- # The CeCILL-C license is close to the GNU LGPL.
- # ( http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html )
- #
- # or CeCILL v2.0
- # The CeCILL license is compatible with the GNU GPL.
- # ( http://www.cecill.info/licences/Licence_CeCILL_V2-en.html )
- #
- # This software is governed either by the CeCILL or the CeCILL-C license
- # under French law and abiding by the rules of distribution of free software.
- # You can use, modify and or redistribute the software under the terms of
- # the CeCILL or CeCILL-C licenses as circulated by CEA, CNRS and INRIA
- # at the following URL : "http://www.cecill.info".
- #
- # As a counterpart to the access to the source code and rights to copy,
- # modify and redistribute granted by the license, users are provided only
- # with a limited warranty and the software's author, the holder of the
- # economic rights, and the successive licensors have only limited
- # liability.
- #
- # In this respect, the user's attention is drawn to the risks associated
- # with loading, using, modifying and/or developing or reproducing the
- # software by the user in light of its specific status of free software,
- # that may mean that it is complicated to manipulate, and that also
- # therefore means that it is reserved for developers and experienced
- # professionals having in-depth computer knowledge. Users are therefore
- # encouraged to load and test the software's suitability as regards their
- # requirements in conditions enabling the security of their systems and/or
- # data to be ensured and, more generally, to use and operate it in the
- # same conditions as regards security.
- #
- # The fact that you are presently reading this means that you have had
- # knowledge of the CeCILL and CeCILL-C licenses and that you accept its terms.
- #
- */
- // Define version number of the current file.
- //
- #ifndef cimg_version
- #define cimg_version 131
- /*-----------------------------------------------------------
- #
- # Test/auto-set CImg configuration variables
- # and include required headers.
- #
- # If you find that default configuration variables are
- # not adapted, you can override their values before including
- # the header file "CImg.h" (using the #define directive).
- #
- ------------------------------------------------------------*/
- // Include required standard C++ headers.
- //
- #include <cstdio>
- #include <cstdlib>
- #include <cstdarg>
- #include <cstring>
- #include <cmath>
- #include <ctime>
- // Operating system configuration.
- //
- // Define 'cimg_OS' to : 0 for an unknown OS (will try to minize library dependancies).
- // 1 for a Unix-like OS (Linux, Solaris, BSD, MacOSX, Irix, ...).
- // 2 for Microsoft Windows.
- //
- #ifndef cimg_OS
- #if defined(unix) || defined(__unix) || defined(__unix__) \
- || defined(linux) || defined(__linux) || defined(__linux__) \
- || defined(sun) || defined(__sun) \
- || defined(BSD) || defined(__OpenBSD__) || defined(__NetBSD__) \
- || defined(__FreeBSD__) || defined __DragonFly__ \
- || defined(sgi) || defined(__sgi) \
- || defined(__MACOSX__) || defined(__APPLE__) \
- || defined(__CYGWIN__)
- #define cimg_OS 1
- #elif defined(_MSC_VER) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) \
- || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
- #define cimg_OS 2
- #else
- #define cimg_OS 0
- #endif
- #elif !(cimg_OS==0 || cimg_OS==1 || cimg_OS==2)
- #error CImg Library : Configuration variable 'cimg_OS' is badly defined.
- #error (valid values are '0=unknown OS', '1=Unix-like OS', '2=Microsoft Windows').
- #endif
- // Compiler configuration.
- //
- // Try to detect Microsoft VC++ compilers.
- // (lot of workarounds are needed afterwards to
- // make CImg working, particularly with VC++ 6.0).
- //
- #ifdef _MSC_VER
- #pragma warning(push)
- #pragma warning(disable:4311)
- #pragma warning(disable:4312)
- #pragma warning(disable:4800)
- #pragma warning(disable:4804)
- #pragma warning(disable:4996)
- #define _CRT_SECURE_NO_DEPRECATE 1
- #define _CRT_NONSTDC_NO_DEPRECATE 1
- #if _MSC_VER<1300
- #define cimg_use_visualcpp6
- #define cimg_std
- #define _WIN32_WINNT 0x0500
- #endif
- #endif
- // Include OS-specific headers.
- //
- #if cimg_OS==1
- #include <sys/time.h>
- #include <unistd.h>
- #elif cimg_OS==2
- #include <windows.h>
- #ifndef _WIN32_IE
- #define _WIN32_IE 0x0400
- #endif
- #include <shlobj.h>
- #endif
- // Define default pipe for output messages.
- //
- // Define 'cimg_stdout' to : stdout to print CImg messages on the standard output.
- // stderr to print CImg messages on the standart error output (default behavior).
- //
- #ifndef cimg_std
- #define cimg_std std
- #endif
- #ifndef cimg_stdout
- #define cimg_stdout stderr
- #endif
- // Define default filename separator.
- #ifndef cimg_file_separator
- #if cimg_OS==2
- #define cimg_file_separator "\\"
- #else
- #define cimg_file_separator "/"
- #endif
- #endif
- // Output messages configuration.
- //
- // Define 'cimg_debug' to : 0 to hide debug messages (quiet mode, but exceptions are still thrown).
- // 1 to display debug messages on the console.
- // 2 to display debug messages with dialog windows (default behavior).
- // 3 to do as 1 + add extra warnings (may slow down the code !).
- // 4 to do as 2 + add extra warnings (may slow down the code !).
- //
- // Define 'cimg_strict_warnings' to replace warning messages by exception throwns.
- //
- // Define 'cimg_use_vt100' to allow output of color messages (require VT100-compatible terminal).
- //
- #ifndef cimg_debug
- #define cimg_debug 2
- #elif !(cimg_debug==0 || cimg_debug==1 || cimg_debug==2 || cimg_debug==3 || cimg_debug==4)
- #error CImg Library : Configuration variable 'cimg_debug' is badly defined.
- #error (valid values are '0=quiet', '1=console', '2=dialog', '3=console+warnings', '4=dialog+warnings').
- #endif
- // Display framework configuration.
- //
- // Define 'cimg_display' to : 0 to disable display capabilities.
- // 1 to use X-Window framework (X11).
- // 2 to use Microsoft GDI32 framework.
- // 3 to use Apple Carbon framework.
- //
- #ifndef cimg_display
- #if cimg_OS==0
- #define cimg_display 0
- #elif cimg_OS==1
- #if defined(__MACOSX__) || defined(__APPLE__)
- #define cimg_display 1
- #else
- #define cimg_display 1
- #endif
- #elif cimg_OS==2
- #define cimg_display 2
- #endif
- #elif !(cimg_display==0 || cimg_display==1 || cimg_display==2 || cimg_display==3)
- #error CImg Library : Configuration variable 'cimg_display' is badly defined.
- #error (valid values are '0=disable', '1=X-Window (X11)', '2=Microsoft GDI32', '3=Apple Carbon').
- #endif
- // Include display-specific headers.
- //
- #if cimg_display==1
- #include <X11/Xlib.h>
- #include <X11/Xutil.h>
- #include <X11/keysym.h>
- #include <pthread.h>
- #ifdef cimg_use_xshm
- #include <sys/ipc.h>
- #include <sys/shm.h>
- #include <X11/extensions/XShm.h>
- #endif
- #ifdef cimg_use_xrandr
- #include <X11/extensions/Xrandr.h>
- #endif
- #elif cimg_display==3
- #include <Carbon/Carbon.h>
- #include <pthread.h>
- #endif
- // OpenMP configuration.
- // (http://www.openmp.org)
- //
- // Define 'cimg_use_openmp' to enable OpenMP support.
- //
- // OpenMP directives can be used in few CImg functions to get
- // advantages of multi-core CPUs. Using OpenMP is not mandatory.
- //
- #ifdef cimg_use_openmp
- #include "omp.h"
- #endif
- // LibPNG configuration.
- // (http://www.libpng.org)
- //
- // Define 'cimg_use_png' to enable LibPNG support.
- //
- // LibPNG can be used in functions 'CImg<T>::{load,save}_png()'
- // to get a builtin support of PNG files. Using LibPNG is not mandatory.
- //
- #ifdef cimg_use_png
- extern "C" {
- #include "png.h"
- }
- #endif
- // LibJPEG configuration.
- // (http://en.wikipedia.org/wiki/Libjpeg)
- //
- // Define 'cimg_use_jpeg' to enable LibJPEG support.
- //
- // LibJPEG can be used in functions 'CImg<T>::{load,save}_jpeg()'
- // to get a builtin support of JPEG files. Using LibJPEG is not mandatory.
- //
- #ifdef cimg_use_jpeg
- extern "C" {
- #include "jpeglib.h"
- }
- #endif
- // LibTIFF configuration.
- // (http://www.libtiff.org)
- //
- // Define 'cimg_use_tiff' to enable LibTIFF support.
- //
- // LibTIFF can be used in functions 'CImg[List]<T>::{load,save}_tiff()'
- // to get a builtin support of TIFF files. Using LibTIFF is not mandatory.
- //
- #ifdef cimg_use_tiff
- extern "C" {
- #include "tiffio.h"
- }
- #endif
- // FFMPEG Avcodec and Avformat libraries configuration.
- // (http://www.ffmpeg.org)
- //
- // Define 'cimg_use_ffmpeg' to enable FFMPEG lib support.
- //
- // Avcodec and Avformat libraries can be used in functions
- // 'CImg[List]<T>::load_ffmpeg()' to get a builtin
- // support of various image sequences files.
- // Using FFMPEG libraries is not mandatory.
- //
- #ifdef cimg_use_ffmpeg
- extern "C" {
- #include "avformat.h"
- #include "avcodec.h"
- #include "swscale.h"
- }
- #endif
- // Zlib configuration
- // (http://www.zlib.net)
- //
- // Define 'cimg_use_zlib' to enable Zlib support.
- //
- // Zlib can be used in functions 'CImg[List]<T>::{load,save}_cimg()'
- // to allow compressed data in '.cimg' files. Using Zlib is not mandatory.
- //
- #ifdef cimg_use_zlib
- extern "C" {
- #include "zlib.h"
- }
- #endif
- // Magick++ configuration.
- // (http://www.imagemagick.org/Magick++)
- //
- // Define 'cimg_use_magick' to enable Magick++ support.
- //
- // Magick++ library can be used in functions 'CImg<T>::{load,save}()'
- // to get a builtin support of various image formats (PNG,JPEG,TIFF,...).
- // Using Magick++ is not mandatory.
- //
- #ifdef cimg_use_magick
- #include "Magick++.h"
- #endif
- // FFTW3 configuration.
- // (http://www.fftw.org)
- //
- // Define 'cimg_use_fftw3' to enable libFFTW3 support.
- //
- // FFTW3 library can be used in functions 'CImg[List]<T>::FFT()' to
- // efficiently compile the Fast Fourier Transform of image data.
- //
- #ifdef cimg_use_fftw3
- extern "C" {
- #include "fftw3.h"
- }
- #endif
- // Board configuration.
- // (http://libboard.sourceforge.net/)
- //
- // Define 'cimg_use_board' to enable Board support.
- //
- // Board library can be used in functions 'CImg<T>::draw_object3d()'
- // to draw objects 3D in vector-graphics canvas that can be saved
- // as .PS or .SVG files afterwards.
- //
- #ifdef cimg_use_board
- #include "Board.h"
- #endif
- // Lapack configuration.
- // (http://www.netlib.org/lapack)
- //
- // Define 'cimg_use_lapack' to enable LAPACK support.
- //
- // Lapack can be used in various CImg functions dealing with
- // matrix computation and algorithms (eigenvalues, inverse, ...).
- // Using Lapack is not mandatory.
- //
- #ifdef cimg_use_lapack
- extern "C" {
- extern void sgetrf_(int*, int*, float*, int*, int*, int*);
- extern void sgetri_(int*, float*, int*, int*, float*, int*, int*);
- extern void sgetrs_(char*, int*, int*, float*, int*, int*, float*, int*, int*);
- extern void sgesvd_(char*, char*, int*, int*, float*, int*, float*, float*, int*, float*, int*, float*, int*, int*);
- extern void ssyev_(char*, char*, int*, float*, int*, float*, float*, int*, int*);
- extern void dgetrf_(int*, int*, double*, int*, int*, int*);
- extern void dgetri_(int*, double*, int*, int*, double*, int*, int*);
- extern void dgetrs_(char*, int*, int*, double*, int*, int*, double*, int*, int*);
- extern void dgesvd_(char*, char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, double*, int*, int*);
- extern void dsyev_(char*, char*, int*, double*, int*, double*, double*, int*, int*);
- }
- #endif
- // Check if min/max macros are defined.
- //
- // CImg does not compile if macros 'min' or 'max' are defined,
- // because min() and max() functions are also defined in the cimg:: namespace.
- // so it '#undef' these macros if necessary, and restore them to reasonable
- // values at the end of the file.
- //
- #ifdef min
- #undef min
- #define _cimg_redefine_min
- #endif
- #ifdef max
- #undef max
- #define _cimg_redefine_max
- #endif
- // Set the current working directory for native MacOSX bundled applications.
- //
- // By default, MacOS bundled applications set the cwd at the root directory '/',
- // the code below allows to set it to the current exec directory instead when
- // a CImg-based program is executed.
- //
- #if cimg_OS==1 && cimg_display==3
- static struct _cimg_macosx_setcwd {
- _cimg_macosx_setcwd() {
- FSRef location;
- ProcessSerialNumber psn;
- char filePath[512];
- if (GetCurrentProcess(&psn)!=noErr) return;
- if (GetProcessBundleLocation(&psn,&location)!=noErr) return;
- FSRefMakePath(&location,(UInt8*)filePath,sizeof(filePath)-1);
- unsigned int p = cimg_std::strlen(filePath);
- while (filePath[p] != '/') --p;
- filePath[p] = 0;
- chdir(filePath);
- }
- } cimg_macosx_setcwd;
- #endif
- /*------------------------------------------------------------------------------
- #
- # Define user-friendly macros.
- #
- # User macros are prefixed by 'cimg_' and can be used in your own code.
- # They are particularly useful for option parsing, and image loops creation.
- #
- ------------------------------------------------------------------------------*/
- // Define the program usage, and retrieve command line arguments.
- //
- #define cimg_usage(usage) cimg_library::cimg::option((char*)0,argc,argv,(char*)0,usage)
- #define cimg_help(str) cimg_library::cimg::option((char*)0,argc,argv,str,(char*)0)
- #define cimg_option(name,defaut,usage) cimg_library::cimg::option(name,argc,argv,defaut,usage)
- #define cimg_argument(pos) cimg_library::cimg::argument(pos,argc,argv)
- #define cimg_argument1(pos,s0) cimg_library::cimg::argument(pos,argc,argv,1,s0)
- #define cimg_argument2(pos,s0,s1) cimg_library::cimg::argument(pos,argc,argv,2,s0,s1)
- #define cimg_argument3(pos,s0,s1,s2) cimg_library::cimg::argument(pos,argc,argv,3,s0,s1,s2)
- #define cimg_argument4(pos,s0,s1,s2,s3) cimg_library::cimg::argument(pos,argc,argv,4,s0,s1,s2,s3)
- #define cimg_argument5(pos,s0,s1,s2,s3,s4) cimg_library::cimg::argument(pos,argc,argv,5,s0,s1,s2,s3,s4)
- #define cimg_argument6(pos,s0,s1,s2,s3,s4,s5) cimg_library::cimg::argument(pos,argc,argv,6,s0,s1,s2,s3,s4,s5)
- #define cimg_argument7(pos,s0,s1,s2,s3,s4,s5,s6) cimg_library::cimg::argument(pos,argc,argv,7,s0,s1,s2,s3,s4,s5,s6)
- #define cimg_argument8(pos,s0,s1,s2,s3,s4,s5,s6,s7) cimg_library::cimg::argument(pos,argc,argv,8,s0,s1,s2,s3,s4,s5,s6,s7)
- #define cimg_argument9(pos,s0,s1,s2,s3,s4,s5,s6,s7,s8) cimg_library::cimg::argument(pos,argc,argv,9,s0,s1,s2,s3,s4,s5,s6,s7,s8)
- // Define and manipulate local neighborhoods.
- //
- #define CImg_2x2(I,T) T I[4]; \
- T& I##cc = I[0]; T& I##nc = I[1]; \
- T& I##cn = I[2]; T& I##nn = I[3]; \
- I##cc = I##nc = \
- I##cn = I##nn = 0
- #define CImg_3x3(I,T) T I[9]; \
- T& I##pp = I[0]; T& I##cp = I[1]; T& I##np = I[2]; \
- T& I##pc = I[3]; T& I##cc = I[4]; T& I##nc = I[5]; \
- T& I##pn = I[6]; T& I##cn = I[7]; T& I##nn = I[8]; \
- I##pp = I##cp = I##np = \
- I##pc = I##cc = I##nc = \
- I##pn = I##cn = I##nn = 0
- #define CImg_4x4(I,T) T I[16]; \
- T& I##pp = I[0]; T& I##cp = I[1]; T& I##np = I[2]; T& I##ap = I[3]; \
- T& I##pc = I[4]; T& I##cc = I[5]; T& I##nc = I[6]; T& I##ac = I[7]; \
- T& I##pn = I[8]; T& I##cn = I[9]; T& I##nn = I[10]; T& I##an = I[11]; \
- T& I##pa = I[12]; T& I##ca = I[13]; T& I##na = I[14]; T& I##aa = I[15]; \
- I##pp = I##cp = I##np = I##ap = \
- I##pc = I##cc = I##nc = I##ac = \
- I##pn = I##cn = I##nn = I##an = \
- I##pa = I##ca = I##na = I##aa = 0
- #define CImg_5x5(I,T) T I[25]; \
- T& I##bb = I[0]; T& I##pb = I[1]; T& I##cb = I[2]; T& I##nb = I[3]; T& I##ab = I[4]; \
- T& I##bp = I[5]; T& I##pp = I[6]; T& I##cp = I[7]; T& I##np = I[8]; T& I##ap = I[9]; \
- T& I##bc = I[10]; T& I##pc = I[11]; T& I##cc = I[12]; T& I##nc = I[13]; T& I##ac = I[14]; \
- T& I##bn = I[15]; T& I##pn = I[16]; T& I##cn = I[17]; T& I##nn = I[18]; T& I##an = I[19]; \
- T& I##ba = I[20]; T& I##pa = I[21]; T& I##ca = I[22]; T& I##na = I[23]; T& I##aa = I[24]; \
- I##bb = I##pb = I##cb = I##nb = I##ab = \
- I##bp = I##pp = I##cp = I##np = I##ap = \
- I##bc = I##pc = I##cc = I##nc = I##ac = \
- I##bn = I##pn = I##cn = I##nn = I##an = \
- I##ba = I##pa = I##ca = I##na = I##aa = 0
- #define CImg_2x2x2(I,T) T I[8]; \
- T& I##ccc = I[0]; T& I##ncc = I[1]; \
- T& I##cnc = I[2]; T& I##nnc = I[3]; \
- T& I##ccn = I[4]; T& I##ncn = I[5]; \
- T& I##cnn = I[6]; T& I##nnn = I[7]; \
- I##ccc = I##ncc = \
- I##cnc = I##nnc = \
- I##ccn = I##ncn = \
- I##cnn = I##nnn = 0
- #define CImg_3x3x3(I,T) T I[27]; \
- T& I##ppp = I[0]; T& I##cpp = I[1]; T& I##npp = I[2]; \
- T& I##pcp = I[3]; T& I##ccp = I[4]; T& I##ncp = I[5]; \
- T& I##pnp = I[6]; T& I##cnp = I[7]; T& I##nnp = I[8]; \
- T& I##ppc = I[9]; T& I##cpc = I[10]; T& I##npc = I[11]; \
- T& I##pcc = I[12]; T& I##ccc = I[13]; T& I##ncc = I[14]; \
- T& I##pnc = I[15]; T& I##cnc = I[16]; T& I##nnc = I[17]; \
- T& I##ppn = I[18]; T& I##cpn = I[19]; T& I##npn = I[20]; \
- T& I##pcn = I[21]; T& I##ccn = I[22]; T& I##ncn = I[23]; \
- T& I##pnn = I[24]; T& I##cnn = I[25]; T& I##nnn = I[26]; \
- I##ppp = I##cpp = I##npp = \
- I##pcp = I##ccp = I##ncp = \
- I##pnp = I##cnp = I##nnp = \
- I##ppc = I##cpc = I##npc = \
- I##pcc = I##ccc = I##ncc = \
- I##pnc = I##cnc = I##nnc = \
- I##ppn = I##cpn = I##npn = \
- I##pcn = I##ccn = I##ncn = \
- I##pnn = I##cnn = I##nnn = 0
- #define cimg_get2x2(img,x,y,z,v,I) \
- I[0] = (img)(x,y,z,v), I[1] = (img)(_n1##x,y,z,v), I[2] = (img)(x,_n1##y,z,v), I[3] = (img)(_n1##x,_n1##y,z,v)
- #define cimg_get3x3(img,x,y,z,v,I) \
- I[0] = (img)(_p1##x,_p1##y,z,v), I[1] = (img)(x,_p1##y,z,v), I[2] = (img)(_n1##x,_p1##y,z,v), I[3] = (img)(_p1##x,y,z,v), \
- I[4] = (img)(x,y,z,v), I[5] = (img)(_n1##x,y,z,v), I[6] = (img)(_p1##x,_n1##y,z,v), I[7] = (img)(x,_n1##y,z,v), \
- I[8] = (img)(_n1##x,_n1##y,z,v)
- #define cimg_get4x4(img,x,y,z,v,I) \
- I[0] = (img)(_p1##x,_p1##y,z,v), I[1] = (img)(x,_p1##y,z,v), I[2] = (img)(_n1##x,_p1##y,z,v), I[3] = (img)(_n2##x,_p1##y,z,v), \
- I[4] = (img)(_p1##x,y,z,v), I[5] = (img)(x,y,z,v), I[6] = (img)(_n1##x,y,z,v), I[7] = (img)(_n2##x,y,z,v), \
- I[8] = (img)(_p1##x,_n1##y,z,v), I[9] = (img)(x,_n1##y,z,v), I[10] = (img)(_n1##x,_n1##y,z,v), I[11] = (img)(_n2##x,_n1##y,z,v), \
- I[12] = (img)(_p1##x,_n2##y,z,v), I[13] = (img)(x,_n2##y,z,v), I[14] = (img)(_n1##x,_n2##y,z,v), I[15] = (img)(_n2##x,_n2##y,z,v)
- #define cimg_get5x5(img,x,y,z,v,I) \
- I[0] = (img)(_p2##x,_p2##y,z,v), I[1] = (img)(_p1##x,_p2##y,z,v), I[2] = (img)(x,_p2##y,z,v), I[3] = (img)(_n1##x,_p2##y,z,v), \
- I[4] = (img)(_n2##x,_p2##y,z,v), I[5] = (img)(_p2##x,_p1##y,z,v), I[6] = (img)(_p1##x,_p1##y,z,v), I[7] = (img)(x,_p1##y,z,v), \
- I[8] = (img)(_n1##x,_p1##y,z,v), I[9] = (img)(_n2##x,_p1##y,z,v), I[10] = (img)(_p2##x,y,z,v), I[11] = (img)(_p1##x,y,z,v), \
- I[12] = (img)(x,y,z,v), I[13] = (img)(_n1##x,y,z,v), I[14] = (img)(_n2##x,y,z,v), I[15] = (img)(_p2##x,_n1##y,z,v), \
- I[16] = (img)(_p1##x,_n1##y,z,v), I[17] = (img)(x,_n1##y,z,v), I[18] = (img)(_n1##x,_n1##y,z,v), I[19] = (img)(_n2##x,_n1##y,z,v), \
- I[20] = (img)(_p2##x,_n2##y,z,v), I[21] = (img)(_p1##x,_n2##y,z,v), I[22] = (img)(x,_n2##y,z,v), I[23] = (img)(_n1##x,_n2##y,z,v), \
- I[24] = (img)(_n2##x,_n2##y,z,v)
- #define cimg_get6x6(img,x,y,z,v,I) \
- I[0] = (img)(_p2##x,_p2##y,z,v), I[1] = (img)(_p1##x,_p2##y,z,v), I[2] = (img)(x,_p2##y,z,v), I[3] = (img)(_n1##x,_p2##y,z,v), \
- I[4] = (img)(_n2##x,_p2##y,z,v), I[5] = (img)(_n3##x,_p2##y,z,v), I[6] = (img)(_p2##x,_p1##y,z,v), I[7] = (img)(_p1##x,_p1##y,z,v), \
- I[8] = (img)(x,_p1##y,z,v), I[9] = (img)(_n1##x,_p1##y,z,v), I[10] = (img)(_n2##x,_p1##y,z,v), I[11] = (img)(_n3##x,_p1##y,z,v), \
- I[12] = (img)(_p2##x,y,z,v), I[13] = (img)(_p1##x,y,z,v), I[14] = (img)(x,y,z,v), I[15] = (img)(_n1##x,y,z,v), \
- I[16] = (img)(_n2##x,y,z,v), I[17] = (img)(_n3##x,y,z,v), I[18] = (img)(_p2##x,_n1##y,z,v), I[19] = (img)(_p1##x,_n1##y,z,v), \
- I[20] = (img)(x,_n1##y,z,v), I[21] = (img)(_n1##x,_n1##y,z,v), I[22] = (img)(_n2##x,_n1##y,z,v), I[23] = (img)(_n3##x,_n1##y,z,v), \
- I[24] = (img)(_p2##x,_n2##y,z,v), I[25] = (img)(_p1##x,_n2##y,z,v), I[26] = (img)(x,_n2##y,z,v), I[27] = (img)(_n1##x,_n2##y,z,v), \
- I[28] = (img)(_n2##x,_n2##y,z,v), I[29] = (img)(_n3##x,_n2##y,z,v), I[30] = (img)(_p2##x,_n3##y,z,v), I[31] = (img)(_p1##x,_n3##y,z,v), \
- I[32] = (img)(x,_n3##y,z,v), I[33] = (img)(_n1##x,_n3##y,z,v), I[34] = (img)(_n2##x,_n3##y,z,v), I[35] = (img)(_n3##x,_n3##y,z,v)
- #define cimg_get7x7(img,x,y,z,v,I) \
- I[0] = (img)(_p3##x,_p3##y,z,v), I[1] = (img)(_p2##x,_p3##y,z,v), I[2] = (img)(_p1##x,_p3##y,z,v), I[3] = (img)(x,_p3##y,z,v), \
- I[4] = (img)(_n1##x,_p3##y,z,v), I[5] = (img)(_n2##x,_p3##y,z,v), I[6] = (img)(_n3##x,_p3##y,z,v), I[7] = (img)(_p3##x,_p2##y,z,v), \
- I[8] = (img)(_p2##x,_p2##y,z,v), I[9] = (img)(_p1##x,_p2##y,z,v), I[10] = (img)(x,_p2##y,z,v), I[11] = (img)(_n1##x,_p2##y,z,v), \
- I[12] = (img)(_n2##x,_p2##y,z,v), I[13] = (img)(_n3##x,_p2##y,z,v), I[14] = (img)(_p3##x,_p1##y,z,v), I[15] = (img)(_p2##x,_p1##y,z,v), \
- I[16] = (img)(_p1##x,_p1##y,z,v), I[17] = (img)(x,_p1##y,z,v), I[18] = (img)(_n1##x,_p1##y,z,v), I[19] = (img)(_n2##x,_p1##y,z,v), \
- I[20] = (img)(_n3##x,_p1##y,z,v), I[21] = (img)(_p3##x,y,z,v), I[22] = (img)(_p2##x,y,z,v), I[23] = (img)(_p1##x,y,z,v), \
- I[24] = (img)(x,y,z,v), I[25] = (img)(_n1##x,y,z,v), I[26] = (img)(_n2##x,y,z,v), I[27] = (img)(_n3##x,y,z,v), \
- I[28] = (img)(_p3##x,_n1##y,z,v), I[29] = (img)(_p2##x,_n1##y,z,v), I[30] = (img)(_p1##x,_n1##y,z,v), I[31] = (img)(x,_n1##y,z,v), \
- I[32] = (img)(_n1##x,_n1##y,z,v), I[33] = (img)(_n2##x,_n1##y,z,v), I[34] = (img)(_n3##x,_n1##y,z,v), I[35] = (img)(_p3##x,_n2##y,z,v), \
- I[36] = (img)(_p2##x,_n2##y,z,v), I[37] = (img)(_p1##x,_n2##y,z,v), I[38] = (img)(x,_n2##y,z,v), I[39] = (img)(_n1##x,_n2##y,z,v), \
- I[40] = (img)(_n2##x,_n2##y,z,v), I[41] = (img)(_n3##x,_n2##y,z,v), I[42] = (img)(_p3##x,_n3##y,z,v), I[43] = (img)(_p2##x,_n3##y,z,v), \
- I[44] = (img)(_p1##x,_n3##y,z,v), I[45] = (img)(x,_n3##y,z,v), I[46] = (img)(_n1##x,_n3##y,z,v), I[47] = (img)(_n2##x,_n3##y,z,v), \
- I[48] = (img)(_n3##x,_n3##y,z,v)
- #define cimg_get8x8(img,x,y,z,v,I) \
- I[0] = (img)(_p3##x,_p3##y,z,v), I[1] = (img)(_p2##x,_p3##y,z,v), I[2] = (img)(_p1##x,_p3##y,z,v), I[3] = (img)(x,_p3##y,z,v), \
- I[4] = (img)(_n1##x,_p3##y,z,v), I[5] = (img)(_n2##x,_p3##y,z,v), I[6] = (img)(_n3##x,_p3##y,z,v), I[7] = (img)(_n4##x,_p3##y,z,v), \
- I[8] = (img)(_p3##x,_p2##y,z,v), I[9] = (img)(_p2##x,_p2##y,z,v), I[10] = (img)(_p1##x,_p2##y,z,v), I[11] = (img)(x,_p2##y,z,v), \
- I[12] = (img)(_n1##x,_p2##y,z,v), I[13] = (img)(_n2##x,_p2##y,z,v), I[14] = (img)(_n3##x,_p2##y,z,v), I[15] = (img)(_n4##x,_p2##y,z,v), \
- I[16] = (img)(_p3##x,_p1##y,z,v), I[17] = (img)(_p2##x,_p1##y,z,v), I[18] = (img)(_p1##x,_p1##y,z,v), I[19] = (img)(x,_p1##y,z,v), \
- I[20] = (img)(_n1##x,_p1##y,z,v), I[21] = (img)(_n2##x,_p1##y,z,v), I[22] = (img)(_n3##x,_p1##y,z,v), I[23] = (img)(_n4##x,_p1##y,z,v), \
- I[24] = (img)(_p3##x,y,z,v), I[25] = (img)(_p2##x,y,z,v), I[26] = (img)(_p1##x,y,z,v), I[27] = (img)(x,y,z,v), \
- I[28] = (img)(_n1##x,y,z,v), I[29] = (img)(_n2##x,y,z,v), I[30] = (img)(_n3##x,y,z,v), I[31] = (img)(_n4##x,y,z,v), \
- I[32] = (img)(_p3##x,_n1##y,z,v), I[33] = (img)(_p2##x,_n1##y,z,v), I[34] = (img)(_p1##x,_n1##y,z,v), I[35] = (img)(x,_n1##y,z,v), \
- I[36] = (img)(_n1##x,_n1##y,z,v), I[37] = (img)(_n2##x,_n1##y,z,v), I[38] = (img)(_n3##x,_n1##y,z,v), I[39] = (img)(_n4##x,_n1##y,z,v), \
- I[40] = (img)(_p3##x,_n2##y,z,v), I[41] = (img)(_p2##x,_n2##y,z,v), I[42] = (img)(_p1##x,_n2##y,z,v), I[43] = (img)(x,_n2##y,z,v), \
- I[44] = (img)(_n1##x,_n2##y,z,v), I[45] = (img)(_n2##x,_n2##y,z,v), I[46] = (img)(_n3##x,_n2##y,z,v), I[47] = (img)(_n4##x,_n2##y,z,v), \
- I[48] = (img)(_p3##x,_n3##y,z,v), I[49] = (img)(_p2##x,_n3##y,z,v), I[50] = (img)(_p1##x,_n3##y,z,v), I[51] = (img)(x,_n3##y,z,v), \
- I[52] = (img)(_n1##x,_n3##y,z,v), I[53] = (img)(_n2##x,_n3##y,z,v), I[54] = (img)(_n3##x,_n3##y,z,v), I[55] = (img)(_n4##x,_n3##y,z,v), \
- I[56] = (img)(_p3##x,_n4##y,z,v), I[57] = (img)(_p2##x,_n4##y,z,v), I[58] = (img)(_p1##x,_n4##y,z,v), I[59] = (img)(x,_n4##y,z,v), \
- I[60] = (img)(_n1##x,_n4##y,z,v), I[61] = (img)(_n2##x,_n4##y,z,v), I[62] = (img)(_n3##x,_n4##y,z,v), I[63] = (img)(_n4##x,_n4##y,z,v);
- #define cimg_get9x9(img,x,y,z,v,I) \
- I[0] = (img)(_p4##x,_p4##y,z,v), I[1] = (img)(_p3##x,_p4##y,z,v), I[2] = (img)(_p2##x,_p4##y,z,v), I[3] = (img)(_p1##x,_p4##y,z,v), \
- I[4] = (img)(x,_p4##y,z,v), I[5] = (img)(_n1##x,_p4##y,z,v), I[6] = (img)(_n2##x,_p4##y,z,v), I[7] = (img)(_n3##x,_p4##y,z,v), \
- I[8] = (img)(_n4##x,_p4##y,z,v), I[9] = (img)(_p4##x,_p3##y,z,v), I[10] = (img)(_p3##x,_p3##y,z,v), I[11] = (img)(_p2##x,_p3##y,z,v), \
- I[12] = (img)(_p1##x,_p3##y,z,v), I[13] = (img)(x,_p3##y,z,v), I[14] = (img)(_n1##x,_p3##y,z,v), I[15] = (img)(_n2##x,_p3##y,z,v), \
- I[16] = (img)(_n3##x,_p3##y,z,v), I[17] = (img)(_n4##x,_p3##y,z,v), I[18] = (img)(_p4##x,_p2##y,z,v), I[19] = (img)(_p3##x,_p2##y,z,v), \
- I[20] = (img)(_p2##x,_p2##y,z,v), I[21] = (img)(_p1##x,_p2##y,z,v), I[22] = (img)(x,_p2##y,z,v), I[23] = (img)(_n1##x,_p2##y,z,v), \
- I[24] = (img)(_n2##x,_p2##y,z,v), I[25] = (img)(_n3##x,_p2##y,z,v), I[26] = (img)(_n4##x,_p2##y,z,v), I[27] = (img)(_p4##x,_p1##y,z,v), \
- I[28] = (img)(_p3##x,_p1##y,z,v), I[29] = (img)(_p2##x,_p1##y,z,v), I[30] = (img)(_p1##x,_p1##y,z,v), I[31] = (img)(x,_p1##y,z,v), \
- I[32] = (img)(_n1##x,_p1##y,z,v), I[33] = (img)(_n2##x,_p1##y,z,v), I[34] = (img)(_n3##x,_p1##y,z,v), I[35] = (img)(_n4##x,_p1##y,z,v), \
- I[36] = (img)(_p4##x,y,z,v), I[37] = (img)(_p3##x,y,z,v), I[38] = (img)(_p2##x,y,z,v), I[39] = (img)(_p1##x,y,z,v), \
- I[40] = (img)(x,y,z,v), I[41] = (img)(_n1##x,y,z,v), I[42] = (img)(_n2##x,y,z,v), I[43] = (img)(_n3##x,y,z,v), \
- I[44] = (img)(_n4##x,y,z,v), I[45] = (img)(_p4##x,_n1##y,z,v), I[46] = (img)(_p3##x,_n1##y,z,v), I[47] = (img)(_p2##x,_n1##y,z,v), \
- I[48] = (img)(_p1##x,_n1##y,z,v), I[49] = (img)(x,_n1##y,z,v), I[50] = (img)(_n1##x,_n1##y,z,v), I[51] = (img)(_n2##x,_n1##y,z,v), \
- I[52] = (img)(_n3##x,_n1##y,z,v), I[53] = (img)(_n4##x,_n1##y,z,v), I[54] = (img)(_p4##x,_n2##y,z,v), I[55] = (img)(_p3##x,_n2##y,z,v), \
- I[56] = (img)(_p2##x,_n2##y,z,v), I[57] = (img)(_p1##x,_n2##y,z,v), I[58] = (img)(x,_n2##y,z,v), I[59] = (img)(_n1##x,_n2##y,z,v), \
- I[60] = (img)(_n2##x,_n2##y,z,v), I[61] = (img)(_n3##x,_n2##y,z,v), I[62] = (img)(_n4##x,_n2##y,z,v), I[63] = (img)(_p4##x,_n3##y,z,v), \
- I[64] = (img)(_p3##x,_n3##y,z,v), I[65] = (img)(_p2##x,_n3##y,z,v), I[66] = (img)(_p1##x,_n3##y,z,v), I[67] = (img)(x,_n3##y,z,v), \
- I[68] = (img)(_n1##x,_n3##y,z,v), I[69] = (img)(_n2##x,_n3##y,z,v), I[70] = (img)(_n3##x,_n3##y,z,v), I[71] = (img)(_n4##x,_n3##y,z,v), \
- I[72] = (img)(_p4##x,_n4##y,z,v), I[73] = (img)(_p3##x,_n4##y,z,v), I[74] = (img)(_p2##x,_n4##y,z,v), I[75] = (img)(_p1##x,_n4##y,z,v), \
- I[76] = (img)(x,_n4##y,z,v), I[77] = (img)(_n1##x,_n4##y,z,v), I[78] = (img)(_n2##x,_n4##y,z,v), I[79] = (img)(_n3##x,_n4##y,z,v), \
- I[80] = (img)(_n4##x,_n4##y,z,v)
- #define cimg_get2x2x2(img,x,y,z,v,I) \
- I[0] = (img)(x,y,z,v), I[1] = (img)(_n1##x,y,z,v), I[2] = (img)(x,_n1##y,z,v), I[3] = (img)(_n1##x,_n1##y,z,v), \
- I[4] = (img)(x,y,_n1##z,v), I[5] = (img)(_n1##x,y,_n1##z,v), I[6] = (img)(x,_n1##y,_n1##z,v), I[7] = (img)(_n1##x,_n1##y,_n1##z,v)
- #define cimg_get3x3x3(img,x,y,z,v,I) \
- I[0] = (img)(_p1##x,_p1##y,_p1##z,v), I[1] = (img)(x,_p1##y,_p1##z,v), I[2] = (img)(_n1##x,_p1##y,_p1##z,v), \
- I[3] = (img)(_p1##x,y,_p1##z,v), I[4] = (img)(x,y,_p1##z,v), I[5] = (img)(_n1##x,y,_p1##z,v), \
- I[6] = (img)(_p1##x,_n1##y,_p1##z,v), I[7] = (img)(x,_n1##y,_p1##z,v), I[8] = (img)(_n1##x,_n1##y,_p1##z,v), \
- I[9] = (img)(_p1##x,_p1##y,z,v), I[10] = (img)(x,_p1##y,z,v), I[11] = (img)(_n1##x,_p1##y,z,v), \
- I[12] = (img)(_p1##x,y,z,v), I[13] = (img)(x,y,z,v), I[14] = (img)(_n1##x,y,z,v), \
- I[15] = (img)(_p1##x,_n1##y,z,v), I[16] = (img)(x,_n1##y,z,v), I[17] = (img)(_n1##x,_n1##y,z,v), \
- I[18] = (img)(_p1##x,_p1##y,_n1##z,v), I[19] = (img)(x,_p1##y,_n1##z,v), I[20] = (img)(_n1##x,_p1##y,_n1##z,v), \
- I[21] = (img)(_p1##x,y,_n1##z,v), I[22] = (img)(x,y,_n1##z,v), I[23] = (img)(_n1##x,y,_n1##z,v), \
- I[24] = (img)(_p1##x,_n1##y,_n1##z,v), I[25] = (img)(x,_n1##y,_n1##z,v), I[26] = (img)(_n1##x,_n1##y,_n1##z,v)
- // Define various image loops.
- //
- // These macros generally avoid the use of iterators, but you are not forced to used them !
- //
- #define cimg_for(img,ptr,T_ptr) for (T_ptr *ptr = (img).data + (img).size(); (ptr--)>(img).data; )
- #define cimg_foroff(img,off) for (unsigned int off = 0, _max##off = (unsigned int)(img).size(); off<_max##off; ++off)
- #define cimglist_for(list,l) for (unsigned int l = 0; l<(list).size; ++l)
- #define cimglist_apply(list,fn) cimglist_for(list,__##fn) (list)[__##fn].fn
- #define cimg_for1(bound,i) for (int i = 0; i<(int)(bound); ++i)
- #define cimg_forX(img,x) cimg_for1((img).width,x)
- #define cimg_forY(img,y) cimg_for1((img).height,y)
- #define cimg_forZ(img,z) cimg_for1((img).depth,z)
- #define cimg_forV(img,v) cimg_for1((img).dim,v)
- #define cimg_forXY(img,x,y) cimg_forY(img,y) cimg_forX(img,x)
- #define cimg_forXZ(img,x,z) cimg_forZ(img,z) cimg_forX(img,x)
- #define cimg_forYZ(img,y,z) cimg_forZ(img,z) cimg_forY(img,y)
- #define cimg_forXV(img,x,v) cimg_forV(img,v) cimg_forX(img,x)
- #define cimg_forYV(img,y,v) cimg_forV(img,v) cimg_forY(img,y)
- #define cimg_forZV(img,z,v) cimg_forV(img,v) cimg_forZ(img,z)
- #define cimg_forXYZ(img,x,y,z) cimg_forZ(img,z) cimg_forXY(img,x,y)
- #define cimg_forXYV(img,x,y,v) cimg_forV(img,v) cimg_forXY(img,x,y)
- #define cimg_forXZV(img,x,z,v) cimg_forV(img,v) cimg_forXZ(img,x,z)
- #define cimg_forYZV(img,y,z,v) cimg_forV(img,v) cimg_forYZ(img,y,z)
- #define cimg_forXYZV(img,x,y,z,v) cimg_forV(img,v) cimg_forXYZ(img,x,y,z)
- #define cimg_for_in1(bound,i0,i1,i) \
- for (int i = (int)(i0)<0?0:(int)(i0), _max##i = (int)(i1)<(int)(bound)?(int)(i1):(int)(bound)-1; i<=_max##i; ++i)
- #define cimg_for_inX(img,x0,x1,x) cimg_for_in1((img).width,x0,x1,x)
- #define cimg_for_inY(img,y0,y1,y) cimg_for_in1((img).height,y0,y1,y)
- #define cimg_for_inZ(img,z0,z1,z) cimg_for_in1((img).depth,z0,z1,z)
- #define cimg_for_inV(img,v0,v1,v) cimg_for_in1((img).dim,v0,v1,v)
- #define cimg_for_inXY(img,x0,y0,x1,y1,x,y) cimg_for_inY(img,y0,y1,y) cimg_for_inX(img,x0,x1,x)
- #define cimg_for_inXZ(img,x0,z0,x1,z1,x,z) cimg_for_inZ(img,z0,z1,z) cimg_for_inX(img,x0,x1,x)
- #define cimg_for_inXV(img,x0,v0,x1,v1,x,v) cimg_for_inV(img,v0,v1,v) cimg_for_inX(img,x0,x1,x)
- #define cimg_for_inYZ(img,y0,z0,y1,z1,y,z) cimg_for_inZ(img,x0,z1,z) cimg_for_inY(img,y0,y1,y)
- #define cimg_for_inYV(img,y0,v0,y1,v1,y,v) cimg_for_inV(img,v0,v1,v) cimg_for_inY(img,y0,y1,y)
- #define cimg_for_inZV(img,z0,v0,z1,v1,z,v) cimg_for_inV(img,v0,v1,v) cimg_for_inZ(img,z0,z1,z)
- #define cimg_for_inXYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_inZ(img,z0,z1,z) cimg_for_inXY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_inXYV(img,x0,y0,v0,x1,y1,v1,x,y,v) cimg_for_inV(img,v0,v1,v) cimg_for_inXY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_inXZV(img,x0,z0,v0,x1,z1,v1,x,z,v) cimg_for_inV(img,v0,v1,v) cimg_for_inXZ(img,x0,z0,x1,z1,x,z)
- #define cimg_for_inYZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_inV(img,v0,v1,v) cimg_for_inYZ(img,y0,z0,y1,z1,y,z)
- #define cimg_for_inXYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) cimg_for_inV(img,v0,v1,v) cimg_for_inXYZ(img,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for_insideX(img,x,n) cimg_for_inX(img,n,(img).width-1-(n),x)
- #define cimg_for_insideY(img,y,n) cimg_for_inY(img,n,(img).height-1-(n),y)
- #define cimg_for_insideZ(img,z,n) cimg_for_inZ(img,n,(img).depth-1-(n),z)
- #define cimg_for_insideV(img,v,n) cimg_for_inV(img,n,(img).dim-1-(n),v)
- #define cimg_for_insideXY(img,x,y,n) cimg_for_inXY(img,n,n,(img).width-1-(n),(img).height-1-(n),x,y)
- #define cimg_for_insideXYZ(img,x,y,z,n) cimg_for_inXYZ(img,n,n,n,(img).width-1-(n),(img).height-1-(n),(img).depth-1-(n),x,y,z)
- #define cimg_for_insideXYZV(img,x,y,z,v,n) cimg_for_inXYZ(img,n,n,n,(img).width-1-(n),(img).height-1-(n),(img).depth-1-(n),x,y,z)
- #define cimg_for_out1(boundi,i0,i1,i) \
- for (int i = (int)(i0)>0?0:(int)(i1)+1; i<(int)(boundi); ++i, i = i==(int)(i0)?(int)(i1)+1:i)
- #define cimg_for_out2(boundi,boundj,i0,j0,i1,j1,i,j) \
- for (int j = 0; j<(int)(boundj); ++j) \
- for (int _n1j = (int)(j<(int)(j0) || j>(int)(j1)), i = _n1j?0:(int)(i0)>0?0:(int)(i1)+1; i<(int)(boundi); \
- ++i, i = _n1j?i:(i==(int)(i0)?(int)(i1)+1:i))
- #define cimg_for_out3(boundi,boundj,boundk,i0,j0,k0,i1,j1,k1,i,j,k) \
- for (int k = 0; k<(int)(boundk); ++k) \
- for (int _n1k = (int)(k<(int)(k0) || k>(int)(k1)), j = 0; j<(int)(boundj); ++j) \
- for (int _n1j = (int)(j<(int)(j0) || j>(int)(j1)), i = _n1j || _n1k?0:(int)(i0)>0?0:(int)(i1)+1; i<(int)(boundi); \
- ++i, i = _n1j || _n1k?i:(i==(int)(i0)?(int)(i1)+1:i))
- #define cimg_for_out4(boundi,boundj,boundk,boundl,i0,j0,k0,l0,i1,j1,k1,l1,i,j,k,l) \
- for (int l = 0; l<(int)(boundl); ++l) \
- for (int _n1l = (int)(l<(int)(l0) || l>(int)(l1)), k = 0; k<(int)(boundk); ++k) \
- for (int _n1k = (int)(k<(int)(k0) || k>(int)(k1)), j = 0; j<(int)(boundj); ++j) \
- for (int _n1j = (int)(j<(int)(j0) || j>(int)(j1)), i = _n1j || _n1k || _n1l?0:(int)(i0)>0?0:(int)(i1)+1; i<(int)(boundi); \
- ++i, i = _n1j || _n1k || _n1l?i:(i==(int)(i0)?(int)(i1)+1:i))
- #define cimg_for_outX(img,x0,x1,x) cimg_for_out1((img).width,x0,x1,x)
- #define cimg_for_outY(img,y0,y1,y) cimg_for_out1((img).height,y0,y1,y)
- #define cimg_for_outZ(img,z0,z1,z) cimg_for_out1((img).depth,z0,z1,z)
- #define cimg_for_outV(img,v0,v1,v) cimg_for_out1((img).dim,v0,v1,v)
- #define cimg_for_outXY(img,x0,y0,x1,y1,x,y) cimg_for_out2((img).width,(img).height,x0,y0,x1,y1,x,y)
- #define cimg_for_outXZ(img,x0,z0,x1,z1,x,z) cimg_for_out2((img).width,(img).depth,x0,z0,x1,z1,x,z)
- #define cimg_for_outXV(img,x0,v0,x1,v1,x,v) cimg_for_out2((img).width,(img).dim,x0,v0,x1,v1,x,v)
- #define cimg_for_outYZ(img,y0,z0,y1,z1,y,z) cimg_for_out2((img).height,(img).depth,y0,z0,y1,z1,y,z)
- #define cimg_for_outYV(img,y0,v0,y1,v1,y,v) cimg_for_out2((img).height,(img).dim,y0,v0,y1,v1,y,v)
- #define cimg_for_outZV(img,z0,v0,z1,v1,z,v) cimg_for_out2((img).depth,(img).dim,z0,v0,z1,v1,z,v)
- #define cimg_for_outXYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_out3((img).width,(img).height,(img).depth,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for_outXYV(img,x0,y0,v0,x1,y1,v1,x,y,v) cimg_for_out3((img).width,(img).height,(img).dim,x0,y0,v0,x1,y1,v1,x,y,v)
- #define cimg_for_outXZV(img,x0,z0,v0,x1,z1,v1,x,z,v) cimg_for_out3((img).width,(img).depth,(img).dim,x0,z0,v0,x1,z1,v1,x,z,v)
- #define cimg_for_outYZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_out3((img).height,(img).depth,(img).dim,y0,z0,v0,y1,z1,v1,y,z,v)
- #define cimg_for_outXYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) \
- cimg_for_out4((img).width,(img).height,(img).depth,(img).dim,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v)
- #define cimg_for_borderX(img,x,n) cimg_for_outX(img,n,(img).width-1-(n),x)
- #define cimg_for_borderY(img,y,n) cimg_for_outY(img,n,(img).height-1-(n),y)
- #define cimg_for_borderZ(img,z,n) cimg_for_outZ(img,n,(img).depth-1-(n),z)
- #define cimg_for_borderV(img,v,n) cimg_for_outV(img,n,(img).dim-1-(n),v)
- #define cimg_for_borderXY(img,x,y,n) cimg_for_outXY(img,n,n,(img).width-1-(n),(img).height-1-(n),x,y)
- #define cimg_for_borderXYZ(img,x,y,z,n) cimg_for_outXYZ(img,n,n,n,(img).width-1-(n),(img).height-1-(n),(img).depth-1-(n),x,y,z)
- #define cimg_for_borderXYZV(img,x,y,z,v,n) \
- cimg_for_outXYZV(img,n,n,n,n,(img).width-1-(n),(img).height-1-(n),(img).depth-1-(n),(img).dim-1-(n),x,y,z,v)
- #define cimg_for_spiralXY(img,x,y) \
- for (int x = 0, y = 0, _n1##x = 1, _n1##y = (int)((img).width*(img).height); _n1##y; \
- --_n1##y, _n1##x += (_n1##x>>2)-((!(_n1##x&3)?--y:((_n1##x&3)==1?(img).width-1-++x:((_n1##x&3)==2?(img).height-1-++y:--x))))?0:1)
- #define cimg_for_lineXY(x,y,x0,y0,x1,y1) \
- for (int x = (int)(x0), y = (int)(y0), _sx = 1, _sy = 1, _steep = 0, \
- _dx=(x1)>(x0)?(int)(x1)-(int)(x0):(_sx=-1,(int)(x0)-(int)(x1)), \
- _dy=(y1)>(y0)?(int)(y1)-(int)(y0):(_sy=-1,(int)(y0)-(int)(y1)), \
- _counter = _dx, \
- _err = _dx>_dy?(_dy>>1):((_steep=1),(_counter=_dy),(_dx>>1)); \
- _counter>=0; \
- --_counter, x+=_steep? \
- (y+=_sy,(_err-=_dx)<0?_err+=_dy,_sx:0): \
- (y+=(_err-=_dy)<0?_err+=_dx,_sy:0,_sx))
- #define cimg_for2(bound,i) \
- for (int i = 0, _n1##i = 1>=(bound)?(int)(bound)-1:1; \
- _n1##i<(int)(bound) || i==--_n1##i; \
- ++i, ++_n1##i)
- #define cimg_for2X(img,x) cimg_for2((img).width,x)
- #define cimg_for2Y(img,y) cimg_for2((img).height,y)
- #define cimg_for2Z(img,z) cimg_for2((img).depth,z)
- #define cimg_for2V(img,v) cimg_for2((img).dim,v)
- #define cimg_for2XY(img,x,y) cimg_for2Y(img,y) cimg_for2X(img,x)
- #define cimg_for2XZ(img,x,z) cimg_for2Z(img,z) cimg_for2X(img,x)
- #define cimg_for2XV(img,x,v) cimg_for2V(img,v) cimg_for2X(img,x)
- #define cimg_for2YZ(img,y,z) cimg_for2Z(img,z) cimg_for2Y(img,y)
- #define cimg_for2YV(img,y,v) cimg_for2V(img,v) cimg_for2Y(img,y)
- #define cimg_for2ZV(img,z,v) cimg_for2V(img,v) cimg_for2Z(img,z)
- #define cimg_for2XYZ(img,x,y,z) cimg_for2Z(img,z) cimg_for2XY(img,x,y)
- #define cimg_for2XZV(img,x,z,v) cimg_for2V(img,v) cimg_for2XZ(img,x,z)
- #define cimg_for2YZV(img,y,z,v) cimg_for2V(img,v) cimg_for2YZ(img,y,z)
- #define cimg_for2XYZV(img,x,y,z,v) cimg_for2V(img,v) cimg_for2XYZ(img,x,y,z)
- #define cimg_for_in2(bound,i0,i1,i) \
- for (int i = (int)(i0)<0?0:(int)(i0), \
- _n1##i = i+1>=(int)(bound)?(int)(bound)-1:i+1; \
- i<=(int)(i1) && (_n1##i<(int)(bound) || i==--_n1##i); \
- ++i, ++_n1##i)
- #define cimg_for_in2X(img,x0,x1,x) cimg_for_in2((img).width,x0,x1,x)
- #define cimg_for_in2Y(img,y0,y1,y) cimg_for_in2((img).height,y0,y1,y)
- #define cimg_for_in2Z(img,z0,z1,z) cimg_for_in2((img).depth,z0,z1,z)
- #define cimg_for_in2V(img,v0,v1,v) cimg_for_in2((img).dim,v0,v1,v)
- #define cimg_for_in2XY(img,x0,y0,x1,y1,x,y) cimg_for_in2Y(img,y0,y1,y) cimg_for_in2X(img,x0,x1,x)
- #define cimg_for_in2XZ(img,x0,z0,x1,z1,x,z) cimg_for_in2Z(img,z0,z1,z) cimg_for_in2X(img,x0,x1,x)
- #define cimg_for_in2XV(img,x0,v0,x1,v1,x,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2X(img,x0,x1,x)
- #define cimg_for_in2YZ(img,y0,z0,y1,z1,y,z) cimg_for_in2Z(img,z0,z1,z) cimg_for_in2Y(img,y0,y1,y)
- #define cimg_for_in2YV(img,y0,v0,y1,v1,y,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2Y(img,y0,y1,y)
- #define cimg_for_in2ZV(img,z0,v0,z1,v1,z,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2Z(img,z0,z1,z)
- #define cimg_for_in2XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_in2Z(img,z0,z1,z) cimg_for_in2XY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_in2XZV(img,x0,z0,v0,x1,y1,v1,x,z,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2XZ(img,x0,y0,x1,y1,x,z)
- #define cimg_for_in2YZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2YZ(img,y0,z0,y1,z1,y,z)
- #define cimg_for_in2XYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) cimg_for_in2V(img,v0,v1,v) cimg_for_in2XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for3(bound,i) \
- for (int i = 0, _p1##i = 0, \
- _n1##i = 1>=(bound)?(int)(bound)-1:1; \
- _n1##i<(int)(bound) || i==--_n1##i; \
- _p1##i = i++, ++_n1##i)
- #define cimg_for3X(img,x) cimg_for3((img).width,x)
- #define cimg_for3Y(img,y) cimg_for3((img).height,y)
- #define cimg_for3Z(img,z) cimg_for3((img).depth,z)
- #define cimg_for3V(img,v) cimg_for3((img).dim,v)
- #define cimg_for3XY(img,x,y) cimg_for3Y(img,y) cimg_for3X(img,x)
- #define cimg_for3XZ(img,x,z) cimg_for3Z(img,z) cimg_for3X(img,x)
- #define cimg_for3XV(img,x,v) cimg_for3V(img,v) cimg_for3X(img,x)
- #define cimg_for3YZ(img,y,z) cimg_for3Z(img,z) cimg_for3Y(img,y)
- #define cimg_for3YV(img,y,v) cimg_for3V(img,v) cimg_for3Y(img,y)
- #define cimg_for3ZV(img,z,v) cimg_for3V(img,v) cimg_for3Z(img,z)
- #define cimg_for3XYZ(img,x,y,z) cimg_for3Z(img,z) cimg_for3XY(img,x,y)
- #define cimg_for3XZV(img,x,z,v) cimg_for3V(img,v) cimg_for3XZ(img,x,z)
- #define cimg_for3YZV(img,y,z,v) cimg_for3V(img,v) cimg_for3YZ(img,y,z)
- #define cimg_for3XYZV(img,x,y,z,v) cimg_for3V(img,v) cimg_for3XYZ(img,x,y,z)
- #define cimg_for_in3(bound,i0,i1,i) \
- for (int i = (int)(i0)<0?0:(int)(i0), \
- _p1##i = i-1<0?0:i-1, \
- _n1##i = i+1>=(int)(bound)?(int)(bound)-1:i+1; \
- i<=(int)(i1) && (_n1##i<(int)(bound) || i==--_n1##i); \
- _p1##i = i++, ++_n1##i)
- #define cimg_for_in3X(img,x0,x1,x) cimg_for_in3((img).width,x0,x1,x)
- #define cimg_for_in3Y(img,y0,y1,y) cimg_for_in3((img).height,y0,y1,y)
- #define cimg_for_in3Z(img,z0,z1,z) cimg_for_in3((img).depth,z0,z1,z)
- #define cimg_for_in3V(img,v0,v1,v) cimg_for_in3((img).dim,v0,v1,v)
- #define cimg_for_in3XY(img,x0,y0,x1,y1,x,y) cimg_for_in3Y(img,y0,y1,y) cimg_for_in3X(img,x0,x1,x)
- #define cimg_for_in3XZ(img,x0,z0,x1,z1,x,z) cimg_for_in3Z(img,z0,z1,z) cimg_for_in3X(img,x0,x1,x)
- #define cimg_for_in3XV(img,x0,v0,x1,v1,x,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3X(img,x0,x1,x)
- #define cimg_for_in3YZ(img,y0,z0,y1,z1,y,z) cimg_for_in3Z(img,z0,z1,z) cimg_for_in3Y(img,y0,y1,y)
- #define cimg_for_in3YV(img,y0,v0,y1,v1,y,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3Y(img,y0,y1,y)
- #define cimg_for_in3ZV(img,z0,v0,z1,v1,z,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3Z(img,z0,z1,z)
- #define cimg_for_in3XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_in3Z(img,z0,z1,z) cimg_for_in3XY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_in3XZV(img,x0,z0,v0,x1,y1,v1,x,z,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3XZ(img,x0,y0,x1,y1,x,z)
- #define cimg_for_in3YZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3YZ(img,y0,z0,y1,z1,y,z)
- #define cimg_for_in3XYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) cimg_for_in3V(img,v0,v1,v) cimg_for_in3XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for4(bound,i) \
- for (int i = 0, _p1##i = 0, _n1##i = 1>=(bound)?(int)(bound)-1:1, \
- _n2##i = 2>=(bound)?(int)(bound)-1:2; \
- _n2##i<(int)(bound) || _n1##i==--_n2##i || i==(_n2##i = --_n1##i); \
- _p1##i = i++, ++_n1##i, ++_n2##i)
- #define cimg_for4X(img,x) cimg_for4((img).width,x)
- #define cimg_for4Y(img,y) cimg_for4((img).height,y)
- #define cimg_for4Z(img,z) cimg_for4((img).depth,z)
- #define cimg_for4V(img,v) cimg_for4((img).dim,v)
- #define cimg_for4XY(img,x,y) cimg_for4Y(img,y) cimg_for4X(img,x)
- #define cimg_for4XZ(img,x,z) cimg_for4Z(img,z) cimg_for4X(img,x)
- #define cimg_for4XV(img,x,v) cimg_for4V(img,v) cimg_for4X(img,x)
- #define cimg_for4YZ(img,y,z) cimg_for4Z(img,z) cimg_for4Y(img,y)
- #define cimg_for4YV(img,y,v) cimg_for4V(img,v) cimg_for4Y(img,y)
- #define cimg_for4ZV(img,z,v) cimg_for4V(img,v) cimg_for4Z(img,z)
- #define cimg_for4XYZ(img,x,y,z) cimg_for4Z(img,z) cimg_for4XY(img,x,y)
- #define cimg_for4XZV(img,x,z,v) cimg_for4V(img,v) cimg_for4XZ(img,x,z)
- #define cimg_for4YZV(img,y,z,v) cimg_for4V(img,v) cimg_for4YZ(img,y,z)
- #define cimg_for4XYZV(img,x,y,z,v) cimg_for4V(img,v) cimg_for4XYZ(img,x,y,z)
- #define cimg_for_in4(bound,i0,i1,i) \
- for (int i = (int)(i0)<0?0:(int)(i0), \
- _p1##i = i-1<0?0:i-1, \
- _n1##i = i+1>=(int)(bound)?(int)(bound)-1:i+1, \
- _n2##i = i+2>=(int)(bound)?(int)(bound)-1:i+2; \
- i<=(int)(i1) && (_n2##i<(int)(bound) || _n1##i==--_n2##i || i==(_n2##i = --_n1##i)); \
- _p1##i = i++, ++_n1##i, ++_n2##i)
- #define cimg_for_in4X(img,x0,x1,x) cimg_for_in4((img).width,x0,x1,x)
- #define cimg_for_in4Y(img,y0,y1,y) cimg_for_in4((img).height,y0,y1,y)
- #define cimg_for_in4Z(img,z0,z1,z) cimg_for_in4((img).depth,z0,z1,z)
- #define cimg_for_in4V(img,v0,v1,v) cimg_for_in4((img).dim,v0,v1,v)
- #define cimg_for_in4XY(img,x0,y0,x1,y1,x,y) cimg_for_in4Y(img,y0,y1,y) cimg_for_in4X(img,x0,x1,x)
- #define cimg_for_in4XZ(img,x0,z0,x1,z1,x,z) cimg_for_in4Z(img,z0,z1,z) cimg_for_in4X(img,x0,x1,x)
- #define cimg_for_in4XV(img,x0,v0,x1,v1,x,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4X(img,x0,x1,x)
- #define cimg_for_in4YZ(img,y0,z0,y1,z1,y,z) cimg_for_in4Z(img,z0,z1,z) cimg_for_in4Y(img,y0,y1,y)
- #define cimg_for_in4YV(img,y0,v0,y1,v1,y,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4Y(img,y0,y1,y)
- #define cimg_for_in4ZV(img,z0,v0,z1,v1,z,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4Z(img,z0,z1,z)
- #define cimg_for_in4XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_in4Z(img,z0,z1,z) cimg_for_in4XY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_in4XZV(img,x0,z0,v0,x1,y1,v1,x,z,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4XZ(img,x0,y0,x1,y1,x,z)
- #define cimg_for_in4YZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4YZ(img,y0,z0,y1,z1,y,z)
- #define cimg_for_in4XYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) cimg_for_in4V(img,v0,v1,v) cimg_for_in4XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for5(bound,i) \
- for (int i = 0, _p2##i = 0, _p1##i = 0, \
- _n1##i = 1>=(bound)?(int)(bound)-1:1, \
- _n2##i = 2>=(bound)?(int)(bound)-1:2; \
- _n2##i<(int)(bound) || _n1##i==--_n2##i || i==(_n2##i = --_n1##i); \
- _p2##i = _p1##i, _p1##i = i++, ++_n1##i, ++_n2##i)
- #define cimg_for5X(img,x) cimg_for5((img).width,x)
- #define cimg_for5Y(img,y) cimg_for5((img).height,y)
- #define cimg_for5Z(img,z) cimg_for5((img).depth,z)
- #define cimg_for5V(img,v) cimg_for5((img).dim,v)
- #define cimg_for5XY(img,x,y) cimg_for5Y(img,y) cimg_for5X(img,x)
- #define cimg_for5XZ(img,x,z) cimg_for5Z(img,z) cimg_for5X(img,x)
- #define cimg_for5XV(img,x,v) cimg_for5V(img,v) cimg_for5X(img,x)
- #define cimg_for5YZ(img,y,z) cimg_for5Z(img,z) cimg_for5Y(img,y)
- #define cimg_for5YV(img,y,v) cimg_for5V(img,v) cimg_for5Y(img,y)
- #define cimg_for5ZV(img,z,v) cimg_for5V(img,v) cimg_for5Z(img,z)
- #define cimg_for5XYZ(img,x,y,z) cimg_for5Z(img,z) cimg_for5XY(img,x,y)
- #define cimg_for5XZV(img,x,z,v) cimg_for5V(img,v) cimg_for5XZ(img,x,z)
- #define cimg_for5YZV(img,y,z,v) cimg_for5V(img,v) cimg_for5YZ(img,y,z)
- #define cimg_for5XYZV(img,x,y,z,v) cimg_for5V(img,v) cimg_for5XYZ(img,x,y,z)
- #define cimg_for_in5(bound,i0,i1,i) \
- for (int i = (int)(i0)<0?0:(int)(i0), \
- _p2##i = i-2<0?0:i-2, \
- _p1##i = i-1<0?0:i-1, \
- _n1##i = i+1>=(int)(bound)?(int)(bound)-1:i+1, \
- _n2##i = i+2>=(int)(bound)?(int)(bound)-1:i+2; \
- i<=(int)(i1) && (_n2##i<(int)(bound) || _n1##i==--_n2##i || i==(_n2##i = --_n1##i)); \
- _p2##i = _p1##i, _p1##i = i++, ++_n1##i, ++_n2##i)
- #define cimg_for_in5X(img,x0,x1,x) cimg_for_in5((img).width,x0,x1,x)
- #define cimg_for_in5Y(img,y0,y1,y) cimg_for_in5((img).height,y0,y1,y)
- #define cimg_for_in5Z(img,z0,z1,z) cimg_for_in5((img).depth,z0,z1,z)
- #define cimg_for_in5V(img,v0,v1,v) cimg_for_in5((img).dim,v0,v1,v)
- #define cimg_for_in5XY(img,x0,y0,x1,y1,x,y) cimg_for_in5Y(img,y0,y1,y) cimg_for_in5X(img,x0,x1,x)
- #define cimg_for_in5XZ(img,x0,z0,x1,z1,x,z) cimg_for_in5Z(img,z0,z1,z) cimg_for_in5X(img,x0,x1,x)
- #define cimg_for_in5XV(img,x0,v0,x1,v1,x,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5X(img,x0,x1,x)
- #define cimg_for_in5YZ(img,y0,z0,y1,z1,y,z) cimg_for_in5Z(img,z0,z1,z) cimg_for_in5Y(img,y0,y1,y)
- #define cimg_for_in5YV(img,y0,v0,y1,v1,y,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5Y(img,y0,y1,y)
- #define cimg_for_in5ZV(img,z0,v0,z1,v1,z,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5Z(img,z0,z1,z)
- #define cimg_for_in5XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z) cimg_for_in5Z(img,z0,z1,z) cimg_for_in5XY(img,x0,y0,x1,y1,x,y)
- #define cimg_for_in5XZV(img,x0,z0,v0,x1,y1,v1,x,z,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5XZ(img,x0,y0,x1,y1,x,z)
- #define cimg_for_in5YZV(img,y0,z0,v0,y1,z1,v1,y,z,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5YZ(img,y0,z0,y1,z1,y,z)
- #define cimg_for_in5XYZV(img,x0,y0,z0,v0,x1,y1,z1,v1,x,y,z,v) cimg_for_in5V(img,v0,v1,v) cimg_for_in5XYZ(img,x0,y0,z0,x1,y1,z1,x,y,z)
- #define cimg_for6(bound,i) \
- for (int i = 0, _p2##i = 0, _p1##i = 0, \
- _n1##i = 1>=(bound)?(int)(bound)-1:1, \
- _n2##i = 2>=(bound)?(int)(bound)-1:2, \
- _n3##i = 3>=(bound)?(int)(bound)-1:3; \
- _n3##i<(int)(bound) || _n2##i==--_n3##i || _n1##i==--_n2##i || i==(_n3##i = _n2##i = --_n1##i); \
- _p2##i = _p1##i, _p1##i = i++, ++_n1##i, ++_n2##i, ++_n3##i)
- #define cimg_for6X(img,x) cimg_for6((img).width,x)
- #define cimg_for6Y(img,y) cimg_for6((img).height,y)
- #define cimg_for6Z(img,z) cimg_for6((img).depth,z)
- #define cimg_for6V(img,v) cimg_for6((img).dim,v)
- #define cimg_for6XY(img,x,y) cimg_for6Y(img,y) cimg_for6X(img,x)
- #define cimg_for6XZ(img,x,z) cimg_for6Z(img,z) cimg_for6X(img,x)
- #define cimg_for6XV(img,x,v) cimg_for6V(img,v) cimg_for6X(img,x)
- #define cimg_for6YZ(img,y,z) cimg_for6Z(img,z) cimg_for6Y(img,y)
- #define cimg_for6YV(img,y,v) cimg_for6V(img,v) cimg_for6Y(img,y)
- #define cimg_for6ZV(img,z,v) cimg_for6V(img,v) cimg_for6Z(img,z)
- #define cimg_for6XYZ(img,x,y,z) cimg_for6Z(img,z) cimg_for6XY(img,x,y)
- #define cimg_for6XZV(img,x,z,v) cimg_for6V(img,v) cimg_for6XZ(img,x,z)
- #define cimg_for6YZV(img,y,z,v) cimg_for6V(img,v) cimg_for6YZ(img,y,z)
- #define cimg_for6XYZV(img,x,y,z,v) cimg_for6V(img,v) cimg_for6XYZ(img,x,y,z)
- #define cimg_for_in6(bound…
Large files files are truncated, but you can click here to view the full file