From: nicolas Date: Mon, 27 Sep 2010 16:47:39 +0000 (+0000) Subject: ClampUpAxes minor clean up X-Git-Tag: 7.0.1-0~8798 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c90935cab9d995f4881c8b3c9f7bfd5a1e96b4b8;p=imagemagick ClampUpAxes minor clean up --- diff --git a/Magick++/bin/Magick++-config b/Magick++/bin/Magick++-config index 6ca2a2ee3..358177aa5 100755 --- a/Magick++/bin/Magick++-config +++ b/Magick++/bin/Magick++-config @@ -46,7 +46,7 @@ while test $# -gt 0; do echo "-I${includedir} -fopenmp" ;; --cxxflags) - echo '-pthread' + echo '-g -O2 -pthread' ;; --cppflags) echo '-I/usr/local/include/ImageMagick' @@ -55,7 +55,7 @@ while test $# -gt 0; do echo '-L/usr/local/lib ' ;; --libs) - echo "-L${libdir} -lMagick++ -lMagickWand -lMagickCore -ltiff -lfreetype -ljasper -ljpeg -lpng -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread -lltdl" + echo "-L${libdir} -lMagick++ -lMagickWand -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldjvulibre -lwmf -lwmflite -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lxml2 -lgvc -lgraph -lcdt -lz -lm -lgomp -lpthread -lltdl" ;; *) echo "${usage}" 1>&2 diff --git a/PerlMagick/Makefile.PL b/PerlMagick/Makefile.PL index 8178f18c2..af934ea3e 100644 --- a/PerlMagick/Makefile.PL +++ b/PerlMagick/Makefile.PL @@ -125,7 +125,7 @@ EOF # Compute test specification my $delegate_tests='t/*.t'; my $delegate; -foreach $delegate (qw/bzlib fontconfig freetype jpeg jng jp2 png tiff x11 xml zlib/) { +foreach $delegate (qw/bzlib djvu freetype gvc jpeg jng jp2 lcms openexr png tiff x11 xml wmf zlib/) { if ( -d "t/$delegate" ) { if ( defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) { if ( defined $ENV{'DISPLAY'} ) { @@ -138,9 +138,9 @@ foreach $delegate (qw/bzlib fontconfig freetype jpeg jng jp2 png tiff x11 xml zl } # defaults for LIBS & INC & CCFLAGS params that we later pass to Writemakefile -my $INC_magick = '-I../ -I.. -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"'; +my $INC_magick = '-I../ -I.. -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2 -I"' . $Config{'usrinc'} . '/ImageMagick"'; my $LIBS_magick = '-L../magick/.libs -lMagickCore -lperl -lm'; -my $CCFLAGS_magick = "$Config{'ccflags'} -fopenmp -g -O2 -Wall -pthread"; +my $CCFLAGS_magick = "$Config{'ccflags'} -pthread -I/usr/include/OpenEXR -fopenmp -g -O2 -Wall -pthread"; my $LDFLAGS_magick = "-L../magick/.libs -lMagickCore $Config{'ldflags'} "; my $LDDLFLAGS_magick = "-L../magick/.libs -lMagickCore $Config{'lddlflags'} "; @@ -183,7 +183,7 @@ WriteMakefile #'CC' => 'gcc -std=gnu99 -std=gnu99', # C pre-processor flags (e.g. -I & -D options) - # 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/freetype2 -I/usr/include/libxml2", + # 'CPPFLAGS' => "$Config{'cppflags'} -I/usr/include/graphviz -I/usr/include/freetype2 -I/usr/include/libxml2", # C compiler flags (e.g. -O -g) 'CCFLAGS' => $CCFLAGS_magick, diff --git a/config/configure.xml b/config/configure.xml index f6bae8e4f..10eceaf41 100644 --- a/config/configure.xml +++ b/config/configure.xml @@ -9,24 +9,24 @@ - + - + - + - + - + diff --git a/config/type-dejavu.xml b/config/type-dejavu.xml index 88c0d7224..0db1fc8e9 100644 --- a/config/type-dejavu.xml +++ b/config/type-dejavu.xml @@ -17,46 +17,46 @@ ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/type-ghostscript.xml b/config/type-ghostscript.xml index 0f5beb90f..d8d554b97 100644 --- a/config/type-ghostscript.xml +++ b/config/type-ghostscript.xml @@ -17,38 +17,38 @@ ]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/config/type.xml b/config/type.xml index 96866bf8f..ccf5d65dc 100644 --- a/config/type.xml +++ b/config/type.xml @@ -17,5 +17,5 @@ ]> - + diff --git a/libtool b/libtool index bf8c1ec95..180a2a209 100755 --- a/libtool +++ b/libtool @@ -1,8 +1,8 @@ -#! /bin/sh +#! /bin/bash # libtool - Provide generalized library-building support services. # Generated automatically by config.status (ImageMagick) 6.6.4-8 -# Libtool was configured on host magick.imagemagick.org: +# Libtool was configured on host nicolas-laptop: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, @@ -95,7 +95,7 @@ NM="/usr/bin/nm -B" LN_S="ln -s" # What is the maximum length of a command? -max_cmd_len=1966080 +max_cmd_len=3458764513820540925 # Object file suffix (normally "o"). objext=o @@ -138,7 +138,7 @@ old_postuninstall_cmds="" LTCC="gcc -std=gnu99 -std=gnu99" # LTCC compiler flags. -LTCFLAGS="-fopenmp -g -O2 -Wall -pthread" +LTCFLAGS="-pthread -I/usr/include/OpenEXR -fopenmp -g -O2 -Wall -pthread" # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" @@ -156,7 +156,7 @@ global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\ objdir=.libs # Shell to use when invoking shell scripts. -SHELL="/bin/sh" +SHELL="/bin/bash" # An echo program that does not interpret backslashes. ECHO="echo" @@ -240,10 +240,10 @@ finish_eval="" hardcode_into_libs=yes # Compile-time system search path for libraries. -sys_lib_search_path_spec="/usr/lib/gcc/x86_64-redhat-linux/4.4.4 /usr/lib64 /lib64" +sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib /lib /usr/lib/x86_64-linux-gnu" # Run-time system search path for libraries. -sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib64/atlas /usr/lib64/mysql /usr/lib64/qt-3.3/lib /usr/lib/wine/ /usr/lib64/wine/ /usr/lib64/xulrunner-1.9.2 " +sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/lib/mesa /usr/lib32/mesa /usr/lib/alsa-lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu " # Whether dlopen is supported. dlopen_support=yes @@ -252,7 +252,7 @@ dlopen_support=yes dlopen_self=yes # Whether dlopen of statically linked programs is supported. -dlopen_self_static=yes +dlopen_self_static=no # Commands to strip libraries. old_striplib="strip --strip-debug" @@ -281,7 +281,7 @@ wl="-Wl," pic_flag=" -fPIC -DPIC" # Compiler flag to prevent dynamic linking. -link_static_flag="" +link_static_flag="-static" # Does compiler simultaneously support -c and -o options? compiler_c_o="yes" @@ -8915,31 +8915,31 @@ build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. -LD="" +LD="/usr/bin/ld -m elf_x86_64" # Commands used to build an old-style archive. old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" # A language specific compiler. -CC="" +CC="g++" # Is the compiler the GNU compiler? -with_gcc= +with_gcc=yes # Compiler flag to turn off builtin functions. -no_builtin_flag="" +no_builtin_flag=" -fno-builtin" # How to pass a linker flag through the compiler. -wl="" +wl="-Wl," # Additional compiler flags for building library objects. -pic_flag="" +pic_flag=" -fPIC -DPIC" # Compiler flag to prevent dynamic linking. -link_static_flag="" +link_static_flag="-static" # Does compiler simultaneously support -c and -o options? -compiler_c_o="" +compiler_c_o="yes" # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=no @@ -8948,10 +8948,10 @@ build_libtool_need_lc=no allow_libtool_libs_with_static_runtimes=no # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="" +export_dynamic_flag_spec="\${wl}--export-dynamic" # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="" +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" # Whether the compiler copes with passing no objects directly. compiler_needs_object="no" @@ -8963,8 +8963,8 @@ old_archive_from_new_cmds="" old_archive_from_expsyms_cmds="" # Commands used to build a shared archive. -archive_cmds="" -archive_expsym_cmds="" +archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib" # Commands used to build a loadable module if different from building # a shared archive. @@ -8972,7 +8972,7 @@ module_cmds="" module_expsym_cmds="" # Whether we are building with GNU ld or not. -with_gnu_ld="" +with_gnu_ld="yes" # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag="" @@ -8982,7 +8982,7 @@ no_undefined_flag="" # Flag to hardcode $libdir into a binary during linking. # This must work even if $libdir does not exist -hardcode_libdir_flag_spec="" +hardcode_libdir_flag_spec="\${wl}-rpath \${wl}\$libdir" # If ld is used when linking, flag to hardcode $libdir into a binary # during linking. This must work even if $libdir does not exist. @@ -9028,10 +9028,10 @@ fix_srcfile_path="" always_export_symbols=no # The commands to list exported symbols. -export_symbols_cmds="" +export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" # Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="" +exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*" # Symbols that must always be exported. include_expsyms="" @@ -9043,20 +9043,20 @@ prelink_cmds="" file_list_spec="" # How to hardcode a shared library path into an executable. -hardcode_action= +hardcode_action=immediate # The directories searched by this compiler when creating a shared library. -compiler_lib_search_dirs="" +compiler_lib_search_dirs="/usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib/gcc/x86_64-linux-gnu/4.4.3 /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib /lib/../lib /usr/lib/../lib /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. /usr/lib/x86_64-linux-gnu" # Dependencies to place before and after the objects being linked to # create a shared library. -predep_objects="" -postdep_objects="" +predep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtbeginS.o" +postdep_objects="/usr/lib/gcc/x86_64-linux-gnu/4.4.3/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib/crtn.o" predeps="" -postdeps="" +postdeps="-lstdc++ -lm -lgomp -lgcc_s -lpthread -lc -lgcc_s" # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path="" +compiler_lib_search_path="-L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3 -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../.. -L/usr/lib/x86_64-linux-gnu" # ### END LIBTOOL TAG CONFIG: CXX diff --git a/magick/Magick-config b/magick/Magick-config index b64039c35..467f513f6 100755 --- a/magick/Magick-config +++ b/magick/Magick-config @@ -43,7 +43,7 @@ while test $# -gt 0; do echo "-I${includedir} -fopenmp" ;; --cxxflags) - echo '-pthread' + echo '-g -O2 -pthread' ;; --cppflags) echo '-I/usr/local/include/ImageMagick' @@ -52,7 +52,7 @@ while test $# -gt 0; do echo '-L/usr/local/lib ' ;; --libs) - echo "-L${libdir} -lMagickCore -ltiff -lfreetype -ljasper -ljpeg -lpng -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread -lltdl" + echo "-L${libdir} -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldjvulibre -lwmf -lwmflite -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lxml2 -lgvc -lgraph -lcdt -lz -lm -lgomp -lpthread -lltdl" ;; *) echo "${usage}" 1>&2 diff --git a/magick/magick-config.h b/magick/magick-config.h index 8aa230006..9fe2d4c5b 100644 --- a/magick/magick-config.h +++ b/magick/magick-config.h @@ -20,9 +20,7 @@ #endif /* Define if you have CAIRO library */ -#ifndef MAGICKCORE_CAIRO_DELEGATE -#define MAGICKCORE_CAIRO_DELEGATE 1 -#endif +/* #undef CAIRO_DELEGATE */ /* permit enciphering and deciphering image pixels */ #ifndef MAGICKCORE_CIPHER_SUPPORT @@ -54,7 +52,9 @@ #endif /* Define if you have DJVU library */ -/* #undef DJVU_DELEGATE */ +#ifndef MAGICKCORE_DJVU_DELEGATE +#define MAGICKCORE_DJVU_DELEGATE 1 +#endif /* Directory where ImageMagick documents live. */ #ifndef MAGICKCORE_DOCUMENTATION_PATH @@ -89,9 +89,7 @@ #endif /* Define if you have FONTCONFIG library */ -#ifndef MAGICKCORE_FONTCONFIG_DELEGATE -#define MAGICKCORE_FONTCONFIG_DELEGATE 1 -#endif +/* #undef FONTCONFIG_DELEGATE */ /* Define if you have FlashPIX library */ /* #undef FPX_DELEGATE */ @@ -105,7 +103,9 @@ /* #undef GS_DELEGATE */ /* Define if you have GVC library */ -/* #undef GVC_DELEGATE */ +#ifndef MAGICKCORE_GVC_DELEGATE +#define MAGICKCORE_GVC_DELEGATE 1 +#endif /* Define to 1 if you have the `argz_add' function. */ #ifndef MAGICKCORE_HAVE_ARGZ_ADD @@ -161,7 +161,9 @@ #endif /* define if bool is a built-in type */ -/* #undef HAVE_BOOL */ +#ifndef MAGICKCORE_HAVE_BOOL +#define MAGICKCORE_HAVE_BOOL /**/ +#endif /* Define to 1 if you have the `cimag' function. */ #ifndef MAGICKCORE_HAVE_CIMAG @@ -392,7 +394,9 @@ /* #undef HAVE_LCMS2_LCMS2_H */ /* Define if you have the header file. */ -/* #undef HAVE_LCMS_H */ +#ifndef MAGICKCORE_HAVE_LCMS_H +#define MAGICKCORE_HAVE_LCMS_H 1 +#endif /* Define if you have the header file. */ /* #undef HAVE_LCMS_LCMS_H */ @@ -445,7 +449,9 @@ #endif /* define if the compiler implements L"widestring" */ -/* #undef HAVE_LSTRING */ +#ifndef MAGICKCORE_HAVE_LSTRING +#define MAGICKCORE_HAVE_LSTRING /**/ +#endif /* Define this if a modern libltdl is already installed */ #ifndef MAGICKCORE_HAVE_LTDL @@ -494,10 +500,14 @@ #endif /* define if the compiler implements namespaces */ -/* #undef HAVE_NAMESPACES */ +#ifndef MAGICKCORE_HAVE_NAMESPACES +#define MAGICKCORE_HAVE_NAMESPACES /**/ +#endif /* Define if g++ supports namespace std. */ -/* #undef HAVE_NAMESPACE_STD */ +#ifndef MAGICKCORE_HAVE_NAMESPACE_STD +#define MAGICKCORE_HAVE_NAMESPACE_STD /**/ +#endif /* Define to 1 if you have the `nanosleep' function. */ #ifndef MAGICKCORE_HAVE_NANOSLEEP @@ -698,7 +708,9 @@ #endif /* define if the compiler supports ISO C++ standard library */ -/* #undef HAVE_STD_LIBS */ +#ifndef MAGICKCORE_HAVE_STD_LIBS +#define MAGICKCORE_HAVE_STD_LIBS /**/ +#endif /* Define to 1 if you have the `strcasecmp' function. */ #ifndef MAGICKCORE_HAVE_STRCASECMP @@ -1059,7 +1071,9 @@ #endif /* Define if you have LCMS (v1.11 or later) library */ -/* #undef LCMS_DELEGATE */ +#ifndef MAGICKCORE_LCMS_DELEGATE +#define MAGICKCORE_LCMS_DELEGATE 1 +#endif /* Directory where architecture-dependent files live. */ #ifndef MAGICKCORE_LIBRARY_PATH @@ -1085,7 +1099,7 @@ /* Define to the system default library search path. */ #ifndef MAGICKCORE_LT_DLSEARCH_PATH -#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-1.9.2" +#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib/mesa:/usr/lib32/mesa:/usr/lib/alsa-lib:/usr/local/lib:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu" #endif /* The archive extension */ @@ -1126,7 +1140,9 @@ /* #undef NO_MINUS_C_MINUS_O */ /* Define if you have OPENEXR library */ -/* #undef OPENEXR_DELEGATE */ +#ifndef MAGICKCORE_OPENEXR_DELEGATE +#define MAGICKCORE_OPENEXR_DELEGATE 1 +#endif /* Define to the address where bug reports for this package should be sent. */ #ifndef MAGICKCORE_PACKAGE_BUGREPORT @@ -1329,7 +1345,9 @@ /* #undef WITH_DMALLOC */ /* Define if you have WMF library */ -/* #undef WMF_DELEGATE */ +#ifndef MAGICKCORE_WMF_DELEGATE +#define MAGICKCORE_WMF_DELEGATE 1 +#endif /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ diff --git a/magick/resample.c b/magick/resample.c index 083f89769..b929cf816 100644 --- a/magick/resample.c +++ b/magick/resample.c @@ -1214,22 +1214,22 @@ MagickExport MagickBooleanType ResamplePixelColor( % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % -% ClampUpAxes() function converts the input vectors into a major and minor -% axis unit vectors, and their magnatude. This form allows us to ensure that -% the ellipse generated is never smaller than the unit circle and thus never -% too small for use in EWA resampling. +% ClampUpAxes() function converts the input vectors into a major and +% minor axis unit vectors, and their magnatude. This form allows us +% to ensure that the ellipse generated is never smaller than the unit +% circle and thus never too small for use in EWA resampling. % -% This is purely mathematical 'magic' that was provided by Professor -% Nicolas Robidoux, in conjunction with his Phd student Chantal Racette. +% This purely mathematical 'magic' was provided by Professor Nicolas +% Robidoux and his Masters student Chantal Racette. % % See Reference: "We Recommend Singular Value Decomposition", David Austin % http://www.ams.org/samplings/feature-column/fcarc-svd % -% By generating Major and Minor Axis vectors, we can actually use the ellipse -% in its "canonical form", by remapping the dx,dy of the sampled point into -% distances along the major and minor axis unit vectors. +% By generating Major and Minor Axis vectors, we can actually use the +% ellipse in its "canonical form", by remapping the dx,dy of the +% sampled point into distances along the major and minor axis unit +% vectors. % http://en.wikipedia.org/wiki/Ellipse#Canonical_form -% */ static void ClampUpAxes(const double dux, const double dvx, @@ -1282,6 +1282,21 @@ static void ClampUpAxes(const double dux, * to compute the distance between a point in output space and the * center (of a disk) from the position of the corresponding point * in input space. + * + * Now, if you want to modify the input pair of tangent vectors so + * that it defines the modified ellipse, all you have to do is set + * + * newdux = sigmamajor * unitmajor1 + * newdvx = sigmamajor * unitmajor2 + * newduy = sigmaminor * -unitmajor2 + * newdvy = sigmaminor * unitmajor1 + * + * and use these new tangent vectors "as if" they were the original + * ones. Most of the time this is a rather drastic change in the + * tangent vectors (even if the singular values are large enough not + * to be clampled). A technical explanation of why things still work + * is found at the end of the discussion below. + * */ /* * Discussion: @@ -1305,8 +1320,8 @@ static void ClampUpAxes(const double dux, * * The Jacobian matrix J is equal to * - * [ A, B ] = [ dX/dx, dX/dy ] - * [ C, D ] = [ dY/dx, dY/dy ] + * [ A, B ] = [ dX/dx, dX/dy ] + * [ C, D ] = [ dY/dx, dY/dy ] * * Consequently, the vector [A,C] is the tangent vector * corresponding to input changes in the horizontal direction, and @@ -1316,22 +1331,55 @@ static void ClampUpAxes(const double dux, * In the context of resampling, it is more natural to use the * inverse Jacobian matrix Jinv. Jinv is * - * [ a, b ] = [ dx/dX, dx/dY ] - * [ c, d ] = [ dy/dX, dy/dY ] + * [ a, b ] = [ dx/dX, dx/dY ] + * [ c, d ] = [ dy/dX, dy/dY ] * * Note: Jinv can be computed from J with the following matrix * formula: * - * Jinv = 1/(A*D-B*C) [ D, -B ] - * [ -C, A ] + * Jinv = 1/(A*D-B*C) [ D, -B ] + * [ -C, A ] + * + * Now: What we implicitly want to do is replace Jinv by a new Jinv + * which generates an ellipse which is as close as possible to the + * original but which contains the unit disk. Formally, this can be + * done like this: + * + * Let + * + * Jinv = U Sigma V^T + * + * be an SVD decomposition of Jinv. (The SVD is not unique.) In + * principle, what we want is to clamp up the entries of the + * diagonal matrix Sigma so that they are at least 1, and then set + * + * Jinv = U newSigma V^T. + * + * However, we do not need to compute V^T for the following reason: + * V is an orthogonal matrix (that is, it represents a combination + * of a rotation and a reflexion). Consequently, V maps the unit + * circle to itself. For this reason, the exact value of V does not + * affect the final ellipse. + * + * For this reason, we simply set + * + * Jinv = U newSigma, + * + * omitting the V^T factor altogether. More precisely, we return the + * two diagonal entries of newSigma together with the two columns of + * U, for a total of six returned quantities. */ /* * ClampUpAxes was written by Nicolas Robidoux and Chantal Racette - * of Laurentian University. The only (possibly) new math in it is - * the selection of the largest row of the eigen matrix system in - * order to stabilize the computation in near rank-deficient cases, - * and the corresponding efficient repair of degenerate cases using - * the norm of this largest row. + * of Laurentian University with funding from the National Science + * and Engineering Research Council of Canada. + * + * The only (possibly) new math in it is the selection of the + * largest row of the eigen matrix system in order to stabilize the + * computation in near rank-deficient cases, and the corresponding + * efficient repair of degenerate cases using the norm of this + * largest row. Omitting the "V^T" factor of the SVD may also be a + * new "trick." */ const double a = dux; const double b = duy; @@ -1364,7 +1412,8 @@ static void ClampUpAxes(const double dux, * value of the Jacobian matrix itself. * If s1 = 0, both singular values are 0, and any orthogonal pair of * left and right factors produces a singular decomposition of Jinv. - * + */ + /* * At first, we only compute the squares of the singular values. */ const double s1s1 = 0.5*(frobenius_squared+sqrt_discriminant); @@ -1379,8 +1428,9 @@ static void ClampUpAxes(const double dux, /* * u1, the first column of the U factor of a singular decomposition * of Jinv, is a (non-normalized) left singular vector corresponding - * to s1. It has entries u11 and u21. u1 is an eigenvector of n - * corresponding to the eigenvalue s1^2. + * to s1. It has entries u11 and u21. We compute u1 from the fact + * that it is an eigenvector of n corresponding to the eigenvalue + * s1^2. */ const double s1s1minusn11_squared = s1s1minusn11*s1s1minusn11; const double s1s1minusn22_squared = s1s1minusn22*s1s1minusn22; @@ -1409,10 +1459,13 @@ static void ClampUpAxes(const double dux, */ *major_mag = ( (s1s1<1.0) ? 1.0 : sqrt(s1s1) ); *minor_mag = ( (s2s2<1.0) ? 1.0 : sqrt(s2s2) ); + /* + * Return the unit major and minor axis direction vectors. + */ *major_unit_x = u11; *major_unit_y = u21; - *minor_unit_x = u21; - *minor_unit_y = -u11; + *minor_unit_x = -u21; + *minor_unit_y = u11; } #endif diff --git a/magick/version.h b/magick/version.h index 0728b1ec6..14b1ad47b 100644 --- a/magick/version.h +++ b/magick/version.h @@ -33,8 +33,8 @@ extern "C" { #define MagickLibAddendum "-8" #define MagickLibInterface 4 #define MagickLibMinInterface 4 -#define MagickReleaseDate "2010-09-26" -#define MagickChangeDate "20100925" +#define MagickReleaseDate "2010-09-27" +#define MagickChangeDate "20100927" #define MagickAuthoritativeURL "http://www.imagemagick.org" #define MagickFeatures "OpenMP " #define MagickHomeURL "file:///usr/local/share/doc/ImageMagick-6.6.4/index.html" diff --git a/wand/Wand-config b/wand/Wand-config index dd7d2fa43..cf9b4cee8 100755 --- a/wand/Wand-config +++ b/wand/Wand-config @@ -43,7 +43,7 @@ while test $# -gt 0; do echo "-I${includedir} -fopenmp" ;; --cxxflags) - echo '-pthread' + echo '-g -O2 -pthread' ;; --cppflags) echo '-I/usr/local/include/ImageMagick' @@ -52,7 +52,7 @@ while test $# -gt 0; do echo '-L/usr/local/lib ' ;; --libs) - echo "-L${libdir} -lMagickWand -lMagickCore -ltiff -lfreetype -ljasper -ljpeg -lpng -lfontconfig -lXext -lXt -lSM -lICE -lX11 -lbz2 -lxml2 -lz -lm -lgomp -lpthread -lltdl" + echo "-L${libdir} -lMagickWand -lMagickCore -llcms -ltiff -lfreetype -ljasper -ljpeg -lpng -ldjvulibre -lwmf -lwmflite -lXext -lXt -lSM -lICE -lX11 -lbz2 -pthread -lIlmImf -lz -lImath -lHalf -lIex -lIlmThread -lxml2 -lgvc -lgraph -lcdt -lz -lm -lgomp -lpthread -lltdl" ;; *) echo "${usage}" 1>&2