enblend-enfuse-4.1.2+dfsg/0000755000175100017510000000000012232763264015570 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/NEWS0000644000175100017510000005701412224471735016276 0ustar ametzlerametzler* Version 4.1.x -- Stable Branch Patchlevel 2 Released on October 7, 2013. ** Bug Fixes - [Enblend and Enfuse] Fix a bug in the highlight-recovery that caused Enfuse to bail out with the uncaught exception "Minimizer1D::set_bracket: minimum not bracketed". This addresses LaunchPad Bug #1214004. - [Enfuse] Clean up seemingly random, bright-colored pixels that sometimes show up when fusing images with high contrast and "large" color profiles. Patchlevel 1 Released on February 15, 2013. ** Bug Fixes - [Enblend only] Fix a race condition in the seam-line optimizer that can cause wrongly placed seams. - [Enblend and Enfuse] Use a per-thread storage of all OpenMP Vigra-functors. This avoids data races. - [Enblend and Enfuse] The Boost implementation of the `Mersenne Twister' random number generator caused segmentation faults when used in the OpenMP-enabled versions of Enblend and Enfuse. The new implementation is based on the GNU Scientific Library (GSL), which plays nicely with concurrent accesses. - [Enblend only] Correct a mistake that causes overlapping images with multiple seams to be blended incorrectly. - [Enblend only] Require the OpenGL extension `GL_ARB_texture_rectangle' for the `--gpu' option to work. This does away with a pesky warning of OpenGL drivers that do support this extension and avoids crashes with drivers that don't. The GPU performance improvement of Enblend via `--gpu' now is only available with drivers that feature `GL_ARB_texture_rectangle' (among many other required OpenGL extensions). The OpenGL warning about odd texture sizes is unaffected by this change. - [Enblend and Enfuse] Fix a longstanding quirk, which allowed to load masks that were unsuitable for processing. * Version 4.1 "Trouble In Paradise" Released on December 8, 2012. ** Improvements - All deprecated options since version 4.0 have been removed. - A new primary seam-line generator, based on a Graph-Cut algorithm, has been implemented during GSoC 2011 by Mikołaj Leszczyński. The old Nearest-Feature Transform remains the default. The new algorithm is activated with "--primary-seam-generator=graph-cut". - The difference image on which Enblend's seam-line optimization relies for color images uses a perceptual model by default (option "--image-difference"), yielding a true CIE76 "Delta E" with the (default) luminance and chrominance weights of 1. - Parallelize CIECAM02 color conversion (option "--ciecam"). Speedups of up to 40% have been reported on the amd64 architecture. The computationally expensive color-space conversion still slows down blending and fusing by some 25%. - Enblend and Enfuse integrate seamlessly in color-managed workflow. Input images with color profiles automatically enable CIECAM blending and the output image is assigned the input images' color profile. - Enblend and Enfuse exploit a new feature in LittleCMS Version 2.x called "Unbounded CMM". Thereby, the hue and saturation of extreme shadows and highlights can be preserved much longer before pure black or white are reached. See: http://www.littlecms.com/CIC18_UnboundedCMM.pdf - Assign different profiles to profile-free input images with option "--fallback-profile" instead of being tied to sRGB. - A new gray-scale projector called "anti-value" helps when fusing with the intent of minimizing the noise in the output image. When employing a lower exposure cutoff this even is the default projector. - Both Enblend and Enfuse stop right after saving all generated masks to files, if option "--save-masks" is given, but option "--output" is not. This allows to splice tools that manipulate the masks and feed the masks back into Enblend and Enfuse with option "--load-masks". When combining option "--output" and "--save-masks" Enblend and Enfuse write all masks and the final output image as before. - Both Enblend and Enfuse can write their output JPEG files with arithmetic JPEG compression and TIFF files with JPEG compression, if the underlying JPEG and TIFF libraries support these compression schemes. ** Bug Fixes - Enblend and Enfuse consistently warn if they are passed input images that alternate between with color profile and without. - Grant SourceForge feature request ID 2991909 (OSX only). Previous to that, Enblend, when launched from a terminal window with GPU-acceleration (option "--gpu"), started a second, non-responsive terminal window and when this new Enblend window tried to "steal" the focus, it displayed the OSX rotating "beach ball". With the fix that all goes away. Also the responsiveness of the screen improves, which means that the non-functional window also hogged GUI resources. ** New Commandline Options - Option "--primary-seam-generator" controls the primary seam-line generation algorithm. - Option "--image-difference" selects the difference image calculation algorithm and optionally assigns weights to the luminance and the chrominance part of the difference image. - Short option "-c" now has a sibling called "--ciecam". The long option also has a negated form: "--no-ciecam"; the short one has not. - The option "--fallback-profile=PROFILE" allows users to pass their own profiles for image sets that come without ICC color profiles. Before the hard-coded profile was sRGB. - The option "--exposure-cutoff" facilitates tailoring the exposure weight curve specifically to exclude underexposed (and probably noisy) or overexposed pixels from fusion. - In Enblend option "--load-masks" disables all mask computations and loads the blend masks directly from the specified files. This is the dual of Enblend's long-known option "--save-masks". - The option "--layer-selector" overrides the standard default layer selector. - In addition to the usual integral values option "--levels" takes the keyword "auto", which restores the default. (The default is to automatically choose the maximum number of pyramid levels for each separate overlapping region.) ** Deprecated Features - The option "--smooth-difference" will be eliminated in the next version of Enblend; it has not helped and moreover only put lipstick on the seamline-optimizer's objective function. - The user-(re)sizable image-cache will not be available in later versions of Enblend and Enfuse. We are not sure yet whether it will be replaced by an mmap-based solution or just tossed out. ** Developer Stuff - XHTML validation does not rely on network access anymore. This means all necessary DTDs must be available locally and all catalogs must be set up correctly to build the XHTML documentation. - The option "--parameter" allows developers to pass arbitrary key-value pairs to Enblend and Enfuse. The keys must match the regular expression [A-Za-z][A-Za-z0-9_-]*; the values can be almost any string. No further checking or validation is performed. For more explanations on how to use parameters in the source code, see the block-comment within "namespace parameter" in file "common.h". ** Package Maintainer Stuff - Enblend and Enfuse now use LittleCMS version 2.x. - Enblend and Enfuse no longer rely on their own versions of the Vigra imaging library. Vigra version 1.8 or later is now required to build. - Enblend no longer relies on libXMI. (Enfuse never needed this library.) * Version 4.0 Released on December 13, 2009. ** Improvements - Huge new documentation in Info, PS, PDF, and XHTML formats. Plain HTML format is not supported because it cannot portably render MathML. - New manual pages. - Automatic bit depth conversion between input and output images if necessary. For example: given 16-bit TIFF input images and a JPEG output image Enblend and Enfuse automatically convert from 16-bit to 8-bit before writing the JPEG file. - Compilation without image cache works again ("--disable-image-cache"). Speedups of up to 30% have been reported on the amd64 architecture. - Enblend and Enfuse accept repsonse files in addition to literal image files. Response files contain lists of image filenames or names of other response files. - Lots of new warnings if a command-line option has no effect, like, for example, combining a mask optimization option with "--no-optimize". - Enblend shows the initial, unoptimized seam line in addition to the optimized one in all seam-line visualization images (option "--visualize"). - Enblend and Enfuse read multi-layer TIFF files ("multi directory" in TIFF jargon). It is even possible to mix multi-layer with single layer images. This partially fixes SourceForge bug ID 1170329. - Save masks with (lossless) "Deflate" compression. - An improved wrap-around option, formerly only "-w", now "-wMODE" and "--wrap=MODE", lets the user determine whether to create a 360 degrees horizontal or vertical panorama. It is possible to wrap around vertically and horizontally at the same time. - Without any output filename given, i.e. no "-o" option, the output filename now defaults to "a.tif", making "-o" truly an option. - The user has better control of the number of pyramid levels. Previously only the maximum number in any blend could be reduced by the "-l" option. Now, the maximum number can be reduced by a fixed amount no matter what the actual maximum number of permissible pyramid levels is. - Use OpenMP to make better use of multi-processor machines. As the image cache is not reentrant, OpenMP can only be activated when the image cache is disabled. - Enblend and Enfuse issue messages following the GNU standard. ** Bug Fixes - Fix the calculation of the number of blending levels. Previously, it was off by one in most cases. - A longstanding bug (SourceForge ID 2160427) in the primary seam line generation that caused a sub-optimal seam line was fixed. As a side effect the new seam line algorithm is at least 20% faster than the old one. - Another longstanding bug (SourceForge ID 1891785) that caused wrong output for images with holes was also fixed. - Fix a well hidden but serious bug in the seam line optimization. Both, the GPU and non-GPU versions of the optimizer were affected. - Make Enblend and Enfuse aware of the input images' resolution. Use the input resolution in the output file. With this change masks get the correct offsets. This fixes the bug that masks do not end up at the correct position with respect to the input files. - Fix MacOS problem of parsing floating-point parameters at the command line. ** New Commandline Options - All Enfuse options have been converted to Enblend's option naming scheme. This is, camel-casing has been replaced by lowercase plus dashes. The new option name are more systematically constructed, too. The old options will completely dissapear in the next release, 4.1. Old Option New Option ==================== ======================== --ContrastWindowSize --contrast-window-size --EdgeScale --contrast-edge-scale --EntropyCutoff --entropy-cutoff --EntropyWindowSize --entropy-window-size --GrayProjector --gray-projector --HardMask --hard-mask --MinCurvature --contrast-min-curvature --SaveMasks --save-masks --SoftMask --soft-mask --wContrast --contrast-weight --wEntropy --entropy-weight --wExposure --exposure-weight --wExposureMu --exposure-mu --wExposureSigma --exposure-sigma --wSaturation --saturation-weight - New option to control the output bit depth ("--depth"). - Mask filenames can be specified with templates. * Enblend ("--save-masks", "--load-masks", "--visualize"): Save and load all masks of a project in a single run. Same for seam line visualization files. * Enfuse ("--save-masks"): Save soft and hard masks according to path given in template. - New option to control the mask vectorization, which is done before any mask optimizations ("--mask-vectorize"). - New option to control the Simulated Annealing optimizer called strategy 1 ("--anneal"). - New option to control the relative weights of the distance to the initial seam line and the total mismatch ("--optimizer-weights"). - New option to control the Dijkstra path minimizer called strategy 2 ("--dijkstra"). - Option "--coarse-mask" takes an optional (linear) reduction factor. The default remains at 8. - New option "--smooth-difference" to blur difference images prior to seam-line optimization. - Long option "--levels" to control the number of levels; duplicates functionality of short option "-l". ** Removed Commandline Options - After having been deprecated for a long time, Enfuse's option "--debug", which saved the masks used in fusing, was removed. Option "--save-masks" now provides a superset of the previous functionality. - After having been deprecated for a long time, Enblend's and Enfuse's option "-z", which compressed TIFF-output files with the LZW algorithm, was removed. Option "--compression" now provides a superset of the previous functionality and "--compression=LZW" is a substitute for "-z". ** Developer Stuff - VPATH builds work. This makes it easy to compile for differently configured versions, like for example with and without image cache. - The target "make distcheck" works again. - Introduce additional Make variables to control the Make process after the project was configured. See "README" file. - Debugging of dynamic memory allocation has been eased by the integration of the DMalloc package; "configure --with-dmalloc" - Use only m4 files that clearly have a GPL license. This fixes SourceForge feature request ID 2152850. - Remove all files that are meant to be generated auto Autoconf. This fixes SourceForge bug ID 2036031. - Install m4 file to detect the M$ compiler. This fixes SourceForge bug ID 2036034. - Make "configure" report that extra features will get compiled and if they cannot tell the developer why not. - Pull version of program and documentation into file "VERSION". Both program and documentation automatically use this information on every build. - The MSVC project files were removed. They can be regenerated by the (still experimental) CMake environment. - README hosts build instructions for GNU Autoconf/Automake based systems, for MacOSX, and for Win. ** What is known not to work? - Documentation generation is not as reliable and smooth as it ought to be. The culprit is Automake; see PR/486. * Version 3.2 Released on September 8, 2008. ** Improvements - Official release of Enfuse for automatic multi-level exposure blending and focus stack creation. - Support for PNG and OpenEXR input files. - Support for writing JPEG output files (8 bit only). ** Bug Fixes - Bugfix to correctly interpret the alpha channel of float (HDR) images. ** New Commandline Options - New --compression option for selecting the compression type of the output image. ** Developer Stuff - This release includes a Windows binary that does not require a SSE2-capable processor. - There will not be a 3.1 release in order to avoid confusion with numerous cvs builds that self-identify as version 3.1. * Version 3.0 Released on January 27, 2007. ** Improvements - New, faster image processing algorithms for computing Gaussian and Laplacian pyramids. ** New Commandline Options - Optional optimization of seam line placement to try to avoid mismatches and parallax errors in the image overlap region. - Masks can now be saved and loaded from files. This makes it possible to manually edit the location of the seam before multiresolution spline blending is applied. - Checkpointing of partial results is now optional. This improves speed. - Optional blending using the CIECAM02 color appearance model. Your TIFF files should have embedded ICC profiles in order to use this option. This replaces the CIE L*a*b* color blending in Enblend 2.X that never worked properly. - Optional use of the graphics processor to speed up certain computations. This feature is experimental and may not work on all systems. ** Developer Stuff - Like other X.0 releases, please consider this a beta. * Version 2.5 Released on December 11, 2005. ** Bug Fixes - Fixed a bug where Enblend would crash when the -w parameter was used. - Fixed a bug where Enblend would sometimes say "mask transition line bounding box undefined." * Version 2.4 Released on December 3, 2005. ** Improvements - Enblend will now create output files with embedded ICC profiles. The first ICC profile found amongst the input images will be copied to the output image. Enblend does not use ICC profiles to do color calculations. - Incorporated a patch from Fulvio Senore to make the mask generation faster. Fulvio wrote a more efficient data structure for use in the nearest feature transform. ** New Commandline Options - Added support for working with cropped and shifted input images. These types of files are created by Nona's "Multiple TIFF" stitching option. A cropped and shifted TIFF saves space and time because it is just large enough for a single input image, instead of being the size of the entire output panorama with lots of empty space all around. Nona embeds an (x, y) offset coordinate in the file so that Enblend can tell where this file belongs in the final panorama. By default, if you give Enblend cropped and shifted TIFFs, the output will also be a cropped and shifted TIFF. Sometimes you may want to include the extra blank space anyway, for example if you are creating a 360-degree panorama and the image size must be exactly a 2:1 ratio. In this case, use the new -f parameter to manually set the size of the output image: -f WIDTHxHEIGHT Thanks to Pablo d'Angelo for providing this patch. * Version 2.3 Released on April 17, 2005. ** Bug Fixes - Fixed a bug in temporary file handling in the Windows version of enblend. This should solve the "unable to open temporary file" error. - Reduced the maximum number of levels you can specify with the -l parameter from 30 to 29. While both of these are impractically large, at least 29 does not lead to arithmetic overflow and a subsequent crash. - Fixed a bug in temporary file handling in the Windows version of enblend. This should solve the "unable to open temporary file" error. * Version 2.2 Released on February 5, 2004. ** Improvements - The Windows binary of Enblend is now build with a version of libtiff that includes support for all of the TIFF compression standards, such as Deflate, LZW, JPEG, and Packbits. Nona/Hugin produces TIFF files with the Deflate option. - Replaced some system calls that are specific to Windows 2000 and XP with more generic functions. This should get the Windows binary of Enblend to run on pre-Win2K machines. ** Bug Fixes - This release fixes issues with the Windows version of Enblend. If you are using Enblend on UN*X you do not need to upgrade. * Version 2.1 Released on November 15, 2004. ** Improvements - Compression is no longer the default option in the Windows executable. ** Bug Fixes - Turned off TIFF library warning messages that required user interaction on Windows. - Fixed a bug in Vigra that caused primary color spots to appear in overexposed areas of 16-bit images. - Fixed a problem with Enblend crashing on large panoramas. Modified tiff import to use a scanline-based interface instead of a strip- based interface. PTStitcher generates TIFFs with the rows/strip tag set to an unreasonable value. ** Developer Stuff - Ported the source to compile natively on Win32 using MSVC. * Version 2.0 Released on October 17, 2004. ** Improvements - Support for signed and unsigned 16-bit, 32-bit, single- and double- precision floating point pixel types. - Sophisticated memory/disk balancing. You can tell Enblend how much memory it is allowed to use, and it will swap to disk after that. - Support for huge panoramas. I have tested that Enblend can blend a 1.2 gigapixel, 16-bit per channel color image. You should be able to go right up to the 4 gigabyte limit of the TIFF format. ** Bug Fixes - Fixed the banding artifacts that often appeared in skies. ** New Commandline Options - Optional blending in CIE L*a*b* color space. - Option to use LZW compression for the output image, if your libtiff supports it. This option is selected by default in the prebuilt Windows executable. - The -s option for sequential blending is now the default. Enblend cannot accurately determine how many blending levels to use when there are multiple disjoint overlap regions in one blending iteration. It is better to manually tell Enblend the order in which the images should be blended. If you still want Enblend to assemble non-overlapping images first, use the -a flag. - The -l option now tells Enblend the exact number of blending levels that you want to use. The geometry of your images may force Enblend to use a smaller number of levels. In this case a message will be printed. - Gimp (ver. < 2) and Cinepaint exhibit unusual behaviors when loading images with unassociated alpha channels. Use the -g flag to work around this. With this flag Enblend will create the output image with the associated alpha tag set, even though the image is really unassociated alpha. ** Developer Stuff - Ported Enblend to the VIGRA Computer Vision Library. * Version 1.3 Released May 18, 2004. ** Bug Fixes - Added a configure test for the endian-ness of the machine. I changed the way enblend reads and writes 8-bit color fields in 32-bit pixel words to reflect the endian-ness of the machine. This should get enblend working on powerpc machines. This release adds no new features. * Version 1.2 Released April 26, 2004. ** Bug Fixes - Fixed a bug where 8-bit TIFFs would not be identified properly on big-endian machines. - A second (better) fix for the boundary condition problem that lead to horizontal or vertical seams to appear in the output. * Version 1.1 Released April 3, 2004. ** Bug Fixes - Fixed a bug in reading from temporary files that appeared on machines with different versions of GCC. - Fixed a boundary condition problem that lead to horizontal or vertical seams to appear in the output. - Fixed a bug where segments of an input image would appear on the far side of a blending zone. This would cause strange wedge-shaped artifacts in some output images. * Version 1.0 Released March 27, 2004. ** New Commandline Options - Added options to limit the number of blending levels used. This can reduce memory usage and improve speed, at a loss of quality. - Added an option to blend around the -180/+180 degree boundary. There is still an open issue as to how to handle the zenith and nadir. - Added an option to blend the input images sequentially in the order given on the command line. Sometimes the assembler can make poor choices and seams will still be visible in the output. ** Developer Stuff - Replaced erosive thinning algorithm for mask creation with a much faster nearest feature transform. - Reduced memory requirements. Enblend now swaps most of its data to disk as temporary files. Enblend also calculates the region of pixels that are involved in each blending step and only does math on those pixels, improving speed and memory usage. * Version 0.9 Released on March 4, 2004. Local Variables: mode: outline End: enblend-enfuse-4.1.2+dfsg/CMakeLists.txt0000644000175100017510000003666512076207551020346 0ustar ametzlerametzler# This file is part of enblend/enfuse. # Licence details can be found in the file COPYING. # # Copyright(c) 2009-2010, Kornel Benko # , Ryan Sleevi # , Harry van der Wolf # Original file from lyx-project, heavily modified # cmake_minimum_required(VERSION 2.4) if(COMMAND cmake_policy) cmake_policy(SET CMP0003 OLD) cmake_policy(SET CMP0005 OLD) cmake_minimum_required(VERSION 2.6) endif(COMMAND cmake_policy) set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) project(enblend) IF(NOT MSVC) SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel" FORCE) ENDIF(NOT MSVC) # where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ # is checked # For now, reuse the hugin modules directory # # Try to find ... set(CMAKE_MODULE_PATH) # overwrite cache find_file(CMAKE_MODULE_PATH CMakeModules "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/../hugin" "${CMAKE_SOURCE_DIR}/../hugin-trunk" "${CMAKE_SOURCE_DIR}/../../hugin/hugin" "${CMAKE_SOURCE_DIR}/../../hugin/trunk" "$ENV{HOME}/hugin") message(STATUS "found hugin modules directory in ${CMAKE_MODULE_PATH}") set(ARCH_TRIPLET) if(UNIX) FIND_PROGRAM(DPKG_ARCHITECTURE_EXECUTABLE dpkg-architecture) if(DPKG_ARCHITECTURE_EXECUTABLE) EXECUTE_PROCESS(COMMAND dpkg-architecture -qDEB_HOST_MULTIARCH OUTPUT_VARIABLE ARCH_TRIPLET ERROR_VARIABLE ERROR_ARCH_TRIPLET OUTPUT_STRIP_TRAILING_WHITESPACE) endif() endif() if(ARCH_TRIPLET) set(SYSTEM_LIB_DIRS /usr/lib /usr/lib/${ARCH_TRIPLET} /usr/local/lib) else() set(SYSTEM_LIB_DIRS /usr/lib /usr/local/lib) endif() include(HuginMacros) include(FindLibraryForCPU) set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) # Regenerate when calling make set(CMAKE_SUPPRESS_REGENERATION FALSE) set(VERSION_INFO "CMake Build") # Try to get the package version from file set(TOP_SRC_DIR ${CMAKE_SOURCE_DIR}) file(STRINGS "${TOP_SRC_DIR}/VERSION" _version_lines) foreach(_v_l ${_version_lines}) if(_v_l MATCHES "^\([0-9]+\)\\.\([0-9]+\)\(.*\)") set(ENBLEND_MAJOR_VERSION ${CMAKE_MATCH_1}) set(ENBLEND_MINOR_VERSION ${CMAKE_MATCH_2}) set(_tmp ${CMAKE_MATCH_3}) if(_tmp MATCHES "^\\.\([0-9]+\)\(.*\)") set(ENBLEND_PATCH_VERSION ${CMAKE_MATCH_1}) set(_tmp ${CMAKE_MATCH_2}) else() set(ENBLEND_PATCH_VERSION "0") endif() set(PACKAGE_VERSION_STRING ${_v_l}) break() endif() endforeach(_v_l) message(STATUS "Extracted enblend version = ${ENBLEND_MAJOR_VERSION}.${ENBLEND_MINOR_VERSION}.${ENBLEND_PATCH_VERSION}") # For Win32 builds, assume that all of the libraries are located # one directory above the current CMakeLists directory IF(WIN32) STRING(REGEX REPLACE "(.*)/[^/]+$" "\\1" work "${CMAKE_SOURCE_DIR}") # create the cache entry SET(SOURCE_BASE_DIR ${work} CACHE FILEPATH "parent dir of hugin source root") LIST(APPEND CMAKE_PREFIX_PATH ${SOURCE_BASE_DIR}) ENDIF(WIN32) # First include so it picks up(our) config.h INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) SET(library_type STATIC) set(common_libs) IF(WIN32) # we are using static vigra lib on Windows ADD_DEFINITIONS(-DVIGRA_STATIC_LIB) ENDIF(WIN32) # Configurable options OPTION(ENABLE_OPENMP "OpenMP Support" OFF) OPTION(ENABLE_IMAGECACHE "Image Cache Support" ON) OPTION(ENABLE_GPU "GPU Acceleration Support" OFF) OPTION(DOC "Create Documentation" OFF) OPTION(NOSPLIT "Do not split html-documents" OFF) OPTION(A4 "Use A4 for pdf-doc's" ON) IF(NOT CMAKE_CL_64) OPTION(ENABLE_SSE2 "SSE2 Support(Release builds only)" OFF) ELSE(NOT CMAKE_CL_64) SET(ENABLE_SSE2 OFF CACHE INTERNAL "") ENDIF(NOT CMAKE_CL_64) IF(NOT WIN32) OPTION(ENABLE_DMALLOC "Use the dmalloc debugging package" OFF) OPTION(ENABLE_DMALLOC_FUNC_CHECK "Enable dmalloc function checking" OFF) ELSE(NOT WIN32) SET(ENABLE_DMALLOC OFF CACHE INTERNAL "") SET(ENABLE_DMALLOC_FUNC_CHECK OFF CACHE INTERNAL "") ENDIF(NOT WIN32) # Compiler specific tweaks and optimizations IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -ffast-math -DNDEBUG -Wall") IF(APPLE AND CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 5) ## Add needed Compiler and Linker flags for OSX SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flat_namespace -undefined suppress") SET(CMAKE_CXX_FLAGS "{$CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flat_namespace -undefined suppress") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -flat_namespace -undefined suppress") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flat_namespace -undefined suppress") ENDIF(APPLE AND CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION LESS 5) ELSEIF(WIN32) IF(MSVC) # Quiet some compiler noise ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE) ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS) ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_DEPRECATE) # Due to the number of templates and the added overhead in .obj files from 64-bit builds # add /bigobj support # details: http://msdn.microsoft.com/en-us/library/ms173499.aspx IF(CMAKE_CL_64) SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /bigobj") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") ENDIF(CMAKE_CL_64) # compile everything for the static C runtime FOREACH(TYPE C CXX) # makefiles use blank configuration FOREACH(CFG "_DEBUG" "_MINSIZEREL" "_RELEASE" "_RELWITHDEBINFO") #MESSAGE("Replacing CMAKE_${TYPE}_FLAGS${CFG}: ${CMAKE_${TYPE}_FLAGS${CFG}}") SET(NEW_FLAGS "${CMAKE_${TYPE}_FLAGS${CFG}}") # fix up static libc flags STRING(REPLACE "/MD" "/MT" NEW_FLAGS "${NEW_FLAGS}") # *FORCE* to override whats already placed into the cache SET(CMAKE_${TYPE}_FLAGS${CFG} "${NEW_FLAGS}" CACHE STRING "CMAKE_${TYPE}_FLAGS${CFG} (overwritten to ensure static build)" FORCE) #MESSAGE("New CMAKE_${TYPE}_FLAGS${CFG}: ${CMAKE_${TYPE}_FLAGS${CFG}}") ENDFOREACH(CFG) ENDFOREACH(TYPE) # link only with the static C runtime !! THIS IS A MUST !! SET(NEW_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") # ensure that the flags are not duplicated on subsequent runs STRING(REPLACE " /NODEFAULTLIB:\"MSVCRT.lib\" /NODEFAULTLIB:\"MSVCRTd.lib\" /LTCG /LARGEADDRESSAWARE" "" NEW_FLAGS "${NEW_FLAGS}") # note that flag names (NODEFAULTLIB) etc.) are case sensitive SET( CMAKE_EXE_LINKER_FLAGS "${NEW_FLAGS} /NODEFAULTLIB:\"MSVCRT.lib\" /NODEFAULTLIB:\"MSVCRTd.lib\" /LTCG /LARGEADDRESSAWARE" CACHE STRING "for MSVC" FORCE ) # Maximize speed STRING(REPLACE " /O2 " " /Ox /GL " CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}") STRING(REPLACE " /O2 " " /Ox /GL " CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") SET(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} /GL") ENDIF(MSVC) ENDIF(CMAKE_COMPILER_IS_GNUCXX) # Required Libraries first FIND_PACKAGE(LCMS2 REQUIRED) FIND_PACKAGE(TIFF REQUIRED) FIND_PACKAGE(Perl REQUIRED) # this one is needed in doc. (Especially the program "convert") FIND_PACKAGE(ImageMagick REQUIRED) FIND_PACKAGE(GSL REQUIRED) include_directories(${GSL_INCLUDE_DIR}) LIST(APPEND common_libs ${LCMS2_LIBRARIES} ${TIFF_LIBRARIES} ${GSL_LIBRARIES}) include_directories(${TIFF_INCLUDE_DIR} ${LCMS2_INCLUDE_DIR}) # Platform specifics required libraries IF(WIN32) SET(Boost_USE_STATIC_LIBS ON) # path for getopt library INCLUDE_DIRECTORIES(${TOP_SRC_DIR}/src/win32helpers) ENDIF(WIN32) # Boost headers are required, but filesystem is optional if(WIN32) IF( NOT Boost_root_suffix ) SET( Boost_root_suffix _1_51_0 CACHE STRING "suffix of boost root dir." FORCE ) ENDIF( NOT Boost_root_suffix ) SET(Boost_USE_STATIC_LIBS ON) if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") set(BOOST_ROOT $ENV{BOOST_ROOT}) else(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") set(BOOST_ROOT ${SOURCE_BASE_DIR}/boost${Boost_root_suffix}) endif(NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") endif() find_package(Boost COMPONENTS filesystem system) set(Boost_filesystem_FOUND ${Boost_FILESYSTEM_FOUND}) set(Boost_system_FOUND ${Boost_SYSTEM_FOUND}) message(STATUS "Boost_LIBRARIES = ${Boost_LIBRARIES}") IF(Boost_filesystem_FOUND) ADD_DEFINITIONS(-DHAVE_BOOST_FILESYSTEM) ELSE(Boost_filesystem_FOUND) MESSAGE(STATUS "Boost filesystem library found: ${Boost_filesystem_FOUND}") MESSAGE(STATUS "Boost system library found: ${Boost_system_FOUND}") MESSAGE(STATUS "Disabling Boost filesystem support") ENDIF(Boost_filesystem_FOUND) LIST(APPEND common_libs ${Boost_LIBRARIES}) link_directories(${Boost_LIBRARY_DIRS}) IF(NOT MSVC) # MSVC supports auto-linking and will always choose the appropriate # library for the config. Use explicit specifiers for the other platforms LIST(APPEND common_libs ${Boost_LIBRARIES}) ENDIF(NOT MSVC) include_directories(${Boost_INCLUDE_DIR}) # Optional Libraries FIND_PACKAGE(ZLIB) FIND_PACKAGE(JPEG) FIND_PACKAGE(PNG) FIND_PACKAGE(OpenEXR) FIND_PACKAGE(Threads) # VIGRA uses Has* pre-processor definitions for config.h ADD_DEFINITIONS(-DHasTIFF) FIND_PACKAGE(VIGRA REQUIRED) include_directories(${VIGRA_INCLUDE_DIR}) list(APPEND common_libs ${VIGRA_LIBRARIES}) IF(ZLIB_FOUND) LIST(APPEND common_libs ${ZLIB_LIBRARIES}) include_directories(${ZLIB_INCLUDE_DIR}) ELSEIF(WIN32) IF(PNG_FOUND) MESSAGE(STATUS "Disabling support for PNG due to lack of zlib") SET(PNG_FOUND 0) ENDIF(PNG_FOUND) ENDIF(ZLIB_FOUND) IF(JPEG_FOUND) ADD_DEFINITIONS(-DHasJPEG) list(APPEND common_libs ${JPEG_LIBRARIES}) include_directories(${JPEG_INCLUDE_DIR}) ELSE(JPEG_FOUND) MESSAGE(STATUS "Compiling without support for JPEG files") ENDIF(JPEG_FOUND) IF(PNG_FOUND) ADD_DEFINITIONS(-DHasPNG) list(APPEND common_libs ${PNG_LIBRARIES}) include_directories(${PNG_INCLUDE_DIR}) ELSE(PNG_FOUND) MESSAGE(STATUS "Compiling without support for PNG files") ENDIF(PNG_FOUND) IF(OPENEXR_FOUND) ADD_DEFINITIONS(-DHasEXR) list(APPEND common_libs ${OPENEXR_LIBRARIES}) include_directories(${OPENEXR_INCLUDE_DIR}) ELSE(OPENEXR_FOUND) MESSAGE(STATUS "OpenEXR support disabled") ENDIF(OPENEXR_FOUND) # Now that packages are / are not detected, handle config options IF(ENABLE_OPENMP) FIND_PACKAGE(OpenMP REQUIRED) add_definitions(${OpenMP_CXX_FLAGS}) ENDIF(ENABLE_OPENMP) IF(ENABLE_IMAGECACHE AND ENABLE_OPENMP) MESSAGE(STATUS "image cache and OpenMP support are mutually exclusive. only configure like this if you want to develop a reentrant image cache") LIST(APPEND WARNINGS "WARNING: Image cache and OpenMP are both enabled! You are a developer, aren't you?") ENDIF(ENABLE_IMAGECACHE AND ENABLE_OPENMP) IF(ENABLE_IMAGECACHE) set(CACHE_IMAGES 1) ENDIF(ENABLE_IMAGECACHE) IF(ENABLE_GPU) IF(WIN32) IF(NOT GLUT_ROOT_PATH) SET(GLUT_ROOT_PATH ${SOURCE_BASE_DIR}/glut) ENDIF(NOT GLUT_ROOT_PATH) ENDIF(WIN32) FIND_PACKAGE(GLUT REQUIRED) FIND_PACKAGE(GLEW REQUIRED) FIND_PACKAGE(OpenGL) IF(OPENGL_FOUND) if(APPLE) ADD_DEFINITIONS(-DHAVE_APPLE_OPENGL_FRAMEWORK) include_directories(${OPENGL_INCLUDE_DIR}}) endif(APPLE) LIST(APPEND common_libs ${OPENGL_LIBRARIES}) ENDIF(OPENGL_FOUND) ADD_DEFINITIONS(-DHAVE_LIBGLEW) include_directories(${GLEW_INCLUDE_DIR} ${GLUT_INCLUDE_DIR}) LIST(APPEND common_libs ${GLEW_LIBRARIES} ${GLUT_LIBRARIES}) ENDIF(ENABLE_GPU) IF(ENABLE_SSE2) IF(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -msse2 -mtune=pentium4") ELSEIF(MSVC) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /arch:SSE2") ENDIF(CMAKE_COMPILER_IS_GNUCXX) ENDIF(ENABLE_SSE2) IF(ENABLE_DMALLOC) ADD_DEFINITIONS(-DDMALLOC) IF(ENABLE_DMALLOC_FUNC_CHECK) ADD_DEFINITIONS(-DDMALLOC_FUNC_CHECK) ENDIF(ENABLE_DMALLOC_FUNC_CHECK) IF(CMAKE_USE_PTHREADS_INIT) FIND_LIBRARY(dmalloc_LIBRARIES dmallocthcxx) ELSE(CMAKE_USE_PTHREADS_INIT) FIND_LIBRARY(dmalloc_LIBRARIES dmalloccxx) ENDIF(CMAKE_USE_PTHREADS_INIT) IF(NOT dmalloc_LIBRARIES) MESSAGE(FATAL_ERROR "dmalloc support requested, but was unable to locate dmalloc library") ENDIF(NOT dmalloc_LIBRARIES) add_definitions("-g") LIST(APPEND common_libs ${dmalloc_LIBRARIES}) ENDIF(ENABLE_DMALLOC) # Try to create config.h set(ENBLEND_VERSION_ONLY "${PACKAGE_VERSION_STRING}") set(PACKAGE_STRING "enblend-enfuse ${ENBLEND_VERSION_ONLY}") set(ENBLEND_VERSION "${PACKAGE_STRING}") include(ConfigureChecks.cmake) configure_file(config.h.cmake ${CMAKE_BINARY_DIR}/config.h) add_definitions(-DHAVE_CONFIG_H) include_directories(${CMAKE_BINARY_DIR} ${TOP_SRC_DIR}/include) MESSAGE(STATUS "") MESSAGE(STATUS "") MESSAGE(STATUS "Enblend-enfuse now configured for ${CMAKE_SYSTEM}") MESSAGE(STATUS "Source Directory: ${CMAKE_SOURCE_DIR}") message(STATUS "Build Directory: ${CMAKE_BINARY_DIR}") message(STATUS "Installation Directory: ${CMAKE_INSTALL_PREFIX}") MESSAGE(STATUS "C++ Compiler: ${CMAKE_CXX_COMPILER}") MESSAGE(STATUS "CFLAGS: ${CMAKE_C_FLAGS}") MESSAGE(STATUS "CXXFLAGS: ${CMAKE_CXX_FLAGS}") MESSAGE(STATUS "Libraries: ${common_libs}") MESSAGE(STATUS "") MESSAGE(STATUS "Features Enabled:") IF(NOT WIN32) MESSAGE(STATUS "enable malloc debugging: ${ENABLE_DMALLOC}") ENDIF(NOT WIN32) MESSAGE(STATUS "use image cache: ${ENABLE_IMAGECACHE}") MESSAGE(STATUS "build GPU acceleration: ${ENABLE_GPU}") MESSAGE(STATUS "use OpenMP: ${ENABLE_OPENMP}") MESSAGE(STATUS "") MESSAGE(STATUS "Image Formats Enabled:") MESSAGE(STATUS "OpenEXR: ${OPENEXR_FOUND}") MESSAGE(STATUS "JPEG: ${JPEG_FOUND}") MESSAGE(STATUS "TIFF: ${TIFF_FOUND}") MESSAGE(STATUS "PNG: ${PNG_FOUND}") MESSAGE(STATUS "") MESSAGE(STATUS ${WARNINGS}) MESSAGE(STATUS "") add_subdirectory(src) # you really should have perl installed, when creating doc's if (PERL_FOUND AND IMAGEMAGICK_FOUND AND DOC) # this should be set from comman line # Possible values like described in README: @smallbook @afivepaper @afourpaper @afourwide @afourlatex # @letter is default set(EXTRATEXI2DVIFLAGS "@afourpaper" CACHE STRING "Papersize: @letter @smallbook @afivepaper @afourpaper @afourwide @afourlatex") add_subdirectory(doc) endif() # Windows installer packaging related stuff # prepare files here... IF(WIN32) # install into place in build-dir SET( CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}/INSTALL/FILES CACHE FILEPATH "install prefix" FORCE) SET( INSTALL_WIN_FILES AUTHORS ChangeLog COPYING NEWS README ) INSTALL(FILES ${INSTALL_WIN_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}) # install Eriks droplets SET( DROPLETS_FILES contrib/enfuse_droplet/enfuse_droplet.bat contrib/enfuse_droplet/enfuse_droplet_360.bat contrib/enfuse_droplet/enfuse_droplet_readme.txt contrib/enfuse_droplet/LICENCE.txt) INSTALL(FILES ${DROPLETS_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/droplets) ELSE(WIN32) foreach(_manual enblend enfuse) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/src/${_manual}.1 DESTINATION "share/man/man1" CONFIGURATIONS Release RelWithDebInfo MinSizeRel) endforeach() ENDIF(WIN32) SET(CPACK_PACKAGE_VERSION_MAJOR ${ENBLEND_MAJOR_VERSION}) SET(CPACK_PACKAGE_VERSION_MINOR ${ENBLEND_MINOR_VERSION}) SET(CPACK_PACKAGE_VERSION_PATCH ${ENBLEND_PATCH_VERSION}) # Use dpkg-shlibs to get the dependences SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) # needed by rpm SET(CPACK_SET_DESTDIR "ON") # The next ones are required by debian SET(CPACK_PACKAGE_CONTACT "hugin-ptx@googlegroups.com") include(CPack) enblend-enfuse-4.1.2+dfsg/missing0000755000175100017510000001533112232763263017171 0ustar ametzlerametzler#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: enblend-enfuse-4.1.2+dfsg/m4/0000755000175100017510000000000012232763260016104 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/m4/ax_prog_perl_modules.m40000644000175100017510000000420712070530113022547 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_prog_perl_modules.html # =========================================================================== # # SYNOPSIS # # AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # Checks to see if the given perl modules are available. If true the shell # commands in ACTION-IF-TRUE are executed. If not the shell commands in # ACTION-IF-FALSE are run. Note if $PERL is not set (for example by # calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl) # will be run. # # MODULES is a space separated list of module names. To check for a # minimum version of a module, append the version number to the # module name, separated by an equals sign. # # Example: # # AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, , # AC_MSG_WARN(Need some Perl modules) # # LICENSE # # Copyright (c) 2009 Dean Povey # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES]) AC_DEFUN([AX_PROG_PERL_MODULES],[dnl m4_define([ax_perl_modules]) m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])), [ m4_append([ax_perl_modules], [']m4_bpatsubst(ax_perl_module,=,[ ])[' ]) ]) # Make sure we have perl if test -z "$PERL"; then AC_CHECK_PROG(PERL,perl,perl) fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in ax_perl_modules; do AC_MSG_CHECKING(for perl module $ax_perl_module) # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then AC_MSG_RESULT(no); ax_perl_modules_failed=1 else AC_MSG_RESULT(ok); fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : $2 else : $3 fi else AC_MSG_WARN(could not find perl) fi])dnl enblend-enfuse-4.1.2+dfsg/m4/ax_pthread.m40000644000175100017510000002544412070530113020463 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_pthread.html # =========================================================================== # # SYNOPSIS # # AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro figures out how to build C programs using POSIX threads. It # sets the PTHREAD_LIBS output variable to the threads library and linker # flags, and the PTHREAD_CFLAGS output variable to any special C compiler # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # # Also sets PTHREAD_CC to any special C compiler that is needed for # multi-threaded programs (defaults to the value of CC otherwise). (This # is necessary on AIX to use the special cc_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. e.g. you should link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threads programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name # (e.g. PTHREAD_CREATE_UNDETACHED on AIX). # # ACTION-IF-FOUND is a list of shell commands to run if a threads library # is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it # is not found. If ACTION-IF-FOUND is not specified, the default action # will define HAVE_PTHREAD. # # Please let the authors know if this macro fails on any platform, or if # you have any other suggestions or comments. This macro was based on work # by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help # from M. Frigo), as well as ac_pthread and hb_pthread macros posted by # Alejandro Forero Cuervo to the autoconf macro repository. We are also # grateful for the helpful feedback of numerous users. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes) AC_MSG_RESULT($ax_pthread_ok) if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no) if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [ax_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($ax_pthread_ok) if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. AC_MSG_CHECKING([for joinable pthread attribute]) attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do AC_TRY_LINK([#include ], [int attr=$attr; return attr;], [attr_name=$attr; break]) done AC_MSG_RESULT($attr_name) if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, [Define to necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else ax_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl AX_PTHREAD enblend-enfuse-4.1.2+dfsg/m4/ax_lang_compiler_ms.m40000644000175100017510000000212112070530113022331 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_lang_compiler_ms.html # =========================================================================== # # SYNOPSIS # # AX_LANG_COMPILER_MS # # DESCRIPTION # # Check whether the compiler for the current language is Microsoft. # # This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU Autoconf # implementation. # # LICENSE # # Copyright (c) 2009 Braden McDaniel # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AX_LANG_COMPILER_MS], [AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler], [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER choke me #endif ]])], [ax_compiler_ms=yes], [ax_compiler_ms=no]) ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms ])]) enblend-enfuse-4.1.2+dfsg/m4/ax_check_glu.m40000644000175100017510000001251412070530113020752 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_check_glu.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_GLU # # DESCRIPTION # # Check for GLU. If GLU is found, the required preprocessor and linker # flags are included in the output variables "GLU_CFLAGS" and "GLU_LIBS", # respectively. If no GLU implementation is found, "no_glu" is set to # "yes". # # If the header "GL/glu.h" is found, "HAVE_GL_GLU_H" is defined. If the # header "OpenGL/glu.h" is found, HAVE_OPENGL_GLU_H is defined. These # preprocessor definitions may not be mutually exclusive. # # Some implementations (in particular, some versions of Mac OS X) are # known to treat the GLU tesselator callback function type as "GLvoid # (*)(...)" rather than the standard "GLvoid (*)()". If the former # condition is detected, this macro defines "HAVE_VARARGS_GLU_TESSCB". # # LICENSE # # Copyright (c) 2009 Braden McDaniel # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_CHECK_GLU], [AC_REQUIRE([AX_CHECK_GL])dnl AC_REQUIRE([AC_PROG_CXX])dnl GLU_CFLAGS="${GL_CFLAGS}" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" AC_CHECK_HEADERS([GL/glu.h OpenGL/glu.h]) CPPFLAGS="${ax_save_CPPFLAGS}" m4_define([AX_CHECK_GLU_PROGRAM], [AC_LANG_PROGRAM([[ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLU_H # include # elif defined(HAVE_OPENGL_GLU_H) # include # else # error no glu.h # endif]], [[gluBeginCurve(0)]])]) AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], [ax_cv_check_glu_libglu="no" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" # # First, check for the possibility that everything we need is already in # GL_LIBS. # LIBS="${GL_LIBS} ${ax_save_LIBS}" # # libGLU typically links with libstdc++ on POSIX platforms. # However, setting the language to C++ means that test program # source is named "conftest.cc"; and Microsoft cl doesn't know what # to do with such a file. # AC_LANG_PUSH([C++]) AS_IF([test X$ax_compiler_ms = Xyes], [AC_LANG_PUSH([C])]) AC_LINK_IFELSE( [AX_CHECK_GLU_PROGRAM], [ax_cv_check_glu_libglu=yes], [LIBS="" ax_check_libs="-lglu32 -lGLU" for ax_lib in ${ax_check_libs}; do AS_IF([test X$ax_compiler_ms = Xyes], [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], [ax_try_lib="${ax_lib}"]) LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GLU_PROGRAM], [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) done ]) AS_IF([test X$ax_compiler_ms = Xyes], [AC_LANG_POP([C])]) AC_LANG_POP([C++]) LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) AS_IF([test "X$ax_cv_check_glu_libglu" = Xno], [no_glu=yes; GLU_CFLAGS=""; GLU_LIBS=""], [AS_IF([test "X$ax_cv_check_glu_libglu" = Xyes], [GLU_LIBS="$GL_LIBS"], [GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}"])]) AC_SUBST([GLU_CFLAGS]) AC_SUBST([GLU_LIBS]) # # Some versions of Mac OS X include a broken interpretation of the GLU # tesselation callback function signature. # AS_IF([test "X$ax_cv_check_glu_libglu" != Xno], [AC_CACHE_CHECK([for varargs GLU tesselator callback function type], [ax_cv_varargs_glu_tesscb], [ax_cv_varargs_glu_tesscb=no ax_save_CFLAGS="$CFLAGS" CFLAGS="$GL_CFLAGS $CFLAGS" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[ # ifdef HAVE_GL_GLU_H # include # else # include # endif]], [[GLvoid (*func)(...); gluTessCallback(0, 0, func)]])], [ax_cv_varargs_glu_tesscb=yes]) CFLAGS="$ax_save_CFLAGS"]) AS_IF([test X$ax_cv_varargs_glu_tesscb = Xyes], [AC_DEFINE([HAVE_VARARGS_GLU_TESSCB], [1], [Use nonstandard varargs form for the GLU tesselator callback])])]) ]) enblend-enfuse-4.1.2+dfsg/m4/ax_with_prog.m40000644000175100017510000000460312070530113021030 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_with_prog.html # =========================================================================== # # SYNOPSIS # # AX_WITH_PROG([VARIABLE],[program],[VALUE-IF-NOT-FOUND],[PATH]) # # DESCRIPTION # # Locates an installed program binary, placing the result in the precious # variable VARIABLE. Accepts a present VARIABLE, then --with-program, and # failing that searches for program in the given path (which defaults to # the system path). If program is found, VARIABLE is set to the full path # of the binary; if it is not found VARIABLE is set to VALUE-IF-NOT-FOUND # if provided, unchanged otherwise. # # A typical example could be the following one: # # AX_WITH_PROG(PERL,perl) # # NOTE: This macro is based upon the original AX_WITH_PYTHON macro from # Dustin J. Mitchell . # # LICENSE # # Copyright (c) 2008 Francesco Salvestrini # Copyright (c) 2008 Dustin J. Mitchell # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. AC_DEFUN([AX_WITH_PROG],[ AC_PREREQ([2.61]) pushdef([VARIABLE],$1) pushdef([EXECUTABLE],$2) pushdef([VALUE_IF_NOT_FOUND],$3) pushdef([PATH_PROG],$4) AC_ARG_VAR(VARIABLE,Absolute path to EXECUTABLE executable) AS_IF(test -z "$VARIABLE",[ AC_MSG_CHECKING(whether EXECUTABLE executable path has been provided) AC_ARG_WITH(EXECUTABLE,AS_HELP_STRING([--with-EXECUTABLE=[[[PATH]]]],absolute path to EXECUTABLE executable), [ AS_IF([test "$withval" != yes -a "$withval" != no],[ VARIABLE="$withval" AC_MSG_RESULT($VARIABLE) ],[ VARIABLE="" AC_MSG_RESULT([no]) AS_IF([test "$withval" != no], [ AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) ]) ]) ],[ AC_MSG_RESULT([no]) AC_PATH_PROG([]VARIABLE[],[]EXECUTABLE[],[]VALUE_IF_NOT_FOUND[],[]PATH_PROG[]) ]) ]) popdef([PATH_PROG]) popdef([VALUE_IF_NOT_FOUND]) popdef([EXECUTABLE]) popdef([VARIABLE]) ]) enblend-enfuse-4.1.2+dfsg/m4/ax_check_glut.m40000644000175100017510000000752012232763260021152 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_check_glut.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_GLUT # # DESCRIPTION # # Check for GLUT. If GLUT is found, the required compiler and linker flags # are included in the output variables "GLUT_CFLAGS" and "GLUT_LIBS", # respectively. If GLUT is not found, "no_glut" is set to "yes". # # If the header "GL/glut.h" is found, "HAVE_GL_GLUT_H" is defined. If the # header "GLUT/glut.h" is found, HAVE_GLUT_GLUT_H is defined. These # preprocessor definitions may not be mutually exclusive. # # LICENSE # # Copyright (c) 2009 Braden McDaniel # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_CHECK_GLUT], [AC_REQUIRE([AX_CHECK_GLU])dnl AC_REQUIRE([AC_PATH_XTRA])dnl ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}" AC_CHECK_HEADERS([GL/glut.h GLUT/glut.h]) CPPFLAGS="${ax_save_CPPFLAGS}" GLUT_CFLAGS=${GLU_CFLAGS} GLUT_LIBS=${GLU_LIBS} m4_define([AX_CHECK_GLUT_PROGRAM], [AC_LANG_PROGRAM([[ # if HAVE_WINDOWS_H && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLUT_H # include # elif defined(HAVE_GLUT_GLUT_H) # include # else # error no glut.h # endif]], [[glutMainLoop()]])]) AC_CACHE_CHECK([for GLUT library], [ax_cv_check_glut_libglut], [ax_cv_check_glut_libglut="no" AC_LANG_PUSH(C) ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lglut32 -lglut" for ax_lib in ${ax_check_libs}; do AS_IF([test X$ax_compiler_ms = Xyes], [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], [ax_try_lib="${ax_lib}"]) LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], [ax_cv_check_glut_libglut="${ax_try_lib}"; break]) done AS_IF([test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes], [LIBS='-framework GLUT' AC_LINK_IFELSE([AX_CHECK_GLUT_PROGRAM], [ax_cv_check_glut_libglut="$LIBS"])]) CPPFLAGS="${ax_save_CPPFLAGS}" LIBS="${ax_save_LIBS}" AC_LANG_POP(C)]) AS_IF([test "X$ax_cv_check_glut_libglut" = Xno], [no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS=""], [GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}"]) AC_SUBST([GLUT_CFLAGS]) AC_SUBST([GLUT_LIBS]) ])dnl enblend-enfuse-4.1.2+dfsg/m4/ax_openmp.m40000644000175100017510000001027312070530113020324 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_openmp.html # =========================================================================== # # SYNOPSIS # # AX_OPENMP([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) # # DESCRIPTION # # This macro tries to find out how to compile programs that use OpenMP a # standard API and set of compiler directives for parallel programming # (see http://www-unix.mcs/) # # On success, it sets the OPENMP_CFLAGS/OPENMP_CXXFLAGS/OPENMP_F77FLAGS # output variable to the flag (e.g. -omp) used both to compile *and* link # OpenMP programs in the current language. # # NOTE: You are assumed to not only compile your program with these flags, # but also link it with them as well. # # If you want to compile everything with OpenMP, you should set: # # CFLAGS="$CFLAGS $OPENMP_CFLAGS" # #OR# CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" # #OR# FFLAGS="$FFLAGS $OPENMP_FFLAGS" # # (depending on the selected language). # # The user can override the default choice by setting the corresponding # environment variable (e.g. OPENMP_CFLAGS). # # ACTION-IF-FOUND is a list of shell commands to run if an OpenMP flag is # found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it is # not found. If ACTION-IF-FOUND is not specified, the default action will # define HAVE_OPENMP. # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_OPENMP], [ AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX AC_CACHE_CHECK([for OpenMP flag of _AC_LANG compiler], ax_cv_[]_AC_LANG_ABBREV[]_openmp, [save[]_AC_LANG_PREFIX[]FLAGS=$[]_AC_LANG_PREFIX[]FLAGS ax_cv_[]_AC_LANG_ABBREV[]_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_[]_AC_LANG_PREFIX[]FLAGS" != x; then ax_openmp_flags="$OPENMP_[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flags" fi for ax_openmp_flag in $ax_openmp_flags; do case $ax_openmp_flag in none) []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[] ;; *) []_AC_LANG_PREFIX[]FLAGS="$save[]_AC_LANG_PREFIX[]FLAGS $ax_openmp_flag" ;; esac AC_TRY_LINK_FUNC(omp_set_num_threads, [ax_cv_[]_AC_LANG_ABBREV[]_openmp=$ax_openmp_flag; break]) done []_AC_LANG_PREFIX[]FLAGS=$save[]_AC_LANG_PREFIX[]FLAGS ]) if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" = "xunknown"; then m4_default([$2],:) else if test "x$ax_cv_[]_AC_LANG_ABBREV[]_openmp" != "xnone"; then OPENMP_[]_AC_LANG_PREFIX[]FLAGS=$ax_cv_[]_AC_LANG_ABBREV[]_openmp fi m4_default([$1], [AC_DEFINE(HAVE_OPENMP,1,[Define if OpenMP is enabled])]) fi ])dnl AX_OPENMP enblend-enfuse-4.1.2+dfsg/m4/lrint.m40000644000175100017510000000171012070530113017462 0ustar ametzlerametzlerdnl @synopsis AC_C99_FUNC_LRINT dnl dnl Check whether C99's lrint function is available. dnl @version 1.1 dnl @author Erik de Castro Lopo dnl dnl Permission to use, copy, modify, distribute, and sell this file for any dnl purpose is hereby granted without fee, provided that the above copyright dnl and this permission notice appear in all copies. No representations are dnl made about the suitability of this software for any purpose. It is dnl provided "as is" without express or implied warranty. dnl AC_DEFUN([AC_C99_FUNC_LRINT], [AC_CACHE_CHECK(for lrint, ac_cv_c99_lrint, [AC_TRY_COMPILE([ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], [ int value = lrint (0.432) ; ], ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no)]) if test $ac_cv_c99_lrint = yes; then AC_DEFINE(HAVE_LRINT, 1, [Define if you have C99's lrint function.]) fi ])# AC_C99_LRINT enblend-enfuse-4.1.2+dfsg/m4/ax_check_gl.m40000644000175100017510000001201612070530113020562 0ustar ametzlerametzler# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_check_gl.html # =========================================================================== # # SYNOPSIS # # AX_CHECK_GL # # DESCRIPTION # # Check for an OpenGL implementation. If GL is found, the required # compiler and linker flags are included in the output variables # "GL_CFLAGS" and "GL_LIBS", respectively. If no usable GL implementation # is found, "no_gl" is set to "yes". # # If the header "GL/gl.h" is found, "HAVE_GL_GL_H" is defined. If the # header "OpenGL/gl.h" is found, HAVE_OPENGL_GL_H is defined. These # preprocessor definitions may not be mutually exclusive. # # LICENSE # # Copyright (c) 2009 Braden McDaniel # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_CHECK_GL], [AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_PATH_X])dnl AC_REQUIRE([AX_PTHREAD])dnl AC_LANG_PUSH([C]) AX_LANG_COMPILER_MS AS_IF([test X$ax_compiler_ms = Xno], [GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm"]) # # Use x_includes and x_libraries if they have been set (presumably by # AC_PATH_X). # AS_IF([test "X$no_x" != "Xyes"], [AS_IF([test -n "$x_includes"], [GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}"])] AS_IF([test -n "$x_libraries"], [GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}"])) ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" AC_CHECK_HEADERS([GL/gl.h OpenGL/gl.h]) CPPFLAGS="${ax_save_CPPFLAGS}" AC_CHECK_HEADERS([windows.h]) m4_define([AX_CHECK_GL_PROGRAM], [AC_LANG_PROGRAM([[ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GL_H # include # elif defined(HAVE_OPENGL_GL_H) # include # else # error no gl.h # endif]], [[glBegin(0)]])]) AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], [ax_cv_check_gl_libgl="no" case $host_cpu in x86_64) ax_check_gl_libdir=lib64 ;; *) ax_check_gl_libdir=lib ;; esac ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lopengl32 -lGL" for ax_lib in ${ax_check_libs}; do AS_IF([test X$ax_compiler_ms = Xyes], [ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'`], [ax_try_lib="${ax_lib}"]) LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="${ax_try_lib}"; break], [ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break], [ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break])])]) done AS_IF([test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes], [LIBS='-framework OpenGL' AC_LINK_IFELSE([AX_CHECK_GL_PROGRAM], [ax_cv_check_gl_libgl="$LIBS"])]) LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) AS_IF([test "X$ax_cv_check_gl_libgl" = Xno], [no_gl=yes; GL_CFLAGS=""; GL_LIBS=""], [GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}"]) AC_LANG_POP([C]) AC_SUBST([GL_CFLAGS]) AC_SUBST([GL_LIBS]) ])dnl enblend-enfuse-4.1.2+dfsg/m4/lrintf.m40000644000175100017510000000172412070530113017635 0ustar ametzlerametzlerdnl @synopsis AC_C99_FUNC_LRINTF dnl dnl Check whether C99's lrintf function is available. dnl @version 1.1 dnl @author Erik de Castro Lopo dnl dnl Permission to use, copy, modify, distribute, and sell this file for any dnl purpose is hereby granted without fee, provided that the above copyright dnl and this permission notice appear in all copies. No representations are dnl made about the suitability of this software for any purpose. It is dnl provided "as is" without express or implied warranty. dnl AC_DEFUN([AC_C99_FUNC_LRINTF], [AC_CACHE_CHECK(for lrintf, ac_cv_c99_lrintf, [AC_TRY_COMPILE([ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], [ int value = lrintf (0.432) ; ], ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no)]) if test $ac_cv_c99_lrintf = yes; then AC_DEFINE(HAVE_LRINTF, 1, [Define if you have C99's lrintf function.]) fi ])# AC_C99_LRINTF enblend-enfuse-4.1.2+dfsg/ConfigureChecks.cmake0000644000175100017510000000662212224454630021635 0ustar ametzlerametzler# This file is part of enblend. # Licence details can be found in the file COPYING. # # Copyright (c) 2009-2010, Kornel Benko # , Ryan Sleevi # , Harry van der Wolf # include(CheckIncludeFile) include(CheckIncludeFileCXX) include(CheckIncludeFiles) include(CheckSymbolExists) include(CheckFunctionExists) include(CheckLibraryExists) include(CheckTypeSize) include(CheckCXXSourceCompiles) include(CheckFunctionExists) include(TestBigEndian) #Check for some include files and set appropriate variables # e.g. "sys/dir.h" found => "HAVE_SYS_DIR_H" set to 1 foreach(_fl "dirent.h" "ext/slist" "fenv.h" "GLUT/glut.h" "GL/glut.h" "GL/glu.h" "GL/gl.h" "OpenGL/glu.h" "OpenGL/gl.h" "inttypes.h" "limits.h" "memory.h" "stdint.h" "stdlib.h" "stdbool.h" "strings.h" "string.h" "sys/stat.h" "sys/types.h" "unistd.h" "windows.h") string(REGEX REPLACE "[/\\.]" "_" _var ${_fl}) string(TOUPPER "${_var}" _FLN) check_include_file_cxx("${_fl}" "HAVE_${_FLN}" ) endforeach() #Check for functions set(CMAKE_REQUIRED_LIBRARIES -lm) foreach(_fc fesetround floor fseeko lrint lrintf memset mkstemp pow rint sqrt malloc strchr strcspn strdup strerror strerror_r strrchr strtol strtok_r) string(TOUPPER "${_fc}" _FC) check_function_exists(${_fc} "HAVE_${_FC}") endforeach() if(HAVE_DIRENT_H) check_cxx_source_compiles( " #include DIR *DI; int i = closedir(DI); int main(){return(0);} " CLOSEDIR_INT) endif(HAVE_DIRENT_H) if(VIGRA_FOUND AND NOT VIGRA_VERSION_CHECK) unset(VIGRA_SETIMAGEINDEX CACHE) set(CMAKE_REQUIRED_INCLUDES ${VIGRA_INCLUDE_DIR}) set(CMAKE_REQUIRED_LIBRARIES ${VIGRA_LIBRARIES}) check_cxx_source_compiles( " #include vigra::ImageImportInfo info(\"image.tif\"); int main(){ vigra::impexListFormats(); info.setImageIndex(99); return(0); } " VIGRA_SETIMAGEINDEX) if(NOT VIGRA_SETIMAGEINDEX) message(FATAL_ERROR "Vigra library too old") endif() endif() if (NOT CLOSEDIR_INT) set(CLOSEDIR_VOID 1) endif() message(STATUS "CMAKE_ERRFILE = ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log") message(STATUS "CMAKE_LOGFILE = ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log") check_type_size( ptrdiff_t HAVE_PTRDIFF_T ) # How to check if stdbool.h conforms to C99? check_cxx_source_compiles( " #include DIR *a = 0; int main(){return(0);} " HAVE_SYS_DIR_H) check_cxx_source_compiles( " #include DIR *a = 0; int main(){return(0);} " HAVE_SYS_NDIR_H) check_include_files("stdlib.h;stdarg.h;string.h;float.h" STDC_HEADERS) check_cxx_source_compiles( " #include static void sg(int b) { return;} int main(int c, char *av[]) { signal(0, sg); return(0);} " RETSIGTYPE_VOID) if(RETSIGTYPE_VOID) set(RETSIGTYPE void) else(RETSIGTYPE_VOID) set(RETSIGTYPE int) endif(RETSIGTYPE_VOID) test_big_endian(WORDS_BIGENDIAN) check_cxx_source_compiles( " #include off_t a = 0; int main(){return(0);} " HAVE_OFF_T) check_cxx_source_compiles( " #include size_t a = 0; int main(){return(0);} " HAVE_SIZE_T) check_cxx_source_compiles( " #include int main(){char b;char *a = strerror_r(0, &b, 0); return(0);} " STRERROR_R_CHAR_P) enblend-enfuse-4.1.2+dfsg/config.h.in0000664000175100017510000001570012232763262017616 0ustar ametzlerametzler/* config.h.in. Generated from configure.in by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define if you want to compile Enblend and Enfuse with image cache */ #undef CACHE_IMAGES /* Define to 1 if the `closedir' function returns void instead of `int'. */ #undef CLOSEDIR_VOID /* Define to enable malloc debugger library */ #undef DMALLOC /* Define to enable malloc debugger function checking */ #undef DMALLOC_FUNC_CHECK /* Use the Apple OpenGL framework. */ #undef HAVE_APPLE_OPENGL_FRAMEWORK /* Define if you have boost/filesystem.hpp */ #undef HAVE_BOOST_FILESYSTEM /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_FENV_H /* Define to 1 if you have the `fesetround' function. */ #undef HAVE_FESETROUND /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO /* Define to 1 if you have the header file. */ #undef HAVE_GLUT_GLUT_H /* Define to 1 if you have the header file. */ #undef HAVE_GL_GLUT_H /* Define to 1 if you have the header file. */ #undef HAVE_GL_GLU_H /* Define to 1 if you have the header file. */ #undef HAVE_GL_GL_H /* Define if functions can be declared `inline'. */ #undef HAVE_INLINE /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have the GLEW library */ #undef HAVE_LIBGLEW /* Define to 1 if you have the `gsl' library (-lgsl). */ #undef HAVE_LIBGSL /* Define to 1 if you have the `gslcblas' library (-lgslcblas). */ #undef HAVE_LIBGSLCBLAS /* Define to 1 if you have the `lcms2' library (-llcms2). */ #undef HAVE_LIBLCMS2 /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define if you have C99's lrint function. */ #undef HAVE_LRINT /* Define if you have C99's lrintf function. */ #undef HAVE_LRINTF /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENGL_GLU_H /* Define to 1 if you have the header file. */ #undef HAVE_OPENGL_GL_H /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define if you have POSIX threads libraries and header files. */ #undef HAVE_PTHREAD /* Define to 1 if the system has the type `ptrdiff_t'. */ #undef HAVE_PTRDIFF_T /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strcspn' function. */ #undef HAVE_STRCSPN /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strtok_r' function. */ #undef HAVE_STRTOK_R /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the `strtoul' function. */ #undef HAVE_STRTOUL /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Use nonstandard varargs form for the GLU tesselator callback */ #undef HAVE_VARARGS_GLU_TESSCB /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define if you have EXR library */ #undef HasEXR /* Define if you have the jpeg library */ #undef HasJPEG /* Define if you have the png library */ #undef HasPNG /* Define if you have the tiff library */ #undef HasTIFF /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to necessary symbol if this constant uses a non-standard name on your system. */ #undef PTHREAD_CREATE_JOINABLE /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Version number of package */ #undef VERSION /* Define if using the dmalloc debugging malloc package */ #undef WITH_DMALLOC /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ #if defined AC_APPLE_UNIVERSAL_BUILD # if defined __BIG_ENDIAN__ # define WORDS_BIGENDIAN 1 # endif #else # ifndef WORDS_BIGENDIAN # undef WORDS_BIGENDIAN # endif #endif /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ #undef _LARGEFILE_SOURCE /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to `long int' if does not define. */ #undef off_t /* Define to `unsigned int' if does not define. */ #undef size_t enblend-enfuse-4.1.2+dfsg/include/0000755000175100017510000000000012232763263017212 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/include/CMakeLists.txt0000644000175100017510000000036412070530113021737 0ustar ametzlerametzler include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) add_subdirectory(vigra) add_subdirectory(vigra_ext) ########### install files ############### #original Makefile.am contents follow: #SUBDIRS = vigra vigra_ext enblend-enfuse-4.1.2+dfsg/include/Makefile.in0000664000175100017510000004460412232763263021271 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = vigra_ext EXTRA_DIST = CMakeLists.txt all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic distclean-tags distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/include/vigra_ext/0000755000175100017510000000000012232763263021202 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/include/vigra_ext/CMakeLists.txt0000644000175100017510000000143112070530113023723 0ustar ametzlerametzler include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) ########### install files ############### #original Makefile.am contents follow: #EXTRA_DIST = blend.h \ # Correlation.h \ # FitPolynom.h \ # FunctorAccessor.h \ # ImageTransforms.h \ # Interpolators.h \ # MultiLayerImage.h \ # MultiThreadOperations.h \ # NearestFeatureTransform.h \ # Pyramid.h \ # RansacParameterEstimator.h \ # ROI.h \ # ROIImage.h \ # VigQuotientEstimator.h \ # VignettingCorrection.h \ # impexalpha.hxx \ # ransac.h \ # tiffUtils.h \ # utils.h \ # XMIWrapper.h enblend-enfuse-4.1.2+dfsg/include/vigra_ext/functoraccessor.hxx0000644000175100017510000004201212070530113025117 0ustar ametzlerametzler// -*- c-basic-offset: 4 -*- /** @file functoraccessor.hxx * * @author Pablo d'Angelo * * $Id: FunctorAccessor.h,v 1.5 2007/01/27 05:00:35 acmihal Exp $ * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #ifndef FUNCTORACCESSOR_HXX_ #define FUNCTORACCESSOR_HXX_ #include namespace vigra_ext { /** This class can be used to apply a function when reading the input image. Can be used to apply point operations temporarily, like scaling, gamma correction etc. This is a read only accessor, writing is not supported. */ template class ReadFunctorAccessor { public: typedef typename Functor::result_type value_type; ReadFunctorAccessor(Functor f, Accessor a) : m_f(f), m_a(a) { } /** Get functor result template void function(A a, B b) { }; */ template typename Functor::result_type operator()(ITERATOR_ const & i, DIFFERENCE_ d) const { return m_f(m_a(i,d)); } /** Get functor result */ template typename Functor::result_type operator()(ITERATOR const & i) const { return m_f(m_a(i)); } protected: Functor m_f; Accessor m_a; }; /** This class can be used to apply a function when writing to an image Can be used to apply point operations temporarily, like scaling, gamma correction etc. This is a write only accessor, reading is not supported. */ template class WriteFunctorAccessor { public: typedef typename Functor::result_type value_type; WriteFunctorAccessor(Functor f, Accessor a) : m_f(f), m_a(a) { } /** Set functor result */ template void set(Value const & v, ITERATOR const & i) const { m_a.set(m_f(vigra::detail::RequiresExplicitCast::cast(v)), i); } /** Set functor result */ template void set(Value const & v, ITERATOR_ const & i, DIFFERENCE_ d) const { m_a.set(m_f(vigra::detail::RequiresExplicitCast::cast(v)),i,d); } Functor m_f; Accessor m_a; }; /** define a write only accessor for a virtual Image, 2> image, which actually consists of two Images. Useful to split an image into gray and alpha images while loading, like it is shown in the following example: \code vigra::ImageImportInfo info(argv[1]); if(info.numBands() == 2 && info.numExtraBands() == 1) { vigra::BImage image; vigra::BImage mask; image.resize(info.width(), info.height()); mask.resize(info.width(), info.height()); // construct special reading accessor, to split // the image into two images while reading vigra_ext::SplitVector2Accessor splitA(image.upperLeft(), image.accessor(), mask.upperLeft(), mask.accessor()); importImage(info, Diff2D(), splitA ); \endcode */ template class SplitVector2Accessor { public: /** the vector's value_type */ typedef vigra::TinyVector value_type; typedef typename value_type::value_type component_type; /** Construct from two image iterators and associated accessors. */ SplitVector2Accessor(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2) : i1_(i1), a1_(a1), i2_(i2), a2_(a2) {} /** scalar & scalar image */ template void setComponent( V const & value, ITERATOR const & i, int idx ) const { switch (idx) { case 0: a1_.set(value, i1_, *i); break; case 1: a2_.set(value, i2_, *i); break; default: vigra_fail("too many components in input value"); } } /** return the size (Number of Bands) */ template unsigned int size(ITERATOR const & i) const { return 2; } Iter1 i1_; Acc1 a1_; Iter2 i2_; Acc2 a2_; }; /** split a vector image into a vector and a scalar image * * like SplitVector2Accessor, but for the vector -> vector, scalar * case. * * the template parameter SIZE gives the length of each vector * in the input image. components 0..SIZE-2, are put into the * image 1 (must be a vector image), and component SIZE-1 * is stored in image 2 (should be a scalar image) */ template class SplitVectorNAccessor { public: /** the vector's value_type */ typedef vigra::TinyVector value_type; typedef typename value_type::value_type component_type; /** Construct from two image iterators and associated accessors. */ SplitVectorNAccessor(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2) : i1_(i1), a1_(a1), i2_(i2), a2_(a2) {} /** vector & scalar image */ template void setComponent( V const & value, ITERATOR const & i, int idx ) const { if ( idx < SIZE - 1 ) { a1_.setComponent(value, i1_, *i, idx); } else if ( idx == SIZE - 1 ) { a2_.set(value, i2_, *i); } else { vigra_fail("too many components in input value"); } } /** return the size (Number of Bands) */ template unsigned int size(ITERATOR const & i) const { return SIZE; } Iter1 i1_; Acc1 a1_; Iter2 i2_; Acc2 a2_; }; /** merge two scalar images into a vector image. * * the inverse to SplitVector2Accessor. * */ template class MergeScalarScalar2VectorAccessor { public: /** the vector's value_type */ typedef vigra::TinyVector value_type; typedef typename value_type::value_type component_type; /** Construct from two image iterators and associated accessors. */ MergeScalarScalar2VectorAccessor(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2) : i1_(i1), a1_(a1), i2_(i2), a2_(a2) {} /** read the current data item */ template value_type operator()(DIFFERENCE_ const & d) const { return value_type(a1_(i1_, d), a2_(i2_, d)); } /** read one component */ template component_type getComponent(ITERATOR const & i, int idx) const { switch (idx) { case 0: return a1_( i1_, *i ); case 1: return a2_( i2_, *i ); default: vigra_fail("too many components in input value"); // never reached, but here to silence compiler exit(1); } } /** read one component, with offset */ template component_type const & getComponent(ITERATOR const & i, DIFFERENCE_ const & d, int idx) const { i += d; switch (idx) { case 0: return a1_.getComponent(i1_, *i, idx); case 1: return a2_.getComponent(i2_, *i, idx); default: vigra_fail("too many components in input value"); } } /** return the size (Number of Bands) */ template unsigned int size(ITERATOR const & i) const { return 2; } Iter1 i1_; Acc1 a1_; Iter2 i2_; Acc2 a2_; }; /** merge a vector and a scalar image into a vector image. * * This virtually "appends" the scalar image plane to * the vector image. * * the inverse to SplitVectorNAccessor. * */ template class MergeVectorScalar2VectorAccessor { public: /** the vector's value_type */ typedef typename Acc1::value_type image1_type; typedef typename Acc2::value_type image2_type; typedef typename image1_type::value_type component_type; typedef vigra::TinyVector value_type; /** Construct from two image iterators and associated accessors. */ MergeVectorScalar2VectorAccessor(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2) : i1_(i1), a1_(a1), i2_(i2), a2_(a2) {} /** read the current data item */ template value_type operator()(DIFFERENCE_ const & d) const { value_type ret; typename value_type::iterator it = ret.begin(); const image1_type & i1 = a1_(i1_, d); for ( typename image1_type::const_iterator it1 = i1.begin(); it1 != i1.end(); ++it1 ) { *it = *it1; it++; } *it = a2_(i2_, d); return ret; } /** read one component */ template component_type getComponent(ITERATOR const & i, int idx) const { if ( idx < SIZE - 1 ) { return a1_.getComponent(i1_, *i, idx); } else if ( idx == SIZE - 1 ) { return a2_(i2_, *i); } else { vigra_fail("too many components in input value"); // just to silence the compiler warning. this is // never reached, since vigra_fail will always // throw an exception. throw 0; } } /** read one component, with offset */ template component_type const getComponent(ITERATOR i, DIFFERENCE_ const & d, int idx) const { i += d; if ( idx < SIZE - 1 ) { return a1_.getComponent(i1_, *i, idx); } else if ( idx == SIZE - 1 ) { return a2_(i2_, *i); } else { vigra_fail("too many components in input value"); // just to silence the compiler warning. this is // never reached, since vigra_fail will always // throw an exception. throw 0; } } /** return the size (Number of Bands) */ template unsigned int size(ITERATOR const & i) const { return SIZE; } Iter1 i1_; Acc1 a1_; Iter2 i2_; Acc2 a2_; }; /** An accessor to encapsulate write access to a multiband image, and move divide it into two images. This is particulary useful, if a multiband image should be splitted into separate images during import operations. Then one doesn't need to create a temporary image. This can be used to copy a 4 band image into a 3 band image and a 1 band image, with a single copyImage, or during other operations. For example, some images contain an alpha channel, and depending on the application, this doesn't need to have the same type, for example, float RGB channels, uint8 mask channel. Many algorithms provided by vigra also expect the masks and the image in separate images. The following image combinations are supported so far: - vector -> scalar, scalar - vector -> vector, scalar This accessor is quite slow. It checks the vector indicies on every access. @bug This is not a complete accessor, only write operations are supported. @bug value_type is not specified correctly, I don't know how to merge them properly with template programming. Requirements: both images need to have the same elementary type */ template class ImageSplittingAccessor { public: /** value type of image 1 */ typedef typename Acc1::value_type image_type1; /** value type of image 2 */ typedef typename Acc2::value_type image_type2; /** @BUG: how to combine two value types into one? */ // typedef image_type1 value_type; /** Construct from two image iterators and associated accessors. */ ImageSplittingAccessor(Iter1 i1, Acc1 a1, Iter2 i2, Acc2 a2) : i1_(i1), a1_(a1), i2_(i2), a2_(a2) {} /** write value V into the two images. * * V has to be a stl compatible vector type, * the two images can be of vector or scalar types. * */ template void setComponent(V const & value, ITERATOR const & i, int idx) const { setComponentIsScalar(value, i, idx, vigra::NumericTraits::isScalar() ); } #if 0 /** Write the current data item. The type V must be a sequence type, Likewise the value types of image 1 and image 2. Its size must be size(image_type1) + size(image_type2); The type V of the passed in value is automatically converted to VALUETYPE. In case of a conversion floating point -> intergral this includes rounding and clipping. */ template void setVector2VectorVector(V const & value, ITERATOR const & i) const { // get pixels at current position indicated by iterator image_type1 & v1 = a1_(i); image_type2 & v2 = a2_(i2_, i - i1_); // TODO: check if the size of both images is correct // copy into first image typename V::iterator vIt = value.begin(); typename image_type1::iterator v1It = v1.begin(); while ( v1It != v1.end() && vIt != value.end()) { *v1It = detail::RequiresExplicitCast::cast(*vIt); ++v1It; ++vIt; } // copy rest into second image typename image_type2::iterator v2It = v2.begin(); while ( v2It != v1.end() && vIt != value.end()) { *v2It = detail::RequiresExplicitCast::cast(*vIt); ++v2It; ++vIt; } for (int i=0; i < value.size(); i++) { if (i < *i = detail::RequiresExplicitCast::cast(value); } /** Write the data item at an offset (can be 1D or 2D or higher order difference).. The type V of the passed in value is automatically converted to VALUETYPE. In case of a conversion floating point -> intergral this includes rounding and clipping. */ template void set(V const & value, ITERATOR const & i, DIFFERENCE_ const & diff) const { i[diff]= detail::RequiresExplicitCast::cast(value); } #endif protected: /** if first dest image is scalar */ template void setComponentIsScalar(V const & value, ITERATOR const & i, int idx, vigra::VigraTrueType) const { setComponentScalarIsScalar(value, i, idx, vigra::NumericTraits::isScalar() ); } /** if first dest image is vector image */ template void setComponentIsScalar(V const & value, ITERATOR const & i, int idx, vigra::VigraFalseType) const { setComponentVectorIsScalar(value, i, idx, vigra::NumericTraits::isScalar() ); } /** if scalar & scalar image */ template void setComponentScalarIsScalar(V const & value, ITERATOR const & i, int idx, vigra::VigraTrueType) const { switch (idx) { case 0: a1_.set(value, i); break; case 1: a2_.set(value, i2_, i - i1_); break; default: vigra_fail("too many components in input value"); } } /** if scalar & vector image */ template void setComponentScalarIsVector(V const & value, ITERATOR const & i, int idx, vigra::VigraTrueType) const { vigra_fail("vector -> scalar, vector accessor not implemented"); } /** if vector & scalar image */ template void setComponentVectorIsScalar(V const & value, ITERATOR const & i, int idx, vigra::VigraTrueType) const { image_type1 & v1 = a1_(i); typename image_type1::size_type s1 = v1.size(); if (idx < s1) { a1_.setComponent(value, i, idx); } else if ( idx == s1) { a2_.set(value, i2_, i - i1_); } else { vigra_fail("too many components in input value"); } } /** if vector & vector image */ template void setComponentVectorIsVector(V const & value, ITERATOR const & i, int idx, vigra::VigraTrueType) const { vigra_fail("vector -> vector, vector accessor not implemented"); } Iter1 i1_; Acc1 a1_; Iter2 i2_; Acc2 a2_; }; /** a sample functor that can be used to multiply pixel values with a constant*/ template struct Multiply { typedef T result_type; Multiply(T factor) : m_factor(factor) {} template PixelType operator()(PixelType const& v) const { return vigra::NumericTraits::fromRealPromote(v * m_factor); } T m_factor; }; } // namespace #endif // FUNCTORACCESSOR_HXX enblend-enfuse-4.1.2+dfsg/include/vigra_ext/rect2d.hxx0000644000175100017510000000141012070530113023074 0ustar ametzlerametzler#ifndef RECT2D_HXX_ #define RECT2D_HXX_ #include #include namespace vigra_ext { template inline vigra::triple apply(const vigra::Rect2D& rectangle, const vigra::triple& image) { return vigra::make_triple(image.first + rectangle.upperLeft(), image.first + rectangle.lowerRight(), image.third); } template inline std::pair apply(const vigra::Rect2D& rectangle, const std::pair& image) { return std::make_pair(image.first + rectangle.upperLeft(), image.second); } } #endif // RECT2D_HXX_ enblend-enfuse-4.1.2+dfsg/include/vigra_ext/Makefile.in0000664000175100017510000003047012232763263023255 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = include/vigra_ext DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ cachedfileimage.hxx \ fillpolygon.hxx \ functoraccessor.hxx \ impexalpha.hxx \ rect2d.hxx \ stdcachedfileimage.hxx \ \ CMakeLists.txt all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/vigra_ext/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/vigra_ext/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/include/vigra_ext/fillpolygon.hxx0000644000175100017510000004056512070530113024265 0ustar ametzlerametzler/* * Copyright (C) 2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef FILLPOLYGON_HXX #define FILLPOLYGON_HXX #include #include #include #include #include #include #ifndef HAVE_LRINT __inline long int lrint (double x){ return static_cast(x + (x < 0.0 ? -0.5 : 0.5)); } #endif #define END_OF_SEGMENT_MARKER vigra::Point2D(INT_MIN, INT_MIN) namespace vigra_ext { namespace detail { template inline static vigra::Rect2D get_polygon_extent(PolygonVertexIterator vertex_begin, PolygonVertexIterator vertex_end) { if (vertex_begin == vertex_end) { throw std::invalid_argument("empty polygon"); } int left = vertex_begin->px(); int top = vertex_begin->py(); int right = vertex_begin->px(); int bottom = vertex_begin->py(); for (PolygonVertexIterator v = vertex_begin; v != vertex_end; ++v) { if (*v != END_OF_SEGMENT_MARKER) { left = std::min(left, v->px()); top = std::min(top, v->py()); right = std::max(right, v->px()); bottom = std::max(bottom, v->py()); } } return vigra::Rect2D(left, top, right, bottom); } typedef enum {HORIZONTAL_LEFT, CROSSING, TOUCHING, HORIZONTAL_RIGHT} intersection_t; inline static intersection_t intersection_of_bool(bool is_touching) { return is_touching ? TOUCHING : CROSSING; } inline static bool is_touching_point(const vigra::Point2D& u, const vigra::Point2D& v, int y) { return (u.py() >= y && v.py() >= y) || (u.py() < y && v.py() < y); } template inline void search_intersections(const PolygonVertexIterator& vertex_begin, const PolygonVertexIterator& vertex_end, int y, // y-coordinate of scanline BackInsertIterator intersections_end) { if (vertex_begin == vertex_end) { return; } PolygonVertexIterator u(vertex_begin); PolygonVertexIterator v(vertex_begin); ++v; while (v != vertex_end) { if (*u != END_OF_SEGMENT_MARKER && *v != END_OF_SEGMENT_MARKER) { const int delta_y = v->py() - u->py(); if (delta_y != 0) { const double m = static_cast(y - u->py()) / static_cast(delta_y); if (0.0 <= m && m <= 1.0) { const int x = lrint(static_cast(u->px()) + m * static_cast(v->px() - u->px())); *intersections_end++ = std::make_pair(x, intersection_of_bool(is_touching_point(*u, *v, y))); } } else if (y == u->py()) // horizontal segment in _current_ scanline { *intersections_end++ = std::make_pair(std::min(u->px(), v->px()), HORIZONTAL_LEFT); *intersections_end++ = std::make_pair(std::max(u->px(), v->px()), HORIZONTAL_RIGHT); } } ++u; ++v; } } template inline void search_intersections_active(ActiveList& active_segments, int y, // y-coordinate of scanline BackInsertIterator intersections_end) { typedef typename ActiveList::iterator active_list_iterator; active_list_iterator a(active_segments.begin()); while (a != active_segments.end()) { if (a->first != END_OF_SEGMENT_MARKER && a->second != END_OF_SEGMENT_MARKER) { const int delta_y = a->second.py() - a->first.py(); if (delta_y != 0) { const double m = static_cast(y - a->first.py()) / static_cast(delta_y); if (0.0 <= m && m <= 1.0) { const int x = lrint(static_cast(a->first.px()) + m * static_cast(a->second.px() - a->first.px())); *intersections_end++ = std::make_pair(x, intersection_of_bool(is_touching_point(a->first, a->second, y))); if (m == 1.0) { active_segments.erase(a++); // see: Meyers, Effective STL, Item 9 continue; } } } else if (y == a->first.py()) // horizontal segment in _current_ scanline { *intersections_end++ = std::make_pair(std::min(a->first.px(), a->second.px()), HORIZONTAL_LEFT); *intersections_end++ = std::make_pair(std::max(a->first.px(), a->second.px()), HORIZONTAL_RIGHT); } } ++a; } } template inline static void fill_row(const RowIterator& row, int x_first, int x_last, Accessor accessor, const typename Accessor::value_type& value) { for (int x = x_first; x <= x_last; ++x) { accessor.set(value, row, x); } } template inline static T limit(T x, T lower_limit, T upper_limit) { return std::min(std::max(x, lower_limit), upper_limit); } struct malformed_polygon : public std::runtime_error { malformed_polygon(const std::string& message) : std::runtime_error(message) {} }; template inline static void fill_row_segments(const IntersectionList& intersections, const RowIterator& row, int row_width, Accessor accessor, const typename Accessor::value_type& value) { typedef typename IntersectionList::size_type size_type; const size_type n = intersections.size(); const int row_max = row_width - 1; if (n >= 2U && n % 2U == 0U) { for (size_type i = 0U; i != n; i += 2U) { const int x0 = limit(intersections[i], 0, row_max); const int x1 = limit(intersections[i + 1], 0, row_max); detail::fill_row(row, x0, x1, accessor, value); } } else { throw malformed_polygon("vigra_ext::fill_row_segments: open polygon"); } } template void group_to_pairs(Iterator begin, Iterator end, BackInsertIterator result) { typedef typename Iterator::value_type value_type; typedef std::vector array; typedef typename array::const_iterator array_const_iterator; array horizontal_begins; array horizontal_ends; for (Iterator i = begin; i != end; ++i) { switch (i->second) { case TOUCHING: *result++ = i->first; // FALLTHROUGH case CROSSING: *result++ = i->first; break; case HORIZONTAL_LEFT: horizontal_begins.push_back(i->first); break; case HORIZONTAL_RIGHT: horizontal_ends.push_back(i->first); break; default: assert(false); } } assert(horizontal_begins.size() == horizontal_ends.size()); array_const_iterator x0(horizontal_begins.begin()); array_const_iterator x1(horizontal_ends.begin()); while (x0 != horizontal_begins.end()) { *result++ = *x0++; *result++ = *x1++; } } template struct LessThanSegment : public std::binary_function { bool operator()(const SegmentType& s, const SegmentType& t) const { const int s_min_y = std::min(s.first.py(), s.second.py()); const int t_min_y = std::min(t.first.py(), t.second.py()); if (s_min_y < t_min_y) { return true; } else if (s_min_y == t_min_y) { const int s_min_x = std::min(s.first.px(), s.second.px()); const int t_min_x = std::min(t.first.px(), t.second.px()); return s_min_x < t_min_x; } else { return false; } } }; } // end namespace detail template void fill_polygon(const ImageIterator& upper_left, const ImageIterator& lower_right, const ImageAccessor& accessor, const PolygonVertexIterator& vertex_begin, const PolygonVertexIterator& vertex_end, const ValueType& fill_value) { typedef std::pair intersection_data; typedef std::vector intersection_list; typedef typename ImageIterator::row_iterator row_iterator; if (vertex_begin == vertex_end) { return; } const vigra::Size2D image_size(lower_right - upper_left); const vigra::Rect2D extent(detail::get_polygon_extent(vertex_begin, vertex_end)); #ifdef DEBUG_POLYGON_FILL std::cout << "+ fill_polygon: image's size = " << image_size << "\n" << "+ fill_polygon: polygon's extent = " << extent; unsigned i = 0U; for (PolygonVertexIterator v = vertex_begin; v != vertex_end; ++v) { if (i % 5U == 0U) { std::cout << "\n+ fill_polygon: vertices "; } else { std::cout << " "; } if (*v == END_OF_SEGMENT_MARKER) { std::cout << ""; } else { std::cout << *v; } ++i; } std::cout << "\n"; #endif #ifdef OPENMP #pragma omp for #endif for (int y = std::max(0, extent.top()); y < std::min(image_size.height(), extent.bottom()); ++y) { intersection_list intersections; detail::search_intersections(vertex_begin, vertex_end, y, std::back_inserter(intersections)); if (!intersections.empty()) // OPTIMIZATION: skip empty scanlines { std::sort(intersections.begin(), intersections.end()); std::vector paired_intersections; paired_intersections.reserve(intersections.size()); detail::group_to_pairs(intersections.begin(), intersections.end(), std::back_inserter(paired_intersections)); const row_iterator row((upper_left + vigra::Diff2D(0, y)).rowIterator()); detail::fill_row_segments(paired_intersections, row, image_size.width(), accessor, fill_value); } } } template void fill_polygon_active(const ImageIterator& upper_left, const ImageIterator& lower_right, const ImageAccessor& accessor, const PolygonVertexIterator& vertex_begin, const PolygonVertexIterator& vertex_end, const ValueType& fill_value) { typedef std::pair intersection_data; typedef std::vector intersection_list; typedef typename ImageIterator::row_iterator row_iterator; if (vertex_begin == vertex_end) { return; } const vigra::Size2D image_size(lower_right - upper_left); const vigra::Rect2D extent(detail::get_polygon_extent(vertex_begin, vertex_end)); typedef std::pair segment; typedef std::vector segments; typedef typename segments::const_iterator segments_const_iterator; typedef std::list segment_list; // Create the line segments that make up the polygon. We sort the // y-coordinates ascendingly. segments polygon_segments; PolygonVertexIterator u(vertex_begin); PolygonVertexIterator v(vertex_begin); ++v; while (v != vertex_end) { polygon_segments.push_back(u->py() < v->py() ? std::make_pair(*u, *v) : std::make_pair(*v, *u)); ++u; ++v; } // Sort the line segments according to their y-coordinates. std::sort(polygon_segments.begin(), polygon_segments.end(), detail::LessThanSegment()); segment_list active_segments; segments_const_iterator s(polygon_segments.begin()); #ifdef OPENMP #pragma omp parallel for private (active_segments) firstprivate (s) #endif for (int y = std::max(0, extent.top()); y < std::min(image_size.height(), extent.bottom()); ++y) { // Fill active-segments range. while (s != polygon_segments.end() && s->first.py() <= y) { // NOTE: In the parallel version all threads start at // polygon_segments.begin(), but we need to record // only segments that reach beyond our scan-line. if (s->second.py() >= y) { active_segments.push_back(*s); } ++s; } intersection_list intersections; detail::search_intersections_active(active_segments, y, std::back_inserter(intersections)); if (!intersections.empty()) // OPTIMIZATION: skip empty scanlines { std::sort(intersections.begin(), intersections.end()); std::vector paired_intersections; paired_intersections.reserve(intersections.size()); detail::group_to_pairs(intersections.begin(), intersections.end(), std::back_inserter(paired_intersections)); const row_iterator row((upper_left + vigra::Diff2D(0, y)).rowIterator()); detail::fill_row_segments(paired_intersections, row, image_size.width(), accessor, fill_value); } } } } // end namespace vigra_ext #endif // FILLPOLYGON_HXX enblend-enfuse-4.1.2+dfsg/include/vigra_ext/impexalpha.hxx0000644000175100017510000007017212070530501024055 0ustar ametzlerametzler/* * Copyright (C) 2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef IMPEXALPHA_HXX #define IMPEXALPHA_HXX #include #include namespace vigra_ext { namespace detail { typedef enum { UNSIGNED_INT_8, UNSIGNED_INT_16, UNSIGNED_INT_32, SIGNED_INT_16, SIGNED_INT_32, FLOAT_32, FLOAT_64 } pixel_t; inline static pixel_t pixel_t_of_string(const std::string& pixel_type) { if (pixel_type == "UINT8") { return UNSIGNED_INT_8; } else if (pixel_type == "UINT16") { return UNSIGNED_INT_16; } else if (pixel_type == "UINT32") { return UNSIGNED_INT_32; } else if (pixel_type == "INT16") { return SIGNED_INT_16; } else if (pixel_type == "INT32") { return SIGNED_INT_32; } else if (pixel_type == "FLOAT") { return FLOAT_32; } else if (pixel_type == "DOUBLE") { return FLOAT_64; } else { vigra_fail("vigra_ext::detail::pixel_t_of_string: unknown pixel type"); return UNSIGNED_INT_8; // NOT REACHED } } template inline static void read_image_band_and_alpha(vigra::Decoder* decoder, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor) { typedef typename ImageIterator::row_iterator ImageRowIterator; typedef typename AlphaIterator::row_iterator AlphaRowIterator; vigra_precondition(decoder->getNumExtraBands() == 1, "vigra_ext::detail::read_image_band_and_alpha: expecting exactly one alpha band"); vigra_precondition(decoder->getNumBands() - decoder->getNumExtraBands() == 1, "vigra_ext::detail::read_image_band_and_alpha: expecting exactly one image band"); const unsigned width(decoder->getWidth()); const unsigned height(decoder->getHeight()); const unsigned offset(decoder->getOffset()); for (unsigned y = 0U; y != height; ++y) { decoder->nextScanline(); const ValueType* scanline0 = static_cast(decoder->currentScanlineOfBand(0)); const ValueType* scanline1 = static_cast(decoder->currentScanlineOfBand(1)); ImageRowIterator is(image_iterator.rowIterator()); const ImageRowIterator is_end(is + width); AlphaRowIterator as(alpha_iterator.rowIterator()); while (is != is_end) { image_accessor.set(*scanline0, is); scanline0 += offset; ++is; alpha_accessor.set(*scanline1, as); scanline1 += offset; ++as; } ++image_iterator.y; ++alpha_iterator.y; } } template inline static void read_image_bands_and_alpha(vigra::Decoder* decoder, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor) { typedef typename ImageIterator::row_iterator ImageRowIterator; typedef typename AlphaIterator::row_iterator AlphaRowIterator; vigra_precondition(decoder->getNumExtraBands() == 1, "vigra_ext::detail::read_image_bands_and_alpha: expecting exactly one alpha band"); vigra_precondition(decoder->getNumBands() - decoder->getNumExtraBands() == 3, "vigra_ext::detail::read_image_bands_and_alpha: expecting exactly three image bands"); vigra_precondition(image_accessor.size(image_iterator) == 3, "vigra_ext::detail::read_image_bands_and_alpha: number of bands in file and destination image differ"); const unsigned width(decoder->getWidth()); const unsigned height(decoder->getHeight()); const unsigned offset(decoder->getOffset()); for (unsigned y = 0U; y != height; ++y) { decoder->nextScanline(); const ValueType* scanline0 = static_cast(decoder->currentScanlineOfBand(0)); const ValueType* scanline1 = static_cast(decoder->currentScanlineOfBand(1)); const ValueType* scanline2 = static_cast(decoder->currentScanlineOfBand(2)); const ValueType* scanline3 = static_cast(decoder->currentScanlineOfBand(3)); ImageRowIterator is(image_iterator.rowIterator()); const ImageRowIterator is_end(is + width); AlphaRowIterator as(alpha_iterator.rowIterator()); while (is != is_end) { image_accessor.setComponent(*scanline0, is, 0); scanline0 += offset; image_accessor.setComponent(*scanline1, is, 1); scanline1 += offset; image_accessor.setComponent(*scanline2, is, 2); scanline2 += offset; ++is; alpha_accessor.set(*scanline3, as); scanline3 += offset; ++as; } ++image_iterator.y; ++alpha_iterator.y; } } template inline static void importImageAlpha(const vigra::ImageImportInfo& import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor, vigra::VigraTrueType) { std::auto_ptr decoder(vigra::decoder(import_info)); switch (pixel_t_of_string(decoder->getPixelType())) { case UNSIGNED_INT_8: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case UNSIGNED_INT_16: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case UNSIGNED_INT_32: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case SIGNED_INT_16: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case SIGNED_INT_32: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case FLOAT_32: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case FLOAT_64: read_image_band_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; default: vigra_fail("vigra_ext::detail::importImageAlpha: not reached"); } decoder->close(); } template inline static void importImageAlpha(const vigra::ImageImportInfo& import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor, vigra::VigraFalseType) { std::auto_ptr decoder(vigra::decoder(import_info)); switch (pixel_t_of_string(decoder->getPixelType())) { case UNSIGNED_INT_8: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case UNSIGNED_INT_16: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case UNSIGNED_INT_32: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case SIGNED_INT_16: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case SIGNED_INT_32: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case FLOAT_32: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; case FLOAT_64: read_image_bands_and_alpha(decoder.get(), image_iterator, image_accessor, alpha_iterator, alpha_accessor); break; default: vigra_fail("vigra_ext::detail::importImageAlpha: not reached"); } decoder->close(); } } // end namespace detail template inline void importImageAlpha(const vigra::ImageImportInfo& import_info, ImageIterator image_iterator, ImageAccessor image_accessor, AlphaIterator alpha_iterator, AlphaAccessor alpha_accessor) { typedef typename ImageAccessor::value_type ImageValueType; typedef typename vigra::NumericTraits::isScalar is_scalar; detail::importImageAlpha(import_info, image_iterator, image_accessor, alpha_iterator, alpha_accessor, is_scalar()); } template inline void importImageAlpha(const vigra::ImageImportInfo& import_info, const vigra::pair& image, const vigra::pair& alpha) { importImageAlpha(import_info, image.first, image.second, alpha.first, alpha.second); } namespace detail { template inline static void write_image_band_and_alpha(vigra::Encoder* encoder, ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor) { typedef typename ImageIterator::row_iterator ImageRowIterator; typedef typename ImageAccessor::value_type ImageValueType; typedef typename AlphaIterator::row_iterator AlphaRowIterator; typedef typename AlphaAccessor::value_type AlphaValueType; vigra_precondition(image_lower_right.x >= image_upper_left.x, "vigra_ext::detail::write_image_band_and_alpha: negative width"); vigra_precondition(image_lower_right.y >= image_upper_left.y, "vigra_ext::detail::write_image_band_and_alpha: negative height"); const unsigned width(static_cast(image_lower_right.x - image_upper_left.x)); const unsigned height(static_cast(image_lower_right.y - image_upper_left.y)); encoder->setWidth(width); encoder->setHeight(height); encoder->setNumBands(1 + 1); encoder->finalizeSettings(); const unsigned offset(encoder->getOffset()); // correct offset only _after_ finalizeSettings() // IMPLEMENTATION NOTE: We avoid calling the default constructor // to allow classes ImageIterator and AlphaIterator that do not // define one. ImageIterator image_iterator(image_upper_left); AlphaIterator alpha_iterator(alpha_upper_left); for (unsigned y = 0U; y != height; ++y) { ValueType* scanline0 = static_cast(encoder->currentScanlineOfBand(0)); ValueType* scanline1 = static_cast(encoder->currentScanlineOfBand(1)); ImageRowIterator is(image_iterator.rowIterator()); const ImageRowIterator is_end(is + width); AlphaRowIterator as(alpha_iterator.rowIterator()); while (is != is_end) { *scanline0 = vigra::detail::RequiresExplicitCast::cast(image_accessor(is)); scanline0 += offset; ++is; *scanline1 = vigra::detail::RequiresExplicitCast::cast(alpha_accessor(as)); scanline1 += offset; ++as; } encoder->nextScanline(); ++image_iterator.y; ++alpha_iterator.y; } } template inline static void write_image_bands_and_alpha(vigra::Encoder* encoder, ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor) { typedef typename ImageIterator::row_iterator ImageRowIterator; typedef typename AlphaIterator::row_iterator AlphaRowIterator; vigra_precondition(image_lower_right.x >= image_upper_left.x, "vigra_ext::detail::write_image_bands_and_alpha: negative width"); vigra_precondition(image_lower_right.y >= image_upper_left.y, "vigra_ext::detail::write_image_bands_and_alpha: negative height"); vigra_precondition(image_accessor.size(image_upper_left) == 3, "vigra_ext::detail::write_image_bands_and_alpha: number of bands in file and source image differ"); const unsigned width(static_cast(image_lower_right.x - image_upper_left.x)); const unsigned height(static_cast(image_lower_right.y - image_upper_left.y)); encoder->setWidth(width); encoder->setHeight(height); encoder->setNumBands(3 + 1); encoder->finalizeSettings(); const unsigned offset(encoder->getOffset()); // correct offset only _after_ finalizeSettings() // IMPLEMENTATION NOTE: We avoid calling the default constructor // to allow classes ImageIterator and AlphaIterator that do not // define one. ImageIterator image_iterator(image_upper_left); AlphaIterator alpha_iterator(alpha_upper_left); for (unsigned y = 0U; y != height; ++y) { ValueType* scanline0 = static_cast(encoder->currentScanlineOfBand(0)); ValueType* scanline1 = static_cast(encoder->currentScanlineOfBand(1)); ValueType* scanline2 = static_cast(encoder->currentScanlineOfBand(2)); ValueType* scanline3 = static_cast(encoder->currentScanlineOfBand(3)); ImageRowIterator is(image_iterator.rowIterator()); const ImageRowIterator is_end(is + width); AlphaRowIterator as(alpha_iterator.rowIterator()); while (is != is_end) { *scanline0 = vigra::detail::RequiresExplicitCast::cast(image_accessor.getComponent(is, 0)); scanline0 += offset; *scanline1 = vigra::detail::RequiresExplicitCast::cast(image_accessor.getComponent(is, 1)); scanline1 += offset; *scanline2 = vigra::detail::RequiresExplicitCast::cast(image_accessor.getComponent(is, 2)); scanline2 += offset; ++is; *scanline3 = vigra::detail::RequiresExplicitCast::cast(alpha_accessor(as)); scanline3 += offset; ++as; } encoder->nextScanline(); ++image_iterator.y; ++alpha_iterator.y; } } template inline static void exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const vigra::ImageExportInfo& export_info, vigra::VigraTrueType) { const std::string pixel_type(export_info.getPixelType()); std::auto_ptr encoder(vigra::encoder(export_info)); encoder->setPixelType(pixel_type); switch (pixel_t_of_string(pixel_type)) { case UNSIGNED_INT_8: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case UNSIGNED_INT_16: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case UNSIGNED_INT_32: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case SIGNED_INT_16: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case SIGNED_INT_32: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case FLOAT_32: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case FLOAT_64: write_image_band_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; default: vigra_fail("vigra_ext::detail::exportImageAlpha: not reached"); } encoder->close(); } template inline static void exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const vigra::ImageExportInfo& export_info, vigra::VigraFalseType) { const std::string pixel_type(export_info.getPixelType()); std::auto_ptr encoder(vigra::encoder(export_info)); encoder->setPixelType(pixel_type); switch (pixel_t_of_string(pixel_type)) { case UNSIGNED_INT_8: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case UNSIGNED_INT_16: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case UNSIGNED_INT_32: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case SIGNED_INT_16: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case SIGNED_INT_32: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case FLOAT_32: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; case FLOAT_64: write_image_bands_and_alpha(encoder.get(), image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor); break; default: vigra_fail("vigra_ext::detail::exportImageAlpha: not reached"); } encoder->close(); } } // end namespace detail template inline void exportImageAlpha(ImageIterator image_upper_left, ImageIterator image_lower_right, ImageAccessor image_accessor, AlphaIterator alpha_upper_left, AlphaAccessor alpha_accessor, const vigra::ImageExportInfo& export_info) { typedef typename ImageAccessor::value_type ImageValueType; typedef typename vigra::NumericTraits::isScalar is_scalar; try { detail::exportImageAlpha(image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor, export_info, is_scalar()); } catch (vigra::Encoder::TIFFCompressionException&) { const_cast(export_info).setCompression(""); detail::exportImageAlpha(image_upper_left, image_lower_right, image_accessor, alpha_upper_left, alpha_accessor, export_info, is_scalar()); } } template inline void exportImageAlpha(const vigra::triple& image, const vigra::pair& alpha, const vigra::ImageExportInfo& export_info) { exportImageAlpha(image.first, image.second, image.third, alpha.first, alpha.second, export_info); } } // end namespace vigra_ext #endif // IMPEXALPHA_HXX enblend-enfuse-4.1.2+dfsg/include/vigra_ext/Makefile.am0000644000175100017510000000026212070530501023221 0ustar ametzlerametzlerEXTRA_DIST = \ cachedfileimage.hxx \ fillpolygon.hxx \ functoraccessor.hxx \ impexalpha.hxx \ rect2d.hxx \ stdcachedfileimage.hxx \ \ CMakeLists.txt enblend-enfuse-4.1.2+dfsg/include/vigra_ext/stdcachedfileimage.hxx0000644000175100017510000002274012070530113025507 0ustar ametzlerametzler/* * Copyright (C) 2004 Andrew Mihal * * This software is an extension of the VIGRA computer vision library. * ( Version 1.2.0, Aug 07 2003 ) * You may use, modify, and distribute this software according * to the terms stated in the LICENSE file included in * the VIGRA distribution. * * VIGRA is Copyright 1998-2002 by Ullrich Koethe * Cognitive Systems Group, University of Hamburg, Germany * * The VIGRA Website is * http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ * Please direct questions, bug reports, and contributions to * koethe@informatik.uni-hamburg.de * * THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef VIGRA_EXT_STDCACHEDFILEIMAGE_HXX #define VIGRA_EXT_STDCACHEDFILEIMAGE_HXX #include #include #include #include #include #include "vigra_ext/cachedfileimage.hxx" namespace vigra_ext { #define CFI_DEFINE_ITERATORTRAITS(VALUETYPE, ACCESSOR, CONSTACCESSOR) \ template<> \ struct IteratorTraits< \ CachedFileImageIterator > \ { \ typedef CachedFileImageIterator Iterator; \ typedef Iterator iterator; \ typedef iterator::iterator_category iterator_category; \ typedef iterator::value_type value_type; \ typedef iterator::reference reference; \ typedef iterator::index_reference index_reference; \ typedef iterator::pointer pointer; \ typedef iterator::difference_type difference_type; \ typedef iterator::row_iterator row_iterator; \ typedef iterator::column_iterator column_iterator; \ typedef ACCESSOR default_accessor; \ typedef ACCESSOR DefaultAccessor; \ }; \ template<> \ struct IteratorTraits< \ ConstCachedFileImageIterator > \ { \ typedef \ ConstCachedFileImageIterator Iterator; \ typedef Iterator iterator; \ typedef iterator::iterator_category iterator_category; \ typedef iterator::value_type value_type; \ typedef iterator::reference reference; \ typedef iterator::index_reference index_reference; \ typedef iterator::pointer pointer; \ typedef iterator::difference_type difference_type; \ typedef iterator::row_iterator row_iterator; \ typedef iterator::column_iterator column_iterator; \ typedef CONSTACCESSOR default_accessor; \ typedef CONSTACCESSOR DefaultAccessor; \ }; \ template<> \ struct IteratorTraits< \ StridedCachedFileImageIterator > \ { \ typedef StridedCachedFileImageIterator Iterator; \ typedef Iterator iterator; \ typedef iterator::iterator_category iterator_category; \ typedef iterator::value_type value_type; \ typedef iterator::reference reference; \ typedef iterator::index_reference index_reference; \ typedef iterator::pointer pointer; \ typedef iterator::difference_type difference_type; \ typedef iterator::row_iterator row_iterator; \ typedef iterator::column_iterator column_iterator; \ typedef ACCESSOR default_accessor; \ typedef ACCESSOR DefaultAccessor; \ }; \ template<> \ struct IteratorTraits< \ ConstStridedCachedFileImageIterator > \ { \ typedef ConstStridedCachedFileImageIterator Iterator; \ typedef Iterator iterator; \ typedef iterator::iterator_category iterator_category; \ typedef iterator::value_type value_type; \ typedef iterator::reference reference; \ typedef iterator::index_reference index_reference; \ typedef iterator::pointer pointer; \ typedef iterator::difference_type difference_type; \ typedef iterator::row_iterator row_iterator; \ typedef iterator::column_iterator column_iterator; \ typedef CONSTACCESSOR default_accessor; \ typedef CONSTACCESSOR DefaultAccessor; \ }; CFI_DEFINE_ITERATORTRAITS(vigra::UInt8, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage UInt8CFImage; CFI_DEFINE_ITERATORTRAITS(vigra::Int8, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage Int8CFImage; CFI_DEFINE_ITERATORTRAITS(vigra::UInt16, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage UInt16CFImage; CFI_DEFINE_ITERATORTRAITS(vigra::Int16, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage Int16CFImage; CFI_DEFINE_ITERATORTRAITS(vigra::UInt32, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage UInt32CFImage; CFI_DEFINE_ITERATORTRAITS(vigra::Int32, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage Int32CFImage; CFI_DEFINE_ITERATORTRAITS(float, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage FCFImage; CFI_DEFINE_ITERATORTRAITS(double, vigra::StandardValueAccessor, vigra::StandardConstValueAccessor) typedef CachedFileImage DCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > UInt8RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > Int8RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > UInt16RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > Int16RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > UInt32RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > Int32RGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > FRGBCFImage; CFI_DEFINE_ITERATORTRAITS(vigra::RGBValue, vigra::RGBAccessor, vigra::RGBAccessor) typedef CachedFileImage > DRGBCFImage; #ifndef NO_PARTIAL_TEMPLATE_SPECIALIZATION // define traits for BasicImageIterator instanciations that // were not explicitly defined above template struct IteratorTraits > { typedef CachedFileImageIterator Iterator; typedef Iterator iterator; typedef typename iterator::iterator_category iterator_category; typedef typename iterator::value_type value_type; typedef typename iterator::reference reference; typedef typename iterator::index_reference index_reference; typedef typename iterator::pointer pointer; typedef typename iterator::difference_type difference_type; typedef typename iterator::row_iterator row_iterator; typedef typename iterator::column_iterator column_iterator; typedef vigra::StandardAccessor DefaultAccessor; typedef vigra::StandardAccessor default_accessor; }; template struct IteratorTraits > { typedef ConstCachedFileImageIterator Iterator; typedef Iterator iterator; typedef typename iterator::iterator_category iterator_category; typedef typename iterator::value_type value_type; typedef typename iterator::reference reference; typedef typename iterator::index_reference index_reference; typedef typename iterator::pointer pointer; typedef typename iterator::difference_type difference_type; typedef typename iterator::row_iterator row_iterator; typedef typename iterator::column_iterator column_iterator; typedef vigra::StandardConstAccessor DefaultAccessor; typedef vigra::StandardConstAccessor default_accessor; }; #endif } // namespace vigra_ext #endif /* VIGRA_EXT_STDCACHEDFILEIMAGE_HXX */ enblend-enfuse-4.1.2+dfsg/include/vigra_ext/cachedfileimage.hxx0000644000175100017510000024452212070530501025001 0ustar ametzlerametzler/* * Copyright (C) 2004 Andrew Mihal * * This software is an extension of the VIGRA computer vision library. * ( Version 1.2.0, Aug 07 2003 ) * You may use, modify, and distribute this software according * to the terms stated in the LICENSE file included in * the VIGRA distribution. * * VIGRA is Copyright 1998-2002 by Ullrich Koethe * Cognitive Systems Group, University of Hamburg, Germany * * The VIGRA Website is * http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ * Please direct questions, bug reports, and contributions to * koethe@informatik.uni-hamburg.de * * THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #ifndef CACHEDFILEIMAGE_HXX #define CACHEDFILEIMAGE_HXX #include #include #include #include #include #include #ifdef _WIN32 #include #include #endif #ifndef _WIN32 #include #endif #ifdef __GW32C__ #define fseeko fseeko64 #undef malloc #endif #include #include #include #include #include #include using std::cout; using std::cerr; using std::endl; using std::list; using std::map; using std::min; #ifdef _WIN32 #define mktemp _mktemp #endif namespace vigra_ext { /** Abstract base class for CachedFileImages. */ class CachedFileImageBase { public: virtual ~CachedFileImageBase() {} virtual int numBlocksAllocated() const = 0; virtual int numBlocksNeeded() const = 0; virtual void swapOutBlock() const = 0; virtual void printBlockStats() const = 0; }; // Forward declaration. template class CachedFileImage; /** A singleton that manages memory for several CachedFileImages. */ class CachedFileImageDirector { public: ~CachedFileImageDirector() { // This is no longer necessary. temp files get unlinked on creation. //// Make sure all image caches get destroyed and //// temp backing files get deleted. //if (!imageList.empty()) { // cout << endl << "Cleaning up temporary files." << endl; // while (!imageList.empty()) { // CachedFileImageBase const *image = imageList.front(); // //cout << "deleting image " << image << endl; // // Remember that this delete call modifies imageList. // delete image; // } //} //delete pool; } // Obtain a reference to the singleton. static CachedFileImageDirector &v() { static CachedFileImageDirector instance; return instance; } // Obtain a pointer to a blocksize chunk of memory. void* allocateBlock() { void *block = pool->malloc(); // Prevent the pool from allocating more than one block // at a time from the system. Otherwise the pool will grab // more blocks than managedBlocks. pool->set_next_size(1); if (block == NULL) throw std::bad_alloc(); return block; } void deallocateBlock(void* block) { if (block != NULL) pool->free(block); } // Set the number of bytes this director manages. void setAllocation(long long bytes) { // This may not be changed after images have been created. vigra_precondition(imageList.empty(), "CachedFileImageDirector: " "attempt to change allocation after images have already " "been created."); managedBytes = bytes; // Recalculate the number of blocks available. managedBlocks = (int)ceil(managedBytes / (double)blocksize); blocksAvailable = managedBlocks; //cout << "director.setAllocation: managedBlocks=" << managedBlocks // << " blocksAvailable=" << blocksAvailable << endl; } // Set the cache block size. This is the minimum amount that is // moved between the caches and the backing files. void setBlockSize(int bytes) { // This may not be changed after images have been created. vigra_precondition(imageList.empty(), "CachedFileImageDirector: " "attempt to change block size after images have already " "been created."); blocksize = bytes; delete pool; pool = new boost::pool<>(blocksize); // Recalculate the number of blocks available. managedBlocks = (int)ceil(managedBytes / (double)blocksize); blocksAvailable = managedBlocks; //cout << "director.setBlockSize: managedBlocks=" << managedBlocks // << " blocksAvailable=" << blocksAvailable << endl; } long long getAllocation() const { return managedBytes; } // Get the cache block size. int getBlockSize() const { return blocksize; } int getManagedBlocks() const { return managedBlocks; } int getBlocksAvailable() const { return blocksAvailable; } // Request a certain number of blocks for a new image. // Returns the number of blocks the new image may use. int requestBlocksForNewImage(int blocks, CachedFileImageBase const * image) { //cout << "director.requestBlocksForNewImage(blocks=" << blocks // << " image=" << image << endl; int blocksAllocated = 0; if (blocksAvailable > 0) { blocksAllocated = 1; blocksAvailable--; } else { // Zero blocks available. // Try to free a block by forcing another image to swap. blocksAvailable += freeBlock(image); if (blocksAvailable == 0) { // Attempt to free a block was a failure. vigra_fail("CachedFileImageDirector::requestBlocksForNewImage(): " "no blocks available and attempt to free blocks failed."); } blocksAllocated = blocksAvailable; blocksAvailable = 0; } // Register the new image. // By placing it at the back, it is marked as the // most-recently-swapped image. imageList.push_back(image); // Initialize the cache miss counter for this image. imageToMissMap[image] = 0LL; //cout << "director.requestBlocksForNewImage: blocksAllocated=" // << blocksAllocated << " blocksAvailable=" << blocksAvailable << endl; //cout << "director.imageList="; //std::copy(imageList.begin(), imageList.end(), // std::ostream_iterator(cout, " ")); //cout << endl; return blocksAllocated; } // Unregister a CachedFileImage with the director. void returnBlocksUnregisterImage(int blocks, CachedFileImageBase const * image) { blocksAvailable += blocks; imageList.remove(image); //cout << "director.returnBlocks: blocks=" << blocks // << " image=" << image << endl; //cout << "director.returnBlocks: blocksAvailable=" << blocksAvailable // << endl; //cout << "director.returnBlocks: imageList="; //std::copy(imageList.begin(), imageList.end(), // std::ostream_iterator(cout, " ")); //cout << endl; } // Tell the director that a cache miss has occured for this image. // The director may decide to allocate more blocks to the image. // If so it returns a nonzero number. int registerCacheMiss(CachedFileImageBase const * image) { cacheMisses++; imageToMissMap[image]++; // Remove image from list. imageList.remove(image); if (blocksAvailable == 0) { // Try to free a block from an image that has not // missed recently. If this fails then we just won't // give the calling image more blocks. blocksAvailable += freeBlock(image); } // Add image to back of list. // This marks it most-recently-swapped imageList.push_back(image); if (blocksAvailable > 0) { // There are more blocks available to give out. // Give the image one more block. blocksAvailable--; //cout << "director.registerCacheMiss(image=" << image << ")" // << " blocksAvailable=" << blocksAvailable << " return 1" << endl; return 1; } else { //cout << "director.registerCacheMiss(image=" << image << ")" // << " blocksAvailable=" << blocksAvailable << " return 0" << endl; return 0; } } // How many cache misses have occured in total. long long getCacheMisses() { return cacheMisses; } // How many cache misses have occured for the given image. long long getCacheMisses(CachedFileImageBase const * image) { return imageToMissMap[image]; } // Reset all cache miss counters. void resetCacheMisses() { cacheMisses = 0LL; map::iterator i; for (i = imageToMissMap.begin(); i != imageToMissMap.end(); i++) { (*i).second = 0LL; } } // Print general stats about allocated blocks and cache misses. void printStats(std::ostream& out, const std::string& label) { out << label << "summary: cache misses=" << cacheMisses << " blocks managed=" << managedBlocks << " allocated=" << (managedBlocks - blocksAvailable) << " free=" << blocksAvailable << endl; } // Print stats about a particular image. void printStats(std::ostream& out, const std::string& imageName, const CachedFileImageBase* image) { out << imageName << " " << image << ":" << " cache misses=" << imageToMissMap[image] << " blocks allocated=" << image->numBlocksAllocated() << " blocks required=" << image->numBlocksNeeded() << endl; } // Print stats about a particular image. // Add an integer suffix to the image's name. void printStats(std::ostream& out, const std::string& imageName, const int imageNumber, const CachedFileImageBase* image) { out << imageName << imageNumber << " " << image << ":" << " cache misses=" << imageToMissMap[image] << " blocks allocated=" << image->numBlocksAllocated() << " blocks required=" << image->numBlocksNeeded() << endl; } // Print stats on all images. void printAllBlockStats() { list::iterator i; for (i = imageList.begin(); i != imageList.end(); i++) { (*i)->printBlockStats(); } } protected: // Singleton constructor. CachedFileImageDirector() : blocksize(2<<20), managedBytes(1LL<<30), cacheMisses(0), imageList(), imageToMissMap() { // Recalculate the number of blocks available. managedBlocks = (int)ceil(managedBytes / (double)blocksize); blocksAvailable = managedBlocks; pool = new boost::pool<>(blocksize); } // Free a block for the given image. // Find another image with proportionally more blocks than image. int freeBlock(CachedFileImageBase const * image) { // Try to free a block from an image. // Check least-recently-missed images first. list::iterator i; for (i = imageList.begin(); i != imageList.end(); i++) { CachedFileImageBase const * candidate = *i; //cout << "director.freeBlock candidate=" << candidate // << " candidate_blocks=" << candidate->numBlocksAllocated() // << " image_blocks=" << image->numBlocksAllocated() << endl; //// Don't try to break close ties - else if blocks cannot be divided up //// evenly the remainder will just get rotated around. //if (candidate->numBlocksAllocated() > (1+image->numBlocksAllocated())) { // //cout << "director.freeBlock(image=" << image << ")" // // << " candidate=" << candidate << " return 1" << endl; // candidate->swapOutBlock(); // // mark candidate as most-recently-missed. // imageList.erase(i); // imageList.push_back(candidate); // return 1; //} // 20080221: If an image is at the front of the list, it has not missed recently. // Take a block from it. Don't move it to the end of the list. This only happens // if there is a miss on that image. if (candidate->numBlocksAllocated() > 0) { candidate->swapOutBlock(); return 1; } } // Try harder to get another block for image? // Otherwise the thrash exception will be thrown. //if (image->numBlocksAllocated() == 1 && image->numBlocksNeeded() > 1) { // // Look for images that have one block allocated and only need one // // block. Make them swap. Put donor to rear of list. //} // Try even harder? // do the above and also turn off rotation constraint? //cout << "director.freeBlock(image=" << image << ") return 0" << endl; // No blocks could be freed from other images. return 0; } int blocksize; long long managedBytes; int managedBlocks; int blocksAvailable; long long cacheMisses; // Pool for blocks boost::pool<> *pool; // List of images. // Front is least-recently-missed image // Back is most-recently-missed image list imageList; // Map of images to cache miss counters. map imageToMissMap; }; /** A policy for iterating over all pixels in a CachedFileImage sequentially. */ template class CachedFileSequentialAccessIteratorPolicy { public: typedef Iterator BaseType; typedef typename Iterator::value_type value_type; typedef typename Iterator::difference_type::MoveX difference_type; typedef typename Iterator::reference reference; typedef typename Iterator::index_reference index_reference; typedef typename Iterator::pointer pointer; typedef typename Iterator::iterator_category iterator_category; static void initialize(BaseType & d) { } static reference dereference(BaseType const & d) { return *d; } static index_reference dereference(BaseType const & d, difference_type n) { int width = d.i->width(); int dy = n / width; int dx = n % width; if (d.x() + dx >= width) {dy++; dx -= width;} else if (d.x() + dx < 0) {dy--; dx += width;} return d(dx, dy); } static bool equal(BaseType const & d1, BaseType const & d2) { int width1 = d1.i->width(); int width2 = d2.i->width(); return (d1.y()*width1 + d1.x()) == (d2.y()*width2 + d2.x()); } static bool less(BaseType const & d1, BaseType const & d2) { int width1 = d1.i->width(); int width2 = d2.i->width(); return (d1.y()*width1 + d1.x()) < (d2.y()*width2 + d2.x()); } static difference_type difference(BaseType const & d1, BaseType const & d2) { int width1 = d1.i->width(); int width2 = d2.i->width(); return (d1.y()*width1 + d1.x()) - (d2.y()*width2 + d2.x()); } static void increment(BaseType & d) { ++d.x; if (d.x() == d.i->width()) { d.x = 0; ++d.y; } } static void decrement(BaseType & d) { --d.x; if (d.x() < 0) { d.x = d.i->width() - 1; --d.y; } } static void advance(BaseType & d, difference_type n) { int width = d.i->width(); int dy = n / width; int dx = n % width; d.x += dx; d.y += dy; if (d.x() >= width) {++d.y; d.x -= width;} if (d.x() < 0) {--d.y; d.x += width;} } }; namespace cfi_detail { template class DirectionSelector; template class DirectionSelector { public: DirectionSelector(T base=0) : current_(base) {} DirectionSelector(DirectionSelector const & rhs) : current_(rhs.current_) {} DirectionSelector & operator=(DirectionSelector const & rhs) { current_ = rhs.current_; return *this; } void operator++() { ++current_; } void operator++(int) { ++current_; } void operator--() { --current_; } void operator--(int) { --current_; } void operator+=(int dx) { current_ += dx; } void operator-=(int dx) { current_ -= dx; } bool operator==(DirectionSelector const & rhs) const { return (current_ == rhs.current_); } bool operator!=(DirectionSelector const & rhs) const { return (current_ != rhs.current_); } bool operator<(DirectionSelector const & rhs) const { return (current_ < rhs.current_); } bool operator<=(DirectionSelector const & rhs) const { return (current_ <= rhs.current_); } bool operator>(DirectionSelector const & rhs) const { return (current_ > rhs.current_); } bool operator>=(DirectionSelector const & rhs) const { return (current_ >= rhs.current_); } int operator-(DirectionSelector const & rhs) const { return (current_ - rhs.current_); } T operator()() const { return current_; } T operator()(int d) const { return (current_ + d); } T current_; }; template class DirectionSelector { public: DirectionSelector(int stride=1, T base=0) : stride_(stride), current_(base) {} DirectionSelector(DirectionSelector const & rhs) : stride_(rhs.stride_), current_(rhs.current_) {} DirectionSelector & operator=(DirectionSelector const & rhs) { stride_ = rhs.stride_; current_ = rhs.current_; return *this; } void operator++() { current_ += stride_; } void operator++(int) { current_ += stride_; } void operator--() { current_ -= stride_; } void operator--(int) { current_ -= stride_; } void operator+=(int dy) { current_ += dy*stride_; } void operator-=(int dy) { current_ -= dy*stride_; } bool operator==(DirectionSelector const & rhs) const { return (current_ == rhs.current_); } bool operator!=(DirectionSelector const & rhs) const { return (current_ != rhs.current_); } bool operator<(DirectionSelector const & rhs) const { return (current_ < rhs.current_); } bool operator<=(DirectionSelector const & rhs) const { return (current_ <= rhs.current_); } bool operator>(DirectionSelector const & rhs) const { return (current_ > rhs.current_); } bool operator>=(DirectionSelector const & rhs) const { return (current_ >= rhs.current_); } int operator-(DirectionSelector const & rhs) const { return (current_ - rhs.current_) / stride_; } T operator()() const { return current_; } T operator()(int d) const { return current_ + d*stride_; } int stride_; T current_; }; template class NotifyingDirectionSelector; template class NotifyingDirectionSelector { #if defined(__GNUC__) && !defined(__clang__) friend class Notify::self_type; #else friend typename Notify::self_type; #endif protected: NotifyingDirectionSelector(T base = 0) : current_(base), notify_(NULL) {} NotifyingDirectionSelector(NotifyingDirectionSelector const & rhs) : current_(rhs.current_), notify_(NULL) {} void setNotify(Notify *n) { notify_ = n; } public: NotifyingDirectionSelector & operator=(NotifyingDirectionSelector const & rhs) { notify_->_notify(current_, rhs.current_); current_ = rhs.current_; return *this; } void operator++() { notify_->_notify(current_, current_+1); ++current_; } void operator++(int) { notify_->_notify(current_, current_+1); ++current_; } void operator--() { notify_->_notify(current_, current_-1); --current_; } void operator--(int) { notify_->_notify(current_, current_-1); --current_; } void operator+=(int dx) { notify_->_notify(current_, current_+dx); current_ += dx; } void operator-=(int dx) { notify_->_notify(current_, current_-dx); current_ -= dx; } bool operator==(NotifyingDirectionSelector const & rhs) const { return (current_ == rhs.current_); } bool operator!=(NotifyingDirectionSelector const & rhs) const { return (current_ != rhs.current_); } bool operator<(NotifyingDirectionSelector const & rhs) const { return (current_ < rhs.current_); } bool operator<=(NotifyingDirectionSelector const & rhs) const { return (current_ <= rhs.current_); } bool operator>(NotifyingDirectionSelector const & rhs) const { return (current_ > rhs.current_); } bool operator>=(NotifyingDirectionSelector const & rhs) const { return (current_ >= rhs.current_); } int operator-(NotifyingDirectionSelector const & rhs) const { return (current_ - rhs.current_); } T operator()() const { return current_; } T operator()(int d) const { return (current_ + d); } T current_; private: Notify *notify_; }; template class NotifyingDirectionSelector { #if defined(__GNUC__) && !defined(__clang__) friend class Notify::self_type; #else friend typename Notify::self_type; #endif protected: NotifyingDirectionSelector(int stride = 1, T base = 0) : stride_(stride), current_(base), notify_(NULL) {} NotifyingDirectionSelector(NotifyingDirectionSelector const & rhs) : stride_(rhs.stride_), current_(rhs.current_), notify_(NULL) {} void setNotify(Notify *n) { notify_ = n; } public: NotifyingDirectionSelector & operator=(NotifyingDirectionSelector const & rhs) { notify_->_notify(current_, rhs.current_); stride_ = rhs.stride_; current_ = rhs.current_; return *this; } void operator++() { notify_->_notify(current_, current_+stride_); current_ += stride_; } void operator++(int) { notify_->_notify(current_, current_+stride_); current_ += stride_; } void operator--() { notify_->_notify(current_, current_-stride_); current_ -= stride_; } void operator--(int) { notify_->_notify(current_, current_-stride_); current_ -= stride_; } void operator+=(int dy) { notify_->_notify(current_, current_+dy*stride_); current_ += dy*stride_; } void operator-=(int dy) { notify_->_notify(current_, current_-dy*stride_); current_ -= dy*stride_; } bool operator==(NotifyingDirectionSelector const & rhs) const { return (current_ == rhs.current_); } bool operator!=(NotifyingDirectionSelector const & rhs) const { return (current_ != rhs.current_); } bool operator<(NotifyingDirectionSelector const & rhs) const { return (current_ < rhs.current_); } bool operator<=(NotifyingDirectionSelector const & rhs) const { return (current_ <= rhs.current_); } bool operator>(NotifyingDirectionSelector const & rhs) const { return (current_ > rhs.current_); } bool operator>=(NotifyingDirectionSelector const & rhs) const { return (current_ >= rhs.current_); } int operator-(NotifyingDirectionSelector const & rhs) const { return (current_ - rhs.current_) / stride_; } T operator()() const { return current_; } T operator()(int d) const { return current_ + d*stride_; } int stride_; T current_; private: Notify *notify_; }; } // namespace cfi_detail /** Base class for CachedFileImage traversers. */ template class CachedFileImageIteratorBase { public: typedef CachedFileImageIteratorBase self_type; typedef IMAGE_TYPE image_type; typedef PIXELTYPE value_type; typedef PIXELTYPE PixelType; typedef REFERENCE reference; typedef REFERENCE index_reference; typedef POINTER pointer; typedef vigra::Diff2D difference_type; typedef image_traverser_tag iterator_category; typedef vigra::RowIterator row_iterator; typedef vigra::ColumnIterator column_iterator; typedef typename cfi_detail::DirectionSelector MoveX; friend class cfi_detail::DirectionSelector; typedef typename cfi_detail::NotifyingDirectionSelector MoveY; friend class cfi_detail::NotifyingDirectionSelector; friend class CachedFileSequentialAccessIteratorPolicy; MoveX x; MoveY y; IMAGEITERATOR & operator+=(difference_type const & s) { x += s.x; y += s.y; return static_cast(*this); } IMAGEITERATOR & operator-=(difference_type const & s) { x -= s.x; y -= s.y; return static_cast(*this); } IMAGEITERATOR operator+(difference_type const & s) const { IMAGEITERATOR ret(static_cast(*this)); ret += s; return ret; } IMAGEITERATOR operator-(difference_type const & s) const { IMAGEITERATOR ret(static_cast(*this)); ret -= s; return ret; } difference_type operator-(CachedFileImageIteratorBase const & rhs) const { return difference_type(x-rhs.x, y-rhs.y); } bool operator==(CachedFileImageIteratorBase const & rhs) const { return (x == rhs.x) && (y == rhs.y); } bool operator!=(CachedFileImageIteratorBase const & rhs) const { return (x != rhs.x) || (y != rhs.y); } reference operator*() const { //std::cout << "iterator=" << this << " currentRow=" << (void*)currentRow << " modifying pixel at (" << x << "," << y._y << ") = " << (void*)(¤tRow[x]) << std::endl; return currentRow[x()]; //return (*i)(x, y); } // FIXME pointer is supposed to be a weak_ptr pointer operator->() const { //BOOST_STATIC_ASSERT(false); return (*i)[y()] + x(); } index_reference operator[](difference_type const & d) const { if (d.y == 0) { return currentRow[x(d.x)]; } else { return (*i)(x(d.x), y(d.y)); } } index_reference operator()(int dx, int dy) const { if (dy == 0) { return currentRow[x(dx)]; } else { return (*i)(x(dx), y(dy)); } } // FIXME pointer is supposed to be a weak_ptr pointer operator[](int dy) const { //BOOST_STATIC_ASSERT(false); return (*i)[y(dy)] + x(); } row_iterator rowIterator() const { return row_iterator(static_cast(*this)); } column_iterator columnIterator() const { return column_iterator(static_cast(*this)); } protected: CachedFileImageIteratorBase(const int X, const int Y, image_type * const I) : x(X), y(Y), i(I), currentRow(NULL) { y.setNotify(this); _notify(y()); } // Constructor only for strided iterators CachedFileImageIteratorBase(const int X, const int Y, image_type * const I, int xstride, int ystride) : x(xstride, X), y(ystride, Y), i(I), currentRow(NULL) { y.setNotify(this); _notify(y()); } CachedFileImageIteratorBase(const CachedFileImageIteratorBase &r) : x(r.x), y(r.y), i(r.i), currentRow(NULL) { y.setNotify(this); _notify(y()); } CachedFileImageIteratorBase& operator=(const CachedFileImageIteratorBase &r) { // Note that we change i first so that the assignment to y causes us to get notified // about the new y coordinate in the new image. currentRow = NULL; i = r.i; x = r.x; y = r.y; return *this; } void _notify(int initialY) { // Y has been initialized to initialY. if (i) currentRow = (*i)[initialY]; //std::cout << "iterator " << this << " _notify(" << initialY << ") currentRow=" << (void*)currentRow << std::endl; } void _notify(int oldY, int newY) { // Y has changed from oldY to newY if (i) currentRow = (*i)[newY]; //std::cout << "iterator " << this << " _notify(" << oldY << ", " << newY << ") currentRow=" << (void*)currentRow << std::endl; } image_type *i; pointer currentRow; }; /** Forward declarations */ template class StridedCachedFileImageIterator; template class ConstStridedCachedFileImageIterator; /** Regular CachedFileImage traverser. */ template class CachedFileImageIterator : public CachedFileImageIteratorBase, CachedFileImage, PIXELTYPE, PIXELTYPE &, PIXELTYPE *> // FIXME this needs to be a weak_ptr ^^^^^^^^^^^ // in case someone uses the iterator to get a pointer to cached data. { public: typedef CachedFileImageIteratorBase, PIXELTYPE, PIXELTYPE &, PIXELTYPE *> Base; CachedFileImageIterator(const int x = 0, const int y = 0, CachedFileImage * const i = NULL) : Base(x, y, i) {} friend class StridedCachedFileImageIterator; friend class ConstStridedCachedFileImageIterator; }; /** Traverser over const CachedFileImage. */ template class ConstCachedFileImageIterator : public CachedFileImageIteratorBase, const CachedFileImage, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *> // FIXME this needs to be a weak_ptr ^^^^^^^^^^^^^^^^^ // in case someone uses the iterator to get a pointer to cached data. { public: typedef CachedFileImageIteratorBase, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *> Base; // FIXME this needs to be a weak_ptr ^^^^^^^^^^^^^^^^^ ConstCachedFileImageIterator(const int x = 0, const int y = 0, const CachedFileImage * const i = NULL) : Base(x, y, i) {} // FIXME functions to copy CachedFileImageIterator to ConstCachedFileImageIterator are broken //ConstCachedFileImageIterator(CachedFileImageIterator const & rhs) //: Base(0, 0, NULL) //{ // Base::x = rhs.x; // Base::y = rhs.y; // Base::i = rhs.i; // Base::currentRow = NULL; // Base::y.setNotify(this); // Base::_notify(Base::y()); //} //ConstCachedFileImageIterator & //operator=(CachedFileImageIterator const & rhs) //{ // Base::x = rhs.x; // Base::y = rhs.y; // Base::i = rhs.i; // Base::currentRow = NULL; // Base::y.setNotify(this); // Base::_notify(Base::y()); // return *this; //} friend class ConstStridedCachedFileImageIterator; }; /** Regular CachedFileImage traverser. */ template class StridedCachedFileImageIterator : public CachedFileImageIteratorBase, CachedFileImage, PIXELTYPE, PIXELTYPE &, PIXELTYPE *, vigra::StridedArrayTag> // FIXME this needs to be a weak_ptr ^^^^^^^^^^^ // in case someone uses the iterator to get a pointer to cached data. { public: typedef CachedFileImageIteratorBase, PIXELTYPE, PIXELTYPE &, PIXELTYPE *, vigra::StridedArrayTag> Base; StridedCachedFileImageIterator(const int x = 0, const int y = 0, CachedFileImage * const i = NULL, const int xstride = 1, const int ystride = 1) : Base(x, y, i, xstride, ystride) {} StridedCachedFileImageIterator(CachedFileImageIterator const & r, const int xstride, const int ystride) : Base(r.x(), r.y(), r.i, xstride, ystride) {} }; /** Traverser over const CachedFileImage. */ template class ConstStridedCachedFileImageIterator : public CachedFileImageIteratorBase, const CachedFileImage, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, vigra::StridedArrayTag> // FIXME this needs to be a weak_ptr ^^^^^^^^^^^^^^^^^ // in case someone uses the iterator to get a pointer to cached data. { public: typedef CachedFileImageIteratorBase, PIXELTYPE, PIXELTYPE const &, PIXELTYPE const *, vigra::StridedArrayTag> Base; // FIXME this needs to be a weak_ptr ^^^^^^^^^^^^^^^^^ ConstStridedCachedFileImageIterator(const int x = 0, const int y = 0, const CachedFileImage * const i = NULL, const int xstride = 1, const int ystride = 1) : Base(x, y, i, xstride, ystride) {} ConstStridedCachedFileImageIterator(ConstCachedFileImageIterator const & r, const int xstride, const int ystride) : Base(r.x(), r.y(), r.i, xstride, ystride) {} ConstStridedCachedFileImageIterator(CachedFileImageIterator const & r, const int xstride, const int ystride) : Base(r.x(), r.y(), r.i, xstride, ystride) {} // FIXME functions to copy StridedCachedFileImageIterator to ConstStridedCachedFileImageIterator are broken //ConstStridedCachedFileImageIterator(StridedCachedFileImageIterator const & rhs) //: Base(0, 0, NULL, 1, 1) //{ // Base::x = rhs.x; // Base::y = rhs.y; // Base::i = rhs.i; // Base::currentRow = NULL; // Base::y.setNotify(this); // Base::_notify(Base::y()); //} //ConstStridedCachedFileImageIterator & //operator=(StridedCachedFileImageIterator const & rhs) //{ // Base::x = rhs.x; // Base::y = rhs.y; // Base::i = rhs.i; // Base::currentRow = NULL; // Base::y.setNotify(this); // Base::_notify(Base::y()); // return *this; //} }; // Forward declaration. template struct IteratorTraits; /** Basic CachedFileImage */ template class CachedFileImage : public CachedFileImageBase { public: typedef PIXELTYPE value_type; typedef PIXELTYPE PixelType; typedef PIXELTYPE & reference; typedef PIXELTYPE const & const_reference; // FIXME these need to be weak_ptrs typedef PIXELTYPE * pointer; typedef PIXELTYPE const * const_pointer; typedef CachedFileImageIterator traverser; typedef ConstCachedFileImageIterator const_traverser; typedef vigra::IteratorAdaptor > iterator; typedef vigra::IteratorAdaptor > const_iterator; typedef vigra::Diff2D difference_type; typedef vigra::Size2D size_type; typedef typename vigra::IteratorTraits::DefaultAccessor Accessor; typedef typename vigra::IteratorTraits::DefaultAccessor ConstAccessor; CachedFileImage() { initMembers(); } CachedFileImage(int width, int height) { vigra_precondition((width >= 0) && (height >= 0), "CachedFileImage::CachedFileImage(int width, int height): " "width and height must be >= 0.\n"); initMembers(); resize(width, height, value_type()); } explicit CachedFileImage(difference_type const & size, value_type const & d = value_type()) { vigra_precondition((size.x >= 0) && (size.y >= 0), "CachedFileImage::CachedFileImage(Diff2D size): " "size.x and size.y must be >= 0.\n"); initMembers(); resize(size.x, size.y, d); } CachedFileImage(int width, int height, value_type const & d) { vigra_precondition((width >= 0) && (height >= 0), "CachedFileImage::CachedFileImage(int width, int height, value_type const & ): " "width and height must be >= 0.\n"); initMembers(); resize(width, height, d); } CachedFileImage(const CachedFileImage & rhs) { initMembers(); resizeCopy(rhs); } virtual ~CachedFileImage() { deallocate(); } CachedFileImage & operator=(const CachedFileImage &rhs); CachedFileImage & init(value_type const & pixel); void resize(int width, int height) { resize(width, height, value_type()); } void resize(difference_type const & size) { resize(size.x, size.y, value_type()); } void resize(int width, int height, value_type const & d); void resizeCopy(const CachedFileImage & rhs); void swap( CachedFileImage& rhs ); int width() const { return width_; } int height() const { return height_; } size_type size() const { return size_type(width(), height()); } bool isInside(difference_type const & d) const { return d.x >= 0 && d.y >= 0 && d.x < width() && d.y < height(); } reference operator[](difference_type const & d) { return (getLinePointerDirty(d.y))[d.x]; } const_reference operator[](difference_type const & d) const { return (getLinePointer(d.y))[d.x]; } reference operator()(int dx, int dy) { return (getLinePointerDirty(dy))[dx]; } const_reference operator()(int dx, int dy) const { return (getLinePointer(dy))[dx]; } // FIXME - needs to return a weak_ptr pointer operator[](int dy) { //BOOST_STATIC_ASSERT(false); //cout << "fetching line pointer for row " << dy << endl; if (dy < 0 || dy >= height_) return NULL; else return getLinePointerDirty(dy); } // FIXME - needs to return a weak_ptr const_pointer operator[](int dy) const { //BOOST_STATIC_ASSERT(false); //cout << "fetching line pointer for row " << dy << endl; if (dy < 0 || dy >= height_) return NULL; else return getLinePointer(dy); } traverser upperLeft() { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::upperLeft(): image must have non-zero size."); return traverser(0, 0, this); } traverser lowerRight() { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::lowerRight(): image must have non-zero size."); return traverser(width_, height_, this); } const_traverser upperLeft() const { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::upperLeft(): image must have non-zero size."); return const_traverser(0, 0, this); } const_traverser lowerRight() const { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::lowerRight(): image must have non-zero size."); return const_traverser(width_, height_, this); } iterator begin() { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::begin(): image must have non-zero size."); return iterator(traverser(0, 0, this)); } iterator end() { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::end(): image must have non-zero size."); return iterator(traverser(0, height_, this)); } const_iterator begin() const { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::begin(): image must have non-zero size."); return const_iterator(const_traverser(0, 0, this)); } const_iterator end() const { //vigra_precondition(width_ > 0 && height_ > 0, vigra_assert(width_ > 0 && height_ > 0, "CachedFileImage::end(): image must have non-zero size."); return const_iterator(const_traverser(0, height_, this)); } Accessor accessor() { return Accessor(); } ConstAccessor accessor() const { return ConstAccessor(); } int numBlocksAllocated() const { return blocksAllocated_; } int numBlocksNeeded() const { return blocksNeeded_; } void printBlockStats() const { cout << "image " << this << " blocksAllocated=" << blocksAllocated_ << "/" << blocksNeeded_ << " mrl=" << *mostRecentlyLoadedBlockIterator_ << " blocksInMemory={"; std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), std::ostream_iterator(cout, " ")); cout << "}" << endl; } private: // Data value used to initialize previously unused pixels. PIXELTYPE initPixel; void deallocate(); // Init the cache data structures once we know the size of the image. void initLineStartArray(); // obtain a pointer to the beginning of a line. // split into two functions for efficiency. // getLinePointer can then be inlined, and we only incur the function // call overhead on cache misses. PIXELTYPE * getLinePointer(const int dy) const; PIXELTYPE * getLinePointerDirty(const int dy); PIXELTYPE * getLinePointerCacheMiss(const int dy) const; // Free space by swapping out a block of lines to the file. void swapOutBlock() const; // Lazy creation of tmp file for swapping image data to disk void initTmpfile() const; void initMembers() { initPixel = value_type(); linesPerBlocksize_ = 0; linesPerBlocksizeLog2_ = 0; blocksAllocated_ = 0; blocksNeeded_ = 0; blocksInMemory_ = NULL; lines_ = NULL; blockIsClean_ = NULL; blockInFile_ = NULL; width_ = 0; height_ = 0; #ifdef _WIN32 hTempFile_ = INVALID_HANDLE_VALUE; #else tmpFile_ = NULL; #endif tmpFilename_ = NULL; } // how many image lines are loaded in one fread int linesPerBlocksize_; int linesPerBlocksizeLog2_; // How many blocks are currently cached in memory. mutable int blocksAllocated_; // How many blocks are needed for the entire image. int blocksNeeded_; // List of blocks in memory. // Blocks are in sequential order. mutable list *blocksInMemory_; // An iterator that points to the most recently loaded block // in the blocksInMemory_ list. mutable list::iterator mostRecentlyLoadedBlockIterator_; // Array of pointers to first pixel in each line. mutable PIXELTYPE ** lines_; // For each block, indicate if that block is dirty. // Dirty blocks get swapped to disk when they are deallocated. // Clean blocks are simply deallocated. mutable bool * blockIsClean_; // For each block, indicate if that block is in the file. // Blocks in the file get read from disk when the block is swapped in. // Blocks not in the file get initialized with initPixel instead. mutable bool * blockInFile_; int width_, height_; #ifdef _WIN32 mutable HANDLE hTempFile_; #else mutable FILE *tmpFile_; #endif mutable char *tmpFilename_; }; template void CachedFileImage::deallocate() { // Unregister the image with the director. //cout << "image " << this << ".deallocate" << endl; CachedFileImageDirector::v().returnBlocksUnregisterImage(blocksAllocated_, this); delete blocksInMemory_; // Deallocate all the blocks in use. if (lines_ != NULL) { int line = 0; for (int block = 0; block < blocksNeeded_; block++) { int firstLineInBlock = line; for (int subblock = 0; subblock < linesPerBlocksize_; subblock++, line++) { if (line >= height_) break; PIXELTYPE *p = lines_[line]; if (p != NULL) { for (int column = 0; column < width_; column++) { //FIXME if pixel type is not a simple data type // and this destructor actually does // something, then we are in big trouble. (p[column]).~PIXELTYPE(); } } } CachedFileImageDirector::v().deallocateBlock(lines_[firstLineInBlock]); if (line >= height_) break; } delete[] lines_; } delete[] blockIsClean_; delete[] blockInFile_; // Close and delete the tmp file if it exists. #ifdef _WIN32 if (hTempFile_ != INVALID_HANDLE_VALUE) { CloseHandle(hTempFile_); } #else if (tmpFile_ != NULL) { fclose(tmpFile_); } #endif // unlink(tmpFilename_); //} delete[] tmpFilename_; }; /** Perform initialization of internal data structures once image size is known. */ template void CachedFileImage::initLineStartArray() { // Number of lines to load in one block. linesPerBlocksize_ = (int)floor( ((double)CachedFileImageDirector::v().getBlockSize()) / (width_ * sizeof(PIXELTYPE))); // Round this down to the nearest power of two. // This will let us divide using right-shift to calculate block number from line number. linesPerBlocksizeLog2_ = (int)floor(log((double)linesPerBlocksize_)/log(2.0)); linesPerBlocksize_ = 1 << linesPerBlocksizeLog2_; //cout << "linesPerBlocksizeLog2=" << linesPerBlocksizeLog2_ << endl; //cout << "linesPerBlocksize=" << linesPerBlocksize_ << endl; // This is no longer necessary with SKIPSM pyramid operations. //// Need a minimum of 3 lines per block to support 5-line sliding windows. //if (linesPerBlocksize_ < 3) { // vigra_fail("Image cache block size is too small. Use the -b flag to " // "increase the cache block size."); //} blocksNeeded_ = (int)ceil(((double)height_) / linesPerBlocksize_); //cout << "image.initLineStartArray this=" << this // << " linesPerBlocksize=" << linesPerBlocksize_ // << " blocksNeeded=" << blocksNeeded_ << endl; // Request blocks from the director. int blocksAllowed = CachedFileImageDirector::v().requestBlocksForNewImage( blocksNeeded_, this); //cout << "image.initLineStartArray this=" << this // << " blocksAllowed=" << blocksAllowed << endl; // Create the blockLRU list. blocksInMemory_ = new list(); lines_ = new PIXELTYPE*[height_]; blockIsClean_ = new bool[blocksNeeded_]; blockInFile_ = new bool[blocksNeeded_]; // Initialize blockIsClean / blockInFile vectors. for (int block = 0; block < blocksNeeded_; block++) { blockIsClean_[block] = true; blockInFile_[block] = false; } // Allocate mem for the first linesPerBlocksize_*blocksAllowed lines. int line = 0; for (int block = 0; block < blocksAllowed; block++) { blocksInMemory_->push_back(block); blocksAllocated_++; // Get a block from the director. PIXELTYPE* blockStart = (PIXELTYPE*)CachedFileImageDirector::v().allocateBlock(); // Divide the block up amongst the lines in the block. for (int subblock = 0; subblock < linesPerBlocksize_; subblock++, line++, blockStart+=width_) { if (line >= height_) break; lines_[line] = blockStart; // Fill the line with initPixel. std::uninitialized_fill_n(lines_[line], width_, initPixel); } if (line >= height_) break; } // All remaining lines (if any) are null (swapped out) for (; line < height_; line++) { lines_[line] = NULL; } //cout << "image.initLineStartArray this=" << this << " blocksInMemory="; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << endl; mostRecentlyLoadedBlockIterator_ = blocksInMemory_->begin(); return; }; /** Obtain a pointer to the beginning of a row. * Marks the block that owns that row dirty. */ template inline PIXELTYPE * CachedFileImage::getLinePointerDirty(const int dy) { PIXELTYPE *line = lines_[dy]; // Check if line dy is swapped out. if (line == NULL) line = getLinePointerCacheMiss(dy); // Mark this block as dirty. //blockIsClean_[dy / linesPerBlocksize_] = false; blockIsClean_[dy >> linesPerBlocksizeLog2_] = false; return line; }; /** Obtain a pointer to the beginning of a row. * This is for clean dereferences. */ template inline PIXELTYPE * CachedFileImage::getLinePointer(const int dy) const { PIXELTYPE *line = lines_[dy]; // Check if line dy is swapped out. if (line == NULL) line = getLinePointerCacheMiss(dy); return line; }; /** Swap in the requested line. */ template PIXELTYPE * CachedFileImage::getLinePointerCacheMiss(const int dy) const { //int blockNumber = dy / linesPerBlocksize_; int blockNumber = dy >> linesPerBlocksizeLog2_; //int firstLineInBlock = blockNumber * linesPerBlocksize_; int firstLineInBlock = blockNumber << linesPerBlocksizeLog2_; //cout << "-------------------------------------------------------" << endl; //cout << "image " << this << " cache miss:" // << " line=" << dy // << " block=" << blockNumber // << " firstLineInBlock=" << firstLineInBlock // << " blocksAllocated=" << blocksAllocated_ // << " blocksInMemory={"; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << "}" << endl; int moreBlocks = CachedFileImageDirector::v().registerCacheMiss(this); if (moreBlocks == 0 && blocksAllocated_ == 0) { vigra_fail("enblend: Out of memory blocks. Try using the -m flag to " "increase the amount of memory to use, or use the -b flag to " "decrease the block size\n" "reason: cache miss, 0 blocks allocated, 0 blocks available."); } else if (moreBlocks == 0) { // Make space for new block. swapOutBlock(); } // Allocate a block. PIXELTYPE* blockStart = (PIXELTYPE*)CachedFileImageDirector::v().allocateBlock(); // The number of lines in the block and the number of pixels in the block. int numLinesInBlock = std::min(height_, firstLineInBlock + linesPerBlocksize_) - firstLineInBlock; int pixelsToRead = numLinesInBlock * width_; if (blockInFile_[blockNumber]) { // Find the right spot in the file. #ifdef _WIN32 DWORD dwError = NO_ERROR; LONGLONG offset = (LONGLONG)width_ * (LONGLONG)firstLineInBlock * (LONGLONG)sizeof(PIXELTYPE); LARGE_INTEGER liOffset; liOffset.QuadPart = offset; liOffset.LowPart = SetFilePointer(hTempFile_, liOffset.LowPart, &liOffset.HighPart, FILE_BEGIN); if (liOffset.LowPart == INVALID_SET_FILE_POINTER && (dwError = GetLastError()) != NO_ERROR) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); cerr << endl << lpMsgBuf << endl; LocalFree(lpMsgBuf); vigra_fail("Unable to seek within temporary file.\n" "This error is specific to the Windows version of Enblend."); } #else off_t offset = (off_t)width_ * (off_t)firstLineInBlock * (off_t)sizeof(PIXELTYPE); if (fseeko(tmpFile_, offset, SEEK_SET) != 0) { vigra_fail(strerror(errno)); } #endif // Fill the block with data from the file. // FIXME: should use compression #ifdef _WIN32 DWORD bytesRead; if (0 == ReadFile(hTempFile_, blockStart, sizeof(PIXELTYPE) * pixelsToRead, &bytesRead, NULL)) { DWORD dwError = GetLastError(); LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); cerr << endl << lpMsgBuf << endl; LocalFree(lpMsgBuf); vigra_fail("enblend: error reading from image swap file.\n"); } #else clearerr(tmpFile_); int itemsRead = fread(blockStart, sizeof(PIXELTYPE), pixelsToRead, tmpFile_); if (itemsRead < pixelsToRead) { perror("enblend"); vigra_fail("enblend: error reading from image swap file.\n"); } #endif } else { // File does not have data for this block. // Fill lines with initPixel. std::uninitialized_fill_n(blockStart, pixelsToRead, initPixel); } // Divide the block up amongst the lines in the block. for (int l = 0; l < linesPerBlocksize_; l++, blockStart+=width_) { int absoluteLineNumber = l + firstLineInBlock; if (absoluteLineNumber >= height_) break; lines_[absoluteLineNumber] = blockStart; } // Mark this block as clean. blockIsClean_[blockNumber] = true; // Add this block to the list in the right spot. list::iterator i = blocksInMemory_->begin(); for (; i != blocksInMemory_->end(); ++i) { if (*i > blockNumber) break; } blocksInMemory_->insert(i, blockNumber); // Push mostRecentlyLoadedBlockIterator to the end of a sequential sequence // of blocks in memory. mostRecentlyLoadedBlockIterator_ = --i; for (++i; i != blocksInMemory_->end(); ++i) { if (*i == ++blockNumber) mostRecentlyLoadedBlockIterator_ = i; else break; } blocksAllocated_++; //cout << "image.after-swap-in this=" << this // << " blocksAllocated=" << blocksAllocated_ // << " mostRecentlyLoadedBlock=" << *mostRecentlyLoadedBlockIterator_ // << " blocksInMemory="; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << endl; //CachedFileImageDirector::v().printAllBlockStats(); return lines_[dy]; }; /** Swap a block out to disk. */ template void CachedFileImage::swapOutBlock() const { if (blocksAllocated_ == 0) { vigra_fail("Attempt to free a block from an image that has no blocks."); } //cout << "swapOutBlock image=" << this // << " blocksAllocated=" << blocksAllocated_ // << " block list before:"; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << endl; // Choose a block to swap out. int blockNumber = 0; // This is no longer necessary with SKIPSM-based reduce. //if (blocksAllocated_ == 1 && blocksNeeded_ > 1) { // // Never swap out our only block (if we need more than one). // // Enblend iterates over images in 5-line sliding windows (in reduce). // // This is to avoid thrashing. // vigra_fail("enblend: Out of memory blocks. Try using the -m flag to " // "increase the amount of memory to use, or use the -b flag to " // "decrease the block size\n" // "reason: probable thrash, 1 blocks allocated, 0 blocks available."); //} else { if (mostRecentlyLoadedBlockIterator_ == blocksInMemory_->begin()) { // We're at the beginning of the image. // The last block in memory is the one least likely to be used next, // assuming forward iteration through the image. blockNumber = blocksInMemory_->back(); blocksInMemory_->pop_back(); } else { // Try the block before mostRecentlyLoadedBlockIterator. // Keep the m-r-l block for the 5-line sliding window. // The block just before that is least likely to be used next, // assuming forward iteration through the image. list::iterator candidate = mostRecentlyLoadedBlockIterator_; --candidate; blockNumber = *candidate; blocksInMemory_->erase(candidate); } //} //cout << "swapOutBlock image=" << this << " mRLBI=" << *mostRecentlyLoadedBlockIterator_ // << " after list remove block=" << blockNumber << ": "; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << endl; //int firstLineInBlock = blockNumber * linesPerBlocksize_; int firstLineInBlock = blockNumber << linesPerBlocksizeLog2_; PIXELTYPE *blockStart = lines_[firstLineInBlock]; // If block is dirty, swap it to the file. if (!blockIsClean_[blockNumber]) { blockInFile_[blockNumber] = true; // Lazy init the temp file. #ifdef _WIN32 if (hTempFile_ == INVALID_HANDLE_VALUE) #else if (tmpFile_ == NULL) #endif initTmpfile(); // Find the right spot in the file. #ifdef _WIN32 DWORD dwError = NO_ERROR; LONGLONG offset = (LONGLONG)width_ * (LONGLONG)firstLineInBlock * (LONGLONG)sizeof(PIXELTYPE); LARGE_INTEGER liOffset; liOffset.QuadPart = offset; liOffset.LowPart = SetFilePointer(hTempFile_, liOffset.LowPart, &liOffset.HighPart, FILE_BEGIN); if (liOffset.LowPart == INVALID_SET_FILE_POINTER && (dwError = GetLastError()) != NO_ERROR) { LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); cerr << endl << lpMsgBuf << endl; LocalFree(lpMsgBuf); vigra_fail("Unable to seek within temporary file.\n" "This error is specific to the Windows version of Enblend."); } #else off_t offset = (off_t)width_ * (off_t)firstLineInBlock * (off_t)sizeof(PIXELTYPE); if (fseeko(tmpFile_, offset, SEEK_SET) != 0) { vigra_fail(strerror(errno)); } #endif int numLinesInBlock = std::min(height_, firstLineInBlock + linesPerBlocksize_) - firstLineInBlock; int pixelsToWrite = numLinesInBlock * width_; //FIXME this should use compression. #ifdef _WIN32 DWORD bytesWritten; if (0 == WriteFile(hTempFile_, blockStart, sizeof(PIXELTYPE) * pixelsToWrite, &bytesWritten, NULL)) { DWORD dwError = GetLastError(); LPVOID lpMsgBuf; FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, dwError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL); cerr << endl << lpMsgBuf << endl; LocalFree(lpMsgBuf); vigra_fail("enblend: error writing to image swap file.\nMost likely cause: No space for temporary files.\nMake sure that there is enough space in the temporary directory\n"); } #else clearerr(tmpFile_); int itemsWritten = fwrite(blockStart, sizeof(PIXELTYPE), pixelsToWrite, tmpFile_); if (itemsWritten < pixelsToWrite) { perror("enblend"); vigra_fail("enblend: error writing to image swap file.\nMost likely cause: No space for temporary files.\nMake sure that there is enough space in the temporary directory\n"); } #endif } // Deallocate lines in block. for (int l = 0; l < linesPerBlocksize_; l++) { int absoluteLineNumber = l + firstLineInBlock; if (absoluteLineNumber >= height_) break; PIXELTYPE *p = lines_[absoluteLineNumber]; for (int column = 0; column <= width_; column++) { //FIXME if pixel type is not a simple data type and // this destructor actually does // something, then we are in big trouble. (p[column]).~PIXELTYPE(); } lines_[absoluteLineNumber] = NULL; } // Return block to the director. CachedFileImageDirector::v().deallocateBlock(blockStart); blocksAllocated_--; //cout << "swapOutBlock image=" << this << " after swapout:" // << " blocksAllocated=" << blocksAllocated_ // << " blocksInMemory="; //std::copy(blocksInMemory_->begin(), blocksInMemory_->end(), // std::ostream_iterator(cout, " ")); //cout << endl; }; /** Create the tmp file to store swapped-out blocks. */ template void CachedFileImage::initTmpfile() const { #ifdef _WIN32 const DWORD BUFSIZE=MAX_PATH; char filenameTemplate[BUFSIZE]; char lpPathBuffer[BUFSIZE]; DWORD dwRetVal; // Get the temp path. dwRetVal = GetTempPath(BUFSIZE, // length of the buffer lpPathBuffer); // buffer for path if (dwRetVal > BUFSIZE || (dwRetVal == 0)) { vigra_fail ("GetTempPath failed."); } if (! GetTempFileNameA(lpPathBuffer, // directory for temp files ".en", // temp file prefix 0, // create unique name filenameTemplate)) // buffer for name { vigra_fail("enblend: unable to create image swap file name.\n"); } hTempFile_ = CreateFileA(filenameTemplate, GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ, // share mode NULL, // security attributes CREATE_ALWAYS, // create mode FILE_FLAG_DELETE_ON_CLOSE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY, // file attributes NULL); if (hTempFile_ == INVALID_HANDLE_VALUE) { vigra_fail(strerror(errno)); } #else sigset_t oldsigmask; sigprocmask(SIG_BLOCK, &SigintMask, &oldsigmask); char * filenameTemplate; char * tmpdir = getenv("TMPDIR"); if (tmpdir) { int len = strlen(tmpdir) + 22; if (len > 0) { filenameTemplate = (char *) malloc(strlen(tmpdir)+ 22); strncpy(filenameTemplate, tmpdir, len); if (filenameTemplate[len-1] != '/') { strncat(filenameTemplate, "/", len); } strncat(filenameTemplate, ".enblend_tmpXXXXXX", len); } else { filenameTemplate = strdup("/tmp/.enblend_tmpXXXXXX"); } } else { filenameTemplate = strdup("/tmp/.enblend_tmpXXXXXX"); } #if defined(HAVE_MKSTEMP) int tmpFD = mkstemp(filenameTemplate); if (tmpFD < 0) { vigra_fail("enblend: unable to create image swap file.\n"); } tmpFile_ = fdopen(tmpFD, "wb+"); #else // HAVE_MKSTEMP char *tmpReturn = mktemp(filenameTemplate); if (tmpReturn == NULL) { vigra_fail("enblend: unable to create image swap file.\n"); } tmpFile_ = fopen(filenameTemplate, "wb+"); #endif // !HAVE_MKSTEMP if (tmpFile_ == NULL) { vigra_fail(strerror(errno)); } #endif // ! _WIN32 unsigned int filenameTemplateLength = (unsigned int)strlen(filenameTemplate) + 1; tmpFilename_ = new char[filenameTemplateLength]; strncpy(tmpFilename_, filenameTemplate, filenameTemplateLength); #ifndef _WIN32 unlink(tmpFilename_); sigprocmask(SIG_SETMASK, &oldsigmask, NULL); free(filenameTemplate); #endif // This doesn't seem to help. //if (setvbuf(tmpFile_, NULL, _IONBF, 0) != 0) { // vigra_fail(strerror(errno)); //} }; template CachedFileImage & CachedFileImage::operator=(const CachedFileImage & rhs) { if (this != &rhs) { if ((width() != rhs.width()) || (height() != rhs.height())) { resizeCopy(rhs); } else { const_iterator is = rhs.begin(); const_iterator iend = rhs.end(); iterator id = begin(); for(; is != iend; ++is, ++id) *id = *is; } } return *this; }; template CachedFileImage & CachedFileImage::init(value_type const & pixel) { initPixel = pixel; // Mark all blocks as clean // Mark all blocks as absent from the backing file. // This will effectively discard all current pixel data in the file. for (int block = 0; block < blocksNeeded_; block++) { blockIsClean_[block] = true; blockInFile_[block] = false; } // For any lines that are currently allocated, fill them with initPixel. // This will discard all current pixel data in memory. for (int line = 0; line < height_; line++) { PIXELTYPE *p = lines_[line]; if (lines_[line] != NULL) { for (int column = 0; column <= width_; column++) { //FIXME if pixel type is not a simple data type and this // destructor actually does // something, then we are in big trouble. (p[column]).~PIXELTYPE(); } // Fill the line with initPixel. std::uninitialized_fill_n(lines_[line], width_, initPixel); } } return *this; }; template void CachedFileImage::resize(int width, int height, value_type const & d) { vigra_precondition((width >= 0) && (height >= 0), "CachedFileImage::resize(int width, int height, value_type const &): " "width and height must be >= 0.\n"); deallocate(); initMembers(); initPixel = d; width_ = width; height_ = height; initLineStartArray(); }; template void CachedFileImage::resizeCopy(const CachedFileImage & rhs) { deallocate(); initMembers(); if (rhs.width() * rhs.height() > 0) { width_ = rhs.width(); height_ = rhs.height(); initLineStartArray(); const_iterator is = rhs.begin(); const_iterator iend = rhs.end(); iterator id = begin(); for(; is != iend; ++is, ++id) *id = *is; } }; template void CachedFileImage::swap( CachedFileImage& rhs ) { if (&rhs != this) { std::swap(initPixel, rhs.initPixel); std::swap(linesPerBlocksize_, rhs.linesPerBlocksize_); std::swap(linesPerBlocksizeLog2_, rhs.linesPerBlocksizeLog2_); std::swap(blocksAllocated_, rhs.blocksAllocated_); std::swap(blocksNeeded_, rhs.blocksNeeded_); std::swap(blocksInMemory_, rhs.blocksInMemory_); std::swap(mostRecentlyLoadedBlockIterator_, rhs.mostRecentlyLoadedBlockIterator_); std::swap(lines_, rhs.lines_); std::swap(blockIsClean_, rhs.blockIsClean_); std::swap(blockInFile_, rhs.blockInFile_); std::swap(width_, rhs.width_); std::swap(height_, rhs.height_); #ifdef _WIN32 std::swap(hTempFile_, rhs.hTempFile_); #else std::swap(tmpFile_, rhs.tmpFile_); #endif std::swap(tmpFilename_, rhs.tmpFilename_); } }; /********************************************************/ /* */ /* argument object factories */ /* */ /********************************************************/ template inline vigra::triple::const_traverser, typename CachedFileImage::const_traverser, Accessor> srcImageRange(CachedFileImage const & img, Accessor a) { return vigra::triple::const_traverser, typename CachedFileImage::const_traverser, Accessor>(img.upperLeft(), img.lowerRight(), a); } template inline vigra::pair::const_traverser, Accessor> srcImage(CachedFileImage const & img, Accessor a) { return vigra::pair::const_traverser, Accessor>(img.upperLeft(), a); } template inline vigra::triple::traverser, typename CachedFileImage::traverser, Accessor> destImageRange(CachedFileImage & img, Accessor a) { return vigra::triple::traverser, typename CachedFileImage::traverser, Accessor>(img.upperLeft(), img.lowerRight(), a); } template inline vigra::pair::traverser, Accessor> destImage(CachedFileImage & img, Accessor a) { return vigra::pair::traverser, Accessor>(img.upperLeft(), a); } template inline vigra::pair::const_traverser, Accessor> maskImage(CachedFileImage const & img, Accessor a) { return vigra::pair::const_traverser, Accessor>(img.upperLeft(), a); } /****************************************************************/ template inline vigra::triple::const_traverser, typename CachedFileImage::const_traverser, typename CachedFileImage::ConstAccessor> srcImageRange(CachedFileImage const & img) { return vigra::triple::const_traverser, typename CachedFileImage::const_traverser, typename CachedFileImage::ConstAccessor>(img.upperLeft(), img.lowerRight(), img.accessor()); } template inline vigra::pair< typename CachedFileImage::const_traverser, typename CachedFileImage::ConstAccessor> srcImage(CachedFileImage const & img) { return vigra::pair::const_traverser, typename CachedFileImage::ConstAccessor>(img.upperLeft(), img.accessor()); } template inline vigra::triple< typename CachedFileImage::traverser, typename CachedFileImage::traverser, typename CachedFileImage::Accessor> destImageRange(CachedFileImage & img) { return vigra::triple::traverser, typename CachedFileImage::traverser, typename CachedFileImage::Accessor>(img.upperLeft(), img.lowerRight(), img.accessor()); } template inline vigra::pair< typename CachedFileImage::traverser, typename CachedFileImage::Accessor> destImage(CachedFileImage & img) { return vigra::pair::traverser, typename CachedFileImage::Accessor>(img.upperLeft(), img.accessor()); } template inline vigra::pair< typename CachedFileImage::const_traverser, typename CachedFileImage::ConstAccessor> maskImage(CachedFileImage const & img) { return vigra::pair::const_traverser, typename CachedFileImage::ConstAccessor>(img.upperLeft(), img.accessor()); } template inline vigra::pair< ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor> maskStrideIter(CachedFileImageIterator const & upperLeft, int xstride, int ystride) { return vigra::pair< ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor > (ConstStridedCachedFileImageIterator(upperLeft, xstride, ystride), typename vigra::IteratorTraits >::DefaultAccessor()); } template inline vigra::pair< ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor> maskStrideIter(ConstCachedFileImageIterator const & upperLeft, int xstride, int ystride) { return vigra::pair< ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor > (ConstStridedCachedFileImageIterator(upperLeft, xstride, ystride), typename vigra::IteratorTraits >::DefaultAccessor()); } template inline vigra::triple< ConstStridedCachedFileImageIterator, ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor> maskStrideIterRange(CachedFileImageIterator const & upperLeft, CachedFileImageIterator const & lowerRight, int xstride, int ystride) { return vigra::triple< ConstStridedCachedFileImageIterator, ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor > (ConstStridedCachedFileImageIterator(upperLeft, xstride, ystride), ConstStridedCachedFileImageIterator(lowerRight, xstride, ystride), typename vigra::IteratorTraits >::DefaultAccessor()); } template inline vigra::triple< ConstStridedCachedFileImageIterator, ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor> maskStrideIterRange(ConstCachedFileImageIterator const & upperLeft, ConstCachedFileImageIterator const & lowerRight, int xstride, int ystride) { return vigra::triple< ConstStridedCachedFileImageIterator, ConstStridedCachedFileImageIterator, typename vigra::IteratorTraits >::DefaultAccessor > (ConstStridedCachedFileImageIterator(upperLeft, xstride, ystride), ConstStridedCachedFileImageIterator(lowerRight, xstride, ystride), typename vigra::IteratorTraits >::DefaultAccessor()); } vigra::Diff2D stridedCachedFileSize(int xstride, int ystride, vigra::Diff2D size) { if (size.x % xstride != 0) { size.x += xstride - size.x % xstride; } if (size.y % ystride != 0) { size.y += ystride - size.y % ystride; } return size; } template vigra::triple, StridedCachedFileImageIterator, ImgAccessor> stride(int xstride, int ystride, vigra::triple, CachedFileImageIterator, ImgAccessor> image) { typedef StridedCachedFileImageIterator SCFII; const vigra::Diff2D size = stridedCachedFileSize(xstride, ystride, image.second - image.first); return vigra::make_triple(SCFII(image.first, xstride, ystride), SCFII(image.first + size, xstride, ystride), image.third); } template std::pair, ImgAccessor> stride(int xstride, int ystride, std::pair, ImgAccessor> image) { typedef StridedCachedFileImageIterator SCFII; return std::make_pair(SCFII(image.first, xstride, ystride), image.second); } template vigra::triple, ConstStridedCachedFileImageIterator, ImgAccessor> stride(int xstride, int ystride, vigra::triple, ConstCachedFileImageIterator, ImgAccessor> image) { typedef ConstStridedCachedFileImageIterator CSCFII; const vigra::Diff2D size = stridedCachedFileSize(xstride, ystride, image.second - image.first); return vigra::make_triple(CSCFII(image.first, xstride, ystride), CSCFII(image.first + size, xstride, ystride), image.third); } template std::pair, ImgAccessor> stride(int xstride, int ystride, std::pair, ImgAccessor> image) { typedef ConstStridedCachedFileImageIterator CSCFII; return std::make_pair(CSCFII(image.first, xstride, ystride), image.second); } // // Missing implementations of stride() for compilation without image-cache // vigra::Diff2D stridedSize(int xstride, int ystride, vigra::Diff2D size) { if (size.x % xstride != 0) { size.x += xstride - size.x % xstride; } if (size.y % ystride != 0) { size.y += ystride - size.y % ystride; } size.x /= xstride; size.y /= ystride; return size; } template int iteratorWidth(Iterator imageIterator) { Iterator nextLine(imageIterator); nextLine.y += 1; return nextLine[0] - imageIterator[0]; } template vigra::triple, vigra::StridedImageIterator, ImgAccessor> stride(int xstride, int ystride, vigra::triple, vigra::BasicImageIterator, ImgAccessor> image) { typedef vigra::StridedImageIterator SII; const vigra::Diff2D size = stridedSize(xstride, ystride, image.second - image.first); const SII base = SII(image.first[0], iteratorWidth(image.first), xstride, ystride); return vigra::make_triple(base, base + size, image.third); } template std::pair, ImgAccessor> stride(int xstride, int ystride, std::pair, ImgAccessor> image) { typedef vigra::StridedImageIterator SII; return std::make_pair(SII(image.first[0], iteratorWidth(image.first), xstride, ystride), image.second); } template vigra::triple, vigra::ConstStridedImageIterator, ImgAccessor> stride(int xstride, int ystride, vigra::triple, vigra::ConstBasicImageIterator, ImgAccessor> image) { typedef vigra::ConstStridedImageIterator CSII; const vigra::Diff2D size = stridedSize(xstride, ystride, image.second - image.first); const CSII base = CSII(image.first[0], iteratorWidth(image.first), xstride, ystride); return vigra::make_triple(base, base + size, image.third); } template std::pair, ImgAccessor> stride(int xstride, int ystride, std::pair, ImgAccessor> image) { typedef vigra::ConstStridedImageIterator CSII; return std::make_pair(CSII(image.first[0], iteratorWidth(image.first), xstride, ystride), image.second); } } // namespace vigra_ext #endif // CACHEDFILEIMAGE_HXX // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/include/Makefile.am0000644000175100017510000000006112070530113021225 0ustar ametzlerametzlerSUBDIRS = vigra_ext EXTRA_DIST = CMakeLists.txt enblend-enfuse-4.1.2+dfsg/aclocal.m40000664000175100017510000013543412232763262017442 0ustar ametzlerametzler# generated automatically by aclocal 1.14 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_check_gl.m4]) m4_include([m4/ax_check_glu.m4]) m4_include([m4/ax_check_glut.m4]) m4_include([m4/ax_lang_compiler_ms.m4]) m4_include([m4/ax_openmp.m4]) m4_include([m4/ax_prog_perl_modules.m4]) m4_include([m4/ax_pthread.m4]) m4_include([m4/ax_with_prog.m4]) m4_include([m4/lrint.m4]) m4_include([m4/lrintf.m4]) enblend-enfuse-4.1.2+dfsg/ChangeLog0000644000175100017510000000000212070530113017313 0ustar ametzlerametzler. enblend-enfuse-4.1.2+dfsg/Makefile.in0000664000175100017510000006317112232763263017646 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config.h.in COPYING compile config.guess config.sub \ depcomp install-sh mdate-sh missing texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ README.txt VERSION \ CMakeLists.txt CMakeModules ConfigureChecks.cmake config.h.cmake @BUILD_DOC_TRUE@MAYBE_DOC = doc SUBDIRS = include src $(MAYBE_DOC) DIST_SUBDIRS = include src doc ACLOCAL_AMFLAGS = -I m4 # created by configure(1) DISTCLEANFILES = config-h.texi all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PHONY: xhtml xhtml: $(MAKE) --directory=doc $@ .PHONY: install-xhtml install-xhtml: $(MAKE) --directory=doc $@ .PHONY: uninstall-xhtml uninstall-xhtml: $(MAKE) --directory=doc $@ .PHONY: validate-xhtml validate-xhtml: $(MAKE) --directory=doc $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/install-sh0000755000175100017510000003325512232763263017603 0ustar ametzlerametzler#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: enblend-enfuse-4.1.2+dfsg/config.sub0000755000175100017510000010535412232763263017562 0ustar ametzlerametzler#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-08-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: enblend-enfuse-4.1.2+dfsg/texinfo.tex0000644000175100017510000116703612232763263020003 0ustar ametzlerametzler% texinfo.tex -- TeX macros to handle Texinfo files. % % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % \def\texinfoversion{2013-02-01.11} % % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, % 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. % % This texinfo.tex file is free software: you can redistribute it and/or % modify it under the terms of the GNU General Public License as % published by the Free Software Foundation, either version 3 of the % License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU % General Public License for more details. % % You should have received a copy of the GNU General Public License % along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without % restriction. This Exception is an additional permission under section 7 % of the GNU General Public License, version 3 ("GPLv3"). % % Please try the latest version of texinfo.tex before submitting bug % reports; you can get the latest version from: % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or % http://www.gnu.org/software/texinfo/ (the Texinfo home page) % The texinfo.tex in any given distribution could well be out % of date, so if that's what you're using, please check. % % Send bug reports to bug-texinfo@gnu.org. Please include including a % complete document in each bug report with which we can reproduce the % problem. Patches are, of course, greatly appreciated. % % To process a Texinfo manual with TeX, it's most reliable to use the % texi2dvi shell script that comes with the distribution. For a simple % manual foo.texi, however, you can get away with this: % tex foo.texi % texindex foo.?? % tex foo.texi % tex foo.texi % dvips foo.dvi -o # or whatever; this makes foo.ps. % The extra TeX runs get the cross-reference information correct. % Sometimes one run after texindex suffices, and sometimes you need more % than two; texi2dvi does it as many times as necessary. % % It is possible to adapt texinfo.tex for other languages, to some % extent. You can get the existing language-specific files from the % full Texinfo distribution. % % The GNU Texinfo home page is http://www.gnu.org/software/texinfo. \message{Loading texinfo [version \texinfoversion]:} % If in a .fmt file, print the version number % and turn on active characters that we couldn't do earlier because % they might have appeared in the input file name. \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. % For @tex, we can use \tabalign. \let\+ = \relax % Save some plain tex macros whose names we will redefine. \let\ptexb=\b \let\ptexbullet=\bullet \let\ptexc=\c \let\ptexcomma=\, \let\ptexdot=\. \let\ptexdots=\dots \let\ptexend=\end \let\ptexequiv=\equiv \let\ptexexclam=\! \let\ptexfootnote=\footnote \let\ptexgtr=> \let\ptexhat=^ \let\ptexi=\i \let\ptexindent=\indent \let\ptexinsert=\insert \let\ptexlbrace=\{ \let\ptexless=< \let\ptexnewwrite\newwrite \let\ptexnoindent=\noindent \let\ptexplus=+ \let\ptexraggedright=\raggedright \let\ptexrbrace=\} \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t \let\ptextop=\top {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode % If this character appears in an error message or help string, it % starts a new line in the output. \newlinechar = `^^J % Use TeX 3.0's \inputlineno to get the line number, for better error % messages, but if we're using an old version of TeX, don't do anything. % \ifx\inputlineno\thisisundefined \let\linenumber = \empty % Pre-3.0. \else \def\linenumber{l.\the\inputlineno:\space} \fi % Set up fixed words for English if not already set. \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi \ifx\putworderror\undefined \gdef\putworderror{error}\fi \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi \ifx\putwordin\undefined \gdef\putwordin{in}\fi \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi \ifx\putwordof\undefined \gdef\putwordof{of}\fi \ifx\putwordon\undefined \gdef\putwordon{on}\fi \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi % \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi % \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi % Since the category of space is not known, we have to be careful. \chardef\spacecat = 10 \def\spaceisspace{\catcode`\ =\spacecat} % sometimes characters are active, so we need control sequences. \chardef\ampChar = `\& \chardef\colonChar = `\: \chardef\commaChar = `\, \chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! \chardef\hashChar = `\# \chardef\lquoteChar= `\` \chardef\questChar = `\? \chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\slashChar = `\/ \chardef\underChar = `\_ % Ignore a token. % \def\gobble#1{} % The following is used inside several \edef's. \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} % Hyphenation fixes. \hyphenation{ Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script ap-pen-dix bit-map bit-maps data-base data-bases eshell fall-ing half-way long-est man-u-script man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces spell-ing spell-ings stand-alone strong-est time-stamp time-stamps which-ever white-space wide-spread wrap-around } % Margin to add to right of even pages, to left of odd pages. \newdimen\bindingoffset \newdimen\normaloffset \newdimen\pagewidth \newdimen\pageheight % For a final copy, take out the rectangles % that mark overfull boxes (in case you have decided % that the text looks ok even though it passes the margin). % \def\finalout{\overfullrule=0pt } % Sometimes it is convenient to have everything in the transcript file % and nothing on the terminal. We don't just call \tracingall here, % since that produces some useless output on the terminal. We also make % some effort to order the tracing commands to reduce output in the log % file; cf. trace.sty in LaTeX. % \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% \def\loggingall{% \tracingstats2 \tracingpages1 \tracinglostchars2 % 2 gives us more in etex \tracingparagraphs1 \tracingoutput1 \tracingmacros2 \tracingrestores1 \showboxbreadth\maxdimen \showboxdepth\maxdimen \ifx\eTeXversion\thisisundefined\else % etex gives us more logging \tracingscantokens1 \tracingifs1 \tracinggroups1 \tracingnesting2 \tracingassigns1 \fi \tracingcommands3 % 3 gives us more in etex \errorcontextlines16 }% % @errormsg{MSG}. Do the index-like expansions on MSG, but if things % aren't perfect, it's not the end of the world, being an error message, % after all. % \def\errormsg{\begingroup \indexnofonts \doerrormsg} \def\doerrormsg#1{\errmessage{#1}} % add check for \lastpenalty to plain's definitions. If the last thing % we did was a \nobreak, we don't want to insert more space. % \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount \removelastskip\penalty-50\smallskip\fi\fi} \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount \removelastskip\penalty-100\medskip\fi\fi} \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount \removelastskip\penalty-200\bigskip\fi\fi} % Do @cropmarks to get crop marks. % \newif\ifcropmarks \let\cropmarks = \cropmarkstrue % % Dimensions to add cropmarks at corners. % Added by P. A. MacKay, 12 Nov. 1986 % \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines \newdimen\cornerlong \cornerlong=1pc \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in % Output a mark which sets \thischapter, \thissection and \thiscolor. % We dump everything together because we only have one kind of mark. % This works because we only use \botmark / \topmark, not \firstmark. % % A mark contains a subexpression of the \ifcase ... \fi construct. % \get*marks macros below extract the needed part using \ifcase. % % Another complication is to let the user choose whether \thischapter % (\thissection) refers to the chapter (section) in effect at the top % of a page, or that at the bottom of a page. The solution is % described on page 260 of The TeXbook. It involves outputting two % marks for the sectioning macros, one before the section break, and % one after. I won't pretend I can describe this better than DEK... \def\domark{% \toks0=\expandafter{\lastchapterdefs}% \toks2=\expandafter{\lastsectiondefs}% \toks4=\expandafter{\prevchapterdefs}% \toks6=\expandafter{\prevsectiondefs}% \toks8=\expandafter{\lastcolordefs}% \mark{% \the\toks0 \the\toks2 \noexpand\or \the\toks4 \the\toks6 \noexpand\else \the\toks8 }% } % \topmark doesn't work for the very first chapter (after the title % page or the contents), so we use \firstmark there -- this gets us % the mark with the chapter defs, unless the user sneaks in, e.g., % @setcolor (or @url, or @link, etc.) between @contents and the very % first @chapter. \def\gettopheadingmarks{% \ifcase0\topmark\fi \ifx\thischapter\empty \ifcase0\firstmark\fi \fi } \def\getbottomheadingmarks{\ifcase1\botmark\fi} \def\getcolormarks{\ifcase2\topmark\fi} % Avoid "undefined control sequence" errors. \def\lastchapterdefs{} \def\lastsectiondefs{} \def\prevchapterdefs{} \def\prevsectiondefs{} \def\lastcolordefs{} % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} \newbox\headlinebox \newbox\footlinebox % \onepageout takes a vbox as an argument. Note that \pagecontents % does insertions, but you have to call it yourself. \def\onepageout#1{% \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi % \ifodd\pageno \advance\hoffset by \bindingoffset \else \advance\hoffset by -\bindingoffset\fi % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% % Have to do this stuff outside the \shipout because we want it to % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if % the page break happens to be in the middle of an example. % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi % \ifcropmarks \vbox to \outervsize\bgroup \hsize = \outerhsize \vskip-\topandbottommargin \vtop to0pt{% \line{\ewtop\hfil\ewtop}% \nointerlineskip \line{% \vbox{\moveleft\cornerthick\nstop}% \hfill \vbox{\moveright\cornerthick\nstop}% }% \vss}% \vskip\topandbottommargin \line\bgroup \hfil % center the page within the outer (page) hsize. \ifodd\pageno\hskip\bindingoffset\fi \vbox\bgroup \fi % \unvbox\headlinebox \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. \vskip 24pt \unvbox\footlinebox \fi % \ifcropmarks \egroup % end of \vbox\bgroup \hfil\egroup % end of (centering) \line\bgroup \vskip\topandbottommargin plus1fill minus1fill \boxmaxdepth = \cornerthick \vbox to0pt{\vss \line{% \vbox{\moveleft\cornerthick\nsbot}% \hfill \vbox{\moveright\cornerthick\nsbot}% }% \nointerlineskip \line{\ewbot\hfil\ewbot}% }% \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } \newinsert\margin \dimen\margin=\maxdimen \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} {\catcode`\@ =11 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi \dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } % Here are the rules for the cropmarks. Note that they are % offset so that the space between them is truly \outerhsize or \outervsize % (P. A. MacKay, 12 November, 1986) % \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} \def\nstop{\vbox {\hrule height\cornerthick depth\cornerlong width\cornerthick}} \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} \def\nsbot{\vbox {\hrule height\cornerlong depth\cornerthick width\cornerthick}} % Parse an argument, then pass it to #1. The argument is the rest of % the input line (except we remove a trailing comment). #1 should be a % macro which expects an ordinary undelimited TeX argument. % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% \def\argtorun{#2}% \begingroup \obeylines \spaceisspace #1% \parseargline\empty% Insert the \empty token, see \finishparsearg below. } {\obeylines % \gdef\parseargline#1^^M{% \endgroup % End of the group started in \parsearg. \argremovecomment #1\comment\ArgTerm% }% } % First remove any @comment, then any @c comment. \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} % Each occurrence of `\^^M' or `\^^M' is replaced by a single space. % % \argremovec might leave us with trailing space, e.g., % @end itemize @c foo % This space token undergoes the same procedure and is eventually removed % by \finishparsearg. % \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces \fi % Put the space token in: \temp#1 #3\ArgTerm } % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, % just before passing the control to \argtorun. % (Similarly, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to % \def\foo{\parsearg\Xfoo} % \def\Xfoo#1{...} % % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my % favourite TeX trick. --kasal, 16nov03 \def\parseargdef#1{% \expandafter \doparseargdef \csname\string#1\endcsname #1% } \def\doparseargdef#1#2{% \def#2{\parsearg#1}% \def#1##1% } % Several utility definitions with active space: { \obeyspaces \gdef\obeyedspace{ } % Make each space character in the input produce a normal interword % space in the output. Don't allow a line break at this space, as this % is used only in environments like @example, where each line of input % should produce a line of output anyway. % \gdef\sepspaces{\obeyspaces\let =\tie} % If an index command is used in an @example environment, any spaces % therein should become regular spaces in the raw index file, not the % expansion of \tie (\leavevmode \penalty \@M \ ). \gdef\unsepspaces{\let =\space} } \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} % Define the framework for environments in texinfo.tex. It's used like this: % % \envdef\foo{...} % \def\Efoo{...} % % It's the responsibility of \envdef to insert \begingroup before the % actual body; @end closes the group after calling \Efoo. \envdef also % defines \thisenv, so the current environment is known; @end checks % whether the environment name matches. The \checkenv macro can also be % used to check whether the current environment is the one expected. % % Non-false conditionals (@iftex, @ifset) don't fit into this, so they % are not treated as environments; they don't open a group. (The % implementation of @end takes care not to call \endgroup in this % special case.) % At run-time, environments start with this: \def\startenvironment#1{\begingroup\def\thisenv{#1}} % initialize \let\thisenv\empty % ... but they get defined via ``\envdef\foo{...}'': \long\def\envdef#1#2{\def#1{\startenvironment#1#2}} \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} % Check whether we're in the right environment: \def\checkenv#1{% \def\temp{#1}% \ifx\thisenv\temp \else \badenverr \fi } % Environment mismatch, #1 expected: \def\badenverr{% \errhelp = \EMsimple \errmessage{This command can appear only \inenvironment\temp, not \inenvironment\thisenv}% } \def\inenvironment#1{% \ifx#1\empty outside of any environment% \else in environment \expandafter\string#1% \fi } % @end foo executes the definition of \Efoo. % But first, it executes a specialized version of \checkenv % \parseargdef\end{% \if 1\csname iscond.#1\endcsname \else % The general wording of \badenverr may not be ideal. \expandafter\checkenv\csname#1\endcsname \csname E#1\endcsname \endgroup \fi } \newhelp\EMsimple{Press RETURN to continue.} % Be sure we're in horizontal mode when doing a tie, since we make space % equivalent to this in @example-like environments. Otherwise, a space % at the beginning of a line will start with \penalty -- and % since \penalty is valid in vertical mode, we'd end up putting the % penalty on the vertical list instead of in the new paragraph. {\catcode`@ = 11 % Avoid using \@M directly, because that causes trouble % if the definition is written into an index file. \global\let\tiepenalty = \@M \gdef\tie{\leavevmode\penalty\tiepenalty\ } } % @: forces normal size whitespace following. \def\:{\spacefactor=1000 } % @* forces a line break. \def\*{\unskip\hfil\break\hbox{}\ignorespaces} % @/ allows a line break. \let\/=\allowbreak % @. is an end-of-sentence period. \def\.{.\spacefactor=\endofsentencespacefactor\space} % @! is an end-of-sentence bang. \def\!{!\spacefactor=\endofsentencespacefactor\space} % @? is an end-of-sentence query. \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. % \def\onword{on} \def\offword{off} % \parseargdef\frenchspacing{% \def\temp{#1}% \ifx\temp\onword \plainfrenchspacing \else\ifx\temp\offword \plainnonfrenchspacing \else \errhelp = \EMsimple \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% \fi\fi } % @w prevents a word break. Without the \leavevmode, @w at the % beginning of a paragraph, when TeX is still in vertical mode, would % produce a whole line of output instead of starting the paragraph. \def\w#1{\leavevmode\hbox{#1}} % @group ... @end group forces ... to be all on one page, by enclosing % it in a TeX vbox. We use \vtop instead of \vbox to construct the box % to keep its height that of a normal line. According to the rules for % \topskip (p.114 of the TeXbook), the glue inserted is % max (\topskip - \ht (first item), 0). If that height is large, % therefore, no glue is inserted, and the space between the headline and % the text is small, which looks bad. % % Another complication is that the group might be very large. This can % cause the glue on the previous page to be unduly stretched, because it % does not have much material. In this case, it's better to add an % explicit \vfill so that the extra space is at the bottom. The % threshold for doing this is if the group is more than \vfilllimit % percent of a page (\vfilllimit can be changed inside of @tex). % \newbox\groupbox \def\vfilllimit{0.7} % \envdef\group{% \ifnum\catcode`\^^M=\active \else \errhelp = \groupinvalidhelp \errmessage{@group invalid in context where filling is enabled}% \fi \startsavinginserts % \setbox\groupbox = \vtop\bgroup % Do @comment since we are called inside an environment such as % @example, where each end-of-line in the input causes an % end-of-line in the output. We don't want the end-of-line after % the `@group' to put extra space in the output. Since @group % should appear on a line by itself (according to the Texinfo % manual), we don't worry about eating any user text. \comment } % % The \vtop produces a box with normal height and large depth; thus, TeX puts % \baselineskip glue before it, and (when the next line of text is done) % \lineskip glue after it. Thus, space below is not quite equal to space % above. But it's pretty close. \def\Egroup{% % To get correct interline space between the last line of the group % and the first line afterwards, we have to propagate \prevdepth. \endgraf % Not \par, as it may have been set to \lisppar. \global\dimen1 = \prevdepth \egroup % End the \vtop. % \dimen0 is the vertical size of the group's box. \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox % \dimen2 is how much space is left on the page (more or less). \dimen2 = \pageheight \advance\dimen2 by -\pagetotal % if the group doesn't fit on the current page, and it's a big big % group, force a page break. \ifdim \dimen0 > \dimen2 \ifdim \pagetotal < \vfilllimit\pageheight \page \fi \fi \box\groupbox \prevdepth = \dimen1 \checkinserts } % % TeX puts in an \escapechar (i.e., `@') at the beginning of the help % message, so this ends up printing `@group can only ...'. % \newhelp\groupinvalidhelp{% group can only be used in environments such as @example,^^J% where each line of input produces a line of output.} % @need space-in-mils % forces a page break if there is not space-in-mils remaining. \newdimen\mil \mil=0.001in \parseargdef\need{% % Ensure vertical mode, so we don't make a big box in the middle of a % paragraph. \par % % If the @need value is less than one line space, it's useless. \dimen0 = #1\mil \dimen2 = \ht\strutbox \advance\dimen2 by \dp\strutbox \ifdim\dimen0 > \dimen2 % % Do a \strut just to make the height of this box be normal, so the % normal leading is inserted relative to the preceding line. % And a page break here is fine. \vtop to #1\mil{\strut\vfil}% % % TeX does not even consider page breaks if a penalty added to the % main vertical list is 10000 or more. But in order to see if the % empty box we just added fits on the page, we must make it consider % page breaks. On the other hand, we don't want to actually break the % page after the empty box. So we use a penalty of 9999. % % There is an extremely small chance that TeX will actually break the % page at this \penalty, if there are no other feasible breakpoints in % sight. (If the user is using lots of big @group commands, which % almost-but-not-quite fill up a page, TeX will have a hard time doing % good page breaking, for example.) However, I could not construct an % example where a page broke at this \penalty; if it happens in a real % document, then we can reconsider our strategy. \penalty9999 % % Back up by the size of the box, whether we did a page break or not. \kern -#1\mil % % Do not allow a page break right after this kern. \nobreak \fi } % @br forces paragraph break (and is undocumented). \let\br = \par % @page forces the start of a new page. % \def\page{\par\vfill\supereject} % @exdent text.... % outputs text on separate line in roman font, starting at standard page margin % This records the amount of indent in the innermost environment. % That's how much \exdent should take out. \newskip\exdentamount % This defn is used inside fill environments such as @defun. \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} % This defn is used inside nofill environments such as @example. \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount \leftline{\hskip\leftskip{\rm#1}}}} % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current % paragraph. For more general purposes, use the \margin insertion % class. WHICH is `l' or `r'. Not documented, written for gawk manual. % \newskip\inmarginspacing \inmarginspacing=1cm \def\strutdepth{\dp\strutbox} % \def\doinmargin#1#2{\strut\vadjust{% \nobreak \kern-\strutdepth \vtop to \strutdepth{% \baselineskip=\strutdepth \vss % if you have multiple lines of stuff to put here, you'll need to % make the vbox yourself of the appropriate size. \ifx#1l% \llap{\ignorespaces #2\hskip\inmarginspacing}% \else \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% \fi \null }% }} \def\inleftmargin{\doinmargin l} \def\inrightmargin{\doinmargin r} % % @inmargin{TEXT [, RIGHT-TEXT]} % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; % else use TEXT for both). % \def\inmargin#1{\parseinmargin #1,,\finish} \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \def\lefttext{#1}% have both texts \def\righttext{#2}% \else \def\lefttext{#1}% have only one text \def\righttext{#1}% \fi % \ifodd\pageno \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin \else \def\temp{\inleftmargin\lefttext}% \fi \temp } % @| inserts a changebar to the left of the current line. It should % surround any changed text. This approach does *not* work if the % change spans more than two lines of output. To handle that, we would % have adopt a much more difficult approach (putting marks into the main % vertical list for the beginning and end of each change). This command % is not documented, not supported, and doesn't work. % \def\|{% % \vadjust can only be used in horizontal mode. \leavevmode % % Append this vertical mode material after the current line in the output. \vadjust{% % We want to insert a rule with the height and depth of the current % leading; that is exactly what \strutbox is supposed to record. \vskip-\baselineskip % % \vadjust-items are inserted at the left edge of the type. So % the \llap here moves out into the left-hand margin. \llap{% % % For a thicker or thinner bar, change the `1pt'. \vrule height\baselineskip width1pt % % This is the space between the bar and the text. \hskip 12pt }% }% } % @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% \makevalueexpandable % we want to expand any @value in FILE. \turnoffactive % and allow special characters in the expansion \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @include of #1^^J}% \edef\temp{\noexpand\input #1 }% % % This trickery is to read FILE outside of a group, in case it makes % definitions, etc. \expandafter }\temp \popthisfilestack } \def\filenamecatcodes{% \catcode`\\=\other \catcode`~=\other \catcode`^=\other \catcode`_=\other \catcode`|=\other \catcode`<=\other \catcode`>=\other \catcode`+=\other \catcode`-=\other \catcode`\`=\other \catcode`\'=\other } \def\pushthisfilestack{% \expandafter\pushthisfilestackX\popthisfilestack\StackTerm } \def\pushthisfilestackX{% \expandafter\pushthisfilestackY\thisfile\StackTerm } \def\pushthisfilestackY #1\StackTerm #2\StackTerm {% \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% } \def\popthisfilestack{\errthisfilestackempty} \def\errthisfilestackempty{\errmessage{Internal error: the stack of filenames is empty.}} % \def\thisfile{} % @center line % outputs that line, centered. % \parseargdef\center{% \ifhmode \let\centersub\centerH \else \let\centersub\centerV \fi \centersub{\hfil \ignorespaces#1\unskip \hfil}% \let\centersub\relax % don't let the definition persist, just in case } \def\centerH#1{{% \hfil\break \advance\hsize by -\leftskip \advance\hsize by -\rightskip \line{#1}% \break }} % \newcount\centerpenalty \def\centerV#1{% % The idea here is the same as in \startdefun, \cartouche, etc.: if % @center is the first thing after a section heading, we need to wipe % out the negative parskip inserted by \sectionheading, but still % prevent a page break here. \centerpenalty = \lastpenalty \ifnum\centerpenalty>10000 \vskip\parskip \fi \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi \line{\kern\leftskip #1\kern\rightskip}% } % @sp n outputs n lines of vertical space % \parseargdef\sp{\vskip #1\baselineskip} % @comment ...line which is ignored... % @c is the same as @comment % @ignore ... @end ignore is another way to write a comment % \def\comment{\begingroup \catcode`\^^M=\other% \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% \commentxxx} {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} % \let\c=\comment % @paragraphindent NCHARS % We'll use ems for NCHARS, close enough. % NCHARS can also be the word `asis' or `none'. % We cannot feasibly implement @paragraphindent asis, though. % \def\asisword{asis} % no translation, these are keywords \def\noneword{none} % \parseargdef\paragraphindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \defaultparindent = 0pt \else \defaultparindent = #1em \fi \fi \parindent = \defaultparindent } % @exampleindent NCHARS % We'll use ems for NCHARS like @paragraphindent. % It seems @exampleindent asis isn't necessary, but % I preserve it to make it similar to @paragraphindent. \parseargdef\exampleindent{% \def\temp{#1}% \ifx\temp\asisword \else \ifx\temp\noneword \lispnarrowing = 0pt \else \lispnarrowing = #1em \fi \fi } % @firstparagraphindent WORD % If WORD is `none', then suppress indentation of the first paragraph % after a section heading. If WORD is `insert', then do indent at such % paragraphs. % % The paragraph indentation is suppressed or not by calling % \suppressfirstparagraphindent, which the sectioning commands do. % We switch the definition of this back and forth according to WORD. % By default, we suppress indentation. % \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} \def\insertword{insert} % \parseargdef\firstparagraphindent{% \def\temp{#1}% \ifx\temp\noneword \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent \else\ifx\temp\insertword \let\suppressfirstparagraphindent = \relax \else \errhelp = \EMsimple \errmessage{Unknown @firstparagraphindent option `\temp'}% \fi\fi } % Here is how we actually suppress indentation. Redefine \everypar to % \kern backwards by \parindent, and then reset itself to empty. % % We also make \indent itself not actually do anything until the next % paragraph. % \gdef\dosuppressfirstparagraphindent{% \gdef\indent{% \restorefirstparagraphindent \indent }% \gdef\noindent{% \restorefirstparagraphindent \noindent }% \global\everypar = {% \kern -\parindent \restorefirstparagraphindent }% } \gdef\restorefirstparagraphindent{% \global \let \indent = \ptexindent \global \let \noindent = \ptexnoindent \global \everypar = {}% } % @refill is a no-op. \let\refill=\relax % If working on a large document in chapters, it is convenient to % be able to disable indexing, cross-referencing, and contents, for test runs. % This is done with @novalidate (before @setfilename). % \newif\iflinks \linkstrue % by default we want the aux files. \let\novalidate = \linksfalse % @setfilename is done at the beginning of every texinfo file. % So open here the files we need to have open while reading the input. % This makes it possible to make a .fmt file for texinfo. \def\setfilename{% \fixbackslash % Turn off hack to swallow `\input texinfo'. \iflinks \tryauxfile % Open the new aux file. TeX will close it automatically at exit. \immediate\openout\auxfile=\jobname.aux \fi % \openindices needs to do some work in any case. \openindices \let\setfilename=\comment % Ignore extra @setfilename cmds. % % If texinfo.cnf is present on the system, read it. % Useful for site-wide @afourpaper, etc. \openin 1 texinfo.cnf \ifeof 1 \else \input texinfo.cnf \fi \closein 1 % \comment % Ignore the actual filename. } % Called from \setfilename. % \def\openindices{% \newindex{cp}% \newcodeindex{fn}% \newcodeindex{vr}% \newcodeindex{tp}% \newcodeindex{ky}% \newcodeindex{pg}% } % @bye. \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} \message{pdf,} % adobe `portable' document format \newcount\tempnum \newcount\lnkcount \newtoks\filename \newcount\filenamelength \newcount\pgn \newtoks\toksA \newtoks\toksB \newtoks\toksC \newtoks\toksD \newbox\boxA \newcount\countA \newif\ifpdf \newif\ifpdfmakepagedest % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 % can be set). So we test for \relax and 0 as well as being undefined. \ifx\pdfoutput\thisisundefined \else \ifx\pdfoutput\relax \else \ifcase\pdfoutput \else \pdftrue \fi \fi \fi % PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and % related messages. The final outcome is that it is up to the TeX user % to double the backslashes and otherwise make the string valid, so % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to % do this reliably, so we use it. % #1 is a control sequence in which to do the replacements, % which we \xdef. \def\txiescapepdf#1{% \ifx\pdfescapestring\thisisundefined % No primitive available; should we give a warning or log? % Many times it won't matter. \else % The expandable \pdfescapestring primitive escapes parentheses, % backslashes, and other special chars. \xdef#1{\pdfescapestring{#1}}% \fi } \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images with PDF output, and none of those formats could be found. (.eps cannot be supported due to the design of the PDF format; use regular TeX (DVI output) for that.)} \ifpdf % % Color manipulation macros based on pdfcolor.tex, % except using rgb instead of cmyk; the latter is said to render as a % very dark gray on-screen and a very dark halftone in print, instead % of actual black. \def\rgbDarkRed{0.50 0.09 0.12} \def\rgbBlack{0 0 0} % % k sets the color for filling (usual text, etc.); % K sets the color for stroking (thin rules, e.g., normal _'s). \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} % % Set color, and create a mark which defines \thiscolor accordingly, % so that \makeheadline knows which color to restore. \def\setcolor#1{% \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% \domark \pdfsetcolor{#1}% } % \def\maincolor{\rgbBlack} \pdfsetcolor{\maincolor} \edef\thiscolor{\maincolor} \def\lastcolordefs{} % \def\makefootline{% \baselineskip24pt \line{\pdfsetcolor{\maincolor}\the\footline}% } % \def\makeheadline{% \vbox to 0pt{% \vskip-22.5pt \line{% \vbox to8.5pt{}% % Extract \thiscolor definition from the marks. \getcolormarks % Typeset the headline with \maincolor, then restore the color. \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% }% \vss }% \nointerlineskip } % % \pdfcatalog{/PageMode /UseOutlines} % % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% % % pdftex (and the PDF format) support .pdf, .png, .jpg (among % others). Let's try in that order, PDF first since if % someone has a scalable image, presumably better to use that than a % bitmap. \let\pdfimgext=\empty \begingroup \openin 1 #1.pdf \ifeof 1 \openin 1 #1.PDF \ifeof 1 \openin 1 #1.png \ifeof 1 \openin 1 #1.jpg \ifeof 1 \openin 1 #1.jpeg \ifeof 1 \openin 1 #1.JPG \ifeof 1 \errhelp = \nopdfimagehelp \errmessage{Could not find image file #1 for pdf}% \else \gdef\pdfimgext{JPG}% \fi \else \gdef\pdfimgext{jpeg}% \fi \else \gdef\pdfimgext{jpg}% \fi \else \gdef\pdfimgext{png}% \fi \else \gdef\pdfimgext{PDF}% \fi \else \gdef\pdfimgext{pdf}% \fi \closein 1 \endgroup % % without \immediate, ancient pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 \immediate\pdfimage \else \immediate\pdfximage \fi \ifdim \wd0 >0pt width \pdfimagewidth \fi \ifdim \wd2 >0pt height \pdfimageheight \fi \ifnum\pdftexversion<13 #1.\pdfimgext \else {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. \indexnofonts \turnoffactive \makevalueexpandable \def\pdfdestname{#1}% \txiescapepdf\pdfdestname \safewhatsit{\pdfdest name{\pdfdestname} xyz}% }} % % used to mark target names; must be expandable. \def\pdfmkpgn#1{#1} % % by default, use a color that is dark enough to print on paper as % nearly black, but still distinguishable for online viewing. \def\urlcolor{\rgbDarkRed} \def\linkcolor{\rgbDarkRed} \def\endlink{\setcolor{\maincolor}\pdfendlink} % % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% \else \csname#1\endcsname \fi} \def\advancenumber#1{\tempnum=\expnumber{#1}\relax \advance\tempnum by 1 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} % % #1 is the section text, which is what will be displayed in the % outline by the pdf viewer. #2 is the pdf expression for the number % of subentries (or empty, for subsubsections). #3 is the node text, % which might be empty if this toc entry had no corresponding node. % #4 is the page number % \def\dopdfoutline#1#2#3#4{% % Generate a link to the node text if that exists; else, use the % page number. We could generate a destination for the section % text in the case where a section has no node, but it doesn't % seem worth the trouble, since most documents are normally structured. \edef\pdfoutlinedest{#3}% \ifx\pdfoutlinedest\empty \def\pdfoutlinedest{#4}% \else \txiescapepdf\pdfoutlinedest \fi % % Also escape PDF chars in the display string. \edef\pdfoutlinetext{#1}% \txiescapepdf\pdfoutlinetext % \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% } % \def\pdfmakeoutlines{% \begingroup % Read toc silently, to get counts of subentries for \pdfoutline. \def\partentry##1##2##3##4{}% ignore parts in the outlines \def\numchapentry##1##2##3##4{% \def\thischapnum{##2}% \def\thissecnum{0}% \def\thissubsecnum{0}% }% \def\numsecentry##1##2##3##4{% \advancenumber{chap\thischapnum}% \def\thissecnum{##2}% \def\thissubsecnum{0}% }% \def\numsubsecentry##1##2##3##4{% \advancenumber{sec\thissecnum}% \def\thissubsecnum{##2}% }% \def\numsubsubsecentry##1##2##3##4{% \advancenumber{subsec\thissubsecnum}% }% \def\thischapnum{0}% \def\thissecnum{0}% \def\thissubsecnum{0}% % % use \def rather than \let here because we redefine \chapentry et % al. a second time, below. \def\appentry{\numchapentry}% \def\appsecentry{\numsecentry}% \def\appsubsecentry{\numsubsecentry}% \def\appsubsubsecentry{\numsubsubsecentry}% \def\unnchapentry{\numchapentry}% \def\unnsecentry{\numsecentry}% \def\unnsubsecentry{\numsubsecentry}% \def\unnsubsubsecentry{\numsubsubsecentry}% \readdatafile{toc}% % % Read toc second time, this time actually producing the outlines. % The `-' means take the \expnumber as the absolute number of % subentries, which we calculated on our first read of the .toc above. % % We use the node names as the destinations. \def\numchapentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% \def\numsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% \def\numsubsecentry##1##2##3##4{% \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% \def\numsubsubsecentry##1##2##3##4{% count is always zero \dopdfoutline{##1}{}{##3}{##4}}% % % PDF outlines are displayed using system fonts, instead of % document fonts. Therefore we cannot use special characters, % since the encoding is unknown. For example, the eogonek from % Latin 2 (0xea) gets translated to a | character. Info from % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. % % TODO this right, we have to translate 8-bit characters to % their "best" equivalent, based on the @documentencoding. Too % much work for too little return. Just use the ASCII equivalents % we use for the index sort strings. % \indexnofonts \setupdatafile % We can have normal brace characters in the PDF outlines, unlike % Texinfo index files. So set that up. \def\{{\lbracecharliteral}% \def\}{\rbracecharliteral}% \catcode`\\=\active \otherbackslash \input \tocreadfilename \endgroup } {\catcode`[=1 \catcode`]=2 \catcode`{=\other \catcode`}=\other \gdef\lbracecharliteral[{]% \gdef\rbracecharliteral[}]% ] % \def\skipspaces#1{\def\PP{#1}\def\D{|}% \ifx\PP\D\let\nextsp\relax \else\let\nextsp\skipspaces \addtokens{\filename}{\PP}% \advance\filenamelength by 1 \fi \nextsp} \def\getfilename#1{% \filenamelength=0 % If we don't expand the argument now, \skipspaces will get % snagged on things like "@value{foo}". \edef\temp{#1}% \expandafter\skipspaces\temp|\relax } \ifnum\pdftexversion < 14 \let \startlink \pdfannotlink \else \let \startlink \pdfstartlink \fi % make a live url in pdf output. \def\pdfurl#1{% \begingroup % it seems we really need yet another set of dummies; have not % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. % \normalturnoffactive \def\@{@}% \let\/=\empty \makevalueexpandable % do we want to go so far as to use \indexnofonts instead of just % special-casing \var here? \def\var##1{##1}% % \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} \def\maketoks{% \expandafter\poptoks\the\toksA|ENDTOKS|\relax \ifx\first0\adn0 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 \else \ifnum0=\countA\else\makelink\fi \ifx\first.\let\next=\done\else \let\next=\maketoks \addtokens{\toksB}{\the\toksD} \ifx\first,\addtokens{\toksB}{\space}\fi \fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \next} \def\makelink{\addtokens{\toksB}% {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else % non-pdf mode \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax \let\setcolor = \gobble \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput \message{fonts,} % Change the current font style to #1, remembering it in \curfontstyle. % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in % italics, not bold italics. % \def\setfontstyle#1{% \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. \csname ten#1\endcsname % change the current font } % Select #1 fonts with the current style. % \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} \def\rm{\fam=0 \setfontstyle{rm}} \def\it{\fam=\itfam \setfontstyle{it}} \def\sl{\fam=\slfam \setfontstyle{sl}} \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} \def\tt{\fam=\ttfam \setfontstyle{tt}} % Unfortunately, we have to override this for titles and the like, since % in those cases "rm" is bold. Sigh. \def\rmisbold{\rm\def\curfontstyle{bf}} % Texinfo sort of supports the sans serif font style, which plain TeX does not. % So we set up a \sf. \newfam\sffam \def\sf{\fam=\sffam \setfontstyle{sf}} \let\li = \sf % Sometimes we call it \li, not \sf. % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} % Set the baselineskip to #1, and the lineskip and strut size % correspondingly. There is no deep meaning behind these magic numbers % used as factors; they just match (closely enough) what Knuth defined. % \def\lineskipfactor{.08333} \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % % can get a sort of poor man's double spacing by redefining this. \def\baselinefactor{1} % \newdimen\textleading \def\setleading#1{% \dimen0 = #1\relax \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% \vrule width0pt height\strutheightpercent\baselineskip depth \strutdepthpercent \baselineskip }% } % PDF CMaps. See also LaTeX's t1.cmap. % % do nothing with this by default. \expandafter\let\csname cmapOT1\endcsname\gobble \expandafter\let\csname cmapOT1IT\endcsname\gobble \expandafter\let\csname cmapOT1TT\endcsname\gobble % if we are producing pdf, and we have \pdffontattr, then define cmaps. % (\pdffontattr was introduced many years ago, but people still run % older pdftex's; it's easy to conditionalize, so we do.) \ifpdf \ifx\pdffontattr\thisisundefined \else \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1-0) %%Title: (TeX-OT1-0 TeX OT1 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1) /Supplement 0 >> def /CMapName /TeX-OT1-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <23> <26> <0023> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 40 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1IT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1IT-0) %%Title: (TeX-OT1IT-0 TeX OT1IT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1IT) /Supplement 0 >> def /CMapName /TeX-OT1IT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 8 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <25> <26> <0025> <28> <3B> <0028> <3F> <5B> <003F> <5D> <5E> <005D> <61> <7A> <0061> <7B> <7C> <2013> endbfrange 42 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <00660066> <0C> <00660069> <0D> <0066006C> <0E> <006600660069> <0F> <00660066006C> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <21> <0021> <22> <201D> <23> <0023> <24> <00A3> <27> <2019> <3C> <00A1> <3D> <003D> <3E> <00BF> <5C> <201C> <5F> <02D9> <60> <2018> <7D> <02DD> <7E> <007E> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1IT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% % % \cmapOT1TT \begingroup \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap %%DocumentNeededResources: ProcSet (CIDInit) %%IncludeResource: ProcSet (CIDInit) %%BeginResource: CMap (TeX-OT1TT-0) %%Title: (TeX-OT1TT-0 TeX OT1TT 0) %%Version: 1.000 %%EndComments /CIDInit /ProcSet findresource begin 12 dict begin begincmap /CIDSystemInfo << /Registry (TeX) /Ordering (OT1TT) /Supplement 0 >> def /CMapName /TeX-OT1TT-0 def /CMapType 2 def 1 begincodespacerange <00> <7F> endcodespacerange 5 beginbfrange <00> <01> <0393> <09> <0A> <03A8> <21> <26> <0021> <28> <5F> <0028> <61> <7E> <0061> endbfrange 32 beginbfchar <02> <0398> <03> <039B> <04> <039E> <05> <03A0> <06> <03A3> <07> <03D2> <08> <03A6> <0B> <2191> <0C> <2193> <0D> <0027> <0E> <00A1> <0F> <00BF> <10> <0131> <11> <0237> <12> <0060> <13> <00B4> <14> <02C7> <15> <02D8> <16> <00AF> <17> <02DA> <18> <00B8> <19> <00DF> <1A> <00E6> <1B> <0153> <1C> <00F8> <1D> <00C6> <1E> <0152> <1F> <00D8> <20> <2423> <27> <2019> <60> <2018> <7F> <00A8> endbfchar endcmap CMapName currentdict /CMap defineresource pop end end %%EndResource %%EOF }\endgroup \expandafter\edef\csname cmapOT1TT\endcsname#1{% \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% }% \fi\fi % Set the font macro #1 to the font named \fontprefix#2. % #3 is the font's design size, #4 is a scale factor, #5 is the CMap % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit). % Example: % #1 = \textrm % #2 = \rmshape % #3 = 10 % #4 = \mainmagstep % #5 = OT1 % \def\setfont#1#2#3#4#5{% \font#1=\fontprefix#2#3 scaled #4 \csname cmap#5\endcsname#1% } % This is what gets called when #5 of \setfont is empty. \let\cmap\gobble % % (end of cmaps) % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix % before you read in texinfo.tex. \ifx\fontprefix\thisisundefined \def\fontprefix{cm} \fi % Support font families that don't use the same naming scheme as CM. \def\rmshape{r} \def\rmbshape{bx} % where the normal face is bold \def\bfshape{b} \def\bxshape{bx} \def\ttshape{tt} \def\ttbshape{tt} \def\ttslshape{sltt} \def\itshape{ti} \def\itbshape{bxti} \def\slshape{sl} \def\slbshape{bxsl} \def\sfshape{ss} \def\sfbshape{ss} \def\scshape{csc} \def\scbshape{csc} % Definitions for a main text size of 11pt. (The default in Texinfo.) % \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1095} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstep1}{OT1} \setfont\deftt\ttshape{10}{\magstep1}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} \setfont\chaprm\rmbshape{12}{\magstep2}{OT1} \setfont\chapit\itbshape{10}{\magstep3}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep3}{OT1} \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} \setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm \setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 \def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} \setfont\secrm\rmbshape{12}{\magstep1}{OT1} \setfont\secit\itbshape{10}{\magstep2}{OT1IT} \setfont\secsl\slbshape{10}{\magstep2}{OT1} \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 \def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} \setfont\ssecit\itbshape{10}{1315}{OT1IT} \setfont\ssecsl\slbshape{10}{1315}{OT1} \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 \def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} \setfont\reducedrm\rmshape{10}{1000}{OT1} \setfont\reducedtt\ttshape{10}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{1000}{OT1} \setfont\reducedit\itshape{10}{1000}{OT1IT} \setfont\reducedsl\slshape{10}{1000}{OT1} \setfont\reducedsf\sfshape{10}{1000}{OT1} \setfont\reducedsc\scshape{10}{1000}{OT1} \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 \def\reducedecsize{1000} \textleading = 13.2pt % line spacing for 11pt CM \textfonts % reset the current fonts \rm } % end of 11pt text font size definitions, \definetextfontsizexi % Definitions to make the main text be 10pt Computer Modern, with % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. % \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} \edef\mainmagstep{1000} \setfont\textrm\rmshape{10}{\mainmagstep}{OT1} \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} \setfont\textbf\bfshape{10}{\mainmagstep}{OT1} \setfont\textit\itshape{10}{\mainmagstep}{OT1IT} \setfont\textsl\slshape{10}{\mainmagstep}{OT1} \setfont\textsf\sfshape{10}{\mainmagstep}{OT1} \setfont\textsc\scshape{10}{\mainmagstep}{OT1} \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep \def\textecsize{1000} % A few fonts for @defun names and args. \setfont\defbf\bfshape{10}{\magstephalf}{OT1} \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} \setfont\smallrm\rmshape{9}{1000}{OT1} \setfont\smalltt\ttshape{9}{1000}{OT1TT} \setfont\smallbf\bfshape{10}{900}{OT1} \setfont\smallit\itshape{9}{1000}{OT1IT} \setfont\smallsl\slshape{9}{1000}{OT1} \setfont\smallsf\sfshape{9}{1000}{OT1} \setfont\smallsc\scshape{10}{900}{OT1} \setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 \def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} \setfont\smallerrm\rmshape{8}{1000}{OT1} \setfont\smallertt\ttshape{8}{1000}{OT1TT} \setfont\smallerbf\bfshape{10}{800}{OT1} \setfont\smallerit\itshape{8}{1000}{OT1IT} \setfont\smallersl\slshape{8}{1000}{OT1} \setfont\smallersf\sfshape{8}{1000}{OT1} \setfont\smallersc\scshape{10}{800}{OT1} \setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 \def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} \setfont\titlerm\rmbshape{12}{\magstep3}{OT1} \setfont\titleit\itbshape{10}{\magstep4}{OT1IT} \setfont\titlesl\slbshape{10}{\magstep4}{OT1} \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} \setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm \setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\titleecsize{2074} % Chapter fonts (14.4pt). \def\chapnominalsize{14pt} \setfont\chaprm\rmbshape{12}{\magstep1}{OT1} \setfont\chapit\itbshape{10}{\magstep2}{OT1IT} \setfont\chapsl\slbshape{10}{\magstep2}{OT1} \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} \setfont\chapsf\sfbshape{12}{\magstep1}{OT1} \let\chapbf\chaprm \setfont\chapsc\scbshape{10}{\magstep2}{OT1} \font\chapi=cmmi12 scaled \magstep1 \font\chapsy=cmsy10 scaled \magstep2 \def\chapecsize{1440} % Section fonts (12pt). \def\secnominalsize{12pt} \setfont\secrm\rmbshape{12}{1000}{OT1} \setfont\secit\itbshape{10}{\magstep1}{OT1IT} \setfont\secsl\slbshape{10}{\magstep1}{OT1} \setfont\sectt\ttbshape{12}{1000}{OT1TT} \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} \font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} % Subsection fonts (10pt). \def\ssecnominalsize{10pt} \setfont\ssecrm\rmbshape{10}{1000}{OT1} \setfont\ssecit\itbshape{10}{1000}{OT1IT} \setfont\ssecsl\slbshape{10}{1000}{OT1} \setfont\ssectt\ttbshape{10}{1000}{OT1TT} \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} \setfont\ssecsf\sfbshape{10}{1000}{OT1} \let\ssecbf\ssecrm \setfont\ssecsc\scbshape{10}{1000}{OT1} \font\sseci=cmmi10 \font\ssecsy=cmsy10 \def\ssececsize{1000} % Reduced fonts for @acro in text (9pt). \def\reducednominalsize{9pt} \setfont\reducedrm\rmshape{9}{1000}{OT1} \setfont\reducedtt\ttshape{9}{1000}{OT1TT} \setfont\reducedbf\bfshape{10}{900}{OT1} \setfont\reducedit\itshape{9}{1000}{OT1IT} \setfont\reducedsl\slshape{9}{1000}{OT1} \setfont\reducedsf\sfshape{9}{1000}{OT1} \setfont\reducedsc\scshape{10}{900}{OT1} \setfont\reducedttsl\ttslshape{10}{900}{OT1TT} \font\reducedi=cmmi9 \font\reducedsy=cmsy9 \def\reducedecsize{0900} \divide\parskip by 2 % reduce space between paragraphs \textleading = 12pt % line spacing for 10pt CM \textfonts % reset the current fonts \rm } % end of 10pt text font size definitions, \definetextfontsizex % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. % \def\xiword{11} \def\xword{10} \def\xwordpt{10pt} % \parseargdef\fonttextsize{% \def\textsizearg{#1}% %\wlog{doing @fonttextsize \textsizearg}% % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi \else \errhelp=\EMsimple \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} \fi\fi \endgroup } % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since % texinfo doesn't allow for producing subscripts and superscripts except % in the main text, we don't bother to reset \scriptfont and % \scriptscriptfont (which would also require loading a lot more fonts). % \def\resetmathfonts{% \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf \textfont\ttfam=\tentt \textfont\sffam=\tensf } % The font-changing commands redefine the meanings of \tenSTYLE, instead % of just \STYLE. We do this because \STYLE needs to also set the % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire % \tenSTYLE to set the current font. % % Each font-changing command also sets the names \lsize (one size lower) % and \lllsize (three sizes lower). These relative commands are used in % the LaTeX logo and acronyms. % % This all needs generalizing, badly. % \def\textfonts{% \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl \def\curfontsize{text}% \def\lsize{reduced}\def\lllsize{smaller}% \resetmathfonts \setleading{\textleading}} \def\titlefonts{% \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tenttsl=\titlettsl \def\curfontsize{title}% \def\lsize{chap}\def\lllsize{subsec}% \resetmathfonts \setleading{27pt}} \def\titlefont#1{{\titlefonts\rmisbold #1}} \def\chapfonts{% \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl \def\curfontsize{chap}% \def\lsize{sec}\def\lllsize{text}% \resetmathfonts \setleading{19pt}} \def\secfonts{% \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy \let\tenttsl=\secttsl \def\curfontsize{sec}% \def\lsize{subsec}\def\lllsize{reduced}% \resetmathfonts \setleading{16pt}} \def\subsecfonts{% \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl \def\curfontsize{ssec}% \def\lsize{text}\def\lllsize{small}% \resetmathfonts \setleading{15pt}} \let\subsubsecfonts = \subsecfonts \def\reducedfonts{% \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy \let\tenttsl=\reducedttsl \def\curfontsize{reduced}% \def\lsize{small}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallfonts{% \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy \let\tenttsl=\smallttsl \def\curfontsize{small}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{10.5pt}} \def\smallerfonts{% \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tenttsl=\smallerttsl \def\curfontsize{smaller}% \def\lsize{smaller}\def\lllsize{smaller}% \resetmathfonts \setleading{9.5pt}} % Fonts for short table of contents. \setfont\shortcontrm\rmshape{12}{1000}{OT1} \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 \setfont\shortcontsl\slshape{12}{1000}{OT1} \setfont\shortconttt\ttshape{12}{1000}{OT1TT} % Define these just so they can be easily changed for other fonts. \def\angleleft{$\langle$} \def\angleright{$\rangle$} % Set the fonts to use with the @small... environments. \let\smallexamplefonts = \smallfonts % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample % can fit this many characters: % 8.5x11=86 smallbook=72 a4=90 a5=69 % If we use \scriptfonts (8pt), then we can fit this many characters: % 8.5x11=90+ smallbook=80 a4=90+ a5=77 % For me, subjectively, the few extra characters that fit aren't worth % the additional smallness of 8pt. So I'm making the default 9pt. % % By the way, for comparison, here's what fits with @example (10pt): % 8.5x11=71 smallbook=60 a4=75 a5=58 % --karl, 24jan03. % Set up the default fonts, so we can use them for creating boxes. % \definetextfontsizexi \message{markup,} % Check if we are currently using a typewriter font. Since all the % Computer Modern typewriter fonts have zero interword stretch (and % shrink), and it is reasonable to expect all typewriter fonts to have % this property, we can check that font parameter. % \def\ifmonospace{\ifdim\fontdimen3\font=0pt } % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will % define and register \INITMACRO to be called on markup style changes. % \INITMACRO can check \currentmarkupstyle for the innermost % style and the set of \ifmarkupSTYLE switches for all styles % currently in effect. \newif\ifmarkupvar \newif\ifmarkupsamp \newif\ifmarkupkey %\newif\ifmarkupfile % @file == @samp. %\newif\ifmarkupoption % @option == @samp. \newif\ifmarkupcode \newif\ifmarkupkbd %\newif\ifmarkupenv % @env == @code. %\newif\ifmarkupcommand % @command == @code. \newif\ifmarkuptex % @tex (and part of @math, for now). \newif\ifmarkupexample \newif\ifmarkupverb \newif\ifmarkupverbatim \let\currentmarkupstyle\empty \def\setupmarkupstyle#1{% \csname markup#1true\endcsname \def\currentmarkupstyle{#1}% \markupstylesetup } \let\markupstylesetup\empty \def\defmarkupstylesetup#1{% \expandafter\def\expandafter\markupstylesetup \expandafter{\markupstylesetup #1}% \def#1% } % Markup style setup for left and right quotes. \defmarkupstylesetup\markupsetuplq{% \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuplqdefault \else \temp \fi } \defmarkupstylesetup\markupsetuprq{% \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname \ifx\temp\relax \markupsetuprqdefault \else \temp \fi } { \catcode`\'=\active \catcode`\`=\active \gdef\markupsetuplqdefault{\let`\lq} \gdef\markupsetuprqdefault{\let'\rq} \gdef\markupsetcodequoteleft{\let`\codequoteleft} \gdef\markupsetcodequoteright{\let'\codequoteright} } \let\markupsetuplqcode \markupsetcodequoteleft \let\markupsetuprqcode \markupsetcodequoteright % \let\markupsetuplqexample \markupsetcodequoteleft \let\markupsetuprqexample \markupsetcodequoteright % \let\markupsetuplqkbd \markupsetcodequoteleft \let\markupsetuprqkbd \markupsetcodequoteright % \let\markupsetuplqsamp \markupsetcodequoteleft \let\markupsetuprqsamp \markupsetcodequoteright % \let\markupsetuplqverb \markupsetcodequoteleft \let\markupsetuprqverb \markupsetcodequoteright % \let\markupsetuplqverbatim \markupsetcodequoteleft \let\markupsetuprqverbatim \markupsetcodequoteright % Allow an option to not use regular directed right quote/apostrophe % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). % The undirected quote is ugly, so don't make it the default, but it % works for pasting with more pdf viewers (at least evince), the % lilypond developers report. xpdf does work with the regular 0x27. % \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax '% \else \char'15 \fi \else \char'15 \fi } % % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. % \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax % [Knuth] pp. 380,381,391 % \relax disables Spanish ligatures ?` and !` of \tt font. \relax`% \else \char'22 \fi \else \char'22 \fi } % Commands to set the quote options. % \parseargdef\codequoteundirected{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequoteundirected\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequoteundirected\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% \fi\fi } % \parseargdef\codequotebacktick{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxicodequotebacktick\endcsname = t% \else\ifx\temp\offword \expandafter\let\csname SETtxicodequotebacktick\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% \fi\fi } % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. \def\noligaturesquoteleft{\relax\lq} % Count depth in font-changes, for error checks \newcount\fontdepth \fontdepth=0 % Font commands. % #1 is the font command (\sl or \it), #2 is the text to slant. % If we are in a monospaced environment, however, 1) always use \ttsl, % and 2) do not add an italic correction. \def\dosmartslant#1#2{% \ifusingtt {{\ttsl #2}\let\next=\relax}% {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% \next } \def\smartslanted{\dosmartslant\sl} \def\smartitalic{\dosmartslant\it} % Output an italic correction unless \next (presumed to be the following % character) is such as not to need one. \def\smartitaliccorrection{% \ifx\next,% \else\ifx\next-% \else\ifx\next.% \else\ptexslash \fi\fi\fi \aftersmartic } % Unconditional use \ttsl, and no ic. @var is set to this for defuns. \def\ttslanted#1{{\ttsl #1}} % @cite is like \smartslanted except unconditionally use \sl. We never want % ttsl for book titles, do we? \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} \def\aftersmartic{} \def\var#1{% \let\saveaftersmartic = \aftersmartic \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% \smartslanted{#1}% } \let\i=\smartitalic \let\slanted=\smartslanted \let\dfn=\smartslanted \let\emph=\smartitalic % Explicit font changes: @r, @sc, undocumented @ii. \def\r#1{{\rm #1}} % roman font \def\sc#1{{\smallcaps#1}} % smallcaps font \def\ii#1{{\it #1}} % italic font % @b, explicit bold. Also @strong. \def\b#1{{\bf #1}} \let\strong=\b % @sansserif, explicit sans. \def\sansserif#1{{\sf #1}} % We can't just use \exhyphenpenalty, because that only has effect at % the end of a paragraph. Restore normal hyphenation at the end of the % group within which \nohyphenation is presumably called. % \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\restorehyphenation{\hyphenchar\font = `- } % Set sfcode to normal for the chars that usually have another value. % Can't use plain's \frenchspacing because it uses the `\x notation, and % sometimes \x has an active definition that messes things up. % \catcode`@=11 \def\plainfrenchspacing{% \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m \def\endofsentencespacefactor{1000}% for @. and friends } \def\plainnonfrenchspacing{% \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 \def\endofsentencespacefactor{3000}% for @. and friends } \catcode`@=\other \def\endofsentencespacefactor{3000}% default % @t, explicit typewriter. \def\t#1{% {\tt \rawbackslash \plainfrenchspacing #1}% \null } % @samp. \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}} % @indicateurl is \samp, that is, with quotes. \let\indicateurl=\samp % @code (and similar) prints in typewriter, but with spaces the same % size as normal in the surrounding text, without hyphenation, etc. % This is a subroutine for that. \def\tclose#1{% {% % Change normal interword space to be same as for the current font. \spaceskip = \fontdimen2\font % % Switch to typewriter. \tt % % But `\ ' produces the large typewriter interword space. \def\ {{\spaceskip = 0pt{} }}% % % Turn off hyphenation. \nohyphenation % \rawbackslash \plainfrenchspacing #1% }% \null % reset spacefactor to 1000 } % We *must* turn on hyphenation at `-' and `_' in @code. % Otherwise, it is too hard to avoid overfull hboxes % in the Emacs manual, the Library manual, etc. % % Unfortunately, TeX uses one parameter (\hyphenchar) to control % both hyphenation at - and hyphenation within words. % We must therefore turn them both off (\tclose does that) % and arrange explicitly to hyphenate at a dash. % -- rms. { \catcode`\-=\active \catcode`\_=\active \catcode`\'=\active \catcode`\`=\active \global\let'=\rq \global\let`=\lq % default definitions % \global\def\code{\begingroup \setupmarkupstyle{code}% % The following should really be moved into \setupmarkupstyle handlers. \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder \else \let-\normaldash \let_\realunder \fi \codex } } \def\codex #1{\tclose{#1}\endgroup} \def\normaldash{-} \def\codedash{-\discretionary{}{}{}} \def\codeunder{% % this is all so @math{@code{var_name}+1} can work. In math mode, _ % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) % will therefore expand the active definition of _, which is us % (inside @code that is), therefore an endless loop. \ifusingtt{\ifmmode \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. \else\normalunderscore \fi \discretionary{}{}{}}% {\_}% } % An additional complication: the above will allow breaks after, e.g., % each of the four underscores in __typeof__. This is bad. % @allowcodebreaks provides a document-level way to turn breaking at - % and _ on and off. % \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} \def\keywordfalse{false} \parseargdef\allowcodebreaks{% \def\txiarg{#1}% \ifx\txiarg\keywordtrue \allowcodebreakstrue \else\ifx\txiarg\keywordfalse \allowcodebreaksfalse \else \errhelp = \EMsimple \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% \fi\fi } % For @command, @env, @file, @option quotes seem unnecessary, % so use \code rather than \samp. \let\command=\code \let\env=\code \let\file=\code \let\option=\code % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url % itself. First (mandatory) arg is the url. % (This \urefnobreak definition isn't used now, leaving it for a while % for comparison.) \def\urefnobreak#1{\dourefnobreak #1,,,\finish} \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url \fi \else \code{#1}% only url given, so show it \fi \fi \endlink \endgroup} % This \urefbreak definition is the active one. \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} \let\uref=\urefbreak \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example \unsepspaces \pdfurl{#1}% \setbox0 = \hbox{\ignorespaces #3}% \ifdim\wd0 > 0pt \unhbox0 % third arg given, show only that \else \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0 > 0pt \ifpdf \unhbox0 % PDF: 2nd arg given, show only it \else \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url \fi \else \urefcode{#1}% only url given, so show it \fi \fi \endlink \endgroup} % Allow line breaks around only a few characters (only). \def\urefcatcodes{% \catcode\ampChar=\active \catcode\dotChar=\active \catcode\hashChar=\active \catcode\questChar=\active \catcode\slashChar=\active } { \urefcatcodes % \global\def\urefcode{\begingroup \setupmarkupstyle{code}% \urefcatcodes \let&\urefcodeamp \let.\urefcodedot \let#\urefcodehash \let?\urefcodequest \let/\urefcodeslash \codex } % % By default, they are just regular characters. \global\def&{\normalamp} \global\def.{\normaldot} \global\def#{\normalhash} \global\def?{\normalquest} \global\def/{\normalslash} } % we put a little stretch before and after the breakable chars, to help % line breaking of long url's. The unequal skips make look better in % cmtt at least, especially for dots. \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } % \def\urefcodeamp{\urefprestretch \&\urefpoststretch} \def\urefcodedot{\urefprestretch .\urefpoststretch} \def\urefcodehash{\urefprestretch \#\urefpoststretch} \def\urefcodequest{\urefprestretch ?\urefpoststretch} \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} { \catcode`\/=\active \global\def\urefcodeslashfinish{% \urefprestretch \slashChar % Allow line break only after the final / in a sequence of % slashes, to avoid line break between the slashes in http://. \ifx\next/\else \urefpoststretch \fi } } % One more complication: by default we'll break after the special % characters, but some people like to break before the special chars, so % allow that. Also allow no breaking at all, for manual control. % \parseargdef\urefbreakstyle{% \def\txiarg{#1}% \ifx\txiarg\wordnone \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordbefore \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} \else\ifx\txiarg\wordafter \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} \else \errhelp = \EMsimple \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% \fi\fi\fi } \def\wordafter{after} \def\wordbefore{before} \def\wordnone{none} \urefbreakstyle after % @url synonym for @uref, since that's how everyone uses it. % \let\url=\uref % rms does not like angle brackets --karl, 17may97. % So now @email is just like @uref, unless we are pdf. % %\def\email#1{\angleleft{\tt #1}\angleright} \ifpdf \def\email#1{\doemail#1,,\finish} \def\doemail#1,#2,#3\finish{\begingroup \unsepspaces \pdfurl{mailto:#1}% \setbox0 = \hbox{\ignorespaces #2}% \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi \endlink \endgroup} \else \let\email=\uref \fi % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), % `example' (@kbd uses ttsl only inside of @example and friends), % or `code' (@kbd uses normal tty font always). \parseargdef\kbdinputstyle{% \def\txiarg{#1}% \ifx\txiarg\worddistinct \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% \else\ifx\txiarg\wordexample \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \else\ifx\txiarg\wordcode \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \else \errhelp = \EMsimple \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% \fi\fi\fi } \def\worddistinct{distinct} \def\wordexample{example} \def\wordcode{code} % Default is `distinct'. \kbdinputstyle distinct % @kbd is like @code, except that if the argument is just one @key command, % then @kbd has no effect. \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}} \def\xkey{\key} \def\kbdsub#1#2#3\par{% \def\one{#1}\def\three{#3}\def\threex{??}% \ifx\one\xkey\ifx\threex\three \key{#2}% \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi } % definition of @key that produces a lozenge. Doesn't adjust to text size. %\setfont\keyrm\rmshape{8}{1000}{OT1} %\font\keysy=cmsy9 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% % \vbox{\hrule\kern-0.4pt % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% % \kern-0.4pt\hrule}% % \kern-.06em\raise0.4pt\hbox{\angleright}}}} % definition of @key with no lozenge. If the current font is already % monospace, don't change it; that way, we respect @kbdinputstyle. But % if it isn't monospace, then use \tt. % \def\key#1{{\setupmarkupstyle{key}% \nohyphenation \ifmonospace\else\tt\fi #1}\null} % @clicksequence{File @click{} Open ...} \def\clicksequence#1{\begingroup #1\endgroup} % @clickstyle @arrow (by default) \parseargdef\clickstyle{\def\click{#1}} \def\click{\arrow} % Typeset a dimension, e.g., `in' or `pt'. The only reason for the % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. % \def\dmn#1{\thinspace #1} % @l was never documented to mean ``switch to the Lisp font'', % and it is not used as such in any manual I can find. We need it for % Polish suppressed-l. --karl, 22sep96. %\def\l#1{{\li #1}\null} % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. % \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. % \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% \def\temp{#2}% \ifx\temp\empty \else \space ({\unsepspaces \ignorespaces \temp \unskip})% \fi \null % reset \spacefactor=1000 } % @asis just yields its argument. Used with @table, for example. % \def\asis#1{#1} % @math outputs its argument in math mode. % % One complication: _ usually means subscripts, but it could also mean % an actual _ character, as in @math{@var{some_variable} + 1}. So make % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { \catcode`\_ = \active \gdef\mathunderscore{% \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } % Another complication: we want \\ (and @\) to output a math (or tt) \. % FYI, plain.tex uses \\ as a temporary control sequence (for no % particular reason), but this is not advertised and we don't care. % % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} % \def\math{% \tex \mathunderscore \let\\ = \mathbackslash \mathactive % make the texinfo accent commands work in math mode \let\"=\ddot \let\'=\acute \let\==\bar \let\^=\hat \let\`=\grave \let\u=\breve \let\v=\check \let\~=\tilde \let\dotaccent=\dot $\finishmath } \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. % Some active characters (such as <) are spaced differently in math. % We have to reset their definitions in case the @math was an argument % to a command which sets the catcodes (such as @item or @section). % { \catcode`^ = \active \catcode`< = \active \catcode`> = \active \catcode`+ = \active \catcode`' = \active \gdef\mathactive{% \let^ = \ptexhat \let< = \ptexless \let> = \ptexgtr \let+ = \ptexplus \let' = \ptexquoteright } } % ctrl is no longer a Texinfo command, but leave this definition for fun. \def\ctrl #1{{\tt \rawbackslash \hat}#1} % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, % except specified as a normal braced arg, so no newlines to worry about. % \def\outfmtnametex{tex} % \long\def\inlinefmt#1{\doinlinefmt #1,\finish} \long\def\doinlinefmt#1,#2,\finish{% \def\inlinefmtname{#1}% \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi } % For raw, must switch into @tex before parsing the argument, to avoid % setting catcodes prematurely. Doing it this way means that, for % example, @inlineraw{html, foo{bar} gets a parse error instead of being % ignored. But this isn't important because if people want a literal % *right* brace they would have to use a command anyway, so they may as % well use a command to get a left brace too. We could re-use the % delimiter character idea from \verb, but it seems like overkill. % \long\def\inlineraw{\tex \doinlineraw} \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish} \def\doinlinerawtwo#1,#2,\finish{% \def\inlinerawname{#1}% \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi \endgroup % close group opened by \tex. } \message{glyphs,} % and logos. % @@ prints an @, as does @atchar{}. \def\@{\char64 } \let\atchar=\@ % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. % Unless we're in typewriter, use \ecfont because the CM text fonts do % not have braces, and we don't want to switch into math. \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} \let\{=\mylbrace \let\lbracechar=\{ \let\}=\myrbrace \let\rbracechar=\} \begingroup % Definitions to produce \{ and \} commands for indices, % and @{ and @} for the aux/toc files. \catcode`\{ = \other \catcode`\} = \other \catcode`\[ = 1 \catcode`\] = 2 \catcode`\! = 0 \catcode`\\ = \other !gdef!lbracecmd[\{]% !gdef!rbracecmd[\}]% !gdef!lbraceatcmd[@{]% !gdef!rbraceatcmd[@}]% !endgroup % @comma{} to avoid , parsing problems. \let\comma = , % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. \let\, = \ptexc \let\dotaccent = \ptexdot \def\ringaccent#1{{\accent23 #1}} \let\tieaccent = \ptext \let\ubaraccent = \ptexb \let\udotaccent = \d % Other special characters: @questiondown @exclamdown @ordf @ordm % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. \def\questiondown{?`} \def\exclamdown{!`} \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} % Dotless i and dotless j, used for accents. \def\imacro{i} \def\jmacro{j} \def\dotless#1{% \def\temp{#1}% \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi \else \errmessage{@dotless can be used only with i or j}% \fi\fi } % The \TeX{} logo, as in plain, but resetting the spacing so that a % period following counts as ending a sentence. (Idea found in latex.) % \edef\TeX{\TeX \spacefactor=1000 } % @LaTeX{} logo. Not quite the same results as the definition in % latex.ltx, since we use a different font for the raised A; it's most % convenient for us to use an explicitly smaller font, rather than using % the \scriptstyle font (since we don't reset \scriptstyle and % \scriptscriptstyle). % \def\LaTeX{% L\kern-.36em {\setbox0=\hbox{T}% \vbox to \ht0{\hbox{% \ifx\textnominalsize\xwordpt % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. % Revert to plain's \scriptsize, which is 7pt. \count255=\the\fam $\fam\count255 \scriptstyle A$% \else % For 11pt, we can use our lllsize. \selectfonts\lllsize A% \fi }% \vss }}% \kern-.15em \TeX } % Some math mode symbols. \def\bullet{$\ptexbullet$} \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} \def\minus{\ifmmode -\else $-$\fi} % @dots{} outputs an ellipsis using the current font. % We do .5em per period so that it has the same spacing in the cm % typewriter fonts as three actual period characters; on the other hand, % in other typewriter fonts three periods are wider than 1.5em. So do % whichever is larger. % \def\dots{% \leavevmode \setbox0=\hbox{...}% get width of three periods \ifdim\wd0 > 1.5em \dimen0 = \wd0 \else \dimen0 = 1.5em \fi \hbox to \dimen0{% \hskip 0pt plus.25fil .\hskip 0pt plus1fil .\hskip 0pt plus1fil .\hskip 0pt plus.5fil }% } % @enddots{} is an end-of-sentence ellipsis. % \def\enddots{% \dots \spacefactor=\endofsentencespacefactor } % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % % Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. % \newbox\errorbox % {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. \advance\hsize by -2\dimen2 % Rules. \vbox{% \hrule height\dimen2 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. \kern3pt\vrule width\dimen2}% Space to right. \hrule height\dimen2} \hfil} % \def\error{\leavevmode\lower.7ex\copy\errorbox} % @pounds{} is a sterling sign, which Knuth put in the CM italic font. % \def\pounds{{\it\$}} % @euro{} comes from a separate font, depending on the current style. % We use the free feym* fonts from the eurosym package by Henrik % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. % % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. % % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted % % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. % % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. % % \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi \thiseurofont } % Glyphs from the EC fonts. We don't use \let for the aliases, because % sometimes we redefine the original macro, and the alias should reflect % the redefinition. % % Use LaTeX names for the Icelandic letters. \def\DH{{\ecfont \char"D0}} % Eth \def\dh{{\ecfont \char"F0}} % eth \def\TH{{\ecfont \char"DE}} % Thorn \def\th{{\ecfont \char"FE}} % thorn % \def\guillemetleft{{\ecfont \char"13}} \def\guillemotleft{\guillemetleft} \def\guillemetright{{\ecfont \char"14}} \def\guillemotright{\guillemetright} \def\guilsinglleft{{\ecfont \char"0E}} \def\guilsinglright{{\ecfont \char"0F}} \def\quotedblbase{{\ecfont \char"12}} \def\quotesinglbase{{\ecfont \char"0D}} % % This positioning is not perfect (see the ogonek LaTeX package), but % we have the precomposed glyphs for the most common cases. We put the % tests to use those glyphs in the single \ogonek macro so we have fewer % dummy definitions to worry about for index entries, etc. % % ogonek is also used with other letters in Lithuanian (IOU), but using % the precomposed glyphs for those is not so easy since they aren't in % the same EC font. \def\ogonek#1{{% \def\temp{#1}% \ifx\temp\macrocharA\Aogonek \else\ifx\temp\macrochara\aogonek \else\ifx\temp\macrocharE\Eogonek \else\ifx\temp\macrochare\eogonek \else \ecfont \setbox0=\hbox{#1}% \ifdim\ht0=1ex\accent"0C #1% \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}% \fi \fi\fi\fi\fi }% } \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A} \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a} \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E} \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e} % % Use the ec* fonts (cm-super in outline format) for non-CM glyphs. \def\ecfont{% % We can't distinguish serif/sans and italic/slanted, but this % is used for crude hacks anyway (like adding French and German % quotes to documents typeset with CM, where we lose kerning), so % hopefully nobody will notice/care. \edef\ecsize{\csname\curfontsize ecsize\endcsname}% \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% \ifmonospace % typewriter: \font\thisecfont = ectt\ecsize \space at \nominalsize \else \ifx\curfontstyle\bfstylename % bold: \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize \else % regular: \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize \fi \fi \thisecfont } % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. % \def\registeredsymbol{% $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% \hfil\crcr\Orb}}% }$% } % @textdegree - the normal degrees sign. % \def\textdegree{$^\circ$} % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. % \ifx\Orb\thisisundefined \def\Orb{\mathhexbox20D} \fi % Quotes. \chardef\quotedblleft="5C \chardef\quotedblright=`\" \chardef\quoteleft=`\` \chardef\quoteright=`\' \message{page headings,} \newskip\titlepagetopglue \titlepagetopglue = 1.5in \newskip\titlepagebottomglue \titlepagebottomglue = 2pc % First the title page. Must do @settitle before @titlepage. \newif\ifseenauthor \newif\iffinishedtitlepage % Do an implicit @contents or @shortcontents after @end titlepage if the % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. % \newif\ifsetcontentsaftertitlepage \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue \newif\ifsetshortcontentsaftertitlepage \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue \parseargdef\shorttitlepage{% \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% \endgroup\page\hbox{}\page} \envdef\titlepage{% % Open one extra group, as we want to close it in the middle of \Etitlepage. \begingroup \parindent=0pt \textfonts % Leave some space at the very top of the page. \vglue\titlepagetopglue % No rule at page bottom unless we print one at the top with @title. \finishedtitlepagetrue % % Most title ``pages'' are actually two pages long, with space % at the top of the second. We don't want the ragged left on the second. \let\oldpage = \page \def\page{% \iffinishedtitlepage\else \finishtitlepage \fi \let\page = \oldpage \page \null }% } \def\Etitlepage{% \iffinishedtitlepage\else \finishtitlepage \fi % It is important to do the page break before ending the group, % because the headline and footline are only empty inside the group. % If we use the new definition of \page, we always get a blank page % after the title page, which we certainly don't want. \oldpage \endgroup % % Need this before the \...aftertitlepage checks so that if they are % in effect the toc pages will come out with page numbers. \HEADINGSon % % If they want short, they certainly want long too. \ifsetshortcontentsaftertitlepage \shortcontents \contents \global\let\shortcontents = \relax \global\let\contents = \relax \fi % \ifsetcontentsaftertitlepage \contents \global\let\contents = \relax \global\let\shortcontents = \relax \fi } \def\finishtitlepage{% \vskip4pt \hrule height 2pt width \hsize \vskip\titlepagebottomglue \finishedtitlepagetrue } % Settings used for typesetting titles: no hyphenation, no indentation, % don't worry much about spacing, ragged right. This should be used % inside a \vbox, and fonts need to be set appropriately first. Because % it is always used for titles, nothing else, we call \rmisbold. \par % should be specified before the end of the \vbox, since a vbox is a group. % \def\raggedtitlesettings{% \rmisbold \hyphenpenalty=10000 \parindent=0pt \tolerance=5000 \ptexraggedright } % Macros to be used within @titlepage: \let\subtitlerm=\tenrm \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} \parseargdef\title{% \checkenv\titlepage \vbox{\titlefonts \raggedtitlesettings #1\par}% % print a rule at the page bottom also. \finishedtitlepagefalse \vskip4pt \hrule height 4pt width \hsize \vskip4pt } \parseargdef\subtitle{% \checkenv\titlepage {\subtitlefont \rightline{#1}}% } % @author should come last, but may come many times. % It can also be used inside @quotation. % \parseargdef\author{% \def\temp{\quotation}% \ifx\thisenv\temp \def\quotationauthor{#1}% printed in \Equotation. \else \checkenv\titlepage \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi {\secfonts\rmisbold \leftline{#1}}% \fi } % Set up page headings and footings. \let\thispage=\folio \newtoks\evenheadline % headline on even pages \newtoks\oddheadline % headline on odd pages \newtoks\evenfootline % footline on even pages \newtoks\oddfootline % footline on odd pages % Now make TeX use those variables \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline \else \the\evenheadline \fi}} \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}\HEADINGShook} \let\HEADINGShook=\relax % Commands to set those variables. % For example, this is what @headings on does % @evenheading @thistitle|@thispage|@thischapter % @oddheading @thischapter|@thispage|@thistitle % @evenfooting @thisfile|| % @oddfooting ||@thisfile \def\evenheading{\parsearg\evenheadingxxx} \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} \def\evenheadingyyy #1\|#2\|#3\|#4\finish{% \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddheading{\parsearg\oddheadingxxx} \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} \def\oddheadingyyy #1\|#2\|#3\|#4\finish{% \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% \def\evenfooting{\parsearg\evenfootingxxx} \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} \def\evenfootingyyy #1\|#2\|#3\|#4\finish{% \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} \def\oddfooting{\parsearg\oddfootingxxx} \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} \def\oddfootingyyy #1\|#2\|#3\|#4\finish{% \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. \global\advance\pageheight by -12pt \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} % @evenheadingmarks top \thischapter <- chapter at the top of a page % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page % % The same set of arguments for: % % @oddheadingmarks % @evenfootingmarks % @oddfootingmarks % @everyheadingmarks % @everyfootingmarks \def\evenheadingmarks{\headingmarks{even}{heading}} \def\oddheadingmarks{\headingmarks{odd}{heading}} \def\evenfootingmarks{\headingmarks{even}{footing}} \def\oddfootingmarks{\headingmarks{odd}{footing}} \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} \headingmarks{odd}{heading}{#1} } \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} \headingmarks{odd}{footing}{#1} } % #1 = even/odd, #2 = heading/footing, #3 = top/bottom. \def\headingmarks#1#2#3 {% \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname \global\expandafter\let\csname get#1#2marks\endcsname \temp } \everyheadingmarks bottom \everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. % @headings off turns them off. % @headings on same as @headings double, retained for compatibility. % @headings after turns on double-sided headings after this page. % @headings doubleafter turns on double-sided headings after this page. % @headings singleafter turns on single-sided headings after this page. % By default, they are off at the start of a document, % and turned `on' after @end titlepage. \def\headings #1 {\csname HEADINGS#1\endcsname} \def\headingsoff{% non-global headings elimination \evenheadline={\hfil}\evenfootline={\hfil}% \oddheadline={\hfil}\oddfootline={\hfil}% } \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting \HEADINGSoff % it's the default % When we turn headings on, set the page number to 1. % For double-sided printing, put current file name in lower left corner, % chapter name on inside top of right hand pages, document % title on inside top of left hand pages, and page numbers on outside top % edge of all pages. \def\HEADINGSdouble{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \let\contentsalignmacro = \chappager % For single-sided printing, chapter title goes across top left of page, % page number on top right. \def\HEADINGSsingle{% \global\pageno=1 \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } \def\HEADINGSon{\HEADINGSdouble} \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} \let\HEADINGSdoubleafter=\HEADINGSafter \def\HEADINGSdoublex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\folio\hfil\thistitle}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chapoddpage } \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} \def\HEADINGSsinglex{% \global\evenfootline={\hfil} \global\oddfootline={\hfil} \global\evenheadline={\line{\thischapter\hfil\folio}} \global\oddheadline={\line{\thischapter\hfil\folio}} \global\let\contentsalignmacro = \chappager } % Subroutines used in generating headings % This produces Day Month Year style of output. % Only define if not already defined, in case a txi-??.tex file has set % up a different format (e.g., txi-cs.tex does this). \ifx\today\thisisundefined \def\today{% \number\day\space \ifcase\month \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec \fi \space\number\year} \fi % @settitle line... specifies the title of the document, for headings. % It generates no output of its own. \def\thistitle{\putwordNoTitle} \def\settitle{\parsearg{\gdef\thistitle}} \message{tables,} % Tables -- @table, @ftable, @vtable, @item(x). % default indentation of table text \newdimen\tableindent \tableindent=.8in % default indentation of @itemize and @enumerate text \newdimen\itemindent \itemindent=.3in % margin between end of table item and start of table text. \newdimen\itemmargin \itemmargin=.1in % used internally for \itemindent minus \itemmargin \newdimen\itemmax % Note @table, @ftable, and @vtable define @item, @itemx, etc., with % these defs. % They also define \itemindex % to index the item name in whatever manner is desired (perhaps none). \newif\ifitemxneedsnegativevskip \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} \def\internalBitem{\smallbreak \parsearg\itemzzz} \def\internalBitemx{\itemxpar \parsearg\itemzzz} \def\itemzzz #1{\begingroup % \advance\hsize by -\rightskip \advance\hsize by -\tableindent \setbox0=\hbox{\itemindicate{#1}}% \itemindex{#1}% \nobreak % This prevents a break before @itemx. % % If the item text does not fit in the space we have, put it on a line % by itself, and do not allow a page break either before or after that % line. We do not start a paragraph here because then if the next % command is, e.g., @kindex, the whatsit would get put into the % horizontal list on a line by itself, resulting in extra blank space. \ifdim \wd0>\itemmax % % Make this a paragraph so we get the \parskip glue and wrapping, % but leave it ragged-right. \begingroup \advance\leftskip by-\tableindent \advance\hsize by\tableindent \advance\rightskip by0pt plus1fil\relax \leavevmode\unhbox0\par \endgroup % % We're going to be starting a paragraph, but we don't want the % \parskip glue -- logically it's part of the @item we just started. \nobreak \vskip-\parskip % % Stop a page break at the \parskip glue coming up. However, if % what follows is an environment such as @example, there will be no % \parskip glue; then the negative vskip we just inserted would % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse \else % The item text fits into the space. Start a paragraph, so that the % following text (if any) will end up on the same line. \noindent % Do this with kerns and \unhbox so that if there is a footnote in % the item text, it can migrate to the main vertical list and % eventually be printed. \nobreak\kern-\tableindent \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 \unhbox0 \nobreak\kern\dimen0 \endgroup \itemxneedsnegativevskiptrue \fi } \def\item{\errmessage{@item while not in a list environment}} \def\itemx{\errmessage{@itemx while not in a list environment}} % @table, @ftable, @vtable. \envdef\table{% \let\itemindex\gobble \tablecheck{table}% } \envdef\ftable{% \def\itemindex ##1{\doind {fn}{\code{##1}}}% \tablecheck{ftable}% } \envdef\vtable{% \def\itemindex ##1{\doind {vr}{\code{##1}}}% \tablecheck{vtable}% } \def\tablecheck#1{% \ifnum \the\catcode`\^^M=\active \endgroup \errmessage{This command won't work in this context; perhaps the problem is that we are \inenvironment\thisenv}% \def\next{\doignore{#1}}% \else \let\next\tablex \fi \next } \def\tablex#1{% \def\itemindicate{#1}% \parsearg\tabley } \def\tabley#1{% {% \makevalueexpandable \edef\temp{\noexpand\tablez #1\space\space\space}% \expandafter }\temp \endtablez } \def\tablez #1 #2 #3 #4\endtablez{% \aboveenvbreak \ifnum 0#1>0 \advance \leftskip by #1\mil \fi \ifnum 0#2>0 \tableindent=#2\mil \fi \ifnum 0#3>0 \advance \rightskip by #3\mil \fi \itemmax=\tableindent \advance \itemmax by -\itemmargin \advance \leftskip by \tableindent \exdentamount=\tableindent \parindent = 0pt \parskip = \smallskipamount \ifdim \parskip=0pt \parskip=2pt \fi \let\item = \internalBitem \let\itemx = \internalBitemx } \def\Etable{\endgraf\afterenvbreak} \let\Eftable\Etable \let\Evtable\Etable \let\Eitemize\Etable \let\Eenumerate\Etable % This is the counter used by @enumerate, which is really @itemize \newcount \itemno \envdef\itemize{\parsearg\doitemize} \def\doitemize#1{% \aboveenvbreak \itemmax=\itemindent \advance\itemmax by -\itemmargin \advance\leftskip by \itemindent \exdentamount=\itemindent \parindent=0pt \parskip=\smallskipamount \ifdim\parskip=0pt \parskip=2pt \fi % % Try typesetting the item mark that if the document erroneously says % something like @itemize @samp (intending @table), there's an error % right away at the @itemize. It's not the best error message in the % world, but it's better than leaving it to the @item. This means if % the user wants an empty mark, they have to say @w{} not just @w. \def\itemcontents{#1}% \setbox0 = \hbox{\itemcontents}% % % @itemize with no arg is equivalent to @itemize @bullet. \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi % \let\item=\itemizeitem } % Definition of @item while inside @itemize and @enumerate. % \def\itemizeitem{% \advance\itemno by 1 % for enumerations {\let\par=\endgraf \smallbreak}% reasonable place to break {% % If the document has an @itemize directly after a section title, a % \nobreak will be last on the list, and \sectionheading will have % done a \vskip-\parskip. In that case, we don't want to zero % parskip, or the item text will crash with the heading. On the % other hand, when there is normal text preceding the item (as there % usually is), we do want to zero parskip, or there would be too much % space. In that case, we won't have a \nobreak before. At least % that's the theory. \ifnum\lastpenalty<10000 \parskip=0in \fi \noindent \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% % \vadjust{\penalty 1200}}% not good to break after first line of item. \flushcr } % \splitoff TOKENS\endmark defines \first to be the first token in % TOKENS, and \rest to be the remainder. % \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% % Allow an optional argument of an uppercase letter, lowercase letter, % or number, to specify the first label in the enumerated list. No % argument is the same as `1'. % \envparseargdef\enumerate{\enumeratey #1 \endenumeratey} \def\enumeratey #1 #2\endenumeratey{% % If we were given no argument, pretend we were given `1'. \def\thearg{#1}% \ifx\thearg\empty \def\thearg{1}\fi % % Detect if the argument is a single token. If so, it might be a % letter. Otherwise, the only valid thing it can be is a number. % (We will always have one token, because of the test we just made. % This is a good thing, since \splitoff doesn't work given nothing at % all -- the first parameter is undelimited.) \expandafter\splitoff\thearg\endmark \ifx\rest\empty % Only one token in the argument. It could still be anything. % A ``lowercase letter'' is one whose \lccode is nonzero. % An ``uppercase letter'' is one whose \lccode is both nonzero, and % not equal to itself. % Otherwise, we assume it's a number. % % We need the \relax at the end of the \ifnum lines to stop TeX from % continuing to look for a . % \ifnum\lccode\expandafter`\thearg=0\relax \numericenumerate % a number (we hope) \else % It's a letter. \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax \lowercaseenumerate % lowercase letter \else \uppercaseenumerate % uppercase letter \fi \fi \else % Multiple tokens in the argument. We hope it's a number. \numericenumerate \fi } % An @enumerate whose labels are integers. The starting integer is % given in \thearg. % \def\numericenumerate{% \itemno = \thearg \startenumeration{\the\itemno}% } % The starting (lowercase) letter is in \thearg. \def\lowercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more lowercase letters in @enumerate; get a bigger alphabet}% \fi \char\lccode\itemno }% } % The starting (uppercase) letter is in \thearg. \def\uppercaseenumerate{% \itemno = \expandafter`\thearg \startenumeration{% % Be sure we're not beyond the end of the alphabet. \ifnum\itemno=0 \errmessage{No more uppercase letters in @enumerate; get a bigger alphabet} \fi \char\uccode\itemno }% } % Call \doitemize, adding a period to the first argument and supplying the % common last two arguments. Also subtract one from the initial value in % \itemno, since @item increments \itemno. % \def\startenumeration#1{% \advance\itemno by -1 \doitemize{#1.}\flushcr } % @alphaenumerate and @capsenumerate are abbreviations for giving an arg % to @enumerate. % \def\alphaenumerate{\enumerate{a}} \def\capsenumerate{\enumerate{A}} \def\Ealphaenumerate{\Eenumerate} \def\Ecapsenumerate{\Eenumerate} % @multitable macros % Amy Hendrickson, 8/18/94, 3/6/96 % % @multitable ... @end multitable will make as many columns as desired. % Contents of each column will wrap at width given in preamble. Width % can be specified either with sample text given in a template line, % or in percent of \hsize, the current width of text on page. % Table can continue over pages but will only break between lines. % To make preamble: % % Either define widths of columns in terms of percent of \hsize: % @multitable @columnfractions .25 .3 .45 % @item ... % % Numbers following @columnfractions are the percent of the total % current hsize to be used for each column. You may use as many % columns as desired. % Or use a template: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item ... % using the widest term desired in each column. % Each new table line starts with @item, each subsequent new column % starts with @tab. Empty columns may be produced by supplying @tab's % with nothing between them for as many times as empty columns are needed, % ie, @tab@tab@tab will produce two empty columns. % @item, @tab do not need to be on their own lines, but it will not hurt % if they are. % Sample multitable: % @multitable {Column 1 template} {Column 2 template} {Column 3 template} % @item first col stuff @tab second col stuff @tab third col % @item % first col stuff % @tab % second col stuff % @tab % third col % @item first col stuff @tab second col stuff % @tab Many paragraphs of text may be used in any column. % % They will wrap at the width determined by the template. % @item@tab@tab This will be in third column. % @end multitable % Default dimensions may be reset by user. % @multitableparskip is vertical space between paragraphs in table. % @multitableparindent is paragraph indent in table. % @multitablecolmargin is horizontal space to be left between columns. % @multitablelinespace is space to leave between table items, baseline % to baseline. % 0pt means it depends on current normal line spacing. % \newskip\multitableparskip \newskip\multitableparindent \newdimen\multitablecolspace \newskip\multitablelinespace \multitableparskip=0pt \multitableparindent=6pt \multitablecolspace=12pt \multitablelinespace=0pt % Macros used to set up halign preamble: % \let\endsetuptable\relax \def\xendsetuptable{\endsetuptable} \let\columnfractions\relax \def\xcolumnfractions{\columnfractions} \newif\ifsetpercent % #1 is the @columnfraction, usually a decimal number like .5, but might % be just 1. We just use it, whatever it is. % \def\pickupwholefraction#1 {% \global\advance\colcount by 1 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% \setuptable } \newcount\colcount \def\setuptable#1{% \def\firstarg{#1}% \ifx\firstarg\xendsetuptable \let\go = \relax \else \ifx\firstarg\xcolumnfractions \global\setpercenttrue \else \ifsetpercent \let\go\pickupwholefraction \else \global\advance\colcount by 1 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a % separator; typically that is always in the input, anyway. \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \fi \fi \ifx\go\pickupwholefraction % Put the argument back for the \pickupwholefraction call, so % we'll always have a period there to be parsed. \def\go{\pickupwholefraction#1}% \else \let\go = \setuptable \fi% \fi \go } % multitable-only commands. % % @headitem starts a heading row, which we typeset in bold. % Assignments have to be global since we are inside the implicit group % of an alignment entry. \everycr resets \everytab so we don't have to % undo it ourselves. \def\headitemfont{\b}% for people to use in the template row; not changeable \def\headitem{% \checkenv\multitable \crcr \global\everytab={\bf}% can't use \headitemfont since the parsing differs \the\everytab % for the first item }% % % A \tab used to include \hskip1sp. But then the space in a template % line is not enough. That is bad. So let's go back to just `&' until % we again encounter the problem the 1sp was intended to solve. % --karl, nathan@acm.org, 20apr99. \def\tab{\checkenv\multitable &\the\everytab}% % @multitable ... @end multitable definitions: % \newtoks\everytab % insert after every tab. % \envdef\multitable{% \vskip\parskip \startsavinginserts % % @item within a multitable starts a normal row. % We use \def instead of \let so that if one of the multitable entries % contains an @itemize, we don't choke on the \item (seen as \crcr aka % \endtemplate) expanding \doitemize. \def\item{\crcr}% % \tolerance=9500 \hbadness=9500 \setmultitablespacing \parskip=\multitableparskip \parindent=\multitableparindent \overfullrule=0pt \global\colcount=0 % \everycr = {% \noalign{% \global\everytab={}% \global\colcount=0 % Reset the column counter. % Check for saved footnotes, etc. \checkinserts % Keeps underfull box messages off when table breaks over pages. %\filbreak % Maybe so, but it also creates really weird page breaks when the % table breaks over pages. Wouldn't \vfil be better? Wait until the % problem manifests itself, so it can be fixed for real --karl. }% }% % \parsearg\domultitable } \def\domultitable#1{% % To parse everything between @multitable and @item: \setuptable#1 \endsetuptable % % This preamble sets up a generic column definition, which will % be used as many times as user calls for columns. % \vtop will set a single line and will also let text wrap and % continue for many paragraphs if desired. \halign\bgroup &% \global\advance\colcount by 1 \multistrut \vtop{% % Use the current \colcount to find the correct column width: \hsize=\expandafter\csname col\the\colcount\endcsname % % In order to keep entries from bumping into each other % we will add a \leftskip of \multitablecolspace to all columns after % the first one. % % If a template has been used, we will add \multitablecolspace % to the width of each template entry. % % If the user has set preamble in terms of percent of \hsize we will % use that dimension as the width of the column, and the \leftskip % will keep entries from bumping into each other. Table will start at % left margin and final column will justify at right margin. % % Make sure we don't inherit \rightskip from the outer environment. \rightskip=0pt \ifnum\colcount=1 % The first column will be indented with the surrounding text. \advance\hsize by\leftskip \else \ifsetpercent \else % If user has not set preamble in terms of percent of \hsize % we will advance \hsize by \multitablecolspace. \advance\hsize by \multitablecolspace \fi % In either case we will make \leftskip=\multitablecolspace: \leftskip=\multitablecolspace \fi % Ignoring space at the beginning and end avoids an occasional spurious % blank line, when TeX decides to break the line at the space before the % box from the multistrut, so the strut ends up on a line by itself. % For example: % @multitable @columnfractions .11 .89 % @item @code{#} % @tab Legal holiday which is valid in major parts of the whole country. % Is automatically provided with highlighting sequences respectively % marking characters. \noindent\ignorespaces##\unskip\multistrut }\cr } \def\Emultitable{% \crcr \egroup % end the \halign \global\setpercentfalse } \def\setmultitablespacing{% \def\multistrut{\strut}% just use the standard line spacing % % Compute \multitablelinespace (if not defined by user) for use in % \multitableparskip calculation. We used define \multistrut based on % this, but (ironically) that caused the spacing to be off. % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. \ifdim\multitablelinespace=0pt \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip \global\advance\multitablelinespace by-\ht0 \fi % Test to see if parskip is larger than space between lines of % table. If not, do nothing. % If so, set to same dimension as multitablelinespace. \ifdim\multitableparskip>\multitablelinespace \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi% \ifdim\multitableparskip=0pt \global\multitableparskip=\multitablelinespace \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller % than skip between lines in the table. \fi} \message{conditionals,} % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, % @ifnotxml always succeed. They currently do nothing; we don't % attempt to check whether the conditionals are properly nested. But we % have to remember that they are conditionals, so that @end doesn't % attempt to close an environment group. % \def\makecond#1{% \expandafter\let\csname #1\endcsname = \relax \expandafter\let\csname iscond.#1\endcsname = 1 } \makecond{iftex} \makecond{ifnotdocbook} \makecond{ifnothtml} \makecond{ifnotinfo} \makecond{ifnotplaintext} \makecond{ifnotxml} % Ignore @ignore, @ifhtml, @ifinfo, and the like. % \def\direntry{\doignore{direntry}} \def\documentdescription{\doignore{documentdescription}} \def\docbook{\doignore{docbook}} \def\html{\doignore{html}} \def\ifdocbook{\doignore{ifdocbook}} \def\ifhtml{\doignore{ifhtml}} \def\ifinfo{\doignore{ifinfo}} \def\ifnottex{\doignore{ifnottex}} \def\ifplaintext{\doignore{ifplaintext}} \def\ifxml{\doignore{ifxml}} \def\ignore{\doignore{ignore}} \def\menu{\doignore{menu}} \def\xml{\doignore{xml}} % Ignore text until a line `@end #1', keeping track of nested conditionals. % % A count to remember the depth of nesting. \newcount\doignorecount \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other % % Make sure that spaces turn into tokens that match what \doignoretext wants. \spaceisspace % % Count number of #1's that we've seen. \doignorecount = 0 % % Swallow text until we reach the matching `@end #1'. \dodoignore{#1}% } { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. \obeylines % % \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % % Define a command to find the next `@end #1'. \long\def\doignoretext##1^^M@end #1{% \doignoretextyyy##1^^M@#1\_STOP_}% % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. \doignoretext ^^M% }% } \def\doignoreyyy#1{% \def\temp{#1}% \ifx\temp\empty % Nothing found. \let\next\doignoretextzzz \else % Found a nested condition, ... \advance\doignorecount by 1 \let\next\doignoretextyyy % ..., look for another. % If we're here, #1 ends with ^^M\ifinfo (for example). \fi \next #1% the token \_STOP_ is present just after this macro. } % We have to swallow the remaining "\_STOP_". % \def\doignoretextzzz#1{% \ifnum\doignorecount = 0 % We have just found the outermost @end. \let\next\enddoignore \else % Still inside a nested condition. \advance\doignorecount by -1 \let\next\doignoretext % Look for the next @end. \fi \next } % Finish off ignored text. { \obeylines% % Ignore anything after the last `@end #1'; this matters in verbatim % environments, where otherwise the newline after an ignored conditional % would result in a blank line in the output. \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% } % @set VAR sets the variable VAR to an empty value. % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. % % Since we want to separate VAR from REST-OF-LINE (which might be % empty), we can't just use \parsearg; we have to insert a space of our % own to delimit the rest of the line, and then take it out again if we % didn't need it. % We rely on the fact that \parsearg sets \catcode`\ =10. % \parseargdef\set{\setyyy#1 \endsetyyy} \def\setyyy#1 #2\endsetyyy{% {% \makevalueexpandable \def\temp{#2}% \edef\next{\gdef\makecsname{SET#1}}% \ifx\temp\empty \next{}% \else \setzzz#2\endsetzzz \fi }% } % Remove the trailing space \setxxx inserted. \def\setzzz#1 \endsetzzz{\next{#1}} % @clear VAR clears (i.e., unsets) the variable VAR. % \parseargdef\clear{% {% \makevalueexpandable \global\expandafter\let\csname SET#1\endcsname=\relax }% } % @value{foo} gets the text saved in variable foo. \def\value{\begingroup\makevalueexpandable\valuexxx} \def\valuexxx#1{\expandablevalue{#1}\endgroup} { \catcode`\- = \active \catcode`\_ = \active % \gdef\makevalueexpandable{% \let\value = \expandablevalue % We don't want these characters active, ... \catcode`\-=\other \catcode`\_=\other % ..., but we might end up with active ones in the argument if % we're called from @code, as @code{@value{foo-bar_}}, though. % So \let them to their normal equivalents. \let-\normaldash \let_\normalunderscore } } % We have this subroutine so that we can handle at least some @value's % properly in indexes (we call \makevalueexpandable in \indexdummies). % The command has to be fully expandable (if the variable is set), since % the result winds up in the index file. This means that if the % variable's value contains other Texinfo commands, it's almost certain % it will fail (although perhaps we could fix that with sufficient work % to do a one-level expansion on the result, instead of complete). % \def\expandablevalue#1{% \expandafter\ifx\csname SET#1\endcsname\relax {[No value for ``#1'']}% \message{Variable `#1', used in @value, is not set.}% \else \csname SET#1\endcsname \fi } % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % with @set. % % To get special treatment of `@end ifset,' call \makeond and the redefine. % \makecond{ifset} \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} \def\doifset#1#2{% {% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname SET#2\endcsname\relax #1% If not set, redefine \next. \fi \expandafter }\next } \def\ifsetfail{\doignore{ifset}} % @ifclear VAR ... @end executes the `...' iff VAR has never been % defined with @set, or has been undefined with @clear. % % The `\else' inside the `\doifset' parameter is a trick to reuse the % above code: if the variable is not set, do nothing, if it is set, % then redefine \next to \ifclearfail. % \makecond{ifclear} \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} \def\ifclearfail{\doignore{ifclear}} % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written % without the @) is in fact defined. We can only feasibly check at the % TeX level, so something like `mathcode' is going to considered % defined even though it is not a Texinfo command. % \makecond{ifcommanddefined} \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}} % \def\doifcmddefined#1#2{{% \makevalueexpandable \let\next=\empty \expandafter\ifx\csname #2\endcsname\relax #1% If not defined, \let\next as above. \fi \expandafter }\next } \def\ifcmddefinedfail{\doignore{ifcommanddefined}} % @ifcommandnotdefined CMD ... handled similar to @ifclear above. \makecond{ifcommandnotdefined} \def\ifcommandnotdefined{% \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}} \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}} % Set the `txicommandconditionals' variable, so documents have a way to % test if the @ifcommand...defined conditionals are available. \set txicommandconditionals % @dircategory CATEGORY -- specify a category of the dir file % which this file should belong to. Ignore this in TeX. \let\dircategory=\comment % @defininfoenclose. \let\definfoenclose=\comment \message{indexing,} % Index generation facilities % Define \newwrite to be identical to plain tex's \newwrite % except not \outer, so it can be used within macros and \if's. \edef\newwrite{\makecsname{ptexnewwrite}} % \newindex {foo} defines an index named foo. % It automatically defines \fooindex such that % \fooindex ...rest of line... puts an entry in the index foo. % It also defines \fooindfile to be the number of the output channel for % the file that accumulates this index. The file's extension is foo. % The name of an index should be no more than 2 characters long % for the sake of vms. % \def\newindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 % Open the file \fi \expandafter\xdef\csname#1index\endcsname{% % Define @#1index \noexpand\doindex{#1}} } % @defindex foo == \newindex{foo} % \def\defindex{\parsearg\newindex} % Define @defcodeindex, like @defindex except put all entries in @code. % \def\defcodeindex{\parsearg\newcodeindex} % \def\newcodeindex#1{% \iflinks \expandafter\newwrite \csname#1indfile\endcsname \openout \csname#1indfile\endcsname \jobname.#1 \fi \expandafter\xdef\csname#1index\endcsname{% \noexpand\docodeindex{#1}}% } % @synindex foo bar makes index foo feed into index bar. % Do this instead of @defindex foo if you don't want it as a separate index. % % @syncodeindex foo bar similar, but put all entries made for index foo % inside @code. % \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), % #3 the target index (bar). \def\dosynindex#1#2#3{% % Only do \closeout if we haven't already done it, else we'll end up % closing the target index. \expandafter \ifx\csname donesynindex#2\endcsname \relax % The \closeout helps reduce unnecessary open files; the limit on the % Acorn RISC OS is a mere 16 files. \expandafter\closeout\csname#2indfile\endcsname \expandafter\let\csname donesynindex#2\endcsname = 1 \fi % redefine \fooindfile: \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname \expandafter\let\csname#2indfile\endcsname=\temp % redefine \fooindex: \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% } % Define \doindex, the driver for all \fooindex macros. % Argument #1 is generated by the calling \fooindex macro, % and it is "foo", the name of the index. % \doindex just uses \parsearg; it calls \doind for the actual work. % This is because \doind is more useful to call from other macros. % There is also \dosubind {index}{topic}{subtopic} % which makes an entry in a two-level index such as the operation index. \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} \def\singleindexer #1{\doind{\indexname}{#1}} % like the previous two, but they put @code around the argument. \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} % Take care of Texinfo commands that can appear in an index entry. % Since there are some commands we want to expand, and others we don't, % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% % % Need these unexpandable (because we define \tt as a dummy) % definitions when @{ or @} appear in index entry text. Also, more % complicated, when \tex is in effect and \{ is a \delimiter again. % We can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. Perhaps we % should define @lbrace and @rbrace commands a la @comma. \def\{{{\tt\char123}}% \def\}{{\tt\char125}}% % % I don't entirely understand this, but when an index entry is % generated from a macro call, the \endinput which \scanmacro inserts % causes processing to be prematurely terminated. This is, % apparently, because \indexsorttmp is fully expanded, and \endinput % is an expandable command. The redefinition below makes \endinput % disappear altogether for that purpose -- although logging shows that % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} % @findex xyz % @end macro % ... % @funindex commtest % % The above is not enough to reproduce the bug, but it gives the flavor. % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} % % So: \let\endinput = \empty % % Do the redefinitions. \commondummies } % For the aux and toc files, @ is the escape character. So we want to % redefine everything using @ as the escape character (instead of % \realbackslash, still used for index files). When everything uses @, % this will be simpler. % \def\atdummies{% \def\@{@@}% \def\ {@ }% \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % % Do the redefinitions. \commondummies \otherbackslash } % Called from \indexdummies and \atdummies. % \def\commondummies{% % % \definedummyword defines \#1 as \string\#1\space, thus effectively % preventing its expansion. This is used only for control words, % not control letters, because the \space would be incorrect for % control characters, but is needed to separate the control word % from whatever follows. % % For control letters, we have \definedummyletter, which omits the % space. % % These can be used both for control words that take an argument and % those that do not. If it is followed by {arg} in the input, then % that will dutifully get written to the index (or wherever). % \def\definedummyword ##1{\def##1{\string##1\space}}% \def\definedummyletter##1{\def##1{\string##1}}% \let\definedummyaccent\definedummyletter % \commondummiesnofonts % \definedummyletter\_% \definedummyletter\-% % % Non-English letters. \definedummyword\AA \definedummyword\AE \definedummyword\DH \definedummyword\L \definedummyword\O \definedummyword\OE \definedummyword\TH \definedummyword\aa \definedummyword\ae \definedummyword\dh \definedummyword\exclamdown \definedummyword\l \definedummyword\o \definedummyword\oe \definedummyword\ordf \definedummyword\ordm \definedummyword\questiondown \definedummyword\ss \definedummyword\th % % Although these internal commands shouldn't show up, sometimes they do. \definedummyword\bf \definedummyword\gtr \definedummyword\hat \definedummyword\less \definedummyword\sf \definedummyword\sl \definedummyword\tclose \definedummyword\tt % \definedummyword\LaTeX \definedummyword\TeX % % Assorted special characters. \definedummyword\arrow \definedummyword\bullet \definedummyword\comma \definedummyword\copyright \definedummyword\registeredsymbol \definedummyword\dots \definedummyword\enddots \definedummyword\entrybreak \definedummyword\equiv \definedummyword\error \definedummyword\euro \definedummyword\expansion \definedummyword\geq \definedummyword\guillemetleft \definedummyword\guillemetright \definedummyword\guilsinglleft \definedummyword\guilsinglright \definedummyword\lbracechar \definedummyword\leq \definedummyword\minus \definedummyword\ogonek \definedummyword\pounds \definedummyword\point \definedummyword\print \definedummyword\quotedblbase \definedummyword\quotedblleft \definedummyword\quotedblright \definedummyword\quoteleft \definedummyword\quoteright \definedummyword\quotesinglbase \definedummyword\rbracechar \definedummyword\result \definedummyword\textdegree % % We want to disable all macros so that they are not expanded by \write. \macrolist % \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % \def\commondummiesnofonts{% % Control letters and accents. \definedummyletter\!% \definedummyaccent\"% \definedummyaccent\'% \definedummyletter\*% \definedummyaccent\,% \definedummyletter\.% \definedummyletter\/% \definedummyletter\:% \definedummyaccent\=% \definedummyletter\?% \definedummyaccent\^% \definedummyaccent\`% \definedummyaccent\~% \definedummyword\u \definedummyword\v \definedummyword\H \definedummyword\dotaccent \definedummyword\ogonek \definedummyword\ringaccent \definedummyword\tieaccent \definedummyword\ubaraccent \definedummyword\udotaccent \definedummyword\dotless % % Texinfo font commands. \definedummyword\b \definedummyword\i \definedummyword\r \definedummyword\sansserif \definedummyword\sc \definedummyword\slanted \definedummyword\t % % Commands that take arguments. \definedummyword\abbr \definedummyword\acronym \definedummyword\anchor \definedummyword\cite \definedummyword\code \definedummyword\command \definedummyword\dfn \definedummyword\dmn \definedummyword\email \definedummyword\emph \definedummyword\env \definedummyword\file \definedummyword\image \definedummyword\indicateurl \definedummyword\inforef \definedummyword\kbd \definedummyword\key \definedummyword\math \definedummyword\option \definedummyword\pxref \definedummyword\ref \definedummyword\samp \definedummyword\strong \definedummyword\tie \definedummyword\uref \definedummyword\url \definedummyword\var \definedummyword\verb \definedummyword\w \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index % by, and when constructing control sequence names. It eliminates all % control sequences and just writes whatever the best ASCII sort string % would be for a given command (usually its argument). % \def\indexnofonts{% % Accent commands should become @asis. \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. \def\definedummyletter##1{\let##1\empty}% % All control words become @asis by default; overrides below. \let\definedummyword\definedummyaccent % \commondummiesnofonts % % Don't no-op \tt, since it isn't a user-level command % and is used in the definitions of the active chars like <, >, |, etc. % Likewise with the other plain tex font commands. %\let\tt=\asis % \def\ { }% \def\@{@}% \def\_{\normalunderscore}% \def\-{}% @- shouldn't affect sorting % % Unfortunately, texindex is not prepared to handle braces in the % content at all. So for index sorting, we map @{ and @} to strings % starting with |, since that ASCII character is between ASCII { and }. \def\{{|a}% \def\lbracechar{|a}% % \def\}{|b}% \def\rbracechar{|b}% % % Non-English letters. \def\AA{AA}% \def\AE{AE}% \def\DH{DZZ}% \def\L{L}% \def\OE{OE}% \def\O{O}% \def\TH{ZZZ}% \def\aa{aa}% \def\ae{ae}% \def\dh{dzz}% \def\exclamdown{!}% \def\l{l}% \def\oe{oe}% \def\ordf{a}% \def\ordm{o}% \def\o{o}% \def\questiondown{?}% \def\ss{ss}% \def\th{zzz}% % \def\LaTeX{LaTeX}% \def\TeX{TeX}% % % Assorted special characters. % (The following {} will end up in the sort string, but that's ok.) \def\arrow{->}% \def\bullet{bullet}% \def\comma{,}% \def\copyright{copyright}% \def\dots{...}% \def\enddots{...}% \def\equiv{==}% \def\error{error}% \def\euro{euro}% \def\expansion{==>}% \def\geq{>=}% \def\guillemetleft{<<}% \def\guillemetright{>>}% \def\guilsinglleft{<}% \def\guilsinglright{>}% \def\leq{<=}% \def\minus{-}% \def\point{.}% \def\pounds{pounds}% \def\print{-|}% \def\quotedblbase{"}% \def\quotedblleft{"}% \def\quotedblright{"}% \def\quoteleft{`}% \def\quoteright{'}% \def\quotesinglbase{,}% \def\registeredsymbol{R}% \def\result{=>}% \def\textdegree{o}% % \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax \else \indexlquoteignore \fi % % We need to get rid of all macros, leaving only the arguments (if present). % Of course this is not nearly correct, but it is the best we can do for now. % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. % \macrolist } % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us % ignore left quotes in the sort term. {\catcode`\`=\active \gdef\indexlquoteignore{\let`=\empty}} \let\indexbackslash=0 %overridden during \printindex. \let\SETmarginindex=\relax % put index entries in margin (undocumented)? % Most index entries go through here, but \dosubind is the general case. % #1 is the index name, #2 is the entry text. \def\doind#1#2{\dosubind{#1}{#2}{}} % Workhorse for all \fooindexes. % #1 is name of index, #2 is stuff to put there, #3 is subentry -- % empty if called from \doind, as we usually are (the main exception % is with most defuns, which call us directly). % \def\dosubind#1#2#3{% \iflinks {% % Store the main index entry text (including the third arg). \toks0 = {#2}% % If third arg is present, precede it with a space. \def\thirdarg{#3}% \ifx\thirdarg\empty \else \toks0 = \expandafter{\the\toks0 \space #3}% \fi % \edef\writeto{\csname#1indfile\endcsname}% % \safewhatsit\dosubindwrite }% \fi } % Write the entry in \toks0 to the index file: % \def\dosubindwrite{% % Put the index entry in the margin if desired. \ifx\SETmarginindex\relax\else \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% \fi % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % % Process the index entry with all font commands turned off, to % get the string to sort by. {\indexnofonts \edef\temp{\the\toks0}% need full expansion \xdef\indexsorttmp{\temp}% }% % % Set up the complete index entry, with both the sort key and % the original text, including any font commands. We write % three arguments to \entry to the .?? file (four in the % subentry case), texindex reduces to two when writing the .??s % sorted result. \edef\temp{% \write\writeto{% \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% }% \temp } % Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the % \write or \pdfdest will make \lastskip zero. The result is that % sequences like this: % @end defun % @tindex whatever % @defun ... % will have extra space inserted, because the \medbreak in the % start of the @defun won't see the skip inserted by the @end of % the previous defun. % % But don't do any of this if we're not in vertical mode. We % don't want to do a \vskip and prematurely end a paragraph. % % Avoid page breaks due to these extra skips, too. % % But wait, there is a catch there: % We'll have to check whether \lastskip is zero skip. \ifdim is not % sufficient for this purpose, as it ignores stretch and shrink parts % of the skip. The only way seems to be to check the textual % representation of the skip. % % The following is almost like \def\zeroskipmacro{0.0pt} except that % the ``p'' and ``t'' characters have catcode \other, not 11 (letter). % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % \newskip\whatsitskip \newcount\whatsitpenalty % % ..., ready, GO: % \def\safewhatsit#1{\ifhmode #1% \else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else \vskip-\whatsitskip \fi % #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and % perhaps it was >=10000, e.g., a \nobreak. In that case, we want % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: % @deffn deffn-whatever % @vindex index-whatever % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. \nobreak\vskip\whatsitskip \fi \fi} % The index entry written in the file actually looks like % \entry {sortstring}{page}{topic} % or % \entry {sortstring}{page}{topic}{subtopic} % The texindex program reads in these files and writes files % containing these kinds of lines: % \initial {c} % before the first topic whose initial is c % \entry {topic}{pagelist} % for a topic that is used without subtopics % \primary {topic} % for the beginning of a topic that is used with subtopics % \secondary {subtopic}{pagelist} % for each subtopic. % Define the user-accessible indexing commands % @findex, @vindex, @kindex, @cindex. \def\findex {\fnindex} \def\kindex {\kyindex} \def\cindex {\cpindex} \def\vindex {\vrindex} \def\tindex {\tpindex} \def\pindex {\pgindex} \def\cindexsub {\begingroup\obeylines\cindexsub} {\obeylines % \gdef\cindexsub "#1" #2^^M{\endgroup % \dosubind{cp}{#2}{#1}}} % Define the macros used in formatting output of the sorted index material. % @printindex causes a particular index (the ??s file) to get printed. % It does not print any chapter heading (usually an @unnumbered). % \parseargdef\printindex{\begingroup \dobreak \chapheadingskip{10000}% % \smallfonts \rm \tolerance = 9500 \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. % Change catcode of @ here so that if the index file contains % \initial {@} % as its first line, TeX doesn't complain about mismatched braces % (because it thinks @} is a control sequence). \catcode`\@ = 11 \openin 1 \jobname.#1s \ifeof 1 % \enddoublecolumns gets confused if there is no text in the index, % and it loses the chapter title and the aux file entries for the % index. The easiest way to prevent this problem is to make sure % there is some text. \putwordIndexNonexistent \else % % If the index file exists but is empty, then \openin leaves \ifeof % false. We have to make TeX try to read something from the file, so % it can discover if there is anything in it. \read 1 to \temp \ifeof 1 \putwordIndexIsEmpty \else % Index files are almost Texinfo source, but we use \ as the escape % character. It would be better to use @, but that's too big a change % to make right now. \def\indexbackslash{\backslashcurfont}% \catcode`\\ = 0 \escapechar = `\\ \begindoublecolumns \input \jobname.#1s \enddoublecolumns \fi \fi \closein 1 \endgroup} % These macros are used by the sorted index file itself. % Change them to control the appearance of the index. \def\initial#1{{% % Some minor font changes for the special characters. \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt % % Remove any glue we may have, we'll be inserting our own. \removelastskip % % We like breaks before the index initials, so insert a bonus. \nobreak \vskip 0pt plus 3\baselineskip \penalty 0 \vskip 0pt plus -3\baselineskip % % Typeset the initial. Making this add up to a whole number of % baselineskips increases the chance of the dots lining up from column % to column. It still won't often be perfect, because of the stretch % we need before each entry, but it's better. % % No shrink because it confuses \balancecolumns. \vskip 1.67\baselineskip plus .5\baselineskip \leftline{\secbf #1}% % Do our best not to break after the initial. \nobreak \vskip .33\baselineskip plus .1\baselineskip }} % \entry typesets a paragraph consisting of the text (#1), dot leaders, and % then page number (#2) flushed to the right margin. It is used for index % and table of contents entries. The paragraph is indented by \leftskip. % % A straightforward implementation would start like this: % \def\entry#1#2{... % But this freezes the catcodes in the argument, and can cause problems to % @code, which sets - active. This problem was fixed by a kludge--- % ``-'' was active throughout whole index, but this isn't really right. % The right solution is to prevent \entry from swallowing the whole text. % --kasal, 21nov03 \def\entry{% \begingroup % % Start a new paragraph if necessary, so our assignments below can't % affect previous text. \par % % Do not fill out the last line with white space. \parfillskip = 0in % % No extra space above this paragraph. \parskip = 0in % % Do not prefer a separate line ending with a hyphen to fewer lines. \finalhyphendemerits = 0 % % \hangindent is only relevant when the entry text and page number % don't both fit on one line. In that case, bob suggests starting the % dots pretty far over on the line. Unfortunately, a large % indentation looks wrong when the entry text itself is broken across % lines. So we use a small indentation and put up with long leaders. % % \hangafter is reset to 1 (which is the value we want) at the start % of each paragraph, so we need not do anything with that. \hangindent = 2em % % When the entry text needs to be broken, just fill out the first line % with blank space. \rightskip = 0pt plus1fil % % A bit of stretch before each entry for the benefit of balancing % columns. \vskip 0pt plus1pt % % When reading the text of entry, convert explicit line breaks % from @* into spaces. The user might give these in long section % titles, for instance. \def\*{\unskip\space\ignorespaces}% \def\entrybreak{\hfil\break}% % % Swallow the left brace of the text (first parameter): \afterassignment\doentry \let\temp = } \def\entrybreak{\unskip\space\ignorespaces}% \def\doentry{% \bgroup % Instead of the swallowed brace. \noindent \aftergroup\finishentry % And now comes the text of the entry. } \def\finishentry#1{% % #1 is the page number. % % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. \setbox\boxA = \hbox{#1}% \ifdim\wd\boxA = 0pt \ % \else % % If we must, put the page number on a line of its own, and fill out % this line with blank space. (The \hfil is overwhelmed with the % fill leaders glue in \indexdotfill if the page number does fit.) \hfil\penalty50 \null\nobreak\indexdotfill % Have leaders before the page number. % % The `\ ' here is removed by the implicit \unskip that TeX does as % part of (the primitive) \par. Without it, a spurious underfull % \hbox ensues. \ifpdf \pdfgettoks#1.% \ \the\toksA \else \ #1% \fi \fi \par \endgroup } % Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} \newskip\secondaryindent \secondaryindent=0.5cm \def\secondary#1#2{{% \parfillskip=0in \parskip=0in \hangindent=1in \hangafter=1 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill \ifpdf \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. \else #2 \fi \par }} % Define two-column mode, which we use to typeset indexes. % Adapted from the TeXbook, page 416, which is to say, % the manmac.tex format used to print the TeXbook itself. \catcode`\@=11 \newbox\partialpage \newdimen\doublecolumnhsize \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns % Grab any single-column material above us. \output = {% % % Here is a possibility not foreseen in manmac: if we accumulate a % whole lot of material, we might end up calling this \output % routine twice in a row (see the doublecol-lose test, which is % essentially a couple of indexes with @setchapternewpage off). In % that case we just ship out what is in \partialpage with the normal % output routine. Generally, \partialpage will be empty when this % runs and this will be a no-op. See the indexspread.tex test case. \ifvoid\partialpage \else \onepageout{\pagecontents\partialpage}% \fi % \global\setbox\partialpage = \vbox{% % Unvbox the main output page. \unvbox\PAGE \kern-\topskip \kern\baselineskip }% }% \eject % run that output routine to set \partialpage % % Use the double-column output routine for subsequent pages. \output = {\doublecolumnout}% % % Change the page size parameters. We could do this once outside this % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 % format, but then we repeat the same computation. Repeating a couple % of assignments once per index is clearly meaningless for the % execution time, so we may as well do it in one place. % % First we halve the line length, less a little for the gutter between % the columns. We compute the gutter based on the line length, so it % changes automatically with the paper format. The magic constant % below is chosen so that the gutter has the same value (well, +-<1pt) % as it did when we hard-coded it. % % We put the result in a separate register, \doublecolumhsize, so we % can restore it in \pagesofar, after \hsize itself has (potentially) % been clobbered. % \doublecolumnhsize = \hsize \advance\doublecolumnhsize by -.04154\hsize \divide\doublecolumnhsize by 2 \hsize = \doublecolumnhsize % % Double the \vsize as well. (We don't need a separate register here, % since nobody clobbers \vsize.) \vsize = 2\vsize } % The double-column output routine for all double-column pages except % the last. % \def\doublecolumnout{% \splittopskip=\topskip \splitmaxdepth=\maxdepth % Get the available space for the double columns -- the normal % (undoubled) page height minus any material left over from the % previous page. \dimen@ = \vsize \divide\dimen@ by 2 \advance\dimen@ by -\ht\partialpage % % box0 will be the left-hand column, box2 the right. \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ \onepageout\pagesofar \unvbox255 \penalty\outputpenalty } % % Re-output the contents of the output page -- any previous material, % followed by the two boxes we just split, in box0 and box2. \def\pagesofar{% \unvbox\partialpage % \hsize = \doublecolumnhsize \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% } % % All done with double columns. \def\enddoublecolumns{% % The following penalty ensures that the page builder is exercised % _before_ we change the output routine. This is necessary in the % following situation: % % The last section of the index consists only of a single entry. % Before this section, \pagetotal is less than \pagegoal, so no % break occurs before the last section starts. However, the last % section, consisting of \initial and the single \entry, does not % fit on the page and has to be broken off. Without the following % penalty the page builder will not be exercised until \eject % below, and by that time we'll already have changed the output % routine to the \balancecolumns version, so the next-to-last % double-column page will be processed with \balancecolumns, which % is wrong: The two columns will go to the main vertical list, with % the broken-off section in the recent contributions. As soon as % the output routine finishes, TeX starts reconsidering the page % break. The two columns and the broken-off section both fit on the % page, because the two columns now take up only half of the page % goal. When TeX sees \eject from below which follows the final % section, it invokes the new output routine that we've set after % \balancecolumns below; \onepageout will try to fit the two columns % and the final section into the vbox of \pageheight (see % \pagebody), causing an overfull box. % % Note that glue won't work here, because glue does not exercise the % page builder, unlike penalties (see The TeXbook, pp. 280-281). \penalty0 % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. \balancecolumns % % If we end up splitting too much material for the current page, % though, there will be another page break right after this \output % invocation ends. Having called \balancecolumns once, we do not % want to call it again. Therefore, reset \output to its normal % definition right away. (We hope \balancecolumns will never be % called on to balance too much material, but if it is, this makes % the output somewhat more palatable.) \global\output = {\onepageout{\pagecontents\PAGE}}% }% \eject \endgroup % started in \begindoublecolumns % % \pagegoal was set to the doubled \vsize above, since we restarted % the current page. We're now back to normal single-column % typesetting, so reset \pagegoal to the normal \vsize (after the % \endgroup where \vsize got restored). \pagegoal = \vsize } % % Called at the end of the double column material. \def\balancecolumns{% \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. \dimen@ = \ht0 \advance\dimen@ by \topskip \advance\dimen@ by-\baselineskip \divide\dimen@ by 2 % target to split to %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% \splittopskip = \topskip % Loop until we get a decent breakpoint. {% \vbadness = 10000 \loop \global\setbox3 = \copy0 \global\setbox1 = \vsplit3 to \dimen@ \ifdim\ht3>\dimen@ \global\advance\dimen@ by 1pt \repeat }% %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% \setbox0=\vbox to\dimen@{\unvbox1}% \setbox2=\vbox to\dimen@{\unvbox3}% % \pagesofar } \catcode`\@ = \other \message{sectioning,} % Chapters, sections, etc. % Let's start with @part. \outer\parseargdef\part{\partzzz{#1}} \def\partzzz#1{% \chapoddpage \null \vskip.3\vsize % move it down on the page a bit \begingroup \noindent \titlefonts\rmisbold #1\par % the text \let\lastnode=\empty % no node to associate with \writetocentry{part}{#1}{}% but put it in the toc \headingsoff % no headline or footline on the part page \chapoddpage \endgroup } % \unnumberedno is an oxymoron. But we count the unnumbered % sections so that we can refer to them unambiguously in the pdf % outlines by their "section number". We avoid collisions with chapter % numbers by starting them at 10000. (If a document ever has 10000 % chapters, we're in trouble anyway, I'm sure.) \newcount\unnumberedno \unnumberedno = 10000 \newcount\chapno \newcount\secno \secno=0 \newcount\subsecno \subsecno=0 \newcount\subsubsecno \subsubsecno=0 % This counter is funny since it counts through charcodes of letters A, B, ... \newcount\appendixno \appendixno = `\@ % % \def\appendixletter{\char\the\appendixno} % We do the following ugly conditional instead of the above simple % construct for the sake of pdftex, which needs the actual % letter in the expansion, not just typeset. % \def\appendixletter{% \ifnum\appendixno=`A A% \else\ifnum\appendixno=`B B% \else\ifnum\appendixno=`C C% \else\ifnum\appendixno=`D D% \else\ifnum\appendixno=`E E% \else\ifnum\appendixno=`F F% \else\ifnum\appendixno=`G G% \else\ifnum\appendixno=`H H% \else\ifnum\appendixno=`I I% \else\ifnum\appendixno=`J J% \else\ifnum\appendixno=`K K% \else\ifnum\appendixno=`L L% \else\ifnum\appendixno=`M M% \else\ifnum\appendixno=`N N% \else\ifnum\appendixno=`O O% \else\ifnum\appendixno=`P P% \else\ifnum\appendixno=`Q Q% \else\ifnum\appendixno=`R R% \else\ifnum\appendixno=`S S% \else\ifnum\appendixno=`T T% \else\ifnum\appendixno=`U U% \else\ifnum\appendixno=`V V% \else\ifnum\appendixno=`W W% \else\ifnum\appendixno=`X X% \else\ifnum\appendixno=`Y Y% \else\ifnum\appendixno=`Z Z% % The \the is necessary, despite appearances, because \appendixletter is % expanded while writing the .toc file. \char\appendixno is not % expandable, thus it is written literally, thus all appendixes come out % with the same letter (or @) in the toc without it. \else\char\the\appendixno \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} % Each @chapter defines these (using marks) as the number+name, number % and name of the chapter. Page headings and footings can use % these. @section does likewise. \def\thischapter{} \def\thischapternum{} \def\thischaptername{} \def\thissection{} \def\thissectionnum{} \def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count % @raisesections: treat @section as chapter, @subsection as section, etc. \def\raisesections{\global\advance\secbase by -1} \let\up=\raisesections % original BFox name % @lowersections: treat @chapter as section, @section as subsection, etc. \def\lowersections{\global\advance\secbase by 1} \let\down=\lowersections % original BFox name % we only have subsub. \chardef\maxseclevel = 3 % % A numbered section within an unnumbered changes to unnumbered too. % To achieve this, remember the "biggest" unnum. sec. we are currently in: \chardef\unnlevel = \maxseclevel % % Trace whether the current chapter is an appendix or not: % \chapheadtype is "N" or "A", unnumbered chapters are ignored. \def\chapheadtype{N} % Choose a heading macro % #1 is heading type % #2 is heading level % #3 is text for heading \def\genhead#1#2#3{% % Compute the abs. sec. level: \absseclevel=#2 \advance\absseclevel by \secbase % Make sure \absseclevel doesn't fall outside the range: \ifnum \absseclevel < 0 \absseclevel = 0 \else \ifnum \absseclevel > 3 \absseclevel = 3 \fi \fi % The heading type: \def\headtype{#1}% \if \headtype U% \ifnum \absseclevel < \unnlevel \chardef\unnlevel = \absseclevel \fi \else % Check for appendix sections: \ifnum \absseclevel = 0 \edef\chapheadtype{\headtype}% \else \if \headtype A\if \chapheadtype N% \errmessage{@appendix... within a non-appendix chapter}% \fi\fi \fi % Check for numbered within unnumbered: \ifnum \absseclevel > \unnlevel \def\headtype{U}% \else \chardef\unnlevel = 3 \fi \fi % Now print the heading: \if \headtype U% \ifcase\absseclevel \unnumberedzzz{#3}% \or \unnumberedseczzz{#3}% \or \unnumberedsubseczzz{#3}% \or \unnumberedsubsubseczzz{#3}% \fi \else \if \headtype A% \ifcase\absseclevel \appendixzzz{#3}% \or \appendixsectionzzz{#3}% \or \appendixsubseczzz{#3}% \or \appendixsubsubseczzz{#3}% \fi \else \ifcase\absseclevel \chapterzzz{#3}% \or \seczzz{#3}% \or \numberedsubseczzz{#3}% \or \numberedsubsubseczzz{#3}% \fi \fi \fi \suppressfirstparagraphindent } % an interface: \def\numhead{\genhead N} \def\apphead{\genhead A} \def\unnmhead{\genhead U} % @chapter, @appendix, @unnumbered. Increment top-level counter, reset % all lower-level sectioning counters to zero. % % Also set \chaplevelprefix, which we prepend to @float sequence numbers % (e.g., figures), q.v. By default (before any chapter), that is empty. \let\chaplevelprefix = \empty % \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapterzzz#1{% % section resetting is \global in case the chapter is in a group, such % as an @include file. \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\chapno by 1 % % Used for \float. \gdef\chaplevelprefix{\the\chapno.}% \resetallfloatnos % % \putwordChapter can contain complex things in translations. \toks0=\expandafter{\putwordChapter}% \message{\the\toks0 \space \the\chapno}% % % Write the actual heading. \chapmacro{#1}{Ynumbered}{\the\chapno}% % % So @section and the like are numbered underneath this chapter. \global\let\section = \numberedsec \global\let\subsection = \numberedsubsec \global\let\subsubsection = \numberedsubsubsec } \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz % \def\appendixzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\appendixno by 1 \gdef\chaplevelprefix{\appendixletter.}% \resetallfloatnos % % \putwordAppendix can contain complex things in translations. \toks0=\expandafter{\putwordAppendix}% \message{\the\toks0 \space \appendixletter}% % \chapmacro{#1}{Yappendix}{\appendixletter}% % \global\let\section = \appendixsec \global\let\subsection = \appendixsubsec \global\let\subsubsection = \appendixsubsubsec } % normally unnmhead0 calls unnumberedzzz: \outer\parseargdef\unnumbered{\unnmhead0{#1}} \def\unnumberedzzz#1{% \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 \global\advance\unnumberedno by 1 % % Since an unnumbered has no number, no prefix for figures. \global\let\chaplevelprefix = \empty \resetallfloatnos % % This used to be simply \message{#1}, but TeX fully expands the % argument to \message. Therefore, if #1 contained @-commands, TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded @cite (which turns out to cause errors because \cite is meant % to be executed, not expanded). % % Anyway, we don't want the fully-expanded definition of @cite to appear % as a result of the \message, we just want `@cite' itself. We use % \the to achieve this: TeX expands \the only once, % simply yielding the contents of . (We also do this for % the toc entries.) \toks0 = {#1}% \message{(\the\toks0)}% % \chapmacro{#1}{Ynothing}{\the\unnumberedno}% % \global\let\section = \unnumberedsec \global\let\subsection = \unnumberedsubsec \global\let\subsubsection = \unnumberedsubsubsec } % @centerchap is like @unnumbered, but the heading is centered. \outer\parseargdef\centerchap{% % Well, we could do the following in a group, but that would break % an assumption that \chapmacro is called at the outermost level. % Thus we are safer this way: --kasal, 24feb04 \let\centerparametersmaybe = \centerparameters \unnmhead0{#1}% \let\centerparametersmaybe = \relax } % @top is like @unnumbered. \let\top\unnumbered % Sections. % \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz \def\seczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% } % normally calls appendixsectionzzz: \outer\parseargdef\appendixsection{\apphead1{#1}} \def\appendixsectionzzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% } \let\appendixsec\appendixsection % normally calls unnumberedseczzz: \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} \def\unnumberedseczzz#1{% \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% } % Subsections. % % normally calls numberedsubseczzz: \outer\parseargdef\numberedsubsec{\numhead2{#1}} \def\numberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% } % normally calls appendixsubseczzz: \outer\parseargdef\appendixsubsec{\apphead2{#1}} \def\appendixsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno}% } % normally calls unnumberedsubseczzz: \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} \def\unnumberedsubseczzz#1{% \global\subsubsecno=0 \global\advance\subsecno by 1 \sectionheading{#1}{subsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno}% } % Subsubsections. % % normally numberedsubsubseczzz: \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} \def\numberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynumbered}% {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally appendixsubsubseczzz: \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} \def\appendixsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Yappendix}% {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% } % normally unnumberedsubsubseczzz: \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} \def\unnumberedsubsubseczzz#1{% \global\advance\subsubsecno by 1 \sectionheading{#1}{subsubsec}{Ynothing}% {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% } % These macros control what the section commands do, according % to what kind of chapter we are in (ordinary, appendix, or unnumbered). % Define them by default for a numbered chapter. \let\section = \numberedsec \let\subsection = \numberedsubsec \let\subsubsection = \numberedsubsubsec % Define @majorheading, @heading and @subheading \def\majorheading{% {\advance\chapheadingskip by 10pt \chapbreak }% \parsearg\chapheadingzzz } \def\chapheading{\chapbreak \parsearg\chapheadingzzz} \def\chapheadingzzz#1{% \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip \nobreak \suppressfirstparagraphindent } % @heading, @subheading, @subsubheading. \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} \suppressfirstparagraphindent} % These macros generate a chapter, section, etc. heading only % (including whitespace, linebreaking, etc. around it), % given all the information in convenient, parsed form. % Args are the skip and penalty (usually negative) \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} % Parameter controlling skip before chapter headings (if needed) \newskip\chapheadingskip % Define plain chapter starts, and page on/off switching for it. \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} % Because \domark is called before \chapoddpage, the filler page will % get the headings for the next chapter, which is wrong. But we don't % care -- we just disable all headings on the filler page. \def\chapoddpage{% \chappager \ifodd\pageno \else \begingroup \headingsoff \null \chappager \endgroup \fi } \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} \def\CHAPPAGoff{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chapbreak \global\let\pagealignmacro=\chappager} \def\CHAPPAGon{% \global\let\contentsalignmacro = \chappager \global\let\pchapsepmacro=\chappager \global\let\pagealignmacro=\chappager \global\def\HEADINGSon{\HEADINGSsingle}} \def\CHAPPAGodd{% \global\let\contentsalignmacro = \chapoddpage \global\let\pchapsepmacro=\chapoddpage \global\let\pagealignmacro=\chapoddpage \global\def\HEADINGSon{\HEADINGSdouble}} \CHAPPAGon % Chapter opening. % % #1 is the text, #2 is the section type (Ynumbered, Ynothing, % Yappendix, Yomitfromtoc), #3 the chapter number. % % To test against our argument. \def\Ynothingkeyword{Ynothing} \def\Yomitfromtockeyword{Yomitfromtoc} \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% % Insert the first mark before the heading break (see notes for \domark). \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% \gdef\thissection{}}% % \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{\thischaptername}}% \else\ifx\temptype\Yomitfromtockeyword \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% \gdef\thischapter{}}% \else\ifx\temptype\Yappendixkeyword \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\appendixletter}% % \noexpand\putwordAppendix avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordAppendix{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \else \toks0={#1}% \xdef\lastchapterdefs{% \gdef\noexpand\thischaptername{\the\toks0}% \gdef\noexpand\thischapternum{\the\chapno}% % \noexpand\putwordChapter avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thischapter{\noexpand\putwordChapter{} \noexpand\thischapternum: \noexpand\thischaptername}% }% \fi\fi\fi % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert the chapter heading break. \pchapsepmacro % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevchapterdefs=\lastchapterdefs \let\prevsectiondefs=\lastsectiondefs \domark % {% \chapfonts \rmisbold % % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the % \donoderef, because we include the current node name in the toc % entry, and \donoderef resets it to empty. \writetocentry{\toctype}{#1}{#3}% % % For pdftex, we have to write out the node definition (aka, make % the pdfdest) after any page break, but before the actual text has % been typeset. If the destination for the pdf outline is after the % text, then jumping from the outline may wind up with the text not % being visible, for instance under high magnification. \donoderef{#2}% % % Typeset the actual heading. \nobreak % Avoid page breaks at the interline glue. \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% }% \nobreak\bigskip % no page break after a chapter title \nobreak } % @centerchap -- centered and unnumbered. \let\centerparametersmaybe = \relax \def\centerparameters{% \advance\rightskip by 3\rightskip \leftskip = \rightskip \parfillskip = 0pt } % I don't think this chapter style is supported any more, so I'm not % updating it with the new noderef stuff. We'll see. --karl, 11aug03. % \def\setchapterstyle #1 {\csname CHAPF#1\endcsname} % \def\unnchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings #1\par}% \nobreak\bigskip\nobreak } \def\chfopen #1#2{\chapoddpage {\chapfonts \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% \par\penalty 5000 % } \def\centerchfopen #1{% \chapoddpage \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}% \nobreak\bigskip \nobreak } \def\CHAPFopen{% \global\let\chapmacro=\chfopen \global\let\centerchapmacro=\centerchfopen} % Section titles. These macros combine the section number parts and % call the generic \sectionheading to do the printing. % \newskip\secheadingskip \def\secheadingbreak{\dobreak \secheadingskip{-1000}} % Subsection titles. \newskip\subsecheadingskip \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} % Subsubsection titles. \def\subsubsecheadingskip{\subsecheadingskip} \def\subsubsecheadingbreak{\subsecheadingbreak} % Print any size, any type, section title. % % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % \def\seckeyword{sec} % \def\sectionheading#1#2#3#4{% {% \checkenv{}% should not be in an environment. % % Switch to the right set of fonts. \csname #2fonts\endcsname \rmisbold % \def\sectionlevel{#2}% \def\temptype{#3}% % % Insert first mark before the heading break (see notes for \domark). \let\prevsectiondefs=\lastsectiondefs \ifx\temptype\Ynothingkeyword \ifx\sectionlevel\seckeyword \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% \gdef\thissection{\thissectionname}}% \fi \else\ifx\temptype\Yomitfromtockeyword % Don't redefine \thissection. \else\ifx\temptype\Yappendixkeyword \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \else \ifx\sectionlevel\seckeyword \toks0={#1}% \xdef\lastsectiondefs{% \gdef\noexpand\thissectionname{\the\toks0}% \gdef\noexpand\thissectionnum{#4}% % \noexpand\putwordSection avoids expanding indigestible % commands in some of the translations. \gdef\noexpand\thissection{\noexpand\putwordSection{} \noexpand\thissectionnum: \noexpand\thissectionname}% }% \fi \fi\fi\fi % % Go into vertical mode. Usually we'll already be there, but we % don't want the following whatsit to end up in a preceding paragraph % if the document didn't happen to have a blank line. \par % % Output the mark. Pass it through \safewhatsit, to take care of % the preceding space. \safewhatsit\domark % % Insert space above the heading. \csname #2headingbreak\endcsname % % Now the second mark, after the heading break. No break points % between here and the heading. \let\prevsectiondefs=\lastsectiondefs \domark % % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% \gdef\lastsection{#1}% \fi\fi\fi % % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). % Again, see comments in \chapmacro. \donoderef{#3}% % % Interline glue will be inserted when the vbox is completed. % That glue will be a valid breakpoint for the page, since it'll be % preceded by a whatsit (usually from the \donoderef, or from the % \writetocentry if there was no node). We don't want to allow that % break, since then the whatsits could end up on page n while the % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. \nobreak % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright \hangindent=\wd0 % zero if no section number \unhbox0 #1}% }% % Add extra space after the heading -- half of whatever came above it. % Don't allow stretch, though. \kern .5 \csname #2headingskip\endcsname % % Do not let the kern be a potential breakpoint, as it would be if it % was followed by glue. \nobreak % % We'll almost certainly start a paragraph next, so don't let that % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) However, when a paragraph is not started next % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out % or the negative glue will cause weirdly wrong output, typically % obscuring the section heading with something else. \vskip-\parskip % % This is so the last item on the main vertical list is a known % \penalty > 10000, so \startdefun, etc., can recognize the situation % and do the needful. \penalty 10001 } \message{toc,} % Table of contents. \newwrite\tocfile % Write an entry to the toc file, opening it if necessary. % Called from @chapter, etc. % % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} % We append the current node name (if any) and page number as additional % arguments for the \{chap,sec,...}entry macros which will eventually % read this. The node name is used in the pdf outlines as the % destination to jump to. % % We open the .toc file for writing here instead of at @setfilename (or % any other fixed time) so that @contents can be anywhere in the document. % But if #1 is `omit', then we don't do anything. This is used for the % table of contents chapter openings themselves. % \newif\iftocfileopened \def\omitkeyword{omit}% % \def\writetocentry#1#2#3{% \edef\writetoctype{#1}% \ifx\writetoctype\omitkeyword \else \iftocfileopened\else \immediate\openout\tocfile = \jobname.toc \global\tocfileopenedtrue \fi % \iflinks {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp }% \fi \fi % % Tell \shipout to create a pdf destination on each page, if we're % writing pdf. These are used in the table of contents. We can't % just write one on every page because the title pages are numbered % 1 and 2 (the page numbers aren't printed), and so are the first % two pages of the document. Thus, we'd have two destinations named % `1', and two named `2'. \ifpdf \global\pdfmakepagedesttrue \fi } % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. % \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active \catcode`\<=\active \catcode`\>=\active \catcode`\\=\active \catcode`\^=\active \catcode`\_=\active \catcode`\|=\active \catcode`\~=\active } % Read the toc file, which is essentially Texinfo input. \def\readtocfile{% \setupdatafile \activecatcodes \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in \newcount\savepageno \newcount\lastnegativepageno \lastnegativepageno = -1 % Prepare to read what we've written to \tocfile. % \def\startcontents#1{% % If @setchapternewpage on, and @headings double, the contents should % start on an odd page, unlike chapters. Thus, we maintain % \contentsalignmacro in parallel with \pagealignmacro. % From: Torbjorn Granlund \contentsalignmacro \immediate\closeout\tocfile % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno \begingroup % Set up to handle contents files properly. \raggedbottom % Worry more about breakpoints than the bottom. \advance\hsize by -\contentsrightmargin % Don't use the full line length. % % Roman numerals for page numbers. \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. % \def\tocreadfilename{\jobname.toc} % Normal (long) toc. % \def\contents{% \startcontents{\putwordTOC}% \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \ifeof 1 \else \pdfmakeoutlines \fi \closein 1 \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } % And just the chapters. \def\summarycontents{% \startcontents{\putwordShortTOC}% % \let\partentry = \shortpartentry \let\numchapentry = \shortchapentry \let\appentry = \shortchapentry \let\unnchapentry = \shortunnchapentry % We want a true roman here for the page numbers. \secfonts \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl \let\tt=\shortconttt \rm \hyphenpenalty = 10000 \advance\baselineskip by 1pt % Open it up a little. \def\numsecentry##1##2##3##4{} \let\appsecentry = \numsecentry \let\unnsecentry = \numsecentry \let\numsubsecentry = \numsecentry \let\appsubsecentry = \numsecentry \let\unnsubsecentry = \numsecentry \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi \closein 1 \vfill \eject \contentsalignmacro % in case @setchapternewpage odd is in effect \endgroup \lastnegativepageno = \pageno \global\pageno = \savepageno } \let\shortcontents = \summarycontents % Typeset the label for a chapter or appendix for the short contents. % The arg is, e.g., `A' for an appendix, or `3' for a chapter. % \def\shortchaplabel#1{% % This space should be enough, since a single number is .5em, and the % widest letter (M) is 1em, at least in the Computer Modern fonts. % But use \hss just in case. % (This space doesn't include the extra space that gets added after % the label; that gets put in by \shortchapentry above.) % % We'd like to right-justify chapter numbers, but that looks strange % with appendix letters. And right-justifying numbers and % left-justifying letters looks strange when there is less than 10 % chapters. Have to read the whole toc once to know how many chapters % there are before deciding ... \hbox to 1em{#1\hss}% } % These macros generate individual entries in the table of contents. % The first argument is the chapter or section name. % The last argument is the page number. % The arguments in between are the chapter number, section number, ... % Parts, in the main contents. Replace the part number, which doesn't % exist, with an empty box. Let's hope all the numbers have the same width. % Also ignore the page number, which is conventionally not printed. \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} % % Parts, in the short toc. \def\shortpartentry#1#2#3#4{% \penalty-300 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip \shortchapentry{{\bf #1}}{\numeralbox}{}{}% } % Chapters, in the main contents. \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} % % Chapters, in the short toc. % See comments in \dochapentry re vbox and related settings. \def\shortchapentry#1#2#3#4{% \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% } % Appendices, in the main contents. % Need the word Appendix, and a fixed-size box. % \def\appendixbox#1{% % We use M since it's probably the widest letter. \setbox0 = \hbox{\putwordAppendix{} M}% \hbox to \wd0{\putwordAppendix{} #1\hss}} % \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} % Unnumbered chapters. \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} % Sections. \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} \let\appsecentry=\numsecentry \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} % Subsections. \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} \let\appsubsecentry=\numsubsecentry \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} % And subsubsections. \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} \let\appsubsubsecentry=\numsubsubsecentry \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} % This parameter controls the indentation of the various levels. % Same as \defaultparindent. \newdimen\tocindent \tocindent = 15pt % Now for the actual typesetting. In all these, #1 is the text and #2 is the % page number. % % If the toc has to be broken over pages, we want it to be at chapters % if at all possible; hence the \penalty. \def\dochapentry#1#2{% \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip \begingroup \chapentryfonts \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup \nobreak\vskip .25\baselineskip plus.1\baselineskip } \def\dosecentry#1#2{\begingroup \secentryfonts \leftskip=\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsecentry#1#2{\begingroup \subsecentryfonts \leftskip=2\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} \def\dosubsubsecentry#1#2{\begingroup \subsubsecentryfonts \leftskip=3\tocindent \tocentry{#1}{\dopageno\bgroup#2\egroup}% \endgroup} % We use the same \entry macro as for the index entries. \let\tocentry = \entry % Space between chapter (or whatever) number and the title. \def\labelspace{\hskip1em \relax} \def\dopageno#1{{\rm #1}} \def\doshortpageno#1{{\rm #1}} \def\chapentryfonts{\secfonts \rm} \def\secentryfonts{\textfonts} \def\subsecentryfonts{\textfonts} \def\subsubsecentryfonts{\textfonts} \message{environments,} % @foo ... @end foo. % @tex ... @end tex escapes into raw TeX temporarily. % One exception: @ is still an escape character, so that @end tex works. % But \@ or @@ will get a plain @ character. \envdef\tex{% \setupmarkupstyle{tex}% \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie \catcode `\%=14 \catcode `\+=\other \catcode `\"=\other \catcode `\|=\other \catcode `\<=\other \catcode `\>=\other \catcode`\`=\other \catcode`\'=\other \escapechar=`\\ % % ' is active in math mode (mathcode"8000). So reset it, and all our % other math active characters (just in case), to plain's definitions. \mathactive % \let\b=\ptexb \let\bullet=\ptexbullet \let\c=\ptexc \let\,=\ptexcomma \let\.=\ptexdot \let\dots=\ptexdots \let\equiv=\ptexequiv \let\!=\ptexexclam \let\i=\ptexi \let\indent=\ptexindent \let\noindent=\ptexnoindent \let\{=\ptexlbrace \let\+=\tabalign \let\}=\ptexrbrace \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% \def\@{@}% } % There is no need to define \Etex. % Define @lisp ... @end lisp. % @lisp environment forms a group so it can rebind things, % including the definition of @end lisp (which normally is erroneous). % Amount to narrow the margins by for @lisp. \newskip\lispnarrowing \lispnarrowing=0.4in % This is the definition that ^^M gets inside @lisp, @example, and other % such environments. \null is better than a space, since it doesn't % have any width. \def\lisppar{\null\endgraf} % This space is always present above and below environments. \newskip\envskipamount \envskipamount = 0pt % Make spacing and below environment symmetrical. We use \parskip here % to help in doing that, since in @example-like environments \parskip % is reset to zero; thus the \afterenvbreak inserts no space -- but the % start of the next paragraph will insert \parskip. % \def\aboveenvbreak{{% % =10000 instead of <10000 because of a special case in \itemzzz and % \sectionheading, q.v. \ifnum \lastpenalty=10000 \else \advance\envskipamount by \parskip \endgraf \ifdim\lastskip<\envskipamount \removelastskip % it's not a good place to break if the last penalty was \nobreak % or better ... \ifnum\lastpenalty<10000 \penalty-50 \fi \vskip\envskipamount \fi \fi }} \let\afterenvbreak = \aboveenvbreak % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will % also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around % environment contents. \font\circle=lcircle10 \newdimen\circthick \newdimen\cartouter\newdimen\cartinner \newskip\normbskip\newskip\normpskip\newskip\normlskip \circthick=\fontdimen8\circle % \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth \def\ctr{{\hskip 6pt\circle\char'010}} \def\cbl{{\circle\char'012\hskip -6pt}} \def\cbr{{\hskip 6pt\circle\char'011}} \def\carttop{\hbox to \cartouter{\hskip\lskip \ctl\leaders\hrule height\circthick\hfil\ctr \hskip\rskip}} \def\cartbot{\hbox to \cartouter{\hskip\lskip \cbl\leaders\hrule height\circthick\hfil\cbr \hskip\rskip}} % \newskip\lskip\newskip\rskip \envdef\cartouche{% \ifhmode\par\fi % can't be in the midst of a paragraph. \startsavinginserts \lskip=\leftskip \rskip=\rightskip \leftskip=0pt\rightskip=0pt % we want these *outside*. \cartinner=\hsize \advance\cartinner by-\lskip \advance\cartinner by-\rskip \cartouter=\hsize \advance\cartouter by 18.4pt % allow for 3pt kerns on either % side, and for 6pt waste from % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. \let\nonarrowing = t% % % If this cartouche directly follows a sectioning command, we need the % \parskip glue (backspaced over by default) or the cartouche can % collide with the section heading. \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi % \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop \hbox\bgroup \hskip\lskip \vrule\kern3pt \vbox\bgroup \kern3pt \hsize=\cartinner \baselineskip=\normbskip \lineskip=\normlskip \parskip=\normpskip \vskip -\parskip \comment % For explanation, see the end of def\group. } \def\Ecartouche{% \ifhmode\par\fi \kern3pt \egroup \kern3pt\vrule \hskip\rskip \egroup \cartbot \egroup \checkinserts } % This macro is called at the beginning of all the @example variants, % inside a group. \newdimen\nonfillparindent \def\nonfillstart{% \aboveenvbreak \hfuzz = 12pt % Don't be fussy \sepspaces % Make spaces be word-separators rather than space tokens. \let\par = \lisppar % don't ignore blank lines \obeylines % each line of input is a line of output \parskip = 0pt % Turn off paragraph indentation but redefine \indent to emulate % the normal \indent. \nonfillparindent=\parindent \parindent = 0pt \let\indent\nonfillindent % \emergencystretch = 0pt % don't try to avoid overfull boxes \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing \else \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } \begingroup \obeyspaces % We want to swallow spaces (but not other tokens) after the fake % @indent in our nonfill-environments, where spaces are normally % active and set to @tie, resulting in them not being ignored after % @indent. \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}% \gdef\nonfillindentcheck{% \ifx\temp % \expandafter\nonfillindentgobble% \else% \leavevmode\nonfillindentbox% \fi% }% \endgroup \def\nonfillindentgobble#1{\nonfillindent} \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}} % If you want all examples etc. small: @set dispenvsize small. % If you want even small examples the full size: @set dispenvsize nosmall. % This affects the following displayed environments: % @example, @display, @format, @lisp % \def\smallword{small} \def\nosmallword{nosmall} \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword % end paragraph for sake of leading, in case document has no blank % line. This is redundant with what happens in \aboveenvbreak, but % we need to do it before changing the fonts, and it's inconvenient % to change the fonts afterward. \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } % We often define two environments, @foo and @smallfoo. % Let's do it in one command. #1 is the env name, #2 the definition. \def\makedispenvdef#1#2{% \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% \expandafter\let\csname E#1\endcsname \afterenvbreak \expandafter\let\csname Esmall#1\endcsname \afterenvbreak } % Define two environment synonyms (#1 and #2) for an environment. \def\maketwodispenvdef#1#2#3{% \makedispenvdef{#1}{#3}% \makedispenvdef{#2}{#3}% } % % @lisp: indented, narrowed, typewriter font; % @example: same as @lisp. % % @smallexample and @smalllisp: use smaller fonts. % Originally contributed by Pavel@xerox. % \maketwodispenvdef{lisp}{example}{% \nonfillstart \tt\setupmarkupstyle{example}% \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenvdef{display}{% \nonfillstart \gobble } % @format/@smallformat: same as @display except don't narrow margins. % \makedispenvdef{format}{% \let\nonarrowing = t% \nonfillstart \gobble } % @flushleft: same as @format, but doesn't obey \SETdispenvsize. \envdef\flushleft{% \let\nonarrowing = t% \nonfillstart \gobble } \let\Eflushleft = \afterenvbreak % @flushright. % \envdef\flushright{% \let\nonarrowing = t% \nonfillstart \advance\leftskip by 0pt plus 1fill\relax \gobble } \let\Eflushright = \afterenvbreak % @raggedright does more-or-less normal line breaking but no right % justification. From plain.tex. \envdef\raggedright{% \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax } \let\Eraggedright\par \envdef\raggedleft{% \parindent=0pt \leftskip0pt plus2em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedleft\par \envdef\raggedcenter{% \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt \hbadness=10000 % Last line will usually be underfull, so turn off % badness reporting. } \let\Eraggedcenter\par % @quotation does normal linebreaking (hence we can't use \nonfillstart) % and narrows the margins. We keep \parskip nonzero in general, since % we're doing normal filling. So, when using \aboveenvbreak and % \afterenvbreak, temporarily make \parskip 0. % \makedispenvdef{quotation}{\quotationstart} % \def\quotationstart{% \indentedblockstart % same as \indentedblock, but increase right margin too. \ifx\nonarrowing\relax \advance\rightskip by \lispnarrowing \fi \parsearg\quotationlabel } % We have retained a nonzero parskip for the environment, since we're % doing normal filling. % \def\Equotation{% \par \ifx\quotationauthor\thisisundefined\else % indent a bit. \leftline{\kern 2\leftskip \sl ---\quotationauthor}% \fi {\parskip=0pt \afterenvbreak}% } \def\Esmallquotation{\Equotation} % If we're given an argument, typeset it in bold with a colon after. \def\quotationlabel#1{% \def\temp{#1}% \ifx\temp\empty \else {\bf #1: }% \fi } % @indentedblock is like @quotation, but indents only on the left and % has no optional argument. % \makedispenvdef{indentedblock}{\indentedblockstart} % \def\indentedblockstart{% {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip \parindent=0pt % % @cartouche defines \nonarrowing to inhibit narrowing at next level down. \ifx\nonarrowing\relax \advance\leftskip by \lispnarrowing \exdentamount = \lispnarrowing \else \let\nonarrowing = \relax \fi } % Keep a nonzero parskip for the environment, since we're doing normal filling. % \def\Eindentedblock{% \par {\parskip=0pt \afterenvbreak}% } \def\Esmallindentedblock{\Eindentedblock} % LaTeX-like @verbatim...@end verbatim and @verb{...} % If we want to allow any as delimiter, % we need the curly braces so that makeinfo sees the @verb command, eg: % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org % % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. % % [Knuth] p.344; only we need to do the other characters Texinfo sets % active too. Otherwise, they get lost as the first character on a % verbatim line. \def\dospecials{% \do\ \do\\\do\{\do\}\do\$\do\&% \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% \do\<\do\>\do\|\do\@\do+\do\"% % Don't do the quotes -- if we do, @set txicodequoteundirected and % @set txicodequotebacktick will not have effect on @verb and % @verbatim, and ?` and !` ligatures won't get disabled. %\do\`\do\'% } % % [Knuth] p. 380 \def\uncatcodespecials{% \def\do##1{\catcode`##1=\other}\dospecials} % % Setup for the @verb command. % % Eight spaces for a tab \begingroup \catcode`\^^I=\active \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} \endgroup % \def\setupverb{% \tt % easiest (and conventionally used) font for verbatim \def\par{\leavevmode\endgraf}% \setupmarkupstyle{verb}% \tabeightspaces % Respect line breaks, % print special symbols as themselves, and % make each space count % must do in this order: \obeylines \uncatcodespecials \sepspaces } % Setup for the @verbatim environment % % Real tab expansion. \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % % We typeset each line of the verbatim in an \hbox, so we can handle % tabs. The \global is in case the verbatim line starts with an accent, % or some other command that starts with a begin-group. Otherwise, the % entire \verbbox would disappear at the corresponding end-group, before % it is typeset. Meanwhile, we can't have nested verbatim commands % (can we?), so the \global won't be overwriting itself. \newbox\verbbox \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} % \begingroup \catcode`\^^I=\active \gdef\tabexpand{% \catcode`\^^I=\active \def^^I{\leavevmode\egroup \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab \divide\dimen\verbbox by\tabw \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox }% } \endgroup % start the verbatim environment. \def\setupverbatim{% \let\nonarrowing = t% \nonfillstart \tt % easiest (and conventionally used) font for verbatim % The \leavevmode here is for blank lines. Otherwise, we would % never \starttabox and the \egroup would end verbatim mode. \def\par{\leavevmode\egroup\box\verbbox\endgraf}% \tabexpand \setupmarkupstyle{verbatim}% % Respect line breaks, % print special symbols as themselves, and % make each space count. % Must do in this order: \obeylines \uncatcodespecials \sepspaces \everypar{\starttabbox}% } % Do the @verb magic: verbatim text is quoted by unique % delimiter characters. Before first delimiter expect a % right brace, after last delimiter expect closing brace: % % \def\doverb'{'#1'}'{#1} % % [Knuth] p. 382; only eat outer {} \begingroup \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] \endgroup % \def\verb{\begingroup\setupverb\doverb} % % % Do the @verbatim magic: define the macro \doverbatim so that % the (first) argument ends when '@end verbatim' is reached, ie: % % \def\doverbatim#1@end verbatim{#1} % % For Texinfo it's a lot easier than for LaTeX, % because texinfo's \verbatim doesn't stop at '\end{verbatim}': % we need not redefine '\', '{' and '}'. % % Inspired by LaTeX's verbatim command set [latex.ltx] % \begingroup \catcode`\ =\active \obeylines % % ignore everything up to the first ^^M, that's the newline at the end % of the @verbatim input line itself. Otherwise we get an extra blank % line in the output. \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% % We really want {...\end verbatim} in the body of the macro, but % without the active space; thus we have to use \xdef and \gobble. \endgroup % \envdef\verbatim{% \setupverbatim\doverbatim } \let\Everbatim = \afterenvbreak % @verbatiminclude FILE - insert text of file in verbatim environment. % \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} % \def\doverbatiminclude#1{% {% \makevalueexpandable \setupverbatim \indexnofonts % Allow `@@' and other weird things in file names. \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% \input #1 \afterenvbreak }% } % @copying ... @end copying. % Save the text away for @insertcopying later. % % We save the uninterpreted tokens, rather than creating a box. % Saving the text in a box would be much easier, but then all the % typesetting commands (@smallbook, font changes, etc.) have to be done % beforehand -- and a) we want @copying to be done first in the source % file; b) letting users define the frontmatter in as flexible order as % possible is very desirable. % \def\copying{\checkenv{}\begingroup\scanargctxt\docopying} \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} % \def\insertcopying{% \begingroup \parindent = 0pt % paragraph indentation looks wrong on title page \scanexp\copyingtext \endgroup } \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt \newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak \defunpenalty=10003 % Will keep this @deffn together with the % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. % % As a further refinement, we avoid "club" headers by signalling % with penalty of 10003 after the very first @deffn in the % sequence (see above), and penalty of 10002 after any following % @def command. \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. \medskip % preceded by discardable penalty, so not a breakpoint \fi % \parindent=0in \advance\leftskip by \defbodyindent \exdentamount=\defbodyindent } \def\dodefunx#1{% % First, check whether we are in the right environment: \checkenv#1% % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% } \def\gobbledefun#1\startdefun{} % \printdefunline \deffnheader{text} % \def\printdefunline#1#2{% \begingroup % call \deffnheader: #1#2 \endheader % common ending: \interlinepenalty = 10000 \advance\rightskip by 0pt plus 1fil\relax \endgraf \nobreak\vskip -\parskip \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts \endgroup } \def\Edefun{\endgraf\medbreak} % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; % the only thing remaining is to define \deffnheader. % \def\makedefun#1{% \expandafter\let\csname E#1\endcsname = \Edefun \edef\temp{\noexpand\domakedefun \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% \temp } % \domakedefun \deffn \deffnx \deffnheader % % Define \deffn and \deffnx, without parameters. % \deffnheader has to be defined explicitly. % \def\domakedefun#1#2#3{% \envdef#1{% \startdefun \doingtypefnfalse % distinguish typed functions from all else \parseargusing\activeparens{\printdefunline#3}% }% \def#2{\dodefunx#1}% \def#3% } \newif\ifdoingtypefn % doing typed function? \newif\ifrettypeownline % typeset return type on its own line? % @deftypefnnewline on|off says whether the return type of typed functions % are printed on their own line. This affects @deftypefn, @deftypefun, % @deftypeop, and @deftypemethod. % \parseargdef\deftypefnnewline{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETtxideftypefnnl\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETtxideftypefnnl\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @txideftypefnnl value `\temp', must be on|off}% \fi\fi } % Untyped functions: % @deffn category name args \makedefun{deffn}{\deffngeneral{}} % @deffn category class name args \makedefun{defop}#1 {\defopon{#1\ \putwordon}} % \defopon {category on}class name args \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deffngeneral {subind}category name args % \def\deffngeneral#1#2 #3 #4\endheader{% % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. \dosubind{fn}{\code{#3}}{#1}% \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% } % Typed functions: % @deftypefn category type name args \makedefun{deftypefn}{\deftypefngeneral{}} % @deftypeop category class type name args \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} % \deftypeopon {category on}class type name args \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } % \deftypefngeneral {subind}category type name args % \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% \dosubind{fn}{\code{#4}}{#1}% \doingtypefntrue \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Typed variables: % @deftypevr category type var args \makedefun{deftypevr}{\deftypecvgeneral{}} % @deftypecv category class type var args \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} % \deftypecvof {category of}class type var args \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } % \deftypecvgeneral {subind}category type var args % \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% \dosubind{vr}{\code{#4}}{#1}% \defname{#2}{#3}{#4}\defunargs{#5\unskip}% } % Untyped variables: % @defvr category var args \makedefun{defvr}#1 {\deftypevrheader{#1} {} } % @defcv category class var args \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} % \defcvof {category of}class var args \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } % Types: % @deftp category name args \makedefun{deftp}#1 #2 #3\endheader{% \doind{tp}{\code{#2}}% \defname{#1}{}{#2}\defunargs{#3\unskip}% } % Remaining @defun-like shortcuts: \makedefun{defun}{\deffnheader{\putwordDeffunc} } \makedefun{defmac}{\deffnheader{\putwordDefmac} } \makedefun{defspec}{\deffnheader{\putwordDefspec} } \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } \makedefun{defvar}{\defvrheader{\putwordDefvar} } \makedefun{defopt}{\defvrheader{\putwordDefopt} } \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } \makedefun{defmethod}{\defopon\putwordMethodon} \makedefun{deftypemethod}{\deftypeopon\putwordMethodon} \makedefun{defivar}{\defcvof\putwordInstanceVariableof} \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} % \defname, which formats the name of the @def (not the args). % #1 is the category, such as "Function". % #2 is the return type, if any. % #3 is the function name. % % We are followed by (but not passed) the arguments, if any. % \def\defname#1#2#3{% \par % Get the values of \leftskip and \rightskip as they were outside the @def... \advance\leftskip by -\defbodyindent % % Determine if we are typesetting the return type of a typed function % on a line by itself. \rettypeownlinefalse \ifdoingtypefn % doing a typed function specifically? % then check user option for putting return type on its own line: \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else \rettypeownlinetrue \fi \fi % % How we'll format the category name. Putting it in brackets helps % distinguish it from the body text that may end up on the next line % just below it. \def\temp{#1}% \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} % % Figure out line sizes for the paragraph shape. We'll always have at % least two. \tempnum = 2 % % The first line needs space for \box0; but if \rightskip is nonzero, % we need only space for the part of \box0 which exceeds it: \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip % % If doing a return type on its own line, we'll have another line. \ifrettypeownline \advance\tempnum by 1 \def\maybeshapeline{0in \hsize}% \else \def\maybeshapeline{}% \fi % % The continuations: \dimen2=\hsize \advance\dimen2 by -\defargsindent % % The final paragraph shape: \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 % % Put the category name at the right margin. \noindent \hbox to 0pt{% \hfil\box0 \kern-\hsize % \hsize has to be shortened this way: \kern\leftskip % Intentionally do not respect \rightskip, since we need the space. }% % % Allow all lines to be underfull without complaint: \tolerance=10000 \hbadness=10000 \exdentamount=\defbodyindent {% % defun fonts. We use typewriter by default (used to be bold) because: % . we're printing identifiers, they should be in tt in principle. % . in languages with many accents, such as Czech or French, it's % common to leave accents off identifiers. The result looks ok in % tt, but exceedingly strange in rm. % . we don't want -- and --- to be treated as ligatures. % . this still does not fix the ?` and !` ligatures, but so far no % one has made identifiers using them :). \df \tt \def\temp{#2}% text of the return type \ifx\temp\empty\else \tclose{\temp}% typeset the return type \ifrettypeownline % put return type on its own line; prohibit line break following: \hfil\vadjust{\nobreak}\break \else \space % type on same line, so just followed by a space \fi \fi % no return type #3% output function name }% {\rm\enskip}% hskip 0.5 em of \tenrm % \boldbrax % arguments will be output next, if any. } % Print arguments in slanted roman (not ttsl), inconsistently with using % tt for the name. This is because literal text is sometimes needed in % the argument list (groff manual), and ttsl and tt are not very % distinguishable. Prevent hyphenation at `-' chars. % \def\defunargs#1{% % use sl by default (not ttsl), % tt for the names. \df \sl \hyphenchar\font=0 % % On the other hand, if an argument has two dashes (for instance), we % want a way to get ttsl. We used to recommend @var for that, so % leave the code in, but it's strange for @var to lead to typewriter. % Nowadays we recommend @code, since the difference between a ttsl hyphen % and a tt hyphen is pretty tiny. @code also disables ?` !`. \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}% #1% \sl\hyphenchar\font=45 } % We want ()&[] to print specially on the defun line. % \def\activeparens{% \catcode`\(=\active \catcode`\)=\active \catcode`\[=\active \catcode`\]=\active \catcode`\&=\active } % Make control sequences which act like normal parenthesis chars. \let\lparen = ( \let\rparen = ) % Be sure that we always have a definition for `(', etc. For example, % if the fn name has parens in it, \boldbrax will not be in effect yet, % so TeX would otherwise complain about undefined control sequence. { \activeparens \global\let(=\lparen \global\let)=\rparen \global\let[=\lbrack \global\let]=\rbrack \global\let& = \& \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} \gdef\magicamp{\let&=\amprm} } \newcount\parencount % If we encounter &foo, then turn on ()-hacking afterwards \newif\ifampseen \def\amprm#1 {\ampseentrue{\bf\ }} \def\parenfont{% \ifampseen % At the first level, print parens in roman, % otherwise use the default font. \ifnum \parencount=1 \rm \fi \else % The \sf parens (in \boldbrax) actually are a little bolder than % the contained text. This is especially needed for [ and ] . \sf \fi } \def\infirstlevel#1{% \ifampseen \ifnum\parencount=1 #1% \fi \fi } \def\bfafterword#1 {#1 \bf} \def\opnr{% \global\advance\parencount by 1 {\parenfont(}% \infirstlevel \bfafterword } \def\clnr{% {\parenfont)}% \infirstlevel \sl \global\advance\parencount by -1 } \newcount\brackcount \def\lbrb{% \global\advance\brackcount by 1 {\bf[}% } \def\rbrb{% {\bf]}% \global\advance\brackcount by -1 } \def\checkparencounts{% \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } % these should not use \errmessage; the glibc manual, at least, actually % has such constructs (when documenting function pointers). \def\badparencount{% \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } \message{macros,} % @macro. % To do this right we need a feature of e-TeX, \scantokens, % which we arrange to emulate with a temporary file in ordinary TeX. \ifx\eTeXversion\thisisundefined \newwrite\macscribble \def\scantokens#1{% \toks0={#1}% \immediate\openout\macscribble=\jobname.tmp \immediate\write\macscribble{\the\toks0}% \immediate\closeout\macscribble \input \jobname.tmp } \fi \def\scanmacro#1{\begingroup \newlinechar`\^^M \let\xeatspaces\eatspaces % % Undo catcode changes of \startcontents and \doprintindex % When called from @insertcopying or (short)caption, we need active % backslash to get it printed correctly. Previously, we had % \catcode`\\=\other instead. We'll see whether a problem appears % with macro expansion. --kasal, 19aug04 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ % % ... and for \example: \spaceisspace % % The \empty here causes a following catcode 5 newline to be eaten as % part of reading whitespace after a control sequence. It does not % eat a catcode 13 newline. There's no good way to handle the two % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX % would then have different behavior). See the Macro Details node in % the manual for the workaround we recommend for macros and % line-oriented commands. % \scantokens{#1\empty}% \endgroup} \def\scanexp#1{% \edef\temp{\noexpand\scanmacro{#1}}% \temp } \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? % List of all defined macros in the form % \definedummyword\macro1\definedummyword\macro2... % Currently is also contains all @aliases; the list can be split % if there is a need. \def\macrolist{} % Add the macro to \macrolist \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} \def\addtomacrolistxxx#1{% \toks0 = \expandafter{\macrolist\definedummyword#1}% \xdef\macrolist{\the\toks0}% } % Utility routines. % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). % \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname \csname#2\endcsname } % Trim leading and trailing spaces off a string. % Concepts from aro-bend problem 15 (see CTAN). {\catcode`\@=11 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} \def\unbrace#1{#1} \unbrace{\gdef\trim@@@ #1 } #2@{#1} } % Trim a single trailing ^^M off a string. {\catcode`\^^M=\other \catcode`\Q=3% \gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcrb#1Q#2Q{#1}% } % Macro bodies are absorbed as an argument in a context where % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \ % to recognize macro arguments; this is the job of \mbodybackslash. % % Non-ASCII encodings make 8-bit characters active, so un-activate % them to avoid their expansion. Must do this non-globally, to % confine the change to the current group. % % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. % \def\scanctxt{% used as subroutine \catcode`\"=\other \catcode`\+=\other \catcode`\<=\other \catcode`\>=\other \catcode`\@=\other \catcode`\^=\other \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% used for copying and captions, not macros. \scanctxt \catcode`\\=\other \catcode`\^^M=\other } \def\macrobodyctxt{% used for @macro definitions \scanctxt \catcode`\{=\other \catcode`\}=\other \catcode`\^^M=\other \usembodybackslash } \def\macroargctxt{% used when scanning invocations \scanctxt \catcode`\\=0 } % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" % for the single characters \ { }. Thus, we end up with the "commands" % that would be written @\ @{ @} in a Texinfo document. % % We already have @{ and @}. For @\, we define it here, and only for % this purpose, to produce a typewriter backslash (so, the @\ that we % define for @math can't be used with @macro calls): % \def\\{\normalbackslash}% % % We would like to do this for \, too, since that is what makeinfo does. % But it is not possible, because Texinfo already has a command @, for a % cedilla accent. Documents must use @comma{} instead. % % \anythingelse will almost certainly be an error of some kind. % \mbodybackslash is the definition of \ in @macro bodies. % It maps \foo\ => \csname macarg.foo\endcsname => #N % where N is the macro parameter number. % We define \csname macarg.\endcsname to be \realbackslash, so % \\ in macro replacement text gets you a backslash. % {\catcode`@=0 @catcode`@\=@active @gdef@usembodybackslash{@let\=@mbodybackslash} @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} } \expandafter\def\csname macarg.\endcsname{\realbackslash} \def\margbackslash#1{\char`\#1 } \def\macro{\recursivefalse\parsearg\macroxxx} \def\rmacro{\recursivetrue\parsearg\macroxxx} \def\macroxxx#1{% \getargs{#1}% now \macname is the macname and \argl the arglist \ifx\argl\empty % no arguments \paramno=0\relax \else \expandafter\parsemargdef \argl;% \if\paramno>256\relax \ifx\eTeXversion\thisisundefined \errhelp = \EMsimple \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} \fi \fi \fi \if1\csname ismacro.\the\macname\endcsname \message{Warning: redefining \the\macname}% \else \expandafter\ifx\csname \the\macname\endcsname \relax \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody \else \expandafter\parsemacbody \fi} \parseargdef\unmacro{% \if1\csname ismacro.#1\endcsname \global\cslet{#1}{macsave.#1}% \global\expandafter\let \csname ismacro.#1\endcsname=0% % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else \errmessage{Macro #1 not defined}% \fi } % Called by \do from \dounmacro on each macro. The idea is to omit any % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% \ifx #1\relax % remove this \else \noexpand\definedummyword \noexpand#1% \fi } % This makes use of the obscure feature that if the last token of a % is #, then the preceding argument is delimited by % an opening brace, and that opening brace is not consumed. \def\getargs#1{\getargsxxx#1{}} \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} \def\getmacname#1 #2\relax{\macname={#1}} \def\getmacargs#1{\def\argl{#1}} % For macro processing make @ a letter so that we can make Texinfo private macro names. \edef\texiatcatcode{\the\catcode`\@} \catcode `@=11\relax % Parse the optional {params} list. Set up \paramno and \paramlist % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH % in the params list to some hook where the argument si to be expanded. If % there are less than 10 arguments that hook is to be replaced by ##N where N % is the position in that list, that is to say the macro arguments are to be % defined `a la TeX in the macro body. % % That gets used by \mbodybackslash (above). % % We need to get `macro parameter char #' into several definitions. % The technique used is stolen from LaTeX: let \hash be something % unexpandable, insert that wherever you need a #, and then redefine % it to # just before using the token list produced. % % The same technique is used to protect \eatspaces till just before % the macro is used. % % If there are 10 or more arguments, a different technique is used, where the % hook remains in the body, and when macro is to be expanded the body is % processed again to replace the arguments. % % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the % argument N value and then \edef the body (nothing else will expand because of % the catcode regime underwhich the body was input). % % If you compile with TeX (not eTeX), and you have macros with 10 or more % arguments, you need that no macro has more than 256 arguments, otherwise an % error is produced. \def\parsemargdef#1;{% \paramno=0\def\paramlist{}% \let\hash\relax \let\xeatspaces\relax \parsemargdefxxx#1,;,% % In case that there are 10 or more arguments we parse again the arguments % list to set new definitions for the \macarg.BLAH macros corresponding to % each BLAH argument. It was anyhow needed to parse already once this list % in order to count the arguments, and as macros with at most 9 arguments % are by far more frequent than macro with 10 or more arguments, defining % twice the \macarg.BLAH macros does not cost too much processing power. \ifnum\paramno<10\relax\else \paramno0\relax \parsemmanyargdef@@#1,;,% 10 or more arguments \fi } \def\parsemargdefxxx#1,{% \if#1;\let\next=\relax \else \let\next=\parsemargdefxxx \advance\paramno by 1 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname {\xeatspaces{\hash\the\paramno}}% \edef\paramlist{\paramlist\hash\the\paramno,}% \fi\next} \def\parsemmanyargdef@@#1,{% \if#1;\let\next=\relax \else \let\next=\parsemmanyargdef@@ \edef\tempb{\eatspaces{#1}}% \expandafter\def\expandafter\tempa \expandafter{\csname macarg.\tempb\endcsname}% % Note that we need some extra \noexpand\noexpand, this is because we % don't want \the to be expanded in the \parsermacbody as it uses an % \xdef . \expandafter\edef\tempa {\noexpand\noexpand\noexpand\the\toks\the\paramno}% \advance\paramno by 1\relax \fi\next} % These two commands read recursive and nonrecursive macro bodies. % (They're different since rec and nonrec macros end differently.) % \catcode `\@\texiatcatcode \long\def\parsemacbody#1@end macro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \long\def\parsermacbody#1@end rmacro% {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% \catcode `\@=11\relax \let\endargs@\relax \let\nil@\relax \def\nilm@{\nil@}% \long\def\nillm@{\nil@}% % This macro is expanded during the Texinfo macro expansion, not during its % definition. It gets all the arguments values and assigns them to macros % macarg.ARGNAME % % #1 is the macro name % #2 is the list of argument names % #3 is the list of argument values \def\getargvals@#1#2#3{% \def\macargdeflist@{}% \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. \def\paramlist{#2,\nil@}% \def\macroname{#1}% \begingroup \macroargctxt \def\argvaluelist{#3,\nil@}% \def\@tempa{#3}% \ifx\@tempa\empty \setemptyargvalues@ \else \getargvals@@ \fi } % \def\getargvals@@{% \ifx\paramlist\nilm@ % Some sanity check needed here that \argvaluelist is also empty. \ifx\argvaluelist\nillm@ \else \errhelp = \EMsimple \errmessage{Too many arguments in macro `\macroname'!}% \fi \let\next\macargexpandinbody@ \else \ifx\argvaluelist\nillm@ % No more arguments values passed to macro. Set remaining named-arg % macros to empty. \let\next\setemptyargvalues@ \else % pop current arg name into \@tempb \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% \expandafter\@tempa\expandafter{\paramlist}% % pop current argument value into \@tempc \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% \expandafter\@tempa\expandafter{\argvaluelist}% % Here \@tempb is the current arg name and \@tempc is the current arg value. % First place the new argument macro definition into \@tempd \expandafter\macname\expandafter{\@tempc}% \expandafter\let\csname macarg.\@tempb\endcsname\relax \expandafter\def\expandafter\@tempe\expandafter{% \csname macarg.\@tempb\endcsname}% \edef\@tempd{\long\def\@tempe{\the\macname}}% \push@\@tempd\macargdeflist@ \let\next\getargvals@@ \fi \fi \next } \def\push@#1#2{% \expandafter\expandafter\expandafter\def \expandafter\expandafter\expandafter#2% \expandafter\expandafter\expandafter{% \expandafter#1#2}% } % Replace arguments by their values in the macro body, and place the result % in macro \@tempa \def\macvalstoargs@{% % To do this we use the property that token registers that are \the'ed % within an \edef expand only once. So we are going to place all argument % values into respective token registers. % % First we save the token context, and initialize argument numbering. \begingroup \paramno0\relax % Then, for each argument number #N, we place the corresponding argument % value into a new token list register \toks#N \expandafter\putargsintokens@\saveparamlist@,;,% % Then, we expand the body so that argument are replaced by their % values. The trick for values not to be expanded themselves is that they % are within tokens and that tokens expand only once in an \edef . \edef\@tempc{\csname mac.\macroname .body\endcsname}% % Now we restore the token stack pointer to free the token list registers % which we have used, but we make sure that expanded body is saved after % group. \expandafter \endgroup \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% } \def\macargexpandinbody@{% %% Define the named-macro outside of this group and then close this group. \expandafter \endgroup \macargdeflist@ % First the replace in body the macro arguments by their values, the result % is in \@tempa . \macvalstoargs@ % Then we point at the \norecurse or \gobble (for recursive) macro value % with \@tempb . \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname % Depending on whether it is recursive or not, we need some tailing % \egroup . \ifx\@tempb\gobble \let\@tempc\relax \else \let\@tempc\egroup \fi % And now we do the real job: \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% \@tempd } \def\putargsintokens@#1,{% \if#1;\let\next\relax \else \let\next\putargsintokens@ % First we allocate the new token list register, and give it a temporary % alias \@tempb . \toksdef\@tempb\the\paramno % Then we place the argument value into that token list register. \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname \expandafter\@tempb\expandafter{\@tempa}% \advance\paramno by 1\relax \fi \next } % Save the token stack pointer into macro #1 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} % Restore the token stack pointer from number in macro #1 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} % newtoks that can be used non \outer . \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} % Tailing missing arguments are set to empty \def\setemptyargvalues@{% \ifx\paramlist\nilm@ \let\next\macargexpandinbody@ \else \expandafter\setemptyargvaluesparser@\paramlist\endargs@ \let\next\setemptyargvalues@ \fi \next } \def\setemptyargvaluesparser@#1,#2\endargs@{% \expandafter\def\expandafter\@tempa\expandafter{% \expandafter\def\csname macarg.#1\endcsname{}}% \push@\@tempa\macargdeflist@ \def\paramlist{#2}% } % #1 is the element target macro % #2 is the list macro % #3,#4\endargs@ is the list value \def\pop@#1#2#3,#4\endargs@{% \def#1{#3}% \def#2{#4}% } \long\def\longpop@#1#2#3,#4\endargs@{% \long\def#1{#3}% \long\def#2{#4}% } % This defines a Texinfo @macro. There are eight cases: recursive and % nonrecursive macros of zero, one, up to nine, and many arguments. % Much magic with \expandafter here. % \xdef is used so that macro definitions will survive the file % they're defined in; @include reads the file inside a group. % \def\defmacro{% \let\hash=##% convert placeholders to macro parameter chars \ifrecursive \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\scanmacro{\temp}}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup\noexpand\scanmacro{\temp}}% \else \ifnum\paramno<10\relax % at most 9 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{\egroup\noexpand\scanmacro{\temp}}% \else % 10 or more \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble \fi \fi \else \ifcase\paramno % 0 \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \or % 1 \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \noexpand\braceorline \expandafter\noexpand\csname\the\macname xxx\endcsname}% \expandafter\xdef\csname\the\macname xxx\endcsname##1{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % at most 9 \ifnum\paramno<10\relax \expandafter\xdef\csname\the\macname\endcsname{% \bgroup\noexpand\macroargctxt \expandafter\noexpand\csname\the\macname xx\endcsname}% \expandafter\xdef\csname\the\macname xx\endcsname##1{% \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% \expandafter\expandafter \expandafter\xdef \expandafter\expandafter \csname\the\macname xxx\endcsname \paramlist{% \egroup \noexpand\norecurse{\the\macname}% \noexpand\scanmacro{\temp}\egroup}% \else % 10 or more: \expandafter\xdef\csname\the\macname\endcsname{% \noexpand\getargvals@{\the\macname}{\argl}% }% \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse \fi \fi \fi} \catcode `\@\texiatcatcode\relax \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} % \braceorline decides whether the next nonwhitespace character is a % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg). % \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg \fi \macnamexxx} % @alias. % We need some trickery to remove the optional spaces around the equal % sign. Make them active and then expand them all to nothing. % \def\alias{\parseargusing\obeyspaces\aliasxxx} \def\aliasxxx #1{\aliasyyy#1\relax} \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next } \message{cross references,} \newwrite\auxfile \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. % @inforef is relatively simple. \def\inforef #1{\inforefzzz #1,,,,**} \def\inforefzzz #1,#2,#3,#4**{% \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, node \samp{\ignorespaces#1{}}} % @node's only job in TeX is to define \lastnode, which is used in % cross-references. The @node line might or might not have commas, and % might or might not have spaces before the first comma, like: % @node foo , bar , ... % We don't want such trailing spaces in the node name. % \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} % % also remove a trailing comma, in case of something like this: % @node Help-Cross, , , Cross-refs \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} \let\nwnode=\node \let\lastnode=\empty % Write a cross-reference definition for the current node. #1 is the % type (Ynumbered, Yappendix, Ynothing). % \def\donoderef#1{% \ifx\lastnode\empty\else \setref{\lastnode}{#1}% \global\let\lastnode=\empty \fi } % @anchor{NAME} -- define xref target at arbitrary point. % \newcount\savesfregister % \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: % 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. % 3) NAME-pg - the page number. % % This is called from \donoderef, \anchor, and \dofloat. In the case of % floats, there is an additional part, which is not written here: % 4) NAME-lof - the text as it should appear in a @listoffloats. % \def\setref#1#2{% \pdfmkdest{#1}% \iflinks {% \atdummies % preserve commands, but don't expand them \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout }% \fi } % @xrefautosectiontitle on|off says whether @section(ing) names are used % automatically in xrefs, if the third arg is not explicitly specified. % This was provided as a "secret" @set xref-automatic-section-title % variable, now it's official. % \parseargdef\xrefautomaticsectiontitle{% \def\temp{#1}% \ifx\temp\onword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \empty \else\ifx\temp\offword \expandafter\let\csname SETxref-automatic-section-title\endcsname = \relax \else \errhelp = \EMsimple \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', must be on|off}% \fi\fi } % % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is % the node name, #2 the name of the Info cross-reference, #3 the printed % node name, #4 the name of the Info file, #5 the name of the printed % manual. All but the node name can be omitted. % \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} \def\ref#1{\xrefX[#1,,,,,,,]} % \newbox\toprefbox \newbox\printedrefnamebox \newbox\infofilenamebox \newbox\printedmanualbox % \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup \unsepspaces % % Get args without leading/trailing spaces. \def\printedrefname{\ignorespaces #3}% \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}% % \def\infofilename{\ignorespaces #4}% \setbox\infofilenamebox = \hbox{\infofilename\unskip}% % \def\printedmanual{\ignorespaces #5}% \setbox\printedmanualbox = \hbox{\printedmanual\unskip}% % % If the printed reference name (arg #3) was not explicitly given in % the @xref, figure out what we want to use. \ifdim \wd\printedrefnamebox = 0pt % No printed node name was explicitly given. \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax % Not auto section-title: use node name inside the square brackets. \def\printedrefname{\ignorespaces #1}% \else % Auto section-title: use chapter/section title inside % the square brackets if we have it. \ifdim \wd\printedmanualbox > 0pt % It is in another manual, so we don't have it; use node name. \def\printedrefname{\ignorespaces #1}% \else \ifhavexrefs % We (should) know the real title if we have the xref values. \def\printedrefname{\refx{#1-title}{}}% \else % Otherwise just copy the Info node name. \def\printedrefname{\ignorespaces #1}% \fi% \fi \fi \fi % % Make link in pdf output. \ifpdf {\indexnofonts \turnoffactive \makevalueexpandable % This expands tokens, so do it after making catcode changes, so _ % etc. don't get their TeX definitions. This ignores all spaces in % #4, including (wrongly) those in the middle of the filename. \getfilename{#4}% % % This (wrongly) does not take account of leading or trailing % spaces in #1, which should be ignored. \edef\pdfxrefdest{#1}% \ifx\pdfxrefdest\empty \def\pdfxrefdest{Top}% no empty targets \else \txiescapepdf\pdfxrefdest % escape PDF special chars \fi % \leavevmode \startlink attr{/Border [0 0 0]}% \ifnum\filenamelength>0 goto file{\the\filename.pdf} name{\pdfxrefdest}% \else goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" % instead of "[somenode], p.3". We distinguish them by the % LABEL-title being set to a magic string. {% % Have to otherify everything special to allow the \csname to % include an _ in the xref name, etc. \indexnofonts \turnoffactive \expandafter\global\expandafter\let\expandafter\Xthisreftitle \csname XR#1-title\endcsname }% \iffloat\Xthisreftitle % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd\printedrefnamebox = 0pt \refx{#1-snt}{}% \else \printedrefname \fi % % If the user also gave the printed manual name (fifth arg), append % "in MANUALNAME". \ifdim \wd\printedmanualbox > 0pt \space \putwordin{} \cite{\printedmanual}% \fi \else % node/anchor (non-float) references. % % If we use \unhbox to print the node names, TeX does not insert % empty discretionaries after hyphens, which means that it will not % find a line break at a hyphen in a node names. Since some manuals % are best written with fairly long node names, containing hyphens, % this is a loss. Therefore, we give the text of the node name % again, so it is as if TeX is seeing it for the first time. % \ifdim \wd\printedmanualbox > 0pt % Cross-manual reference with a printed manual name. % \crossmanualxref{\cite{\printedmanual\unskip}}% % \else\ifdim \wd\infofilenamebox > 0pt % Cross-manual reference with only an info filename (arg 4), no % printed manual name (arg 5). This is essentially the same as % the case above; we output the filename, since we have nothing else. % \crossmanualxref{\code{\infofilename\unskip}}% % \else % Reference within this manual. % % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand % into the usual \leavevmode...\vrule stuff for purposes of % printing. So we \turnoffactive for the \refx-snt, back on for the % printing, back off for the \refx-pg. {\turnoffactive % Only output a following space if the -snt ref is nonempty; for % @unnumbered and @anchor, it won't be. \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi }% % output the `[mynode]' via the macro below so it can be overridden. \xrefprintnodename\printedrefname % % But we always want a comma and a space: ,\space % % output the `page 3'. \turnoffactive \putwordpage\tie\refx{#1-pg}{}% \fi\fi \fi \endlink \endgroup} % Output a cross-manual xref to #1. Used just above (twice). % % Only include the text "Section ``foo'' in" if the foo is neither % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply % "see The Foo Manual", the idea being to refer to the whole manual. % % But, this being TeX, we can't easily compare our node name against the % string "Top" while ignoring the possible spaces before and after in % the input. By adding the arbitrary 7sp below, we make it much less % likely that a real node name would have the same width as "Top" (e.g., % in a monospaced font). Hopefully it will never happen in practice. % % For the same basic reason, we retypeset the "Top" at every % reference, since the current font is indeterminate. % \def\crossmanualxref#1{% \setbox\toprefbox = \hbox{Top\kern7sp}% \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}% \ifdim \wd2 > 7sp % nonempty? \ifdim \wd2 = \wd\toprefbox \else % same as Top? \putwordSection{} ``\printedrefname'' \putwordin{}\space \fi \fi #1% } % This macro is called from \xrefX for the `[nodename]' part of xref % output. It's a separate macro only so it can be changed more easily, % since square brackets don't work well in some documents. Particularly % one that Bob is working on :). % \def\xrefprintnodename#1{[#1]} % Things referred to by \setref. % \def\Ynothing{} \def\Yomitfromtoc{} \def\Ynumbered{% \ifnum\secno=0 \putwordChapter@tie \the\chapno \else \ifnum\subsecno=0 \putwordSection@tie \the\chapno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno \else \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } \def\Yappendix{% \ifnum\secno=0 \putwordAppendix@tie @char\the\appendixno{}% \else \ifnum\subsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno \else \ifnum\subsubsecno=0 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno \else \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno \fi\fi\fi } % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % If its value is nonempty, SUFFIX is output afterward. % \def\refx#1#2{% {% \indexnofonts \otherbackslash \expandafter\global\expandafter\let\expandafter\thisrefX \csname XR#1\endcsname }% \ifx\thisrefX\relax % If not defined, say something at least. \angleleft un\-de\-fined\angleright \iflinks \ifhavexrefs {\toks0 = {#1}% avoid expansion of possibly-complex value \message{\linenumber Undefined cross reference `\the\toks0'.}}% \else \ifwarnedxrefs\else \global\warnedxrefstrue \message{Cross reference values unknown; you must run TeX again.}% \fi \fi \fi \else % It's defined, so just use it. \thisrefX \fi #2% Output the suffix in any case. } % This is the macro invoked by entries in the aux file. Usually it's % just a \def (we prepend XR to the control sequence name to avoid % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% {% The node name might contain 8-bit characters, which in our current % implementation are changed to commands like @'e. Don't let these % mess up the control sequence name. \indexnofonts \turnoffactive \xdef\safexrefname{#1}% }% % \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname % % Is this the first time we've seen this float type? \expandafter\ifx\floatlist\relax \toks0 = {\do}% yes, so just \do \else % had it before, so preserve previous elements in list. \toks0 = \expandafter{\floatlist\do}% \fi % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 {\safexrefname}}% \fi } % Read the last existing aux file, if any. No error if none exists. % \def\tryauxfile{% \openin 1 \jobname.aux \ifeof 1 \else \readdatafile{aux}% \global\havexrefstrue \fi \closein 1 } \def\setupdatafile{% \catcode`\^^@=\other \catcode`\^^A=\other \catcode`\^^B=\other \catcode`\^^C=\other \catcode`\^^D=\other \catcode`\^^E=\other \catcode`\^^F=\other \catcode`\^^G=\other \catcode`\^^H=\other \catcode`\^^K=\other \catcode`\^^L=\other \catcode`\^^N=\other \catcode`\^^P=\other \catcode`\^^Q=\other \catcode`\^^R=\other \catcode`\^^S=\other \catcode`\^^T=\other \catcode`\^^U=\other \catcode`\^^V=\other \catcode`\^^W=\other \catcode`\^^X=\other \catcode`\^^Z=\other \catcode`\^^[=\other \catcode`\^^\=\other \catcode`\^^]=\other \catcode`\^^^=\other \catcode`\^^_=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. % in xref tags, i.e., node names. But since ^^e4 notation isn't % supported in the main text, it doesn't seem desirable. Furthermore, % that is not enough: for node names that actually contain a ^ % character, we would end up writing a line like this: 'xrdef {'hat % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first % argument, and \hat is not an expandable control sequence. It could % all be worked out, but why? Either we support ^^ or we don't. % % The other change necessary for this was to define \auxhat: % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % and then to call \auxhat in \setq. % \catcode`\^=\other % % Special characters. Should be turned off anyway, but... \catcode`\~=\other \catcode`\[=\other \catcode`\]=\other \catcode`\"=\other \catcode`\_=\other \catcode`\|=\other \catcode`\<=\other \catcode`\>=\other \catcode`\$=\other \catcode`\#=\other \catcode`\&=\other \catcode`\%=\other \catcode`+=\other % avoid \+ for paranoia even though we've turned it off % % This is to support \ in node names and titles, since the \ % characters end up in a \csname. It's easier than % leaving it active and making its active definition an actual \ % character. What I don't understand is why it works in the *value* % of the xrdef. Seems like it should be a catcode12 \, and that % should not typeset properly. But it works, so I'm moving on for % now. --karl, 15jan04. \catcode`\\=\other % % Make the characters 128-255 be printing characters. {% \count1=128 \def\loop{% \catcode\count1=\other \advance\count1 by 1 \ifnum \count1<256 \loop \fi }% }% % % @ is our escape character in .aux files, and we need braces. \catcode`\{=1 \catcode`\}=2 \catcode`\@=0 } \def\readdatafile#1{% \begingroup \setupdatafile \input\jobname.#1 \endgroup} \message{insertions,} % including footnotes. \newcount \footnoteno % The trailing space in the following definition for supereject is % vital for proper filling; pages come out unaligned when you do a % pagealignmacro call if that space before the closing brace is % removed. (Generally, numeric constants should always be followed by a % space to prevent strange expansion errors.) \def\supereject{\par\penalty -20000\footnoteno =0 } % @footnotestyle is meaningful for Info output only. \let\footnotestyle=\comment {\catcode `\@=11 % % Auto-number footnotes. Otherwise like plain. \gdef\footnote{% \let\indent=\ptexindent \let\noindent=\ptexnoindent \global\advance\footnoteno by \@ne \edef\thisfootno{$^{\the\footnoteno}$}% % % In case the footnote comes at the end of a sentence, preserve the % extra spacing after we do the footnote number. \let\@sf\empty \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi % % Remove inadvertent blank space before typesetting the footnote number. \unskip \thisfootno\@sf \dofootnote }% % Don't bother with the trickery in plain.tex to not require the % footnote text as a parameter. Our footnotes don't need to be so general. % % Oh yes, they do; otherwise, @ifset (and anything else that uses % \parseargline) fails inside footnotes because the tokens are fixed when % the footnote is read. --karl, 16nov96. % \gdef\dofootnote{% \insert\footins\bgroup % We want to typeset this text as a normal paragraph, even if the % footnote reference occurs in (for example) a display environment. % So reset some parameters. \hsize=\pagewidth \interlinepenalty\interfootnotelinepenalty \splittopskip\ht\strutbox % top baseline for broken footnotes \splitmaxdepth\dp\strutbox \floatingpenalty\@MM \leftskip\z@skip \rightskip\z@skip \spaceskip\z@skip \xspaceskip\z@skip \parindent\defaultparindent % \smallfonts \rm % % Because we use hanging indentation in footnotes, a @noindent appears % to exdent this text, so make it be a no-op. makeinfo does not use % hanging indentation so @noindent can still be needed within footnote % text after an @example or the like (not that this is good style). \let\noindent = \relax % % Hang the footnote text off the number. Use \everypar in case the % footnote extends for more than one paragraph. \everypar = {\hang}% \textindent{\thisfootno}% % % Don't crash into the line above the footnote text. Since this % expands into a box, it must come within the paragraph, lest it % provide a place where TeX can split the footnote. \footstrut % % Invoke rest of plain TeX footnote routine. \futurelet\next\fo@t } }%end \catcode `\@=11 % In case a @footnote appears in a vbox, save the footnote text and create % the real \insert just after the vbox finished. Otherwise, the insertion % would be lost. % Similarly, if a @footnote appears inside an alignment, save the footnote % text to a box and make the \insert when a row of the table is finished. % And the same can be done for other insert classes. --kasal, 16nov03. % Replace the \insert primitive by a cheating macro. % Deeper inside, just make sure that the saved insertions are not spilled % out prematurely. % \def\startsavinginserts{% \ifx \insert\ptexinsert \let\insert\saveinsert \else \let\checkinserts\relax \fi } % This \insert replacement works for both \insert\footins{foo} and % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. % \def\saveinsert#1{% \edef\next{\noexpand\savetobox \makeSAVEname#1}% \afterassignment\next % swallow the left brace \let\temp = } \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} \def\placesaveins#1{% \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname {\box#1}% } % eat @SAVE -- beware, all of them have catcode \other: { \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) \gdef\gobblesave @SAVE{} } % initialization: \def\newsaveins #1{% \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% \next } \def\newsaveinsX #1{% \csname newbox\endcsname #1% \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts \checksaveins #1}% } % initialize: \let\checkinserts\empty \newsaveins\footins \newsaveins\margin % @image. We use the macros from epsf.tex to support this. % If epsf.tex is not installed and @image is used, we complain. % % Check for and read epsf.tex up front. If we read it only at @image % time, we might be inside a group, and then its definitions would get % undone and the next image would fail. \openin 1 = epsf.tex \ifeof 1 \else % Do not bother showing banner with epsf.tex v2.7k (available in % doc/epsf.tex and on ctan). \def\epsfannounce{\toks0 = }% \input epsf.tex \fi \closein 1 % % We will only complain once about lack of epsf.tex. \newif\ifwarnednoepsf \newhelp\noepsfhelp{epsf.tex must be installed for images to work. It is also included in the Texinfo distribution, or you can get it from ftp://tug.org/tex/epsf.tex.} % \def\image#1{% \ifx\epsfbox\thisisundefined \ifwarnednoepsf \else \errhelp = \noepsfhelp \errmessage{epsf.tex not found, images will be ignored}% \global\warnednoepsftrue \fi \else \imagexxx #1,,,,,\finish \fi } % % Arguments to @image: % #1 is (mandatory) image filename; we tack on .eps extension. % #2 is (optional) width, #3 is (optional) height. % #4 is (ignored optional) html alt text. % #5 is (ignored optional) extension. % #6 is just the usual extra ignored arg for parsing stuff. \newif\ifimagevmode \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup \catcode`\^^M = 5 % in case we're inside an example \normalturnoffactive % allow _ et al. in names % If the image is by itself, center it. \ifvmode \imagevmodetrue \else \ifx\centersub\centerV % for @center @image, we need a vbox so we can have our vertical space \imagevmodetrue \vbox\bgroup % vbox has better behavior than vtop herev \fi\fi % \ifimagevmode \nobreak\medskip % Usually we'll have text after the image which will insert % \parskip glue, so insert it here too to equalize the space % above and below. \nobreak\vskip\parskip \nobreak \fi % % Leave vertical mode so that indentation from an enclosing % environment such as @quotation is respected. % However, if we're at the top level, we don't want the % normal paragraph indentation. % On the other hand, if we are in the case of @center @image, we don't % want to start a paragraph, which will create a hsize-width box and % eradicate the centering. \ifx\centersub\centerV\else \noindent \fi % % Output the image. \ifpdf \dopdfimage{#1}{#2}{#3}% \else % \epsfbox itself resets \epsf?size at each figure. \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi \epsfbox{#1.eps}% \fi % \ifimagevmode \medskip % space after a standalone image \fi \ifx\centersub\centerV \egroup \fi \endgroup} % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, % etc. We don't actually implement floating yet, we always include the % float "here". But it seemed the best name for the future. % \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} % There may be a space before second and/or third parameter; delete it. \def\eatcommaspace#1, {#1,} % #1 is the optional FLOATTYPE, the text label for this float, typically % "Figure", "Table", "Example", etc. Can't contain commas. If omitted, % this float will not be numbered and cannot be referred to. % % #2 is the optional xref label. Also must be present for the float to % be referable. % % #3 is the optional positioning argument; for now, it is ignored. It % will somehow specify the positions allowed to float to (here, top, bottom). % % We keep a separate counter for each FLOATTYPE, which we reset at each % chapter-level command. \let\resetallfloatnos=\empty % \def\dofloat#1,#2,#3,#4\finish{% \let\thiscaption=\empty \let\thisshortcaption=\empty % % don't lose footnotes inside @float. % % BEWARE: when the floats start float, we have to issue warning whenever an % insert appears inside a float which could possibly float. --kasal, 26may04 % \startsavinginserts % % We can't be used inside a paragraph. \par % \vtop\bgroup \def\floattype{#1}% \def\floatlabel{#2}% \def\floatloc{#3}% we do nothing with this yet. % \ifx\floattype\empty \let\safefloattype=\empty \else {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% \fi % % If label is given but no type, we handle that as the empty type. \ifx\floatlabel\empty \else % We want each FLOATTYPE to be numbered separately (Figure 1, % Table 1, Figure 2, ...). (And if no label, no number.) % \expandafter\getfloatno\csname\safefloattype floatno\endcsname \global\advance\floatno by 1 % {% % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi % % start with \parskip glue, I guess. \vskip\parskip % % Don't suppress indentation if a float happens to start a section. \restorefirstparagraphindent } % we have these possibilities: % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap % @float Foo,lbl & no caption: Foo 1.1 % @float Foo & @caption{Cap}: Foo: Cap % @float Foo & no caption: Foo % @float ,lbl & Caption{Cap}: 1.1: Cap % @float ,lbl & no caption: 1.1 % @float & @caption{Cap}: Cap % @float & no caption: % \def\Efloat{% \let\floatident = \empty % % In all cases, if we have a float type, it comes first. \ifx\floattype\empty \else \def\floatident{\floattype}\fi % % If we have an xref label, the number comes next. \ifx\floatlabel\empty \else \ifx\floattype\empty \else % if also had float type, need tie first. \appendtomacro\floatident{\tie}% \fi % the number. \appendtomacro\floatident{\chaplevelprefix\the\floatno}% \fi % % Start the printed caption with what we've constructed in % \floatident, but keep it separate; we need \floatident again. \let\captionline = \floatident % \ifx\thiscaption\empty \else \ifx\floatident\empty \else \appendtomacro\captionline{: }% had ident, so need a colon between \fi % % caption text. \appendtomacro\captionline{\scanexp\thiscaption}% \fi % % If we have anything to print, print it, with space before. % Eventually this needs to become an \insert. \ifx\captionline\empty \else \vskip.5\parskip \captionline % % Space below caption. \vskip\parskip \fi % % If have an xref label, write the list of floats info. Do this % after the caption, to avoid chance of it being a breakpoint. \ifx\floatlabel\empty \else % Write the text that goes in the lof to the aux file as % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% \atdummies % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. \scanexp{% \xdef\noexpand\gtemp{% \ifx\thisshortcaption\empty \thiscaption \else \thisshortcaption \fi }% }% \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident \ifx\gtemp\empty \else : \gtemp \fi}}% }% \fi \egroup % end of \vtop % % place the captured inserts % % BEWARE: when the floats start floating, we have to issue warning % whenever an insert appears inside a float which could possibly % float. --kasal, 26may04 % \checkinserts } % Append the tokens #2 to the definition of macro #1, not expanding either. % \def\appendtomacro#1#2{% \expandafter\def\expandafter#1\expandafter{#1#2}% } % @caption, @shortcaption % \def\caption{\docaption\thiscaption} \def\shortcaption{\docaption\thisshortcaption} \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} \def\defcaption#1#2{\egroup \def#1{#2}} % The parameter is the control sequence identifying the counter we are % going to use. Create it if it doesn't exist and assign it to \floatno. \def\getfloatno#1{% \ifx#1\relax % Haven't seen this figure type before. \csname newcount\endcsname #1% % % Remember to reset this floatno at the next chap. \expandafter\gdef\expandafter\resetallfloatnos \expandafter{\resetallfloatnos #1=0 }% \fi \let\floatno#1% } % \setref calls this to get the XREFLABEL-snt value. We want an @xref % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we % first read the @float command. % \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% % Magic string used for the XREFLABEL-title value, so \xrefX can % distinguish floats from other xref types. \def\floatmagic{!!float!!} % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic % \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % % #1 is (maybe) the \floatmagic string. If so, #2 will be the % (safe) float type for this float. We set \iffloattype to #2. % \def\doiffloat#1=#2=#3\finish{% \def\temp{#1}% \def\iffloattype{#2}% \ifx\temp\floatmagic } % @listoffloats FLOATTYPE - print a list of floats like a table of contents. % \parseargdef\listoffloats{% \def\floattype{#1}% floattype {% % the floattype might have accents or other special characters, % but we need to use it in a control sequence name. \indexnofonts \turnoffactive \xdef\safefloattype{\floattype}% }% % % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax \ifhavexrefs % if the user said @listoffloats foo but never @float foo. \message{\linenumber No `\safefloattype' floats to list.}% \fi \else \begingroup \leftskip=\tocindent % indent these entries like a toc \let\do=\listoffloatsdo \csname floatlist\safefloattype\endcsname \endgroup \fi } % This is called on each entry in a list of floats. We're passed the % xref label, in the form LABEL-title, which is how we save it in the % aux file. We strip off the -title and look up \XRLABEL-lof, which % has the text we're supposed to typeset here. % % Figures without xref labels will not be included in the list (since % they won't appear in the aux file). % \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} \def\listoffloatsdoentry#1-title\finish{{% % Can't fully expand XR#1-lof because it can contain anything. Just % pass the control sequence. On the other hand, XR#1-pg is just the % page number, and we want to fully expand that so we can get a link % in pdf output. \toksA = \expandafter{\csname XR#1-lof\endcsname}% % % use the same \entry macro we use to generate the TOC and index. \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% \writeentry }} \message{localization,} % For single-language documents, @documentlanguage is usually given very % early, just after @documentencoding. Single argument is the language % (de) or locale (de_DE) abbreviation. % { \catcode`\_ = \active \globaldefs=1 \parseargdef\documentlanguage{\begingroup \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 \documentlanguagetrywithoutunderscore{#1_\finish}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 \endgroup % end raw TeX \endgroup} % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. % \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 \errhelp = \nolanghelp \errmessage{Cannot read language file txi-#1.tex}% \else \globaldefs = 1 % everything in the txi-LL files needs to persist \input txi-#1.tex \fi \closein 1 } }% end of special _ catcode % \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? Putting it in the current directory should work if nowhere else does.} % This macro is called from txi-??.tex files; the first argument is the % \language name to set (without the "\lang@" prefix), the second and % third args are \{left,right}hyphenmin. % % The language names to pass are determined when the format is built. % See the etex.log file created at that time, e.g., % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log. % % With TeX Live 2008, etex now includes hyphenation patterns for all % available languages. This means we can support hyphenation in % Texinfo, at least to some extent. (This still doesn't solve the % accented characters problem.) % \catcode`@=11 \def\txisetlanguage#1#2#3{% % do not set the language if the name is undefined in the current TeX. \expandafter\ifx\csname lang@#1\endcsname \relax \message{no patterns for #1}% \else \global\language = \csname lang@#1\endcsname \fi % but there is no harm in adjusting the hyphenmin values regardless. \global\lefthyphenmin = #2\relax \global\righthyphenmin = #3\relax } % Helpers for encodings. % Set the catcode of characters 128 through 255 to the specified number. % \def\setnonasciicharscatcode#1{% \count255=128 \loop\ifnum\count255<256 \global\catcode\count255=#1\relax \advance\count255 by 1 \repeat } \def\setnonasciicharscatcodenonglobal#1{% \count255=128 \loop\ifnum\count255<256 \catcode\count255=#1\relax \advance\count255 by 1 \repeat } % @documentencoding sets the definition of non-ASCII characters % according to the specified encoding. % \parseargdef\documentencoding{% % Encoding being declared for the document. \def\declaredencoding{\csname #1.enc\endcsname}% % % Supported encodings: names converted to tokens in order to be able % to compare them with \ifx. \def\ascii{\csname US-ASCII.enc\endcsname}% \def\latnine{\csname ISO-8859-15.enc\endcsname}% \def\latone{\csname ISO-8859-1.enc\endcsname}% \def\lattwo{\csname ISO-8859-2.enc\endcsname}% \def\utfeight{\csname UTF-8.enc\endcsname}% % \ifx \declaredencoding \ascii \asciichardefs % \else \ifx \declaredencoding \lattwo \setnonasciicharscatcode\active \lattwochardefs % \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % \else \ifx \declaredencoding \latnine \setnonasciicharscatcode\active \latninechardefs % \else \ifx \declaredencoding \utfeight \setnonasciicharscatcode\active \utfeightchardefs % \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight \fi % latnine \fi % latone \fi % lattwo \fi % ascii } % A message to be logged when using a character that isn't available % the default font encoding (OT1). % \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} % First, make active non-ASCII characters in order for them to be % correctly categorized when TeX reads the replacement text of % macros containing the character definitions. \setnonasciicharscatcode\active % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% \gdef^^a0{\tie} \gdef^^a1{\exclamdown} \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\copyright} \gdef^^aa{\ordf} \gdef^^ab{\guillemetleft} \gdef^^ac{$\lnot$} \gdef^^ad{\-} \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} \gdef^^b1{$\pm$} \gdef^^b2{$^2$} \gdef^^b3{$^3$} \gdef^^b4{\'{}} \gdef^^b5{$\mu$} \gdef^^b6{\P} % \gdef^^b7{$^.$} \gdef^^b8{\cedilla\ } \gdef^^b9{$^1$} \gdef^^ba{\ordm} % \gdef^^bb{\guillemetright} \gdef^^bc{$1\over4$} \gdef^^bd{$1\over2$} \gdef^^be{$3\over4$} \gdef^^bf{\questiondown} % \gdef^^c0{\`A} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} \gdef^^c9{\'E} \gdef^^ca{\^E} \gdef^^cb{\"E} \gdef^^cc{\`I} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\"I} % \gdef^^d0{\DH} \gdef^^d1{\~N} \gdef^^d2{\`O} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\~O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\O} \gdef^^d9{\`U} \gdef^^da{\'U} \gdef^^db{\^U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\TH} \gdef^^df{\ss} % \gdef^^e0{\`a} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\~a} \gdef^^e4{\"a} \gdef^^e5{\ringaccent a} \gdef^^e6{\ae} \gdef^^e7{\cedilla c} \gdef^^e8{\`e} \gdef^^e9{\'e} \gdef^^ea{\^e} \gdef^^eb{\"e} \gdef^^ec{\`{\dotless i}} \gdef^^ed{\'{\dotless i}} \gdef^^ee{\^{\dotless i}} \gdef^^ef{\"{\dotless i}} % \gdef^^f0{\dh} \gdef^^f1{\~n} \gdef^^f2{\`o} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\~o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\o} \gdef^^f9{\`u} \gdef^^fa{\'u} \gdef^^fb{\^u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\th} \gdef^^ff{\"y} } % Latin9 (ISO-8859-15) encoding character definitions. \def\latninechardefs{% % Encoding is almost identical to Latin1. \latonechardefs % \gdef^^a4{\euro} \gdef^^a6{\v S} \gdef^^a8{\v s} \gdef^^b4{\v Z} \gdef^^b8{\v z} \gdef^^bc{\OE} \gdef^^bd{\oe} \gdef^^be{\"Y} } % Latin2 (ISO-8859-2) character definitions. \def\lattwochardefs{% \gdef^^a0{\tie} \gdef^^a1{\ogonek{A}} \gdef^^a2{\u{}} \gdef^^a3{\L} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\v L} \gdef^^a6{\'S} \gdef^^a7{\S} \gdef^^a8{\"{}} \gdef^^a9{\v S} \gdef^^aa{\cedilla S} \gdef^^ab{\v T} \gdef^^ac{\'Z} \gdef^^ad{\-} \gdef^^ae{\v Z} \gdef^^af{\dotaccent Z} % \gdef^^b0{\textdegree} \gdef^^b1{\ogonek{a}} \gdef^^b2{\ogonek{ }} \gdef^^b3{\l} \gdef^^b4{\'{}} \gdef^^b5{\v l} \gdef^^b6{\'s} \gdef^^b7{\v{}} \gdef^^b8{\cedilla\ } \gdef^^b9{\v s} \gdef^^ba{\cedilla s} \gdef^^bb{\v t} \gdef^^bc{\'z} \gdef^^bd{\H{}} \gdef^^be{\v z} \gdef^^bf{\dotaccent z} % \gdef^^c0{\'R} \gdef^^c1{\'A} \gdef^^c2{\^A} \gdef^^c3{\u A} \gdef^^c4{\"A} \gdef^^c5{\'L} \gdef^^c6{\'C} \gdef^^c7{\cedilla C} \gdef^^c8{\v C} \gdef^^c9{\'E} \gdef^^ca{\ogonek{E}} \gdef^^cb{\"E} \gdef^^cc{\v E} \gdef^^cd{\'I} \gdef^^ce{\^I} \gdef^^cf{\v D} % \gdef^^d0{\DH} \gdef^^d1{\'N} \gdef^^d2{\v N} \gdef^^d3{\'O} \gdef^^d4{\^O} \gdef^^d5{\H O} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} \gdef^^dd{\'Y} \gdef^^de{\cedilla T} \gdef^^df{\ss} % \gdef^^e0{\'r} \gdef^^e1{\'a} \gdef^^e2{\^a} \gdef^^e3{\u a} \gdef^^e4{\"a} \gdef^^e5{\'l} \gdef^^e6{\'c} \gdef^^e7{\cedilla c} \gdef^^e8{\v c} \gdef^^e9{\'e} \gdef^^ea{\ogonek{e}} \gdef^^eb{\"e} \gdef^^ec{\v e} \gdef^^ed{\'{\dotless{i}}} \gdef^^ee{\^{\dotless{i}}} \gdef^^ef{\v d} % \gdef^^f0{\dh} \gdef^^f1{\'n} \gdef^^f2{\v n} \gdef^^f3{\'o} \gdef^^f4{\^o} \gdef^^f5{\H o} \gdef^^f6{\"o} \gdef^^f7{$\div$} \gdef^^f8{\v r} \gdef^^f9{\ringaccent u} \gdef^^fa{\'u} \gdef^^fb{\H u} \gdef^^fc{\"u} \gdef^^fd{\'y} \gdef^^fe{\cedilla t} \gdef^^ff{\dotaccent{}} } % UTF-8 character definitions. % % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. % \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz \gdef\UTFviiiTwoOctets#1#2{\expandafter \UTFviiiDefined\csname u8:#1\string #2\endcsname} % \gdef\UTFviiiThreeOctets#1#2#3{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} % \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} \gdef\UTFviiiDefined#1{% \ifx #1\relax \message{\linenumber Unicode char \string #1 not defined for Texinfo}% \else \expandafter #1% \fi } \begingroup \catcode`\~13 \catcode`\"12 \def\UTFviiiLoop{% \global\catcode\countUTFx\active \uccode`\~\countUTFx \uppercase\expandafter{\UTFviiiTmp}% \advance\countUTFx by 1 \ifnum\countUTFx < \countUTFy \expandafter\UTFviiiLoop \fi} \countUTFx = "C2 \countUTFy = "E0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiTwoOctets\string~}} \UTFviiiLoop \countUTFx = "E0 \countUTFy = "F0 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiThreeOctets\string~}} \UTFviiiLoop \countUTFx = "F0 \countUTFy = "F4 \def\UTFviiiTmp{% \xdef~{\noexpand\UTFviiiFourOctets\string~}} \UTFviiiLoop \endgroup \begingroup \catcode`\"=12 \catcode`\<=12 \catcode`\.=12 \catcode`\,=12 \catcode`\;=12 \catcode`\!=12 \catcode`\~=13 \gdef\DeclareUnicodeCharacter#1#2{% \countUTFz = "#1\relax %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% \begingroup \parseXMLCharref \def\UTFviiiTwoOctets##1##2{% \csname u8:##1\string ##2\endcsname}% \def\UTFviiiThreeOctets##1##2##3{% \csname u8:##1\string ##2\string ##3\endcsname}% \def\UTFviiiFourOctets##1##2##3##4{% \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% \expandafter\expandafter\expandafter\expandafter \expandafter\expandafter\expandafter \gdef\UTFviiiTmp{#2}% \endgroup} \gdef\parseXMLCharref{% \ifnum\countUTFz < "A0\relax \errhelp = \EMsimple \errmessage{Cannot define Unicode char value < 00A0}% \else\ifnum\countUTFz < "800\relax \parseUTFviiiA,% \parseUTFviiiB C\UTFviiiTwoOctets.,% \else\ifnum\countUTFz < "10000\relax \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% \else \parseUTFviiiA;% \parseUTFviiiA,% \parseUTFviiiA!% \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% \fi\fi\fi } \gdef\parseUTFviiiA#1{% \countUTFx = \countUTFz \divide\countUTFz by 64 \countUTFy = \countUTFz \multiply\countUTFz by 64 \advance\countUTFx by -\countUTFz \advance\countUTFx by 128 \uccode `#1\countUTFx \countUTFz = \countUTFy} \gdef\parseUTFviiiB#1#2#3#4{% \advance\countUTFz by "#10\relax \uccode `#3\countUTFz \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} \endgroup \def\utfeightchardefs{% \DeclareUnicodeCharacter{00A0}{\tie} \DeclareUnicodeCharacter{00A1}{\exclamdown} \DeclareUnicodeCharacter{00A3}{\pounds} \DeclareUnicodeCharacter{00A8}{\"{ }} \DeclareUnicodeCharacter{00A9}{\copyright} \DeclareUnicodeCharacter{00AA}{\ordf} \DeclareUnicodeCharacter{00AB}{\guillemetleft} \DeclareUnicodeCharacter{00AD}{\-} \DeclareUnicodeCharacter{00AE}{\registeredsymbol} \DeclareUnicodeCharacter{00AF}{\={ }} \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} \DeclareUnicodeCharacter{00B4}{\'{ }} \DeclareUnicodeCharacter{00B8}{\cedilla{ }} \DeclareUnicodeCharacter{00BA}{\ordm} \DeclareUnicodeCharacter{00BB}{\guillemetright} \DeclareUnicodeCharacter{00BF}{\questiondown} \DeclareUnicodeCharacter{00C0}{\`A} \DeclareUnicodeCharacter{00C1}{\'A} \DeclareUnicodeCharacter{00C2}{\^A} \DeclareUnicodeCharacter{00C3}{\~A} \DeclareUnicodeCharacter{00C4}{\"A} \DeclareUnicodeCharacter{00C5}{\AA} \DeclareUnicodeCharacter{00C6}{\AE} \DeclareUnicodeCharacter{00C7}{\cedilla{C}} \DeclareUnicodeCharacter{00C8}{\`E} \DeclareUnicodeCharacter{00C9}{\'E} \DeclareUnicodeCharacter{00CA}{\^E} \DeclareUnicodeCharacter{00CB}{\"E} \DeclareUnicodeCharacter{00CC}{\`I} \DeclareUnicodeCharacter{00CD}{\'I} \DeclareUnicodeCharacter{00CE}{\^I} \DeclareUnicodeCharacter{00CF}{\"I} \DeclareUnicodeCharacter{00D0}{\DH} \DeclareUnicodeCharacter{00D1}{\~N} \DeclareUnicodeCharacter{00D2}{\`O} \DeclareUnicodeCharacter{00D3}{\'O} \DeclareUnicodeCharacter{00D4}{\^O} \DeclareUnicodeCharacter{00D5}{\~O} \DeclareUnicodeCharacter{00D6}{\"O} \DeclareUnicodeCharacter{00D8}{\O} \DeclareUnicodeCharacter{00D9}{\`U} \DeclareUnicodeCharacter{00DA}{\'U} \DeclareUnicodeCharacter{00DB}{\^U} \DeclareUnicodeCharacter{00DC}{\"U} \DeclareUnicodeCharacter{00DD}{\'Y} \DeclareUnicodeCharacter{00DE}{\TH} \DeclareUnicodeCharacter{00DF}{\ss} \DeclareUnicodeCharacter{00E0}{\`a} \DeclareUnicodeCharacter{00E1}{\'a} \DeclareUnicodeCharacter{00E2}{\^a} \DeclareUnicodeCharacter{00E3}{\~a} \DeclareUnicodeCharacter{00E4}{\"a} \DeclareUnicodeCharacter{00E5}{\aa} \DeclareUnicodeCharacter{00E6}{\ae} \DeclareUnicodeCharacter{00E7}{\cedilla{c}} \DeclareUnicodeCharacter{00E8}{\`e} \DeclareUnicodeCharacter{00E9}{\'e} \DeclareUnicodeCharacter{00EA}{\^e} \DeclareUnicodeCharacter{00EB}{\"e} \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} \DeclareUnicodeCharacter{00F0}{\dh} \DeclareUnicodeCharacter{00F1}{\~n} \DeclareUnicodeCharacter{00F2}{\`o} \DeclareUnicodeCharacter{00F3}{\'o} \DeclareUnicodeCharacter{00F4}{\^o} \DeclareUnicodeCharacter{00F5}{\~o} \DeclareUnicodeCharacter{00F6}{\"o} \DeclareUnicodeCharacter{00F8}{\o} \DeclareUnicodeCharacter{00F9}{\`u} \DeclareUnicodeCharacter{00FA}{\'u} \DeclareUnicodeCharacter{00FB}{\^u} \DeclareUnicodeCharacter{00FC}{\"u} \DeclareUnicodeCharacter{00FD}{\'y} \DeclareUnicodeCharacter{00FE}{\th} \DeclareUnicodeCharacter{00FF}{\"y} \DeclareUnicodeCharacter{0100}{\=A} \DeclareUnicodeCharacter{0101}{\=a} \DeclareUnicodeCharacter{0102}{\u{A}} \DeclareUnicodeCharacter{0103}{\u{a}} \DeclareUnicodeCharacter{0104}{\ogonek{A}} \DeclareUnicodeCharacter{0105}{\ogonek{a}} \DeclareUnicodeCharacter{0106}{\'C} \DeclareUnicodeCharacter{0107}{\'c} \DeclareUnicodeCharacter{0108}{\^C} \DeclareUnicodeCharacter{0109}{\^c} \DeclareUnicodeCharacter{0118}{\ogonek{E}} \DeclareUnicodeCharacter{0119}{\ogonek{e}} \DeclareUnicodeCharacter{010A}{\dotaccent{C}} \DeclareUnicodeCharacter{010B}{\dotaccent{c}} \DeclareUnicodeCharacter{010C}{\v{C}} \DeclareUnicodeCharacter{010D}{\v{c}} \DeclareUnicodeCharacter{010E}{\v{D}} \DeclareUnicodeCharacter{0112}{\=E} \DeclareUnicodeCharacter{0113}{\=e} \DeclareUnicodeCharacter{0114}{\u{E}} \DeclareUnicodeCharacter{0115}{\u{e}} \DeclareUnicodeCharacter{0116}{\dotaccent{E}} \DeclareUnicodeCharacter{0117}{\dotaccent{e}} \DeclareUnicodeCharacter{011A}{\v{E}} \DeclareUnicodeCharacter{011B}{\v{e}} \DeclareUnicodeCharacter{011C}{\^G} \DeclareUnicodeCharacter{011D}{\^g} \DeclareUnicodeCharacter{011E}{\u{G}} \DeclareUnicodeCharacter{011F}{\u{g}} \DeclareUnicodeCharacter{0120}{\dotaccent{G}} \DeclareUnicodeCharacter{0121}{\dotaccent{g}} \DeclareUnicodeCharacter{0124}{\^H} \DeclareUnicodeCharacter{0125}{\^h} \DeclareUnicodeCharacter{0128}{\~I} \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} \DeclareUnicodeCharacter{012A}{\=I} \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} \DeclareUnicodeCharacter{012C}{\u{I}} \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} \DeclareUnicodeCharacter{0130}{\dotaccent{I}} \DeclareUnicodeCharacter{0131}{\dotless{i}} \DeclareUnicodeCharacter{0132}{IJ} \DeclareUnicodeCharacter{0133}{ij} \DeclareUnicodeCharacter{0134}{\^J} \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} \DeclareUnicodeCharacter{0139}{\'L} \DeclareUnicodeCharacter{013A}{\'l} \DeclareUnicodeCharacter{0141}{\L} \DeclareUnicodeCharacter{0142}{\l} \DeclareUnicodeCharacter{0143}{\'N} \DeclareUnicodeCharacter{0144}{\'n} \DeclareUnicodeCharacter{0147}{\v{N}} \DeclareUnicodeCharacter{0148}{\v{n}} \DeclareUnicodeCharacter{014C}{\=O} \DeclareUnicodeCharacter{014D}{\=o} \DeclareUnicodeCharacter{014E}{\u{O}} \DeclareUnicodeCharacter{014F}{\u{o}} \DeclareUnicodeCharacter{0150}{\H{O}} \DeclareUnicodeCharacter{0151}{\H{o}} \DeclareUnicodeCharacter{0152}{\OE} \DeclareUnicodeCharacter{0153}{\oe} \DeclareUnicodeCharacter{0154}{\'R} \DeclareUnicodeCharacter{0155}{\'r} \DeclareUnicodeCharacter{0158}{\v{R}} \DeclareUnicodeCharacter{0159}{\v{r}} \DeclareUnicodeCharacter{015A}{\'S} \DeclareUnicodeCharacter{015B}{\'s} \DeclareUnicodeCharacter{015C}{\^S} \DeclareUnicodeCharacter{015D}{\^s} \DeclareUnicodeCharacter{015E}{\cedilla{S}} \DeclareUnicodeCharacter{015F}{\cedilla{s}} \DeclareUnicodeCharacter{0160}{\v{S}} \DeclareUnicodeCharacter{0161}{\v{s}} \DeclareUnicodeCharacter{0162}{\cedilla{t}} \DeclareUnicodeCharacter{0163}{\cedilla{T}} \DeclareUnicodeCharacter{0164}{\v{T}} \DeclareUnicodeCharacter{0168}{\~U} \DeclareUnicodeCharacter{0169}{\~u} \DeclareUnicodeCharacter{016A}{\=U} \DeclareUnicodeCharacter{016B}{\=u} \DeclareUnicodeCharacter{016C}{\u{U}} \DeclareUnicodeCharacter{016D}{\u{u}} \DeclareUnicodeCharacter{016E}{\ringaccent{U}} \DeclareUnicodeCharacter{016F}{\ringaccent{u}} \DeclareUnicodeCharacter{0170}{\H{U}} \DeclareUnicodeCharacter{0171}{\H{u}} \DeclareUnicodeCharacter{0174}{\^W} \DeclareUnicodeCharacter{0175}{\^w} \DeclareUnicodeCharacter{0176}{\^Y} \DeclareUnicodeCharacter{0177}{\^y} \DeclareUnicodeCharacter{0178}{\"Y} \DeclareUnicodeCharacter{0179}{\'Z} \DeclareUnicodeCharacter{017A}{\'z} \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} \DeclareUnicodeCharacter{017C}{\dotaccent{z}} \DeclareUnicodeCharacter{017D}{\v{Z}} \DeclareUnicodeCharacter{017E}{\v{z}} \DeclareUnicodeCharacter{01C4}{D\v{Z}} \DeclareUnicodeCharacter{01C5}{D\v{z}} \DeclareUnicodeCharacter{01C6}{d\v{z}} \DeclareUnicodeCharacter{01C7}{LJ} \DeclareUnicodeCharacter{01C8}{Lj} \DeclareUnicodeCharacter{01C9}{lj} \DeclareUnicodeCharacter{01CA}{NJ} \DeclareUnicodeCharacter{01CB}{Nj} \DeclareUnicodeCharacter{01CC}{nj} \DeclareUnicodeCharacter{01CD}{\v{A}} \DeclareUnicodeCharacter{01CE}{\v{a}} \DeclareUnicodeCharacter{01CF}{\v{I}} \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} \DeclareUnicodeCharacter{01D1}{\v{O}} \DeclareUnicodeCharacter{01D2}{\v{o}} \DeclareUnicodeCharacter{01D3}{\v{U}} \DeclareUnicodeCharacter{01D4}{\v{u}} \DeclareUnicodeCharacter{01E2}{\={\AE}} \DeclareUnicodeCharacter{01E3}{\={\ae}} \DeclareUnicodeCharacter{01E6}{\v{G}} \DeclareUnicodeCharacter{01E7}{\v{g}} \DeclareUnicodeCharacter{01E8}{\v{K}} \DeclareUnicodeCharacter{01E9}{\v{k}} \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} \DeclareUnicodeCharacter{01F1}{DZ} \DeclareUnicodeCharacter{01F2}{Dz} \DeclareUnicodeCharacter{01F3}{dz} \DeclareUnicodeCharacter{01F4}{\'G} \DeclareUnicodeCharacter{01F5}{\'g} \DeclareUnicodeCharacter{01F8}{\`N} \DeclareUnicodeCharacter{01F9}{\`n} \DeclareUnicodeCharacter{01FC}{\'{\AE}} \DeclareUnicodeCharacter{01FD}{\'{\ae}} \DeclareUnicodeCharacter{01FE}{\'{\O}} \DeclareUnicodeCharacter{01FF}{\'{\o}} \DeclareUnicodeCharacter{021E}{\v{H}} \DeclareUnicodeCharacter{021F}{\v{h}} \DeclareUnicodeCharacter{0226}{\dotaccent{A}} \DeclareUnicodeCharacter{0227}{\dotaccent{a}} \DeclareUnicodeCharacter{0228}{\cedilla{E}} \DeclareUnicodeCharacter{0229}{\cedilla{e}} \DeclareUnicodeCharacter{022E}{\dotaccent{O}} \DeclareUnicodeCharacter{022F}{\dotaccent{o}} \DeclareUnicodeCharacter{0232}{\=Y} \DeclareUnicodeCharacter{0233}{\=y} \DeclareUnicodeCharacter{0237}{\dotless{j}} \DeclareUnicodeCharacter{02DB}{\ogonek{ }} \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} \DeclareUnicodeCharacter{1E20}{\=G} \DeclareUnicodeCharacter{1E21}{\=g} \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} \DeclareUnicodeCharacter{1E26}{\"H} \DeclareUnicodeCharacter{1E27}{\"h} \DeclareUnicodeCharacter{1E30}{\'K} \DeclareUnicodeCharacter{1E31}{\'k} \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} \DeclareUnicodeCharacter{1E3E}{\'M} \DeclareUnicodeCharacter{1E3F}{\'m} \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} \DeclareUnicodeCharacter{1E54}{\'P} \DeclareUnicodeCharacter{1E55}{\'p} \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} \DeclareUnicodeCharacter{1E7C}{\~V} \DeclareUnicodeCharacter{1E7D}{\~v} \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} \DeclareUnicodeCharacter{1E80}{\`W} \DeclareUnicodeCharacter{1E81}{\`w} \DeclareUnicodeCharacter{1E82}{\'W} \DeclareUnicodeCharacter{1E83}{\'w} \DeclareUnicodeCharacter{1E84}{\"W} \DeclareUnicodeCharacter{1E85}{\"w} \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} \DeclareUnicodeCharacter{1E8C}{\"X} \DeclareUnicodeCharacter{1E8D}{\"x} \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} \DeclareUnicodeCharacter{1E90}{\^Z} \DeclareUnicodeCharacter{1E91}{\^z} \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} \DeclareUnicodeCharacter{1E97}{\"t} \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} \DeclareUnicodeCharacter{1EBC}{\~E} \DeclareUnicodeCharacter{1EBD}{\~e} \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} \DeclareUnicodeCharacter{1EF2}{\`Y} \DeclareUnicodeCharacter{1EF3}{\`y} \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} \DeclareUnicodeCharacter{1EF8}{\~Y} \DeclareUnicodeCharacter{1EF9}{\~y} \DeclareUnicodeCharacter{2013}{--} \DeclareUnicodeCharacter{2014}{---} \DeclareUnicodeCharacter{2018}{\quoteleft} \DeclareUnicodeCharacter{2019}{\quoteright} \DeclareUnicodeCharacter{201A}{\quotesinglbase} \DeclareUnicodeCharacter{201C}{\quotedblleft} \DeclareUnicodeCharacter{201D}{\quotedblright} \DeclareUnicodeCharacter{201E}{\quotedblbase} \DeclareUnicodeCharacter{2022}{\bullet} \DeclareUnicodeCharacter{2026}{\dots} \DeclareUnicodeCharacter{2039}{\guilsinglleft} \DeclareUnicodeCharacter{203A}{\guilsinglright} \DeclareUnicodeCharacter{20AC}{\euro} \DeclareUnicodeCharacter{2192}{\expansion} \DeclareUnicodeCharacter{21D2}{\result} \DeclareUnicodeCharacter{2212}{\minus} \DeclareUnicodeCharacter{2217}{\point} \DeclareUnicodeCharacter{2261}{\equiv} }% end of \utfeightchardefs % US-ASCII character definitions. \def\asciichardefs{% nothing need be done \relax } % Make non-ASCII characters printable again for compatibility with % existing Texinfo documents that may use them, even without declaring a % document encoding. % \setnonasciicharscatcode \other \message{formatting,} \newdimen\defaultparindent \defaultparindent = 15pt \chapheadingskip = 15pt plus 4pt minus 2pt \secheadingskip = 12pt plus 3pt minus 2pt \subsecheadingskip = 9pt plus 2pt minus 2pt % Prevent underfull vbox error messages. \vbadness = 10000 % Don't be very finicky about underfull hboxes, either. \hbadness = 6666 % Following George Bush, get rid of widows and orphans. \widowpenalty=10000 \clubpenalty=10000 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're % using an old version of TeX, don't do anything. We want the amount of % stretch added to depend on the line length, hence the dependence on % \hsize. We call this whenever the paper size is set. % \def\setemergencystretch{% \ifx\emergencystretch\thisisundefined % Allow us to assign to \emergencystretch anyway. \def\emergencystretch{\dimen0}% \else \emergencystretch = .15\hsize \fi } % Parameters in order: 1) textheight; 2) textwidth; % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; % 7) physical page height; 8) physical page width. % % We also call \setleading{\textleading}, so the caller should define % \textleading. The caller should also set \parskip. % \def\internalpagesizes#1#2#3#4#5#6#7#8{% \voffset = #3\relax \topskip = #6\relax \splittopskip = \topskip % \vsize = #1\relax \advance\vsize by \topskip \outervsize = \vsize \advance\outervsize by 2\topandbottommargin \pageheight = \vsize % \hsize = #2\relax \outerhsize = \hsize \advance\outerhsize by 0.5in \pagewidth = \hsize % \normaloffset = #4\relax \bindingoffset = #5\relax % \ifpdf \pdfpageheight #7\relax \pdfpagewidth #8\relax % if we don't reset these, they will remain at "1 true in" of % whatever layout pdftex was dumped with. \pdfhorigin = 1 true in \pdfvorigin = 1 true in \fi % \setleading{\textleading} % \parindent = \defaultparindent \setemergencystretch } % @letterpaper (the default). \def\letterpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % If page is nothing but text, make it come out even. \internalpagesizes{607.2pt}{6in}% that's 46 lines {\voffset}{.25in}% {\bindingoffset}{36pt}% {11in}{8.5in}% }} % Use @smallbook to reset parameters for 7x9.25 trim size. \def\smallbook{{\globaldefs = 1 \parskip = 2pt plus 1pt \textleading = 12pt % \internalpagesizes{7.5in}{5in}% {-.2in}{0in}% {\bindingoffset}{16pt}% {9.25in}{7in}% % \lispnarrowing = 0.3in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .5cm }} % Use @smallerbook to reset parameters for 6x9 trim size. % (Just testing, parameters still in flux.) \def\smallerbook{{\globaldefs = 1 \parskip = 1.5pt plus 1pt \textleading = 12pt % \internalpagesizes{7.4in}{4.8in}% {-.2in}{-.4in}% {0pt}{14pt}% {9in}{6in}% % \lispnarrowing = 0.25in \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = .4cm }} % Use @afourpaper to print on European A4 paper. \def\afourpaper{{\globaldefs = 1 \parskip = 3pt plus 2pt minus 1pt \textleading = 13.2pt % % Double-side printing via postscript on Laserjet 4050 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. % To change the settings for a different printer or situation, adjust % \normaloffset until the front-side and back-side texts align. Then % do the same for \bindingoffset. You can set these for testing in % your texinfo source file like this: % @tex % \global\normaloffset = -6mm % \global\bindingoffset = 10mm % @end tex \internalpagesizes{673.2pt}{160mm}% that's 51 lines {\voffset}{\hoffset}% {\bindingoffset}{44pt}% {297mm}{210mm}% % \tolerance = 700 \hfuzz = 1pt \contentsrightmargin = 0pt \defbodyindent = 5mm }} % Use @afivepaper to print on European A5 paper. % From romildo@urano.iceb.ufop.br, 2 July 2000. % He also recommends making @example and @lisp be small. \def\afivepaper{{\globaldefs = 1 \parskip = 2pt plus 1pt minus 0.1pt \textleading = 12.5pt % \internalpagesizes{160mm}{120mm}% {\voffset}{\hoffset}% {\bindingoffset}{8pt}% {210mm}{148mm}% % \lispnarrowing = 0.2in \tolerance = 800 \hfuzz = 1.2pt \contentsrightmargin = 0pt \defbodyindent = 2mm \tableindent = 12mm }} % A specific text layout, 24x15cm overall, intended for A4 paper. \def\afourlatex{{\globaldefs = 1 \afourpaper \internalpagesizes{237mm}{150mm}% {\voffset}{4.6mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% % % Must explicitly reset to 0 because we call \afourpaper. \globaldefs = 0 }} % Use @afourwide to print on A4 paper in landscape format. \def\afourwide{{\globaldefs = 1 \afourpaper \internalpagesizes{241mm}{165mm}% {\voffset}{-2.95mm}% {\bindingoffset}{7mm}% {297mm}{210mm}% \globaldefs = 0 }} % @pagesizes TEXTHEIGHT[,TEXTWIDTH] % Perhaps we should allow setting the margins, \topskip, \parskip, % and/or leading, also. Or perhaps we should compute them somehow. % \parseargdef\pagesizes{\pagesizesyyy #1,,\finish} \def\pagesizesyyy#1,#2,#3\finish{{% \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi \globaldefs = 1 % \parskip = 3pt plus 2pt minus 1pt \setleading{\textleading}% % \dimen0 = #1\relax \advance\dimen0 by \voffset % \dimen2 = \hsize \advance\dimen2 by \normaloffset % \internalpagesizes{#1}{\hsize}% {\voffset}{\normaloffset}% {\bindingoffset}{44pt}% {\dimen0}{\dimen2}% }} % Set default to letter. % \letterpaper \message{and turning on texinfo input format.} \def^^L{\par} % remove \outer, so ^L can appear in an @comment % DEL is a comment character, in case @c does not suffice. \catcode`\^^? = 14 % Define macros to output various characters with catcode for normal text. \catcode`\"=\other \def\normaldoublequote{"} \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix \catcode`\+=\other \def\normalplus{+} \catcode`\<=\other \def\normalless{<} \catcode`\>=\other \def\normalgreater{>} \catcode`\^=\other \def\normalcaret{^} \catcode`\_=\other \def\normalunderscore{_} \catcode`\|=\other \def\normalverticalbar{|} \catcode`\~=\other \def\normaltilde{~} % This macro is used to make a character print one way in \tt % (where it can probably be output as-is), and another way in other fonts, % where something hairier probably needs to be done. % % #1 is what to print if we are indeed using \tt; #2 is what to print % otherwise. Since all the Computer Modern typewriter fonts have zero % interword stretch (and shrink), and it is reasonable to expect all % typewriter fonts to have this, we can check that font parameter. % \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} % Same as above, but check for italic font. Actually this also catches % non-italic slanted fonts since it is impossible to distinguish them from % italic fonts. But since this is only used by $ and it uses \sl anyway % this is not a problem. \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} % Turn off all special characters except @ % (and those which the user can use as if they were ordinary). % Most of these we simply print from the \tt font, but for some, we can % use math or other variants that look better in normal text. \catcode`\"=\active \def\activedoublequote{{\tt\char34}} \let"=\activedoublequote \catcode`\~=\active \def~{{\tt\char126}} \chardef\hat=`\^ \catcode`\^=\active \def^{{\tt \hat}} \catcode`\_=\active \def_{\ifusingtt\normalunderscore\_} \let\realunder=_ % Subroutine for the previous macro. \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } \catcode`\|=\active \def|{{\tt\char124}} \chardef \less=`\< \catcode`\<=\active \def<{{\tt \less}} \chardef \gtr=`\> \catcode`\>=\active \def>{{\tt \gtr}} \catcode`\+=\active \def+{{\tt \char 43}} \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix % If a .fmt file is being used, characters that might appear in a file % name cannot be active until we have parsed the command line. % So turn them off again, and have \everyjob (or @setfilename) turn them on. % \otherifyactive is called near the end of this file. \def\otherifyactive{\catcode`+=\other \catcode`\_=\other} % Used sometimes to turn off (effectively) the active characters even after % parsing them. \def\turnoffactive{% \normalturnoffactive \otherbackslash } \catcode`\@=0 % \backslashcurfont outputs one backslash character in current font, % as in \char`\\. \global\chardef\backslashcurfont=`\\ \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work % \realbackslash is an actual character `\' with catcode other, and % \doublebackslash is two of them (for the pdf outlines). {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} % In texinfo, backslash is an active character; it prints the backslash % in fixed width font. \catcode`\\=\active % @ for escape char from now on. % The story here is that in math mode, the \char of \backslashcurfont % ends up printing the roman \ from the math symbol font (because \char % in math mode uses the \mathcode, and plain.tex sets % \mathcode`\\="026E). It seems better for @backslashchar{} to always % print a typewriter backslash, hence we use an explicit \mathchar, % which is the decimal equivalent of "715c (class 7, e.g., use \fam; % ignored family value; char position "5C). We can't use " for the % usual hex value because it has already been made active. @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. % On startup, @fixbackslash assigns: % @let \ = @normalbackslash % \rawbackslash defines an active \ to do \backslashcurfont. % \otherbackslash defines an active \ to be a literal `\' character with % catcode other. We switch back and forth between these. @gdef@rawbackslash{@let\=@backslashcurfont} @gdef@otherbackslash{@let\=@realbackslash} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. Also revert - to its normal character, in % case the active - from code has slipped in. % {@catcode`- = @active @gdef@normalturnoffactive{% @let-=@normaldash @let"=@normaldoublequote @let$=@normaldollar %$ font-lock fix @let+=@normalplus @let<=@normalless @let>=@normalgreater @let\=@normalbackslash @let^=@normalcaret @let_=@normalunderscore @let|=@normalverticalbar @let~=@normaltilde @markupsetuplqdefault @markupsetuprqdefault @unsepspaces } } % Make _ and + \other characters, temporarily. % This is canceled by @fixbackslash. @otherifyactive % If a .fmt file is being used, we don't want the `\input texinfo' to show up. % That is what \eatinput is for; after that, the `\' should revert to printing % a backslash. % @gdef@eatinput input texinfo{@fixbackslash} @global@let\ = @eatinput % On the other hand, perhaps the file did not have a `\input texinfo'. Then % the first `\' in the file would cause an error. This macro tries to fix % that, assuming it is called before the first `\' could plausibly occur. % Also turn back on active characters that might appear in the input % file name, in case not using a pre-dumped format. % @gdef@fixbackslash{% @ifx\@eatinput @let\ = @normalbackslash @fi @catcode`+=@active @catcode`@_=@active } % Say @foo, not \foo, in error messages. @escapechar = `@@ % These (along with & and #) are made active for url-breaking, so need % active definitions as the normal characters. @def@normaldot{.} @def@normalquest{?} @def@normalslash{/} % These look ok in all fonts, so just make them not special. % @hashchar{} gets its own user-level command, because of #line. @catcode`@& = @other @def@normalamp{&} @catcode`@# = @other @def@normalhash{#} @catcode`@% = @other @def@normalpercent{%} @let @hashchar = @normalhash @c Finally, make ` and ' active, so that txicodequoteundirected and @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we @c don't make ` and ' active, @code will not get them as active chars. @c Do this last of all since we use ` in the previous @catcode assignments. @catcode`@'=@active @catcode`@`=@active @markupsetuplqdefault @markupsetuprqdefault @c Local variables: @c eval: (add-hook 'write-file-hooks 'time-stamp) @c page-delimiter: "^\\\\message" @c time-stamp-start: "def\\\\texinfoversion{" @c time-stamp-format: "%:y-%02m-%02d.%02H" @c time-stamp-end: "}" @c End: @c vim:sw=2: @ignore arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 @end ignore enblend-enfuse-4.1.2+dfsg/CMakeModules/0000755000175100017510000000000012070530501020063 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/CMakeModules/HuginMacros.cmake0000644000175100017510000000245512070530113023311 0ustar ametzlerametzler# macro to convert a CMAKE list to a string MACRO(LIST2STRING alist astring) FOREACH(elem ${${alist}}) SET(${astring} "${${astring}} ${elem}") ENDFOREACH(elem) ENDMACRO(LIST2STRING) # from http://www.cmake.org/Wiki/CMakeMacroParseArguments MACRO(PARSE_ARGUMENTS prefix arg_names option_names) SET(DEFAULT_ARGS) FOREACH(arg_name ${arg_names}) SET(${prefix}_${arg_name}) ENDFOREACH(arg_name) FOREACH(option ${option_names}) SET(${prefix}_${option} FALSE) ENDFOREACH(option) SET(current_arg_name DEFAULT_ARGS) SET(current_arg_list) FOREACH(arg ${ARGN}) SET(larg_names ${arg_names}) LIST(FIND larg_names "${arg}" is_arg_name) IF (is_arg_name GREATER -1) SET(${prefix}_${current_arg_name} ${current_arg_list}) SET(current_arg_name ${arg}) SET(current_arg_list) ELSE (is_arg_name GREATER -1) SET(loption_names ${option_names}) LIST(FIND loption_names "${arg}" is_option) IF (is_option GREATER -1) SET(${prefix}_${arg} TRUE) ELSE (is_option GREATER -1) SET(current_arg_list ${current_arg_list} ${arg}) ENDIF (is_option GREATER -1) ENDIF (is_arg_name GREATER -1) ENDFOREACH(arg) SET(${prefix}_${current_arg_name} ${current_arg_list}) ENDMACRO(PARSE_ARGUMENTS) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindGSL.cmake0000644000175100017510000001102612070530113022312 0ustar ametzlerametzler# Script copied from http://www.cmake.org/pipermail/cmake/attachments/20080709/38127d1f/attachment.obj # and modified for use in enblend # (replaced calls like: # SET(GSL_LIBRARIES "`${GSL_CONFIG} --libs`") # with: # EXEC_PROGRAM(${GSL_CONFIG} ARGS "--libs" OUTPUT_VARIABLE GSL_LIBRARIES) # ) ################### # Script found on KDE-edu list # TODO replace this with OpenCog SIAI copyrighted version. # # Look for the header file # Try to find gnu scientific library GSL # See # http://www.gnu.org/software/gsl/ and # http://gnuwin32.sourceforge.net/packages/gsl.htm # # Once run this will define: # # GSL_FOUND = system has GSL lib # # GSL_LIBRARIES = full path to the libraries # on Unix/Linux with additional linker flags from "gsl-config --libs" # # CMAKE_GSL_CXX_FLAGS = Unix compiler flags for GSL, essentially "`gsl-config --cxxflags`" # # GSL_INCLUDE_DIR = where to find headers # # GSL_LINK_DIRECTORIES = link directories, useful for rpath on Unix # GSL_EXE_LINKER_FLAGS = rpath on Unix # # Felix Woelk 07/2004 # Jan Woetzel # # www.mip.informatik.uni-kiel.de # -------------------------------- IF(WIN32) SET(GSL_POSSIBLE_ROOT_DIRS ${SOURCE_BASE_DIR}/gsl-1.17 ${SOURCE_BASE_DIR}/gsl-1.16 ${SOURCE_BASE_DIR}/gsl-1.15 ) FIND_PATH(GSL_INCLUDE_DIR NAMES gsl/gsl_cdf.h gsl/gsl_randist.h PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES include DOC "GSL header include dir" ) FIND_LIBRARY(GSL_GSL_LIBRARY NAMES gsl libgsl PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES lib DOC "GSL library dir" ) FIND_LIBRARY(GSL_GSLCBLAS_LIBRARY NAMES gslcblas libgslcblas cblas PATHS ${GSL_POSSIBLE_ROOT_DIRS} PATH_SUFFIXES lib DOC "GSL cblas library dir" ) SET(GSL_LIBRARIES ${GSL_GSL_LIBRARY} ${GSL_GSLCBLAS_LIBRARY}) #MESSAGE("DBG\n" # "GSL_GSL_LIBRARY=${GSL_GSL_LIBRARY}\n" # "GSL_GSLCBLAS_LIBRARY=${GSL_GSLCBLAS_LIBRARY}\n" # "GSL_LIBRARIES=${GSL_LIBRARIES}") ELSE(WIN32) IF(UNIX) SET(GSL_CONFIG_PREFER_PATH "$ENV{GSL_DIR}/bin" "$ENV{GSL_DIR}" "$ENV{GSL_HOME}/bin" "$ENV{GSL_HOME}" CACHE STRING "preferred path to GSL (gsl-config)") FIND_PROGRAM(GSL_CONFIG gsl-config ${GSL_CONFIG_PREFER_PATH} /usr/bin/ ) # MESSAGE("DBG GSL_CONFIG ${GSL_CONFIG}") IF (GSL_CONFIG) # set CXXFLAGS to be fed into CXX_FLAGS by the user: EXEC_PROGRAM(${GSL_CONFIG} ARGS "--cflags" OUTPUT_VARIABLE GSL_CXX_FLAGS) # set INCLUDE_DIRS to prefix+include EXEC_PROGRAM(${GSL_CONFIG} ARGS "--prefix" OUTPUT_VARIABLE GSL_PREFIX) SET(GSL_INCLUDE_DIR ${GSL_PREFIX}/include CACHE STRING INTERNAL) # set link libraries and link flags EXEC_PROGRAM(${GSL_CONFIG} ARGS "--libs" OUTPUT_VARIABLE GSL_LIBRARIES) # extract link dirs for rpath EXEC_PROGRAM(${GSL_CONFIG} ARGS "--libs" OUTPUT_VARIABLE GSL_CONFIG_LIBS ) # split off the link dirs (for rpath) # use regular expression to match wildcard equivalent "-L*" # with is a space or a semicolon STRING(REGEX MATCHALL "[-][L]([^ ;])+" GSL_LINK_DIRECTORIES_WITH_PREFIX "${GSL_CONFIG_LIBS}" ) # MESSAGE("DBG GSL_LINK_DIRECTORIES_WITH_PREFIX=${GSL_LINK_DIRECTORIES_WITH_PREFIX}") # remove prefix -L because we need the pure directory for LINK_DIRECTORIES IF (GSL_LINK_DIRECTORIES_WITH_PREFIX) STRING(REGEX REPLACE "[-][L]" "" GSL_LINK_DIRECTORIES ${GSL_LINK_DIRECTORIES_WITH_PREFIX} ) ENDIF (GSL_LINK_DIRECTORIES_WITH_PREFIX) SET(GSL_EXE_LINKER_FLAGS "-Wl,-rpath,${GSL_LINK_DIRECTORIES}" CACHE STRING INTERNAL) # MESSAGE("DBG GSL_LINK_DIRECTORIES=${GSL_LINK_DIRECTORIES}") # MESSAGE("DBG GSL_EXE_LINKER_FLAGS=${GSL_EXE_LINKER_FLAGS}") # ADD_DEFINITIONS("-DHAVE_GSL") # SET(GSL_DEFINITIONS "-DHAVE_GSL") MARK_AS_ADVANCED( GSL_CXX_FLAGS GSL_INCLUDE_DIR GSL_LIBRARIES GSL_LINK_DIRECTORIES GSL_DEFINITIONS ) MESSAGE(STATUS "Using GSL from ${GSL_PREFIX}") ELSE(GSL_CONFIG) MESSAGE("FindGSL.cmake: gsl-config not found. Please set it manually. GSL_CONFIG=${GSL_CONFIG}") ENDIF(GSL_CONFIG) INCLUDE(FindPackageHandleStandardArgs) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GSL DEFAULT_MSG GSL_CONFIG) ENDIF(UNIX) ENDIF(WIN32) IF(GSL_LIBRARIES) IF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS) SET(GSL_FOUND 1) ENDIF(GSL_INCLUDE_DIR OR GSL_CXX_FLAGS) ENDIF(GSL_LIBRARIES) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindLibraryForCPU.cmake0000644000175100017510000000264512070530113024317 0ustar ametzlerametzler# # FIND_LIBRARY_WITH_CPU # -> enhanced FIND_LIBRARY to allow searching for platform # specific versions of libraries on Win32. This is common # for MSVC based builds that may output a file into a directory # particular for that CPU architecture (traditionally, # "Win32" and "x64" for 32-bit and 64-bit builds) # # # Based in part on FIND_LIBRARY_WITH_DEBUG # Copyright (c) 2009, Ryan Sleevi, # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. MACRO(FIND_LIBRARY_FOR_CPU var_name) IF(NOT MSVC) FIND_LIBRARY(${var_name} ${ARGN}) ELSE(NOT MSVC) SET(args ${ARGN}) SET(names "") SET(newpaths "") SET(found_paths 0) IF(CMAKE_CL_64) SET(msvc_platform "x64") ELSE(CMAKE_CL_64) SET(msvc_platform "Win32") ENDIF(CMAKE_CL_64) FOREACH(val ${args}) IF(found_paths) # Prefer the CPU-specific path over the generic/original path LIST(APPEND newpaths "${val}/${msvc_platform}") LIST(APPEND newpaths "${val}") ELSE(found_paths) IF("${val}" STREQUAL "PATHS") SET(found_paths 1) ELSE("${val}" STREQUAL "PATHS") LIST(APPEND names "${val}") ENDIF("${val}" STREQUAL "PATHS") ENDIF(found_paths) ENDFOREACH(val) FIND_LIBRARY(${var_name} ${names} PATHS ${newpaths}) ENDIF(NOT MSVC) ENDMACRO(FIND_LIBRARY_FOR_CPU) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindExiv2.cmake0000644000175100017510000000731012070530113022663 0ustar ametzlerametzler# - Try to find the Exiv2 library # Once done this will define # # EXIV2_FOUND - system has libexiv2 # EXIV2_INCLUDE_DIR - the libexiv2 include directory # EXIV2_LIBRARIES - Link these to use libexiv2 # EXIV2_DEFINITIONS - Compiler switches required for using libexiv2 # if (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) # in cache already SET(EXIV2_FOUND TRUE) else (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) if (NOT WIN32) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls INCLUDE(UsePkgConfig) PKGCONFIG(exiv2 _EXIV2IncDir _EXIV2LinkDir _EXIV2LinkFlags _EXIV2Cflags) if(_EXIV2LinkFlags) # query pkg-config asking for a Exiv2 >= 0.12 EXEC_PROGRAM(${PKGCONFIG_EXECUTABLE} ARGS --atleast-version=0.12 exiv2 RETURN_VALUE _return_VALUE OUTPUT_VARIABLE _pkgconfigDevNull ) if(_return_VALUE STREQUAL "0") message(STATUS "Found Exiv2 release >= 0.12") set(EXIV2_VERSION_GOOD_FOUND TRUE) else(_return_VALUE STREQUAL "0") message(STATUS "Found Exiv2 release < 0.12") endif(_return_VALUE STREQUAL "0") else(_EXIV2LinkFlags) set(EXIV2_FOUND FALSE) set(EXIV2_VERSION_GOOD_FOUND FALSE) message(STATUS "Cannot find Exiv2 library!") endif(_EXIV2LinkFlags) if(EXIV2_VERSION_GOOD_FOUND) set(EXIV2_DEFINITIONS ${_EXIV2Cflags}) FIND_PATH(EXIV2_INCLUDE_DIR exiv2/exif.hpp ${_EXIV2IncDir} ) FIND_LIBRARY(EXIV2_LIBRARIES NAMES exiv2 libexiv2 PATHS ${_EXIV2LinkDir} ) if (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) set(EXIV2_FOUND TRUE) endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) endif(EXIV2_VERSION_GOOD_FOUND) if (EXIV2_FOUND) if (NOT Exiv2_FIND_QUIETLY) message(STATUS "Found Exiv2: ${EXIV2_LIBRARIES}") endif (NOT Exiv2_FIND_QUIETLY) else (EXIV2_FOUND) if (Exiv2_FIND_REQUIRED) if (NOT EXIV2_INCLUDE_DIR) message(FATAL_ERROR "Could NOT find Exiv2 header files") endif (NOT EXIV2_INCLUDE_DIR) if (NOT EXIV2_LIBRARIES) message(FATAL_ERROR "Could NOT find Exiv2 library") endif (NOT EXIV2_LIBRARIES) endif (Exiv2_FIND_REQUIRED) endif (EXIV2_FOUND) else(NOT WIN32) FIND_PATH(EXIV2_INCLUDE_DIR exiv2/exif.hpp /usr/local/include /usr/include ${SOURCE_BASE_DIR}/exiv2/msvc/include ${SOURCE_BASE_DIR}/exiv2-0.16/msvc/include ${SOURCE_BASE_DIR}/exiv2-0.18/msvc/include ${SOURCE_BASE_DIR}/exiv2-0.18.1/msvc/include ${SOURCE_BASE_DIR}/exiv2-0.18.2/msvc/include ) include(FindLibraryWithDebug) find_library_with_debug(EXIV2_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES exiv2 libexiv2 PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/exiv2/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.16/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18.1/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18.2/msvc/lib ) find_library_with_debug(EXIV2EXPAT_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES libexpat PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/exiv2/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.16/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18.1/msvc/lib ${SOURCE_BASE_DIR}/exiv2-0.18.2/msvc/lib ) SET(EXIV2_LIBRARIES ${EXIV2_LIBRARIES} ${EXIV2EXPAT_LIBRARIES}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(EXIV2 DEFAULT_MSG EXIV2_INCLUDE_DIR EXIV2_LIBRARIES) endif (NOT WIN32) MARK_AS_ADVANCED(EXIV2_INCLUDE_DIR EXIV2_LIBRARIES) endif (EXIV2_INCLUDE_DIR AND EXIV2_LIBRARIES) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindGLEW.cmake0000644000175100017510000000142712070530113022427 0ustar ametzlerametzler# Try to find the glew libraries, setting these defines: # GLEW_FOUND - system has glew # GLEW_INCLUDE_DIR - glew include directory # GLEW_LIBRARIES - Libraries needed to use glew IF(WIN32) include(FindLibraryWithDebug) FIND_PATH(GLEW_INCLUDE_DIR GL/glew.h PATHS ${SOURCE_BASE_DIR}/glew/include) find_library_with_debug(GLEW_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES glew32s PATHS ${GLEW_LIB_DIR} ${SOURCE_BASE_DIR}/glew/lib ) ELSE(WIN32) FIND_PATH(GLEW_INCLUDE_DIR GL/glew.h PATHS /usr/include /usr/local/include) FIND_LIBRARY(GLEW_LIBRARIES GLEW PATHS ${SYSTEM_LIB_DIRS}) ENDIF(WIN32) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDE_DIR GLEW_LIBRARIES) MARK_AS_ADVANCED( GLEW_INCLUDE_DIR GLEW_LIBRARIES ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindOpenEXR.cmake0000644000175100017510000001323412070530113023150 0ustar ametzlerametzler# Try to find the OpenEXR libraries # This check defines: # # OPENEXR_FOUND - system has OpenEXR # OPENEXR_INCLUDE_DIR - OpenEXR include directory # OPENEXR_LIBRARIES - Libraries needed to use OpenEXR # # Copyright (c) 2006, Alexander Neundorf, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) # in cache already SET(OPENEXR_FOUND TRUE) else (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) IF (NOT WIN32 OR MINGW) # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls INCLUDE(UsePkgConfig) PKGCONFIG(OpenEXR _OpenEXRIncDir _OpenEXRLinkDir _OpenEXRLinkFlags _OpenEXRCflags) ENDIF (NOT WIN32 OR MINGW) include(FindLibraryForCPU) FIND_PATH(OPENEXR_INCLUDE_DIR ImfRgbaFile.h ${_OpenEXRIncDir} ${_OpenEXRIncDir}/OpenEXR/ /usr/include /usr/local/include ${SOURCE_BASE_DIR}/Deploy/include ) find_library_for_cpu(OPENEXR_HALF_LIBRARY NAMES Half PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease ${SOURCE_BASE_DIR}/Deploy/lib/Release ) find_library_for_cpu(OPENEXR_IEX_LIBRARY NAMES Iex PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease ${SOURCE_BASE_DIR}/Deploy/lib/Release ) find_library_for_cpu(OPENEXR_ILMTHREAD_LIBRARY NAMES IlmThread PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease ${SOURCE_BASE_DIR}/Deploy/lib/Release ) find_library_for_cpu(OPENEXR_IMATH_LIBRARY NAMES Imath PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease ${SOURCE_BASE_DIR}/Deploy/lib/Release ) find_library_for_cpu(OPENEXR_ILMIMF_LIBRARY NAMES IlmImf PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginRelease ${SOURCE_BASE_DIR}/Deploy/lib/Release ) find_library_for_cpu(OPENEXR_HALF_LIBRARY_DEBUG NAMES Half PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug ${SOURCE_BASE_DIR}/Deploy/lib/Debug ) find_library_for_cpu(OPENEXR_IEX_LIBRARY_DEBUG NAMES Iex PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug ${SOURCE_BASE_DIR}/Deploy/lib/Debug ) find_library_for_cpu(OPENEXR_ILMTHREAD_LIBRARY_DEBUG NAMES IlmThread PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug ${SOURCE_BASE_DIR}/Deploy/lib/Debug ) find_library_for_cpu(OPENEXR_IMATH_LIBRARY_DEBUG NAMES Imath PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug ${SOURCE_BASE_DIR}/Deploy/lib/Debug ) find_library_for_cpu(OPENEXR_ILMIMF_LIBRARY_DEBUG NAMES IlmImf PATHS ${_OPENEXRLinkDir} ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/Deploy/lib/HuginDebug ${SOURCE_BASE_DIR}/Deploy/lib/Debug ) if (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) set(OPENEXR_FOUND TRUE) if (OPENEXR_ILMTHREAD_LIBRARY) # set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBARY} CACHE STRING "The libraries needed to use OpenEXR") if (MSVC) set(OPENEXR_LIBRARIES optimized ${OPENEXR_IMATH_LIBRARY} optimized ${OPENEXR_ILMIMF_LIBRARY} optimized ${OPENEXR_IEX_LIBRARY} optimized ${OPENEXR_HALF_LIBRARY} optimized ${OPENEXR_ILMTHREAD_LIBRARY} debug ${OPENEXR_IMATH_LIBRARY_DEBUG} debug ${OPENEXR_ILMIMF_LIBRARY_DEBUG} debug ${OPENEXR_IEX_LIBRARY_DEBUG} debug ${OPENEXR_HALF_LIBRARY_DEBUG} debug ${OPENEXR_ILMTHREAD_LIBRARY_DEBUG} CACHE STRING "Libraries needed for OpenEXR") else (MSVC) set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} ${OPENEXR_ILMTHREAD_LIBRARY}) endif (MSVC) else (OPENEXR_ILMTHREAD_LIBRARY) if (MSVC) set(OPENEXR_LIBRARIES optimized ${OPENEXR_IMATH_LIBRARY} optimized ${OPENEXR_ILMIMF_LIBRARY} optimized ${OPENEXR_IEX_LIBRARY} optimized ${OPENEXR_HALF_LIBRARY} debug ${OPENEXR_IMATH_LIBRARY_DEBUG} debug ${OPENEXR_ILMIMF_LIBRARY_DEBUG} debug ${OPENEXR_IEX_LIBRARY_DEBUG} debug ${OPENEXR_HALF_LIBRARY_DEBUG} CACHE STRING "The libraries needed to use OpenEXR") else (MSVC) set(OPENEXR_LIBRARIES ${OPENEXR_IMATH_LIBRARY} ${OPENEXR_ILMIMF_LIBRARY} ${OPENEXR_IEX_LIBRARY} ${OPENEXR_HALF_LIBRARY} CACHE STRING "The libraries needed to use OpenEXR") endif (MSVC) endif (OPENEXR_ILMTHREAD_LIBRARY) endif (OPENEXR_INCLUDE_DIR AND OPENEXR_IMATH_LIBRARY AND OPENEXR_ILMIMF_LIBRARY AND OPENEXR_IEX_LIBRARY AND OPENEXR_HALF_LIBRARY) if (OPENEXR_FOUND) if (NOT OpenEXR_FIND_QUIETLY) message(STATUS "Found OPENEXR: ${OPENEXR_LIBRARIES}") endif (NOT OpenEXR_FIND_QUIETLY) else (OPENEXR_FOUND) if (OpenEXR_FIND_REQUIRED) message(FATAL_ERROR "Could NOT find OPENEXR") endif (OpenEXR_FIND_REQUIRED) endif (OPENEXR_FOUND) MARK_AS_ADVANCED( OPENEXR_INCLUDE_DIR OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_IMATH_LIBRARY OPENEXR_IEX_LIBRARY OPENEXR_HALF_LIBRARY OPENEXR_ILMTHREAD_LIBRARY OPENEXR_ILMIMF_LIBRARY_DEBUG OPENEXR_IMATH_LIBRARY_DEBUG OPENEXR_IEX_LIBRARY_DEBUG OPENEXR_HALF_LIBRARY_DEBUG OPENEXR_ILMTHREAD_LIBRARY_DEBUG ) endif (OPENEXR_INCLUDE_DIR AND OPENEXR_LIBRARIES) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindTIFF.cmake0000644000175100017510000000250212070530113022414 0ustar ametzlerametzler# - Find TIFF for Hugin 0.7 01Nov2007 TKSharpless # Added to support Windows build but should work anywhere. # After looking in UNIX standard places, tries wxWidgets build # tree, which should have this package. # # Call FIND_PACKAGE(wxWidgets REQUIRED) before calling this! # # reads cache variables # wxWidgets_ROOT_DIR # wxWidgets_LIB_DIR # defines cache variables # TIFF_INCLUDE_DIR, where to find headers # TIFF_LIBRARIES, list of link libraries for release # TIFF_DEBUG_LIBRARIES ditto for debug # TIFF_FOUND, If != "YES", do not try to use TIFF. FIND_PATH(TIFF_INCLUDE_DIR tiff.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/tiff-4.0.3/libtiff ${SOURCE_BASE_DIR}/tiff-4.0.0beta5/libtiff ${SOURCE_BASE_DIR}/tiff-3.9.2/libtiff ${SOURCE_BASE_DIR}/tiff-3.8.2/libtiff ) include(FindLibraryWithDebug) find_library_with_debug(TIFF_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES tiff libtiff PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/tiff-4.0.3/libtiff ${SOURCE_BASE_DIR}/tiff-4.0.0beta5/libtiff ${SOURCE_BASE_DIR}/tiff-3.9.2/libtiff ${SOURCE_BASE_DIR}/tiff-3.8.2/libtiff ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(TIFF DEFAULT_MSG TIFF_INCLUDE_DIR TIFF_LIBRARIES) MARK_AS_ADVANCED(TIFF_INCLUDE_DIR TIFF_LIBRARIES) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindLCMS2.cmake0000644000175100017510000000144212070530113022506 0ustar ametzlerametzler IF(NOT WIN32) FIND_LIBRARY(LCMS2_LIBRARIES lcms2 HINTS /usr/lib/x86_64-linux-gnu /usr/lib32) ELSE(NOT WIN32) FIND_PATH(LCMS2_ROOT_DIR NAMES include/lcms2.h PATHS /usr/local /usr ${SOURCE_BASE_DIR} PATH_SUFFIXES lcms2-2.5 lcms2-2.4 lcms2-2.3 ) FIND_PATH(LCMS2_INCLUDE_DIR NAMES lcms2.h PATHS /usr/local/include /usr/include ${LCMS2_ROOT_DIR}/include ) FIND_LIBRARY(LCMS2_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES lcms2 lcms2_static PATHS /usr/local/include /usr/include ${LCMS2_ROOT_DIR}/Lib/MS ) MARK_AS_ADVANCED( LCMS_ROOT_DIR LCMS_LIBRARIES LCMS_INCLUDE_DIR ) ENDIF(NOT WIN32) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindPkgConfig.cmake0000644000175100017510000003610512070530113023541 0ustar ametzlerametzler# - a pkg-config module for CMake # # Usage: # pkg_check_modules( [REQUIRED] []*) # checks for all the given modules # # pkg_search_module( [REQUIRED] []*) # checks for given modules and uses the first working one # # When the 'REQUIRED' argument was set, macros will fail with an error # when module(s) could not be found # # It sets the following variables: # PKG_CONFIG_FOUND ... true iff pkg-config works on the system # PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program # _FOUND ... set to 1 iff module(s) exist # # For the following variables two sets of values exist; first one is the # common one and has the given PREFIX. The second set contains flags # which are given out when pkgconfig was called with the '--static' # option. # _LIBRARIES ... only the libraries (w/o the '-l') # _LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # _LDFLAGS ... all required linker flags # _LDFLAGS_OTHERS ... all other linker flags # _INCLUDE_DIRS ... the '-I' preprocessor flags (w/o the '-I') # _CFLAGS ... all required cflags # _CFLAGS_OTHERS ... the other compiler flags # # = for common case # = _STATIC for static linking # # There are some special variables whose prefix depends on the count # of given modules. When there is only one module, stays # unchanged. When there are multiple modules, the prefix will be # changed to _: # _VERSION ... version of the module # _PREFIX ... prefix-directory of the module # _INCLUDEDIR ... include-dir of the module # _LIBDIR ... lib-dir of the module # # = when |MODULES| == 1, else # = _ # # A parameter can have the following formats: # {MODNAME} ... matches any version # {MODNAME}>={VERSION} ... at least version is required # {MODNAME}={VERSION} ... exactly version is required # {MODNAME}<={VERSION} ... modules must not be newer than # # Examples # pkg_check_modules (GLIB2 glib-2.0) # # pkg_check_modules (GLIB2 glib-2.0>=2.10) # requires at least version 2.10 of glib2 and defines e.g. # GLIB2_VERSION=2.10.3 # # pkg_check_modules (FOO glib-2.0>=2.10 gtk+-2.0) # requires both glib2 and gtk2, and defines e.g. # FOO_glib-2.0_VERSION=2.10.3 # FOO_gtk+-2.0_VERSION=2.8.20 # # pkg_check_modules (XRENDER REQUIRED xrender) # defines e.g.: # XRENDER_LIBRARIES=Xrender;X11 # XRENDER_STATIC_LIBRARIES=Xrender;X11;pthread;Xau;Xdmcp # # pkg_search_module (BAR libxml-2.0 libxml2 libxml>=2) # Copyright (C) 2006 Enrico Scholz # # Redistribution and use, with or without modification, are permitted # provided that the following conditions are met: # # 1. Redistributions must retain the above copyright notice, this # list of conditions and the following disclaimer. # 2. The name of the author may not be used to endorse or promote # products derived from this software without specific prior # written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ### Common stuff #### set(PKG_CONFIG_VERSION 1) set(PKG_CONFIG_FOUND 0) find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") mark_as_advanced(PKG_CONFIG_EXECUTABLE) if(PKG_CONFIG_EXECUTABLE) set(PKG_CONFIG_FOUND 1) endif(PKG_CONFIG_EXECUTABLE) # Unsets the given variables macro(_pkgconfig_unset var) set(${var} "" CACHE INTERNAL "") endmacro(_pkgconfig_unset) macro(_pkgconfig_set var value) set(${var} ${value} CACHE INTERNAL "") endmacro(_pkgconfig_set) # Invokes pkgconfig, cleans up the result and sets variables macro(_pkgconfig_invoke _pkglist _prefix _varname _regexp) set(_pkgconfig_invoke_result) execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${ARGN} ${_pkglist} OUTPUT_VARIABLE _pkgconfig_invoke_result RESULT_VARIABLE _pkgconfig_failed) if (_pkgconfig_failed) set(_pkgconfig_${_varname} "") _pkgconfig_unset(${_prefix}_${_varname}) else(_pkgconfig_failed) string(REGEX REPLACE "[\r\n]" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") string(REGEX REPLACE " +$" "" _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") if (NOT ${_regexp} STREQUAL "") string(REGEX REPLACE "${_regexp}" " " _pkgconfig_invoke_result "${_pkgconfig_invoke_result}") endif(NOT ${_regexp} STREQUAL "") separate_arguments(_pkgconfig_invoke_result) #message(STATUS " ${_varname} ... ${_pkgconfig_invoke_result}") set(_pkgconfig_${_varname} ${_pkgconfig_invoke_result}) _pkgconfig_set(${_prefix}_${_varname} "${_pkgconfig_invoke_result}") endif(_pkgconfig_failed) endmacro(_pkgconfig_invoke) # Invokes pkgconfig two times; once without '--static' and once with # '--static' macro(_pkgconfig_invoke_dyn _pkglist _prefix _varname cleanup_regexp) _pkgconfig_invoke("${_pkglist}" ${_prefix} ${_varname} "${cleanup_regexp}" ${ARGN}) _pkgconfig_invoke("${_pkglist}" ${_prefix} STATIC_${_varname} "${cleanup_regexp}" --static ${ARGN}) endmacro(_pkgconfig_invoke_dyn) # Splits given arguments into options and a package list macro(_pkgconfig_parse_options _result _is_req) set(${_is_req} 0) foreach(_pkg ${ARGN}) if (_pkg STREQUAL "REQUIRED") set(${_is_req} 1) endif (_pkg STREQUAL "REQUIRED") endforeach(_pkg ${ARGN}) set(${_result} ${ARGN}) list(REMOVE_ITEM ${_result} "REQUIRED") endmacro(_pkgconfig_parse_options) ### macro(_pkg_check_modules_internal _is_required _is_silent _prefix) _pkgconfig_unset(${_prefix}_FOUND) _pkgconfig_unset(${_prefix}_VERSION) _pkgconfig_unset(${_prefix}_PREFIX) _pkgconfig_unset(${_prefix}_INCLUDEDIR) _pkgconfig_unset(${_prefix}_LIBDIR) _pkgconfig_unset(${_prefix}_LIBS) _pkgconfig_unset(${_prefix}_LIBS_L) _pkgconfig_unset(${_prefix}_LIBS_PATHS) _pkgconfig_unset(${_prefix}_LIBS_OTHER) _pkgconfig_unset(${_prefix}_CFLAGS) _pkgconfig_unset(${_prefix}_CFLAGS_I) _pkgconfig_unset(${_prefix}_CFLAGS_OTHER) _pkgconfig_unset(${_prefix}_STATIC_LIBDIR) _pkgconfig_unset(${_prefix}_STATIC_LIBS) _pkgconfig_unset(${_prefix}_STATIC_LIBS_L) _pkgconfig_unset(${_prefix}_STATIC_LIBS_PATHS) _pkgconfig_unset(${_prefix}_STATIC_LIBS_OTHER) _pkgconfig_unset(${_prefix}_STATIC_CFLAGS) _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_I) _pkgconfig_unset(${_prefix}_STATIC_CFLAGS_OTHER) # create a better addressable variable of the modules and calculate its size set(_pkg_check_modules_list ${ARGN}) list(LENGTH _pkg_check_modules_list _pkg_check_modules_cnt) if(PKG_CONFIG_EXECUTABLE) # give out status message telling checked module if (NOT ${_is_silent}) if (_pkg_check_modules_cnt EQUAL 1) message(STATUS "checking for module '${_pkg_check_modules_list}'") else(_pkg_check_modules_cnt EQUAL 1) message(STATUS "checking for modules '${_pkg_check_modules_list}'") endif(_pkg_check_modules_cnt EQUAL 1) endif(NOT ${_is_silent}) set(_pkg_check_modules_packages) set(_pkg_check_modules_failed) # iterate through module list and check whether they exist and match the required version foreach (_pkg_check_modules_pkg ${_pkg_check_modules_list}) set(_pkg_check_modules_exist_query) # check whether version is given if (_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\1" _pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\2" _pkg_check_modules_pkg_op "${_pkg_check_modules_pkg}") string(REGEX REPLACE "(.*[^><])(>=|=|<=)(.*)" "\\3" _pkg_check_modules_pkg_ver "${_pkg_check_modules_pkg}") else(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") set(_pkg_check_modules_pkg_name "${_pkg_check_modules_pkg}") set(_pkg_check_modules_pkg_op) set(_pkg_check_modules_pkg_ver) endif(_pkg_check_modules_pkg MATCHES ".*(>=|=|<=).*") # handle the operands if (_pkg_check_modules_pkg_op STREQUAL ">=") list(APPEND _pkg_check_modules_exist_query --atleast-version) endif(_pkg_check_modules_pkg_op STREQUAL ">=") if (_pkg_check_modules_pkg_op STREQUAL "=") list(APPEND _pkg_check_modules_exist_query --exact-version) endif(_pkg_check_modules_pkg_op STREQUAL "=") if (_pkg_check_modules_pkg_op STREQUAL "<=") list(APPEND _pkg_check_modules_exist_query --max-version) endif(_pkg_check_modules_pkg_op STREQUAL "<=") # create the final query which is of the format: # * --atleast-version # * --exact-version # * --max-version # * --exists if (_pkg_check_modules_pkg_op) list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_ver}") else(_pkg_check_modules_pkg_op) list(APPEND _pkg_check_modules_exist_query --exists) endif(_pkg_check_modules_pkg_op) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_VERSION) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_PREFIX) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_INCLUDEDIR) _pkgconfig_unset(${_prefix}_${_pkg_check_modules_pkg_name}_LIBDIR) list(APPEND _pkg_check_modules_exist_query "${_pkg_check_modules_pkg_name}") list(APPEND _pkg_check_modules_packages "${_pkg_check_modules_pkg_name}") # execute the query execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} ${_pkg_check_modules_exist_query} RESULT_VARIABLE _pkgconfig_retval) # evaluate result and tell failures if (_pkgconfig_retval) if(NOT ${_is_silent}) message(STATUS " package '${_pkg_check_modules_pkg}' not found") endif(NOT ${_is_silent}) set(_pkg_check_modules_failed 1) endif(_pkgconfig_retval) endforeach(_pkg_check_modules_pkg) if(_pkg_check_modules_failed) # fail when requested if (${_is_required}) message(SEND_ERROR "A required package was not found") endif (${_is_required}) else(_pkg_check_modules_failed) # when we are here, we checked whether requested modules # exist. Now, go through them and set variables _pkgconfig_set(${_prefix}_FOUND 1) list(LENGTH _pkg_check_modules_packages pkg_count) # iterate through all modules again and set individual variables foreach (_pkg_check_modules_pkg ${_pkg_check_modules_packages}) # handle case when there is only one package required if (pkg_count EQUAL 1) set(_pkg_check_prefix "${_prefix}") else(pkg_count EQUAL 1) set(_pkg_check_prefix "${_prefix}_${_pkg_check_modules_pkg}") endif(pkg_count EQUAL 1) _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" VERSION "" --modversion ) _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" PREFIX "" --variable=prefix ) _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" INCLUDEDIR "" --variable=includedir ) _pkgconfig_invoke(${_pkg_check_modules_pkg} "${_pkg_check_prefix}" LIBDIR "" --variable=libdir ) message(STATUS " found ${_pkg_check_modules_pkg}, version ${_pkgconfig_VERSION}") endforeach(_pkg_check_modules_pkg) # set variables which are combined for multiple modules _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) endif(_pkg_check_modules_failed) else(PKG_CONFIG_EXECUTABLE) if (${_is_required}) message(SEND_ERROR "pkg-config tool not found") endif (${_is_required}) endif(PKG_CONFIG_EXECUTABLE) endmacro(_pkg_check_modules_internal) ### ### User visible macros start here ### ### macro(pkg_check_modules _prefix _module0) # check cached value if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) _pkgconfig_parse_options (_pkg_modules _pkg_is_required "${_module0}" ${ARGN}) _pkg_check_modules_internal("${_pkg_is_required}" 0 "${_prefix}" ${_pkg_modules}) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) endmacro(pkg_check_modules) ### macro(pkg_search_module _prefix _module0) # check cached value if (NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) set(_pkg_modules_found 0) _pkgconfig_parse_options(_pkg_modules_alt _pkg_is_required "${_module0}" ${ARGN}) message(STATUS "checking for one of the modules '${_pkg_modules_alt}'") # iterate through all modules and stop at the first working one. foreach(_pkg_alt ${_pkg_modules_alt}) if(NOT _pkg_modules_found) _pkg_check_modules_internal(0 1 "${_prefix}" "${_pkg_alt}") endif(NOT _pkg_modules_found) if (${_prefix}_FOUND) set(_pkg_modules_found 1) endif(${_prefix}_FOUND) endforeach(_pkg_alt) if (NOT ${_prefix}_FOUND) if(${_pkg_is_required}) message(SEND_ERROR "None of the required '${_pkg_modules_alt}' found") endif(${_pkg_is_required}) endif(NOT ${_prefix}_FOUND) _pkgconfig_set(__pkg_config_checked_${_prefix} ${PKG_CONFIG_VERSION}) endif(NOT DEFINED __pkg_config_checked_${_prefix} OR __pkg_config_checked_${_prefix} LESS ${PKG_CONFIG_VERSION}) endmacro(pkg_search_module) ### Local Variables: ### mode: cmake ### End: enblend-enfuse-4.1.2+dfsg/CMakeModules/FindPNG.cmake0000644000175100017510000000233112070530113022310 0ustar ametzlerametzler# - Find PNG for Hugin 0.7 01Nov2007 TKSharpless # Added to support Windows build but should work anywhere. # After looking in UNIX standard places, tries wxWidgets build # tree, which should have this package. # # Call FIND_PACKAGE(wxWidgets REQUIRED) before calling this! # # reads cache variables # wxWidgets_ROOT_DIR # wxWidgets_LIB_DIR # defines cache variables # PNG_INCLUDE_DIR, where to find headers # PNG_LIBRARIES, list of release link libraries. # PNG_FOUND, If != "YES", do not try to use PNG. # None of the above will be defined unless ZLIB can be found INCLUDE(FindZLIB) include(FindLibraryWithDebug) SET(PNG_FOUND "NO") IF (ZLIB_FOUND) FIND_PATH(PNG_INCLUDE_DIR png.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/libpng/include ) find_library_with_debug(PNG_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES png libpng libpng15 libpng15_static PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/libpng/lib ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(PNG DEFAULT_MSG PNG_INCLUDE_DIR PNG_LIBRARIES) SET(PNG_LIBRARIES ${PNG_LIBRARIES} ${ZLIB_LIBRARIES}) MARK_AS_ADVANCED(PNG_INCLUDE_DIR PNG_LIBRARIES ) ENDIF(ZLIB_FOUND) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindLibXMI.cmake0000644000175100017510000000126112070530113022751 0ustar ametzlerametzlerIF(NOT WIN32) FIND_PATH(LIBXMI_INCLUDE_DIR xmi.h /usr/local/include /usr/include ) FIND_LIBRARY(LIBXMI_LIBRARIES xmi) ELSE(NOT WIN32) include(FindLibraryWithDebug) FIND_PATH(LIBXMI_INCLUDE_DIR xmi.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/libxmi-1.2 ) find_library_with_debug(LIBXMI_LIBRARIES WIN32_DEBUG_PATH_SUFFIX Debug WIN32_RELEASE_PATH_SUFFIX Release NAMES libxmi PATHS ${LIBXMI_INCLUDE_DIR} ) ENDIF(NOT WIN32) MARK_AS_ADVANCED( LIBXMI_INCLUDE_DIR LIBXMI_LIBRARIES ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBXMI DEFAULT_MSG LIBXMI_INCLUDE_DIR LIBXMI_LIBRARIES)enblend-enfuse-4.1.2+dfsg/CMakeModules/FindOpenGL.cmake0000644000175100017510000000774012070530113023021 0ustar ametzlerametzler# - Try to find OpenGL # Once done this will define # # OPENGL_FOUND - system has OpenGL # OPENGL_XMESA_FOUND - system has XMESA # OPENGL_GLU_FOUND - system has GLU # OPENGL_INCLUDE_DIR - the GL include directory # OPENGL_LIBRARIES - Link these to use OpenGL and GLU # # If you want to use just GL you can use these values # OPENGL_gl_LIBRARY - Path to OpenGL Library # OPENGL_glu_LIBRARY - Path to GLU Library # # On OSX default to using the framework version of opengl # People will have to change the cache values of OPENGL_glu_LIBRARY # and OPENGL_gl_LIBRARY to use OpenGL with X11 on OSX IF (WIN32) IF (CYGWIN) FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h ) FIND_LIBRARY(OPENGL_gl_LIBRARY opengl32 ) FIND_LIBRARY(OPENGL_glu_LIBRARY glu32 ) ELSE (CYGWIN) IF(BORLAND) SET (OPENGL_gl_LIBRARY import32 CACHE STRING "OpenGL library for win32") SET (OPENGL_glu_LIBRARY import32 CACHE STRING "GLU library for win32") ELSE(BORLAND) SET (OPENGL_gl_LIBRARY opengl32 CACHE STRING "OpenGL library for win32") SET (OPENGL_glu_LIBRARY glu32 CACHE STRING "GLU library for win32") ENDIF(BORLAND) ENDIF (CYGWIN) ELSE (WIN32) IF (APPLE) FIND_LIBRARY(OPENGL_gl_LIBRARY OpenGL DOC "OpenGL lib for OSX") FIND_LIBRARY(OPENGL_glu_LIBRARY AGL DOC "AGL lib for OSX") FIND_PATH(OPENGL_INCLUDE_DIR OpenGL/gl.h DOC "Include for OpenGL on OSX") ELSE(APPLE) # The first line below is to make sure that the proper headers # are used on a Linux machine with the NVidia drivers installed. # They replace Mesa with NVidia's own library but normally do not # install headers and that causes the linking to # fail since the compiler finds the Mesa headers but NVidia's library. # Make sure the NVIDIA directory comes BEFORE the others. # - Atanas Georgiev FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h /usr/share/doc/NVIDIA_GLX-1.0/include /usr/openwin/share/include /opt/graphics/OpenGL/include ) FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h /usr/share/doc/NVIDIA_GLX-1.0/include /usr/openwin/share/include /opt/graphics/OpenGL/include ) FIND_LIBRARY(OPENGL_gl_LIBRARY HINTS /usr/lib/x86_64-linux-gnu /usr/lib32 NAMES GL MesaGL PATHS /opt/graphics/OpenGL/lib /usr/openwin/lib /usr/shlib ) # On Unix OpenGL most certainly always requires X11. # Feel free to tighten up these conditions if you don't # think this is always true. # It's not true on OSX. IF (OPENGL_gl_LIBRARY) IF(NOT X11_FOUND) INCLUDE(FindX11) ENDIF(NOT X11_FOUND) IF (X11_FOUND) IF (NOT APPLE) SET (OPENGL_LIBRARIES ${X11_LIBRARIES}) ENDIF (NOT APPLE) ENDIF (X11_FOUND) ENDIF (OPENGL_gl_LIBRARY) FIND_LIBRARY(OPENGL_glu_LIBRARY NAMES GLU MesaGLU HINTS /usr/lib/x86_64-linux-gnu /usr/lib32 PATHS ${OPENGL_gl_LIBRARY} /opt/graphics/OpenGL/lib /usr/openwin/lib /usr/shlib ) ENDIF(APPLE) ENDIF (WIN32) SET( OPENGL_FOUND "NO" ) IF(OPENGL_gl_LIBRARY) IF(OPENGL_xmesa_INCLUDE_DIR) SET( OPENGL_XMESA_FOUND "YES" ) ELSE(OPENGL_xmesa_INCLUDE_DIR) SET( OPENGL_XMESA_FOUND "NO" ) ENDIF(OPENGL_xmesa_INCLUDE_DIR) SET( OPENGL_LIBRARIES ${OPENGL_gl_LIBRARY} ${OPENGL_LIBRARIES}) IF(OPENGL_glu_LIBRARY) SET( OPENGL_GLU_FOUND "YES" ) SET( OPENGL_LIBRARIES ${OPENGL_glu_LIBRARY} ${OPENGL_LIBRARIES} ) ELSE(OPENGL_glu_LIBRARY) SET( OPENGL_GLU_FOUND "NO" ) ENDIF(OPENGL_glu_LIBRARY) SET( OPENGL_FOUND "YES" ) # This deprecated setting is for backward compatibility with CMake1.4 SET (OPENGL_LIBRARY ${OPENGL_LIBRARIES}) ENDIF(OPENGL_gl_LIBRARY) # This deprecated setting is for backward compatibility with CMake1.4 SET(OPENGL_INCLUDE_PATH ${OPENGL_INCLUDE_DIR}) MARK_AS_ADVANCED( OPENGL_INCLUDE_DIR OPENGL_xmesa_INCLUDE_DIR OPENGL_glu_LIBRARY OPENGL_gl_LIBRARY ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindLibraryWithDebug.cmake0000644000175100017510000000755412070530113025107 0ustar ametzlerametzler# # FIND_LIBRARY_WITH_DEBUG # -> enhanced FIND_LIBRARY to allow the search for an # optional debug library with a WIN32_DEBUG_POSTFIX similar # to CMAKE_DEBUG_POSTFIX when creating a shared lib # it has to be the second and third argument # Copyright (c) 2007, Christian Ehrlicher, # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. MACRO(FIND_LIBRARY_WITH_DEBUG var_name) IF(NOT WIN32) FIND_LIBRARY(${var_name} ${ARGN}) ELSE(NOT WIN32) PARSE_ARGUMENTS(FIND_LIB_WITH_DEBUG "WIN32_DEBUG_POSTFIX;WIN32_DEBUG_PATH_SUFFIX;WIN32_RELEASE_PATH_SUFFIX;NAMES;PATHS" "" ${ARGN}) IF(NOT FIND_LIB_WITH_DEBUG_NAMES) LIST(GET FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0 FIND_LIB_WITH_DEBUG_NAMES) LIST(REMOVE_AT FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0) ENDIF(NOT FIND_LIB_WITH_DEBUG_NAMES) IF(NOT FIND_LIB_WITH_DEBUG_PATHS) LIST(GET FIND_LIB_WITH_DEBUG_DEFAULT_ARGS 0 FIND_LIB_WITH_DEBUG_PATHS) ENDIF(NOT FIND_LIB_WITH_DEBUG_PATHS) IF(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) FIND_LIBRARY(${var_name} NAMES ${FIND_LIB_WITH_DEBUG_NAMES} PATHS ${FIND_LIB_WITH_DEBUG_PATHS}) ELSE(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) SET(libpaths_release "") SET(libpaths_debug "") SET(libnames_release "") SET(libnames_debug "") FOREACH(libpath ${FIND_LIB_WITH_DEBUG_PATHS}) FOREACH(rel_suffix ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) LIST(APPEND libpaths_release "${libpath}/${rel_suffix}") ENDFOREACH(rel_suffix ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) IF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) LIST(APPEND libpaths_release "${libpath}") ENDIF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX}) FOREACH(deb_suffix ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) LIST(APPEND libpaths_debug "${libpath}/${deb_suffix}") ENDFOREACH(deb_suffix ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) IF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) LIST(APPEND libpaths_debug "${libpath}") ENDIF(NOT DEFINED ${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX}) ENDFOREACH(libpath ${FIND_LIB_WITH_DEBUG_PATHS}) FOREACH(libname ${FIND_LIB_WITH_DEBUG_NAMES}) LIST(APPEND libnames_release "${libname}") LIST(APPEND libnames_debug "${libname}${FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX}") ENDFOREACH(libname ${FIND_LIB_WITH_DEBUG_NAMES}) # search the release lib find_library_for_cpu(${var_name}_RELEASE NAMES ${libnames_release} PATHS ${libpaths_release} ) # search the debug lib find_library_for_cpu(${var_name}_DEBUG NAMES ${libnames_debug} PATHS ${libpaths_debug} ) IF(${var_name}_RELEASE AND ${var_name}_DEBUG) # both libs found SET(${var_name} optimized ${${var_name}_RELEASE} debug ${${var_name}_DEBUG}) ELSE(${var_name}_RELEASE AND ${var_name}_DEBUG) IF(${var_name}_RELEASE) # only release found SET(${var_name} ${${var_name}_RELEASE}) ELSE(${var_name}_RELEASE) # only debug (or nothing) found SET(${var_name} ${${var_name}_DEBUG}) ENDIF(${var_name}_RELEASE) ENDIF(${var_name}_RELEASE AND ${var_name}_DEBUG) MARK_AS_ADVANCED(${var_name}_RELEASE) MARK_AS_ADVANCED(${var_name}_DEBUG) ENDIF(NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_POSTFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_DEBUG_PATH_SUFFIX AND NOT FIND_LIB_WITH_DEBUG_WIN32_RELEASE_PATH_SUFFIX) ENDIF(NOT WIN32) ENDMACRO(FIND_LIBRARY_WITH_DEBUG) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindPANO13.cmake0000644000175100017510000000324712070530113022574 0ustar ametzlerametzler# - Find PANO13 headers and libraries # modified for Hugin 0.7 Windows build 02Nov2007 TKSharpless # reads cache variable # SOURCE_BASE_DIR -- directory that contains hugin source root # defines cache vars # PANO13_INCLUDE_DIR, where to find pano13/panorama.h, etc. # PANO13_LIBRARIES, release link library list. # PANO13_DEBUG_LIBRARIES, debug ditto. # PANO13_FOUND, If != "YES", do not try to use PANO13. # In Pablo's Windows setup ${SOURCE_BASE_DIR}/libpano contains pano12 # and pano13. This code also works if pano13 is in ${SOURCE_BASE_DIR} ## NOTE the form "pano13/panorama.h" is used in #includes in some ## Hugin source files, so we are stuck with that for now. FIND_PATH(PANO13_INCLUDE_DIR pano13/panorama.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/libpano ${SOURCE_BASE_DIR} ) # Pablo's Windows setup has the link libs in subdirs Debug # and Release of libpano/pano13, as "Panotools.lib". This # code will also find them in pano13 or in pano13/lib, and # with names pano13 or pano13d. FIND_LIBRARY(PANO13_LIBRARIES NAMES pano13 PATHS ${SYSTEM_LIB_DIRS} "${PANO13_INCLUDE_DIR}/pano13/Release LIB CMD" ${PANO13_INCLUDE_DIR}/pano13/Release ${SOURCE_BASE_DIR}/pano13/lib ${SOURCE_BASE_DIR}/pano13 ) IF(PANO13_INCLUDE_DIR) IF(PANO13_LIBRARIES) SET( PANO13_FOUND "YES" ) FIND_LIBRARY( PANO13_DEBUG_LIBRARIES NAMES Panotools pano13d pano13 PATHS ${SYSTEM_LIB_DIRS} "${PANO13_INCLUDE_DIR}/pano13/Debug LIB CMD" ${PANO13_INCLUDE_DIR}/pano13/Debug ${SOURCE_BASE_DIR}/pano13/lib ${SOURCE_BASE_DIR}/pano13 ) ENDIF(PANO13_LIBRARIES) ENDIF(PANO13_INCLUDE_DIR) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindOpenMP.cmake0000644000175100017510000000744612070530113023036 0ustar ametzlerametzler# - Finds OpenMP support # This module can be used to detect OpenMP support in a compiler. # If the compiler supports OpenMP, the flags required to compile with # openmp support are set. # # The following variables are set: # OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support # OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support # OPENMP_FOUND - true if openmp is detected # # Supported compilers can be found at http://openmp.org/wp/openmp-compilers/ # Copyright 2008, 2009 Andre.Brodtkorb@ifi.uio.no # # Redistribution AND use is allowed according to the terms of the New # BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. include(CheckCSourceCompiles) include(CheckCXXSourceCompiles) include(FindPackageHandleStandardArgs) set(OpenMP_C_FLAG_CANDIDATES #Gnu "-fopenmp" #Microsoft Visual Studio "/openmp" #Intel windows "-Qopenmp" #Intel "-openmp" #Empty, if compiler automatically accepts openmp " " #Sun "-xopenmp" #HP "+Oopenmp" #IBM XL C/c++ "-qsmp" #Portland Group "-mp" ) set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES}) # sample openmp source code to test set(OpenMP_C_TEST_SOURCE " #include int main() { #ifdef _OPENMP return 0; #else breaks_on_purpose #endif } ") # use the same source for CXX as C for now set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE}) # if these are set then do not try to find them again, # by avoiding any try_compiles for the flags if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) set(OpenMP_C_FLAG_CANDIDATES) set(OpenMP_CXX_FLAG_CANDIDATES) endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS) SET(OpenMP_FLAG_CANDIDATE_COUNTER 0) # check c compiler foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") if(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") set(OpenMP_FLAG_DETECTED 1) break() endif(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) math(EXPR OpenMP_FLAG_CANDIDATE_COUNTER "${OpenMP_FLAG_CANDIDATE_COUNTER} + 1") endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) math(EXPR OpenMP_FLAG_CANDIDATE_COUNTER "${OpenMP_FLAG_CANDIDATE_COUNTER} + 1") # check cxx compiler foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") set(CMAKE_REQUIRED_FLAGS "${FLAG}") set(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) message(STATUS "Try OpenMP CXX flag = [${FLAG}]") check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") if(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}") set(OpenMP_FLAG_DETECTED 1) break() endif(OpenMP_FLAG_DETECTED_${OpenMP_FLAG_CANDIDATE_COUNTER}) math(EXPR OpenMP_FLAG_CANDIDATE_COUNTER "${OpenMP_FLAG_CANDIDATE_COUNTER} + 1") endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" CACHE STRING "C compiler flags for OpenMP parallization") set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" CACHE STRING "C++ compiler flags for OpenMP parallization") # handle the standard arguments for find_package find_package_handle_standard_args(OpenMP DEFAULT_MSG OpenMP_C_FLAGS OpenMP_CXX_FLAGS ) mark_as_advanced( OpenMP_C_FLAGS OpenMP_CXX_FLAGS ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindVIGRA.cmake0000644000175100017510000000505112070530501022537 0ustar ametzlerametzler# - Find VIGRA # Added to support Windows build but should work anywhere. # After looking in UNIX standard places, tries wxWidgets build # tree, which should have this package. # # # reads cache variables # defines cache variables # VIGRA_INCLUDE_DIR, where to find headers # VIGRA_LIBRARIES, list of release link libraries # VIGRA_FOUND, If != "YES", error out as VIGRA is required SET( VIGRA_FOUND "NO" ) IF(WIN32) FIND_PATH(VIGRA_INCLUDE_DIR vigra/gaborfilter.hxx PATHS ${SOURCE_BASE_DIR}/vigra/include ) # for dynamic build, it's vigraimpex.lib and the dll must be copied into hugin's bin folder #SET(VIGRA_LIBRARIES ${SOURCE_BASE_DIR}/vigra/lib/libvigraindex.dll) FIND_LIBRARY( VIGRA_LIBRARIES NAMES vigraimpex libvigraimpex PATHS ${VIGRA_ROOT_PATH} ${VIGRA_ROOT_PATH}/Release ${VIGRA_ROOT_PATH}/lib ${SOURCE_BASE_DIR}/vigra/lib ) #FIND_FILE(VIGRA_DLL # NAMES vigraimpex.dll # PATHS ${SOURCE_BASE_DIR}/vigra1.6.0/lib #) ELSE(WIN32) FIND_PATH(VIGRA_INCLUDE_DIR vigra/gaborfilter.hxx /usr/local/include /usr/include /opt/local/include ) FIND_LIBRARY(VIGRA_LIBRARIES NAMES vigraimpex libvigraimpex PATHS /usr/lib /usr/local/lib /opt/local/lib ) ENDIF(WIN32) IF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARIES) SET(VIGRA_FOUND TRUE) ENDIF (VIGRA_INCLUDE_DIR AND VIGRA_LIBRARIES) IF (VIGRA_FOUND) MESSAGE(STATUS "Found VIGRA: ${VIGRA_LIBRARIES}") # we check the version of VIGRA library FIND_FILE(VIGRA_VERSION_FILE VigraConfigVersion.cmake PATH /usr/lib/vigra /usr/local/lib/vigra /opt/local/lib ${SOURCE_BASE_DIR}/vigra/lib/vigra ) IF(${VIGRA_VERSION_FILE} MATCHES "-NOTFOUND") SET(VIGRA_VERSION_CHECK FALSE) # check is done additional in ConfigureChecks.cmake ELSE() # backup of variable PACKAGE_VERSION, it is overwrited in VigraConfigVersion.cmake SET(BACKUP_PACKAGE_VERSION ${PACKAGE_VERSION}) INCLUDE(${VIGRA_VERSION_FILE} NO_POLICY_SCOPE) SET(VIGRA_VERSION ${PACKAGE_VERSION}) SET(PACKAGE_VERSION ${BACKUP_PACKAGE_VERSION}) IF(${VIGRA_VERSION} VERSION_EQUAL 1.8.0 OR ${VIGRA_VERSION} VERSION_GREATER 1.8.0) SET(VIGRA_VERSION_CHECK TRUE) MESSAGE(STATUS "VIGRA version: ${VIGRA_VERSION}") ELSE() MESSAGE(FATAL_ERROR "VIGRA lib is too old.\nEnblend requires at least version 1.8.0, but found version ${VIGRA_VERSION}." ) ENDIF() ENDIF() ELSE (VIGRA_FOUND) MESSAGE(FATAL_ERROR "Could not find VIGRA") ENDIF (VIGRA_FOUND) MARK_AS_ADVANCED( VIGRA_LIBRARIES VIGRA_INCLUDE_DIR ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindZLIB.cmake0000644000175100017510000000212412070530113022424 0ustar ametzlerametzler# - Find zlib # Find the native ZLIB includes and library # # ZLIB_INCLUDE_DIR - where to find zlib.h, etc. # ZLIB_LIBRARIES - List of libraries when using zlib. # ZLIB_FOUND - True if zlib found. # - Find TIFF for Hugin 0.7 01Nov2007 TKSharpless # Added to support Windows build but should work anywhere. # After looking in UNIX standard places, tries wxWidgets build # tree, which should have this package. # # reads cache variables # wxWidgets_ROOT_DIR # wxWidgets_LIB_DIR # IF (ZLIB_INCLUDE_DIR) # Already in cache, be silent SET(ZLIB_FIND_QUIETLY TRUE) ENDIF (ZLIB_INCLUDE_DIR) FIND_PATH(ZLIB_INCLUDE_DIR zlib.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/zlib/include ) include(FindLibraryWithDebug) find_library_with_debug(ZLIB_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES z zlib zlibstatic PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/zlib/lib ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARIES) MARK_AS_ADVANCED( ZLIB_LIBRARIES ZLIB_INCLUDE_DIR ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindPackageHandleStandardArgs.cmake0000644000175100017510000000455212070530113026640 0ustar ametzlerametzler# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME (DEFAULT_MSG|"Custom failure message") VAR1 ... ) # This macro is intended to be used in FindXXX.cmake modules files. # It handles the REQUIRED and QUIET argument to FIND_PACKAGE() and # it also sets the _FOUND variable. # The package is found if all variables listed are TRUE. # Example: # # FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2 DEFAULT_MSG LIBXML2_LIBRARIES LIBXML2_INCLUDE_DIR) # # LibXml2 is considered to be found, if both LIBXML2_LIBRARIES and # LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE. # If it is not found and REQUIRED was used, it fails with FATAL_ERROR, # independent whether QUIET was used or not. # If it is found, the location is reported using the VAR1 argument, so # here a message "Found LibXml2: /usr/lib/libxml2.so" will be printed out. # If the second argument is DEFAULT_MSG, the message in the failure case will # be "Could NOT find LibXml2", if you don't like this message you can specify # your own custom failure message there. MACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FAIL_MSG _VAR1 ) IF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") IF (${_NAME}_FIND_REQUIRED) SET(_FAIL_MESSAGE "Could not find REQUIRED package ${_NAME}") ELSE (${_NAME}_FIND_REQUIRED) SET(_FAIL_MESSAGE "Could not find OPTIONAL package ${_NAME}") ENDIF (${_NAME}_FIND_REQUIRED) ELSE("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") SET(_FAIL_MESSAGE "${_FAIL_MSG}") ENDIF("${_FAIL_MSG}" STREQUAL "DEFAULT_MSG") STRING(TOUPPER ${_NAME} _NAME_UPPER) SET(${_NAME_UPPER}_FOUND TRUE) IF(NOT ${_VAR1}) SET(${_NAME_UPPER}_FOUND FALSE) ENDIF(NOT ${_VAR1}) FOREACH(_CURRENT_VAR ${ARGN}) IF(NOT ${_CURRENT_VAR}) SET(${_NAME_UPPER}_FOUND FALSE) ENDIF(NOT ${_CURRENT_VAR}) ENDFOREACH(_CURRENT_VAR) IF (${_NAME_UPPER}_FOUND) IF (NOT ${_NAME}_FIND_QUIETLY) MESSAGE(STATUS "Found ${_NAME}: ${${_VAR1}}") ENDIF (NOT ${_NAME}_FIND_QUIETLY) ELSE (${_NAME_UPPER}_FOUND) IF (${_NAME}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "${_FAIL_MESSAGE}") ELSE (${_NAME}_FIND_REQUIRED) IF (NOT ${_NAME}_FIND_QUIETLY) MESSAGE(STATUS "${_FAIL_MESSAGE}") ENDIF (NOT ${_NAME}_FIND_QUIETLY) ENDIF (${_NAME}_FIND_REQUIRED) ENDIF (${_NAME_UPPER}_FOUND) ENDMACRO(FIND_PACKAGE_HANDLE_STANDARD_ARGS) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindJPEG.cmake0000644000175100017510000000215112070530113022411 0ustar ametzlerametzler# - Find JPEG for Hugin 0.7 01Nov2007 TKSharpless # Added to support Windows build but should work anywhere. # After looking in UNIX standard places, tries wxWidgets build # tree, which should have this package. # # Call FIND_PACKAGE(wxWidgets REQUIRED) before calling this! # # reads cache variables # wxWidgets_ROOT_DIR # wxWidgets_LIB_DIR # defines cache variables # JPEG_INCLUDE_DIR, where to find headers # JPEG_LIBRARIES, list of release link libraries # JPEG_DEBUG_LIBRARIES, list of debug link libraries # JPEG_FOUND, If != "YES", do not try to use JPEG FIND_PATH(JPEG_INCLUDE_DIR jpeglib.h /usr/local/include /usr/include ${SOURCE_BASE_DIR}/jpeg-8d ${SOURCE_BASE_DIR}/jpeg-7 ) include(FindLibraryForCPU) find_library_for_cpu(JPEG_LIBRARIES WIN32_DEBUG_POSTFIX d NAMES jpeg libjpeg PATHS ${SYSTEM_LIB_DIRS} ${SOURCE_BASE_DIR}/jpeg-8d/lib ${SOURCE_BASE_DIR}/jpeg-7/lib ) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(JPEG DEFAULT_MSG JPEG_INCLUDE_DIR JPEG_LIBRARIES) MARK_AS_ADVANCED(JPEG_INCLUDE_DIR JPEG_LIBRARIES ) enblend-enfuse-4.1.2+dfsg/CMakeModules/FindGLUT.cmake0000644000175100017510000000445712070530113022452 0ustar ametzlerametzler# - try to find glut library and include files # GLUT_INCLUDE_DIR, where to find GL/glut.h, etc. # GLUT_LIBRARIES, the libraries to link against # GLUT_FOUND, If false, do not try to use GLUT. # Also defined, but not for general use are: # GLUT_glut_LIBRARY = the full path to the glut library. # GLUT_Xmu_LIBRARY = the full path to the Xmu library. # GLUT_Xi_LIBRARY = the full path to the Xi Library. IF (WIN32) include(FindLibraryWithDebug) FIND_PATH(GLUT_ROOT_PATH NAMES include/GL/glut.h PATHS ${SOURCE_BASE_DIR}/glut ${SOURCE_BASE_DIR}/glut-3.7.6 ) FIND_PATH(GLUT_INCLUDE_DIR NAMES GL/glut.h PATHS ${GLUT_ROOT_PATH}/include ) find_library_with_debug( GLUT_glut_LIBRARY WIN32_DEBUG_PATH_SUFFIX Debug WIN32_RELEASE_PATH_SUFFIX Release NAMES glut glut32 PATHS ${OPENGL_LIBRARY_DIR} ${GLUT_ROOT_PATH}/lib/glut ) ELSE (WIN32) IF (APPLE) # These values for Apple could probably do with improvement. FIND_PATH( GLUT_INCLUDE_DIR glut.h /System/Library/Frameworks/GLUT.framework/Versions/A/Headers ${OPENGL_LIBRARY_DIR} ) SET(GLUT_glut_LIBRARY "-framework GLUT" CACHE STRING "GLUT library for OSX") SET(GLUT_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX") ELSE (APPLE) FIND_PATH( GLUT_INCLUDE_DIR GL/glut.h /usr/include/GL /usr/openwin/share/include /usr/openwin/include /opt/graphics/OpenGL/include /opt/graphics/OpenGL/contrib/libglut ) FIND_LIBRARY( GLUT_glut_LIBRARY glut /usr/openwin/lib ) FIND_LIBRARY( GLUT_Xi_LIBRARY Xi /usr/openwin/lib ${SYSTEM_LIB_DIRS} ) FIND_LIBRARY( GLUT_Xmu_LIBRARY Xmu /usr/openwin/lib ) ENDIF (APPLE) ENDIF (WIN32) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIR GLUT_glut_LIBRARY) IF(GLUT_FOUND) # Is -lXi and -lXmu required on all platforms that have it? # If not, we need some way to figure out what platform we are on. SET( GLUT_LIBRARIES ${GLUT_glut_LIBRARY} ${GLUT_Xmu_LIBRARY} ${GLUT_Xi_LIBRARY} ${GLUT_cocoa_LIBRARY} ) ENDIF(GLUT_FOUND) MARK_AS_ADVANCED( GLUT_INCLUDE_DIR GLUT_ROOT_PATH GLUT_glut_LIBRARY GLUT_Xmu_LIBRARY GLUT_Xi_LIBRARY ) enblend-enfuse-4.1.2+dfsg/INSTALL0000644000175100017510000003660512232763263016632 0ustar ametzlerametzlerInstallation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for instructions specific to this package. Some packages provide this `INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. Running `configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the `make install' phase executed with root privileges. 5. Optionally, type `make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior `make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type `make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide `make distcheck', which can by used by developers to test that all other targets like `make install' and `make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. This is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple `-arch' options to the compiler but only a single `-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the `lipo' tool if you have problems. Installation Names ================== By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option `--exec-prefix=PREFIX' to `configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of `${prefix}', so that specifying just `--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to `configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the `make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, `make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of `${prefix}'. Any directories that were specified during `configure', but not in terms of `${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the `DESTDIR' variable. For example, `make install DESTDIR=/alternate/directory' will prepend `/alternate/directory' before all installation names. The approach of `DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of `${prefix}' at `configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of `make' will be. For these packages, running `./configure --enable-silent-rules' sets the default to minimal output, which can be overridden with `make V=1'; while running `./configure --disable-silent-rules' sets the default to verbose, which can be overridden with `make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX `make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as `configure' are involved. Use GNU `make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put `/usr/ucb' early in your `PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in `/usr/bin'. So, if you need `/usr/ucb' in your `PATH', put it _after_ `/usr/bin'. On Haiku, software installed for all users goes in `/boot/common', not `/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features `configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option `--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified `gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for `CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of all of the options to `configure', and exit. `--help=short' `--help=recursive' Print a summary of the options unique to this package's `configure', and exit. The `short' variant lists options used only in the top level, while the `recursive' variant lists options also present in any nested packages. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. `--no-create' `-n' Run the configure checks, but stop before creating any output files. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. enblend-enfuse-4.1.2+dfsg/configure0000775000175100017510000125376412232763264017523 0ustar ametzlerametzler#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for enblend-enfuse 4.1.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://bugs.launchpad.net/enblend about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='enblend-enfuse' PACKAGE_TARNAME='enblend-enfuse' PACKAGE_VERSION='4.1.2' PACKAGE_STRING='enblend-enfuse 4.1.2' PACKAGE_BUGREPORT='https://bugs.launchpad.net/enblend' PACKAGE_URL='' ac_unique_file="src/enblend.cc" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS AM_MAKEINFOHTMLFLAGS AM_MAKEINFOFLAGS BUILD_DOC_FALSE BUILD_DOC_TRUE XMLLINT TIDY SED CONVERT FIG2DEV RASTER_DIR GNUPLOT HELP2MAN PERL LIBOBJS POW_LIB HAVE_INLINE EXTRA_LIBS X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS CPP PTHREAD_CFLAGS PTHREAD_LIBS PTHREAD_CC ax_pthread_config XMKMF host_os host_vendor host_cpu host build_os build_vendor build_cpu build GLUT_LIBS GLUT_CFLAGS GLU_LIBS GLU_CFLAGS GL_LIBS GL_CFLAGS OPENGL_LIBS OPENGL_CFLAGS OPENEXR_LIBS OPENEXR_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG EGREP GREP CXXCPP RANLIB am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE ac_ct_CC CFLAGS CC am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CXX CPPFLAGS LDFLAGS CXXFLAGS CXX AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking with_openexr enable_gpu_support with_apple_opengl_framework with_x with_dmalloc with_boost_filesystem with_perl with_gnuplot with_raster_dir enable_split_doc enable_debug enable_image_cache enable_openmp ' ac_precious_vars='build_alias host_alias target_alias CXX CXXFLAGS LDFLAGS LIBS CPPFLAGS CCC CC CFLAGS CXXCPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR OPENEXR_CFLAGS OPENEXR_LIBS OPENGL_CFLAGS OPENGL_LIBS XMKMF CPP PERL GNUPLOT' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures enblend-enfuse 4.1.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/enblend-enfuse] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of enblend-enfuse 4.1.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-gpu-support GPU support for Enblend [default=check] --enable-split-doc split documentation [default=yes] --enable-debug turn on debugging [default=no] --enable-image-cache allow for processing of large images [default=yes] --enable-openmp compile with OpenMP [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-openexr use OpenEXR [default=check] --with-apple-opengl-framework force usage of Apple OpenGL framework (Mac OS X only) --with-x use the X Window System --with-dmalloc use dmalloc, as in http://www.dmalloc.com/dmalloc.tar.gz --with-boost-filesystem use Boost filesystem library [default=check] --with-perl=[PATH] absolute path to perl executable --with-gnuplot=[PATH] absolute path to gnuplot executable --with-raster-dir= set raster image subdirectory [default=raster] Some influential environment variables: CXX C++ compiler command CXXFLAGS C++ compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CC C compiler command CFLAGS C compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path OPENEXR_CFLAGS C compiler flags for OPENEXR, overriding pkg-config OPENEXR_LIBS linker flags for OPENEXR, overriding pkg-config OPENGL_CFLAGS C compiler flags for OpenGL OPENGL_LIBS Linker flags and libraries for OpenGL XMKMF Path to xmkmf, Makefile generator for X Window System CPP C preprocessor PERL Absolute path to perl executable GNUPLOT Absolute path to gnuplot executable Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF enblend-enfuse configure 4.1.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_run LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_cxx_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_run # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_check_header_compile LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_cxx_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_compile # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to https://bugs.launchpad.net/enblend ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ------------------------------------------------- ## ## Report this to https://bugs.launchpad.net/enblend ## ## ------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel # ac_fn_cxx_check_func LINENO FUNC VAR # ------------------------------------ # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_cxx_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_func # ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES # --------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_cxx_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_type # ac_fn_cxx_check_decl LINENO SYMBOL VAR INCLUDES # ----------------------------------------------- # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR # accordingly. ac_fn_cxx_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack as_decl_name=`echo $2|sed 's/ *(.*//'` as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 $as_echo_n "checking whether $as_decl_name is declared... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { #ifndef $as_decl_name #ifdef __cplusplus (void) $as_decl_use; #else (void) $as_decl_name; #endif #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by enblend-enfuse $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.14' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='enblend-enfuse' VERSION='4.1.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi ac_config_headers="$ac_config_headers config.h" # Checks for programs/compilers. # avoid default CXXFLAGS, they trigger a compiler error with g++ 4.2 CXXFLAGS_ORIG=$CXXFLAGS ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler works" >&5 $as_echo_n "checking whether the C++ compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C++ compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler default output file name" >&5 $as_echo_n "checking for C++ compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C++ compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi CXXFLAGS=$CXXFLAGS_ORIG ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __APPLE_CC__ not a universal capable compiler #endif typedef int dummy; _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. ac_arch= ac_prev= for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do if test -n "$ac_prev"; then case $ac_word in i?86 | x86_64 | ppc | ppc64) if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then ac_arch=$ac_word else ac_cv_c_bigendian=universal break fi ;; esac ac_prev= elif test "x$ac_word" = "x-arch"; then ac_prev=arch fi done fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ && LITTLE_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { #ifndef _BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_bigendian=yes else ac_cv_c_bigendian=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. if test "$cross_compiling" = yes; then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } extern int foo; int main () { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long int l; char c[sizeof (long int)]; } u; u.l = 1; return u.c[sizeof (long int) - 1] == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_c_bigendian=no else ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 $as_echo "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h ;; #( no) ;; #( universal) $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) as_fn_error $? "unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrt in -lm" >&5 $as_echo_n "checking for sqrt in -lm... " >&6; } if ${ac_cv_lib_m_sqrt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_m_sqrt=yes else ac_cv_lib_m_sqrt=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sqrt" >&5 $as_echo "$ac_cv_lib_m_sqrt" >&6; } if test "x$ac_cv_lib_m_sqrt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cblas_dgemm in -lgslcblas" >&5 $as_echo_n "checking for cblas_dgemm in -lgslcblas... " >&6; } if ${ac_cv_lib_gslcblas_cblas_dgemm+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgslcblas $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cblas_dgemm (); int main () { return cblas_dgemm (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gslcblas_cblas_dgemm=yes else ac_cv_lib_gslcblas_cblas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gslcblas_cblas_dgemm" >&5 $as_echo "$ac_cv_lib_gslcblas_cblas_dgemm" >&6; } if test "x$ac_cv_lib_gslcblas_cblas_dgemm" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGSLCBLAS 1 _ACEOF LIBS="-lgslcblas $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gsl_blas_dgemm in -lgsl" >&5 $as_echo_n "checking for gsl_blas_dgemm in -lgsl... " >&6; } if ${ac_cv_lib_gsl_gsl_blas_dgemm+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gsl_blas_dgemm (); int main () { return gsl_blas_dgemm (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_gsl_gsl_blas_dgemm=yes else ac_cv_lib_gsl_gsl_blas_dgemm=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gsl_gsl_blas_dgemm" >&5 $as_echo "$ac_cv_lib_gsl_gsl_blas_dgemm" >&6; } if test "x$ac_cv_lib_gsl_gsl_blas_dgemm" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGSL 1 _ACEOF LIBS="-lgsl $LIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 $as_echo_n "checking for gzopen in -lz... " >&6; } if ${ac_cv_lib_z_gzopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gzopen (); int main () { return gzopen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_z_gzopen=yes else ac_cv_lib_z_gzopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_gzopen" >&5 $as_echo "$ac_cv_lib_z_gzopen" >&6; } if test "x$ac_cv_lib_z_gzopen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBZ 1 _ACEOF LIBS="-lz $LIBS" else { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling without libz." >&5 $as_echo "$as_me: Compiling without libz." >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_finish_compress in -ljpeg" >&5 $as_echo_n "checking for jpeg_finish_compress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_finish_compress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_finish_compress (); int main () { return jpeg_finish_compress (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_finish_compress=yes else ac_cv_lib_jpeg_jpeg_finish_compress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_finish_compress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_finish_compress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_finish_compress" = xyes; then : LIBS="-ljpeg ${LIBS}"; $as_echo "#define HasJPEG 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling without support for jpeg files." >&5 $as_echo "$as_me: Compiling without support for jpeg files." >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for png_init_io in -lpng" >&5 $as_echo_n "checking for png_init_io in -lpng... " >&6; } if ${ac_cv_lib_png_png_init_io+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpng $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char png_init_io (); int main () { return png_init_io (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_png_png_init_io=yes else ac_cv_lib_png_png_init_io=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_init_io" >&5 $as_echo "$ac_cv_lib_png_png_init_io" >&6; } if test "x$ac_cv_lib_png_png_init_io" = xyes; then : LIBS="-lpng ${LIBS}"; $as_echo "#define HasPNG 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: Compiling without support for png files." >&5 $as_echo "$as_me: Compiling without support for png files." >&6;} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 $as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFOpen (); int main () { return TIFFOpen (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFOpen=yes else ac_cv_lib_tiff_TIFFOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 $as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : LIBS="-ltiff ${LIBS}"; $as_echo "#define HasTIFF 1" >>confdefs.h else as_fn_error $? "libtiff is required to compile Enblend." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cmsCreateTransform in -llcms2" >&5 $as_echo_n "checking for cmsCreateTransform in -llcms2... " >&6; } if ${ac_cv_lib_lcms2_cmsCreateTransform+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llcms2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cmsCreateTransform (); int main () { return cmsCreateTransform (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_lcms2_cmsCreateTransform=yes else ac_cv_lib_lcms2_cmsCreateTransform=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lcms2_cmsCreateTransform" >&5 $as_echo "$ac_cv_lib_lcms2_cmsCreateTransform" >&6; } if test "x$ac_cv_lib_lcms2_cmsCreateTransform" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBLCMS2 1 _ACEOF LIBS="-llcms2 $LIBS" else as_fn_error $? "liblcms2 is required to compile Enblend." "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Vigra import/export-library" >&5 $as_echo_n "checking for Vigra import/export-library... " >&6; } LIBS="-lvigraimpex $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { vigra::impexListFormats() ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "libvigraimpex is required to compile Enblend." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { vigra::ImageImportInfo info("image.tif"); info.setImageIndex(99) ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Vigra was found, but it was not recent enough." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: checking if OpenEXR is wanted" >&5 $as_echo_n "checking if OpenEXR is wanted... " >&6; } # Check whether --with-openexr was given. if test "${with_openexr+set}" = set; then : withval=$with_openexr; else with_openexr=check fi if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi if test "$with_openexr" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: disabling OpenEXR" >&5 $as_echo "$as_me: disabling OpenEXR" >&6;} have_exr=no else if test "$with_openexr" = yes || test "$with_openexr" = check; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENEXR" >&5 $as_echo_n "checking for OPENEXR... " >&6; } if test -n "$OPENEXR_CFLAGS"; then pkg_cv_OPENEXR_CFLAGS="$OPENEXR_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenEXR >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "OpenEXR >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENEXR_CFLAGS=`$PKG_CONFIG --cflags "OpenEXR >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$OPENEXR_LIBS"; then pkg_cv_OPENEXR_LIBS="$OPENEXR_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"OpenEXR >= 1.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "OpenEXR >= 1.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_OPENEXR_LIBS=`$PKG_CONFIG --libs "OpenEXR >= 1.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then OPENEXR_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "OpenEXR >= 1.0" 2>&1` else OPENEXR_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "OpenEXR >= 1.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$OPENEXR_PKG_ERRORS" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"OpenEXR support disabled: \" $OPENEXR_PKG_ERRORS" >&5 $as_echo "$as_me: WARNING: \"OpenEXR support disabled: \" $OPENEXR_PKG_ERRORS" >&2;} have_exr=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"OpenEXR support disabled: \" $OPENEXR_PKG_ERRORS" >&5 $as_echo "$as_me: WARNING: \"OpenEXR support disabled: \" $OPENEXR_PKG_ERRORS" >&2;} have_exr=no else OPENEXR_CFLAGS=$pkg_cv_OPENEXR_CFLAGS OPENEXR_LIBS=$pkg_cv_OPENEXR_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define HasEXR 1" >>confdefs.h have_exr=yes fi LIBS="${OPENEXR_LIBS} $LIBS" CFLAGS="${OPENEXR_CFLAGS} $CFLAGS" CXXFLAGS="${OPENEXR_CFLAGS} $CXXFLAGS" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } have_exr=no fi fi if test "$GXX" = yes; then # Fixes SourceForge bug id 2121647 on some systems with newer GCCs. CXXFLAGS="$CXXFLAGS --param inline-unit-growth=60" fi gpu_support_default="yes" # Check whether --enable-gpu-support was given. if test "${enable_gpu_support+set}" = set; then : enableval=$enable_gpu_support; gpu_support=$enableval else gpu_support=$gpu_support_default fi # Check whether --with-apple-opengl-framework was given. if test "${with_apple_opengl_framework+set}" = set; then : withval=$with_apple_opengl_framework; fi can_use_gpu=no no_gpu_reason= if test "$gpu_support" = yes; then missing_for_gpu= if test "$with_apple_opengl_framework" = yes; then $as_echo "#define HAVE_APPLE_OPENGL_FRAMEWORK 1" >>confdefs.h GL_LIBS="-framework OpenGL -framework AGL" GLUT_CFLAGS="$GLU_CFLAGS" GLUT_LIBS="-framework GLUT -lobjc $GL_LIBS" no_gl="" no_glu="" no_glut="" else # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then : withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) as_fn_error $? "cannot use X directory names containing '" "$LINENO" 5;; #( *,NONE | NONE,*) if ${ac_cv_have_x+:} false; then : $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R7/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R7 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R7/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R7 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # We can compile using X headers with no special include directory. ac_x_includes= else for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:${as_lineno-$LINENO}: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ax_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 $as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_join (); int main () { return pthread_join (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test x"$ax_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # ... -mt is also the pthreads flag for HP/aCC # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthreads/-mt/ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags" ;; esac if test x"$ax_pthread_ok" = xno; then for flag in $ax_pthread_flags; do case $flag in none) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 $as_echo_n "checking whether pthreads work without any flags... " >&6; } ;; -*) { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5 $as_echo_n "checking whether pthreads work with $flag... " >&6; } PTHREAD_CFLAGS="$flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ax_pthread_config+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no" fi fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 $as_echo "$ax_pthread_config" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ax_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5 $as_echo_n "checking for the pthreads library -l$flag... " >&6; } PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_pthread_ok=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 $as_echo "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$ax_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 $as_echo_n "checking for joinable pthread attribute... " >&6; } attr_name=unknown for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int attr=$attr; return attr; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : attr_name=$attr; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5 $as_echo "$attr_name" >&6; } if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then cat >>confdefs.h <<_ACEOF #define PTHREAD_CREATE_JOINABLE $attr_name _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5 $as_echo_n "checking if more special flags are required for pthreads... " >&6; } flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5 $as_echo "${flag}" >&6; } if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with xlc_r or cc_r if test x"$GCC" != xyes; then for ac_prog in xlc_r cc_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PTHREAD_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PTHREAD_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PTHREAD_CC=$ac_cv_prog_PTHREAD_CC if test -n "$PTHREAD_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 $as_echo "$PTHREAD_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PTHREAD_CC" && break done test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" else PTHREAD_CC=$CC fi else PTHREAD_CC="$CC" fi # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$ax_pthread_ok" = xyes; then $as_echo "#define HAVE_PTHREAD 1" >>confdefs.h : else ax_pthread_ok=no fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Microsoft C compiler" >&5 $as_echo_n "checking whether we are using the Microsoft C compiler... " >&6; } if ${ax_cv_c_compiler_ms+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef _MSC_VER choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_compiler_ms=yes else ax_compiler_ms=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ax_cv_c_compiler_ms=$ax_compiler_ms fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_ms" >&5 $as_echo "$ax_cv_c_compiler_ms" >&6; } if test X$ax_compiler_ms = Xno; then : GL_CFLAGS="${PTHREAD_CFLAGS}"; GL_LIBS="${PTHREAD_LIBS} -lm" fi # # Use x_includes and x_libraries if they have been set (presumably by # AC_PATH_X). # if test "X$no_x" != "Xyes"; then : if test -n "$x_includes"; then : GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}" fi if test -n "$x_libraries"; then : GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}" fi fi ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" for ac_header in GL/gl.h OpenGL/gl.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="${ax_save_CPPFLAGS}" for ac_header in windows.h do : ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" if test "x$ac_cv_header_windows_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL library" >&5 $as_echo_n "checking for OpenGL library... " >&6; } if ${ax_cv_check_gl_libgl+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_check_gl_libgl="no" case $host_cpu in x86_64) ax_check_gl_libdir=lib64 ;; *) ax_check_gl_libdir=lib ;; esac ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lopengl32 -lGL" for ax_lib in ${ax_check_libs}; do if test X$ax_compiler_ms = Xyes; then : ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` else ax_try_lib="${ax_lib}" fi LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GL_H # include # elif defined(HAVE_OPENGL_GL_H) # include # else # error no gl.h # endif int main () { glBegin(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_gl_libgl="${ax_try_lib}"; break else ax_check_gl_nvidia_flags="-L/usr/${ax_check_gl_libdir}/nvidia" LIBS="${ax_try_lib} ${ax_check_gl_nvidia_flags} ${GL_LIBS} ${ax_save_LIBS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GL_H # include # elif defined(HAVE_OPENGL_GL_H) # include # else # error no gl.h # endif int main () { glBegin(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_nvidia_flags}"; break else ax_check_gl_dylib_flag='-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib' LIBS="${ax_try_lib} ${ax_check_gl_dylib_flag} ${GL_LIBS} ${ax_save_LIBS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GL_H # include # elif defined(HAVE_OPENGL_GL_H) # include # else # error no gl.h # endif int main () { glBegin(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_gl_libgl="${ax_try_lib} ${ax_check_gl_dylib_flag}"; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done if test "X$ax_cv_check_gl_libgl" = Xno -a "X$no_x" = Xyes; then : LIBS='-framework OpenGL' cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GL_H # include # elif defined(HAVE_OPENGL_GL_H) # include # else # error no gl.h # endif int main () { glBegin(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_gl_libgl="$LIBS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_gl_libgl" >&5 $as_echo "$ax_cv_check_gl_libgl" >&6; } if test "X$ax_cv_check_gl_libgl" = Xno; then : no_gl=yes; GL_CFLAGS=""; GL_LIBS="" else GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu GLU_CFLAGS="${GL_CFLAGS}" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" for ac_header in GL/glu.h OpenGL/glu.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="${ax_save_CPPFLAGS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenGL Utility library" >&5 $as_echo_n "checking for OpenGL Utility library... " >&6; } if ${ax_cv_check_glu_libglu+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_check_glu_libglu="no" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" # # First, check for the possibility that everything we need is already in # GL_LIBS. # LIBS="${GL_LIBS} ${ax_save_LIBS}" # # libGLU typically links with libstdc++ on POSIX platforms. # However, setting the language to C++ means that test program # source is named "conftest.cc"; and Microsoft cl doesn't know what # to do with such a file. # ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test X$ax_compiler_ms = Xyes; then : ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLU_H # include # elif defined(HAVE_OPENGL_GLU_H) # include # else # error no glu.h # endif int main () { gluBeginCurve(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_glu_libglu=yes else LIBS="" ax_check_libs="-lglu32 -lGLU" for ax_lib in ${ax_check_libs}; do if test X$ax_compiler_ms = Xyes; then : ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` else ax_try_lib="${ax_lib}" fi LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if defined(HAVE_WINDOWS_H) && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLU_H # include # elif defined(HAVE_OPENGL_GLU_H) # include # else # error no glu.h # endif int main () { gluBeginCurve(0) ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_glu_libglu="${ax_try_lib}"; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test X$ax_compiler_ms = Xyes; then : ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS} fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glu_libglu" >&5 $as_echo "$ax_cv_check_glu_libglu" >&6; } if test "X$ax_cv_check_glu_libglu" = Xno; then : no_glu=yes; GLU_CFLAGS=""; GLU_LIBS="" else if test "X$ax_cv_check_glu_libglu" = Xyes; then : GLU_LIBS="$GL_LIBS" else GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}" fi fi # # Some versions of Mac OS X include a broken interpretation of the GLU # tesselation callback function signature. # if test "X$ax_cv_check_glu_libglu" != Xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for varargs GLU tesselator callback function type" >&5 $as_echo_n "checking for varargs GLU tesselator callback function type... " >&6; } if ${ax_cv_varargs_glu_tesscb+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_varargs_glu_tesscb=no ax_save_CFLAGS="$CFLAGS" CFLAGS="$GL_CFLAGS $CFLAGS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # ifdef HAVE_GL_GLU_H # include # else # include # endif int main () { GLvoid (*func)(...); gluTessCallback(0, 0, func) ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ax_cv_varargs_glu_tesscb=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="$ax_save_CFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_varargs_glu_tesscb" >&5 $as_echo "$ax_cv_varargs_glu_tesscb" >&6; } if test X$ax_cv_varargs_glu_tesscb = Xyes; then : $as_echo "#define HAVE_VARARGS_GLU_TESSCB 1" >>confdefs.h fi fi if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. $as_echo "#define X_DISPLAY_MISSING 1" >>confdefs.h X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cxx_werror_flag=$ac_xsave_cxx_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if ${ac_cv_lib_dnet_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dnet_dnet_ntoa=yes else ac_cv_lib_dnet_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if ${ac_cv_lib_dnet_stub_dnet_ntoa+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_dnet_stub_dnet_ntoa=yes else ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. ac_fn_cxx_check_func "$LINENO" "gethostbyname" "ac_cv_func_gethostbyname" if test "x$ac_cv_func_gethostbyname" = xyes; then : fi if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if ${ac_cv_lib_nsl_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_nsl_gethostbyname=yes else ac_cv_lib_nsl_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if ${ac_cv_lib_bsd_gethostbyname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_bsd_gethostbyname=yes else ac_cv_lib_bsd_gethostbyname=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. ac_fn_cxx_check_func "$LINENO" "connect" "ac_cv_func_connect" if test "x$ac_cv_func_connect" = xyes; then : fi if test $ac_cv_func_connect = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if ${ac_cv_lib_socket_connect+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_socket_connect=yes else ac_cv_lib_socket_connect=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = xyes; then : X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. ac_fn_cxx_check_func "$LINENO" "remove" "ac_cv_func_remove" if test "x$ac_cv_func_remove" = xyes; then : fi if test $ac_cv_func_remove = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if ${ac_cv_lib_posix_remove+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_posix_remove=yes else ac_cv_lib_posix_remove=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. ac_fn_cxx_check_func "$LINENO" "shmat" "ac_cv_func_shmat" if test "x$ac_cv_func_shmat" = xyes; then : fi if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if ${ac_cv_lib_ipc_shmat+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_ipc_shmat=yes else ac_cv_lib_ipc_shmat=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = xyes; then : X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if ${ac_cv_lib_ICE_IceConnectionNumber+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_ICE_IceConnectionNumber=yes else ac_cv_lib_ICE_IceConnectionNumber=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = xyes; then : X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GLU_CFLAGS} ${CPPFLAGS}" for ac_header in GL/glut.h GLUT/glut.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done CPPFLAGS="${ax_save_CPPFLAGS}" GLUT_CFLAGS=${GLU_CFLAGS} GLUT_LIBS=${GLU_LIBS} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLUT library" >&5 $as_echo_n "checking for GLUT library... " >&6; } if ${ax_cv_check_glut_libglut+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_check_glut_libglut="no" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GLUT_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lglut32 -lglut" for ax_lib in ${ax_check_libs}; do if test X$ax_compiler_ms = Xyes; then : ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` else ax_try_lib="${ax_lib}" fi LIBS="${ax_try_lib} ${GLUT_LIBS} ${ax_save_LIBS}" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if HAVE_WINDOWS_H && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLUT_H # include # elif defined(HAVE_GLUT_GLUT_H) # include # else # error no glut.h # endif int main () { glutMainLoop() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_glut_libglut="${ax_try_lib}"; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done if test "X$ax_cv_check_glut_libglut" = Xno -a "X$no_x" = Xyes; then : LIBS='-framework GLUT' cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # if HAVE_WINDOWS_H && defined(_WIN32) # include # endif # ifdef HAVE_GL_GLUT_H # include # elif defined(HAVE_GLUT_GLUT_H) # include # else # error no glut.h # endif int main () { glutMainLoop() ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_check_glut_libglut="$LIBS" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi CPPFLAGS="${ax_save_CPPFLAGS}" LIBS="${ax_save_LIBS}" ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_glut_libglut" >&5 $as_echo "$ax_cv_check_glut_libglut" >&6; } if test "X$ax_cv_check_glut_libglut" = Xno; then : no_glut="yes"; GLUT_CFLAGS=""; GLUT_LIBS="" else GLUT_LIBS="${ax_cv_check_glut_libglut} ${GLUT_LIBS}" fi fi if test "$no_gl" = yes; then missing_for_gpu="$missing_for_gpu GL" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GL not found, disabling GPU mode" >&5 $as_echo "$as_me: WARNING: GL not found, disabling GPU mode" >&2;} elif test "$no_glu" = yes; then missing_for_gpu="$missing_for_gpu GLU" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GLU not found, disabling GPU mode" >&5 $as_echo "$as_me: WARNING: GLU not found, disabling GPU mode" >&2;} elif test "$no_glut" = yes; then missing_for_gpu="$missing_for_gpu GLUT" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GLUT not found, disabling GPU mode" >&5 $as_echo "$as_me: WARNING: GLUT not found, disabling GPU mode" >&2;} else # GLUT_LIBS and GLU_LIBS include GL_LIBS implicitly OPENGL_LIBS="${GLU_LIBS} ${GLUT_LIBS}" OPENGL_CFLAGS="${GL_CFLAGS}" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for glewInit in -lGLEW" >&5 $as_echo_n "checking for glewInit in -lGLEW... " >&6; } if ${ac_cv_lib_GLEW_glewInit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lGLEW $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char glewInit (); int main () { return glewInit (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_GLEW_glewInit=yes else ac_cv_lib_GLEW_glewInit=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_GLEW_glewInit" >&5 $as_echo "$ac_cv_lib_GLEW_glewInit" >&6; } if test "x$ac_cv_lib_GLEW_glewInit" = xyes; then : can_use_gpu=yes OPENGL_LIBS="-lGLEW ${OPENGL_LIBS}" $as_echo "#define HAVE_LIBGLEW 1" >>confdefs.h else missing_for_gpu="$missing_for_gpu GLEW" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: GLEW not found, disabling GPU mode" >&5 $as_echo "$as_me: WARNING: GLEW not found, disabling GPU mode" >&2;} fi fi if test $can_use_gpu = no; then no_gpu_reason=", because of missing$missing_for_gpu" fi else no_gpu_reason=", because it was disabled" fi # Memory allocation debug support { $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5 $as_echo_n "checking if malloc debugging is wanted... " >&6; } # Check whether --with-dmalloc was given. if test "${with_dmalloc+set}" = set; then : withval=$with_dmalloc; if test "$withval" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } $as_echo "#define WITH_DMALLOC 1" >>confdefs.h if test $acx_pthread_ok = yes; then LIBS="$LIBS -ldmallocthcxx" enable_dmalloc="yes (thread aware)" else LIBS="$LIBS -ldmalloccxx" enable_dmalloc=yes fi LDFLAGS="$LDFLAGS -g" $as_echo "#define DMALLOC 1" >>confdefs.h $as_echo "#define DMALLOC_FUNC_CHECK 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_dmalloc=no fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_dmalloc=no fi # Checks for header files. ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char opendir (); int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi for ac_header in fenv.h limits.h stdlib.h string.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_cxx_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_cxx_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : else as_fn_error $? "libtiff-devel header files are required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes; then : else as_fn_error $? "libjpeg-devel header files are required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default" if test "x$ac_cv_header_png_h" = xyes; then : else as_fn_error $? "libpng-devel header files are required to compile Enblend." "$LINENO" 5 fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "vigra/basicimage.hxx" "ac_cv_header_vigra_basicimage_hxx" "$ac_includes_default" if test "x$ac_cv_header_vigra_basicimage_hxx" = xyes; then : else as_fn_error $? "Vigra \"basicimage.hxx\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/algorithm/string/case_conv.hpp" "ac_cv_header_boost_algorithm_string_case_conv_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_algorithm_string_case_conv_hpp" = xyes; then : else as_fn_error $? "Boost \"case_conv\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/algorithm/string/trim.hpp" "ac_cv_header_boost_algorithm_string_trim_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_algorithm_string_trim_hpp" = xyes; then : else as_fn_error $? "Boost \"trim\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/algorithm/string/erase.hpp" "ac_cv_header_boost_algorithm_string_erase_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_algorithm_string_erase_hpp" = xyes; then : else as_fn_error $? "Boost \"erase\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/assign/list_inserter.hpp" "ac_cv_header_boost_assign_list_inserter_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_assign_list_inserter_hpp" = xyes; then : else as_fn_error $? "Boost \"list_inserter\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/assign/list_of.hpp" "ac_cv_header_boost_assign_list_of_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_assign_list_of_hpp" = xyes; then : else as_fn_error $? "Boost \"list_of\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/functional/hash.hpp" "ac_cv_header_boost_functional_hash_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_functional_hash_hpp" = xyes; then : else as_fn_error $? "Boost \"hash\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/lambda/algorithm.hpp" "ac_cv_header_boost_lambda_algorithm_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_lambda_algorithm_hpp" = xyes; then : else as_fn_error $? "Boost \"algorithm\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/lambda/bind.hpp" "ac_cv_header_boost_lambda_bind_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_lambda_bind_hpp" = xyes; then : else as_fn_error $? "Boost \"bind\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/lambda/construct.hpp" "ac_cv_header_boost_lambda_construct_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_lambda_construct_hpp" = xyes; then : else as_fn_error $? "Boost \"construct\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/lambda/if.hpp" "ac_cv_header_boost_lambda_if_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_lambda_if_hpp" = xyes; then : else as_fn_error $? "Boost \"if\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/lambda/lambda.hpp" "ac_cv_header_boost_lambda_lambda_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_lambda_lambda_hpp" = xyes; then : else as_fn_error $? "Boost \"lambda\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/logic/tribool.hpp" "ac_cv_header_boost_logic_tribool_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_logic_tribool_hpp" = xyes; then : else as_fn_error $? "Boost \"tribool\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/math/special_functions.hpp" "ac_cv_header_boost_math_special_functions_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_math_special_functions_hpp" = xyes; then : else as_fn_error $? "Boost \"special_functions\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/optional.hpp" "ac_cv_header_boost_optional_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_optional_hpp" = xyes; then : else as_fn_error $? "Boost \"optional\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/pool/pool.hpp" "ac_cv_header_boost_pool_pool_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_pool_pool_hpp" = xyes; then : else as_fn_error $? "Boost \"pool\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/random/uniform_real.hpp" "ac_cv_header_boost_random_uniform_real_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_random_uniform_real_hpp" = xyes; then : else as_fn_error $? "Boost \"uniform_real\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/random/variate_generator.hpp" "ac_cv_header_boost_random_variate_generator_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_random_variate_generator_hpp" = xyes; then : else as_fn_error $? "Boost \"variate_generator\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/scoped_ptr.hpp" "ac_cv_header_boost_scoped_ptr_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_scoped_ptr_hpp" = xyes; then : else as_fn_error $? "Boost \"scoped_ptr\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/static_assert.hpp" "ac_cv_header_boost_static_assert_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_static_assert_hpp" = xyes; then : else as_fn_error $? "Boost \"static_assert\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/system/error_code.hpp" "ac_cv_header_boost_system_error_code_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_system_error_code_hpp" = xyes; then : else as_fn_error $? "Boost \"error_code\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "boost/unordered_set.hpp" "ac_cv_header_boost_unordered_set_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_unordered_set_hpp" = xyes; then : else as_fn_error $? "Boost \"unordered_set\" header file is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_errno.h" "ac_cv_header_gsl_gsl_errno_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_errno_h" = xyes; then : else as_fn_error $? "GNU Scientific Library (GSL) header file \"gsl_errno\" is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_min.h" "ac_cv_header_gsl_gsl_min_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_min_h" = xyes; then : else as_fn_error $? "GNU Scientific Library (GSL) header file \"gsl_min\" is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_multimin.h" "ac_cv_header_gsl_gsl_multimin_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_multimin_h" = xyes; then : else as_fn_error $? "GNU Scientific Library (GSL) header file \"gsl_multimin\" is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_rng.h" "ac_cv_header_gsl_gsl_rng_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_rng_h" = xyes; then : else as_fn_error $? "GNU Scientific Library (GSL) header file \"gsl_rng\" is required to compile Enblend." "$LINENO" 5 fi ac_fn_cxx_check_header_mongrel "$LINENO" "gsl/gsl_vector.h" "ac_cv_header_gsl_gsl_vector_h" "$ac_includes_default" if test "x$ac_cv_header_gsl_gsl_vector_h" = xyes; then : else as_fn_error $? "GNU Scientific Library (GSL) header file \"gsl_vector\" is required to compile Enblend." "$LINENO" 5 fi LIBS="-lboost_system $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for new Boost system library" >&5 $as_echo_n "checking for new Boost system library... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "boost/system/error_code.hpp" int main () { boost::system::generic_category(); boost::system::system_category() ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for old Boost system library" >&5 $as_echo_n "checking for old Boost system library... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "boost/system/error_code.hpp" int main () { boost::system::get_generic_category(); boost::system::get_system_category() ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } as_fn_error $? "Boost \"system\" library is required to compile Enblend." "$LINENO" 5 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext # Check whether --with-boost-filesystem was given. if test "${with_boost_filesystem+set}" = set; then : withval=$with_boost_filesystem; else with_boost_filesystem=check fi if test "$with_boost_filesystem" = no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: disabling use of Boost \"filesystem\" library" >&5 $as_echo "$as_me: disabling use of Boost \"filesystem\" library" >&6;} else if test "$with_boost_filesystem" = yes; then : { $as_echo "$as_me:${as_lineno-$LINENO}: forcing use of Boost \"filesystem\" library" >&5 $as_echo "$as_me: forcing use of Boost \"filesystem\" library" >&6;} $as_echo "#define HAVE_BOOST_FILESYSTEM 1" >>confdefs.h EXTRA_LIBS="-lboost_filesystem ${EXTRA_LIBS}" else ac_fn_cxx_check_header_mongrel "$LINENO" "boost/filesystem.hpp" "ac_cv_header_boost_filesystem_hpp" "$ac_includes_default" if test "x$ac_cv_header_boost_filesystem_hpp" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: Boost \"filesystem\" header is missing." >&5 $as_echo "$as_me: Boost \"filesystem\" header is missing." >&6;} fi if test "$ac_cv_header_boost_filesystem_hpp" = yes; then found_boost_filesystem_lib=no candidates="-lboost_filesystem" if test "$acx_pthread_ok" = yes; then candidates="-lboost_filesystem-mt $candidates" fi if test "$with_boost_filesystem" != check; then candidates="$with_boost_filesystem $candidates" fi LIBS_ORIG=$LIBS for x in $candidates; do LIBS="$LIBS_ORIG $x" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include "boost/filesystem.hpp" int main () { #if BOOST_FILESYSTEM_VERSION <= 2 typedef boost::filesystem::basic_path basic_path; basic_path p("foo/bar/baz.oo"); p.branch_path().string(); p.leaf(); #else typedef boost::filesystem::path basic_path; basic_path p("foo/bar/baz.oo"); p.parent_path(); p.filename(); #endif basename(p); extension(p); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : EXTRA_LIBS="$x $y ${EXTRA_LIBS}" found_boost_filesystem_lib=yes { $as_echo "$as_me:${as_lineno-$LINENO}: compiling with Boost's generic filename parsing support." >&5 $as_echo "$as_me: compiling with Boost's generic filename parsing support." >&6;} break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done LIBS=$LIBS_ORIG fi if test "$ac_cv_header_boost_filesystem_hpp" = yes && test "$found_boost_filesystem_lib" = yes; then $as_echo "#define HAVE_BOOST_FILESYSTEM 1" >>confdefs.h else { $as_echo "$as_me:${as_lineno-$LINENO}: Boost \"filesystem\" header or library not found. Using built-in support." >&5 $as_echo "$as_me: Boost \"filesystem\" header or library not found. Using built-in support." >&6;} fi fi fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_fn_cxx_check_header_mongrel "$LINENO" "lcms2.h" "ac_cv_header_lcms2_h" "$ac_includes_default" if test "x$ac_cv_header_lcms2_h" = xyes; then : else as_fn_error $? "lcms2 header files are required to compile Enblend." "$LINENO" 5 fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_cxx_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac if test "$ac_cv_c_inline" != no; then $as_echo "#define HAVE_INLINE 1" >>confdefs.h fi ac_fn_cxx_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define off_t long int _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF ac_fn_cxx_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_cxx_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default" if test "x$ac_cv_type_ptrdiff_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTRDIFF_T 1 _ACEOF fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5 $as_echo_n "checking whether closedir returns void... " >&6; } if ${ac_cv_func_closedir_void+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_closedir_void=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include <$ac_header_dirent> #ifndef __cplusplus int closedir (); #endif int main () { return closedir (opendir (".")) != 0; ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_closedir_void=no else ac_cv_func_closedir_void=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_closedir_void" >&5 $as_echo "$ac_cv_func_closedir_void" >&6; } if test $ac_cv_func_closedir_void = yes; then $as_echo "#define CLOSEDIR_VOID 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 $as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } if ${ac_cv_sys_largefile_source+:} false; then : $as_echo_n "(cached) " >&6 else while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_sys_largefile_source=no; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGEFILE_SOURCE 1 #include /* for off_t */ #include int main () { int (*fp) (FILE *, off_t, int) = fseeko; return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_sys_largefile_source=1; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_cv_sys_largefile_source=unknown break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 $as_echo "$ac_cv_sys_largefile_source" >&6; } case $ac_cv_sys_largefile_source in #( no | unknown) ;; *) cat >>confdefs.h <<_ACEOF #define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source _ACEOF ;; esac rm -rf conftest* # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug # in glibc 2.1.3, but that breaks too many other things. # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. if test $ac_cv_sys_largefile_source != unknown; then $as_echo "#define HAVE_FSEEKO 1" >>confdefs.h fi # AC_FUNC_MALLOC dnl unused and harmful when cross compiling if ${ac_cv_func_setvbuf_reversed+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_setvbuf_reversed=no fi ac_fn_cxx_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_cxx_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if ${ac_cv_func_strtod+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_cxx_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_cxx_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in fesetround floor \ memset mkstemp \ pow \ sqrt strchr strcspn strdup strerror strrchr strtok_r strtol strtoul do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_cxx_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done # lrint and lrintf { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lrint" >&5 $as_echo_n "checking for lrint... " >&6; } if ${ac_cv_c99_lrint+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { int value = lrint (0.432) ; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c99_lrint=yes else ac_cv_c99_lrint=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_lrint" >&5 $as_echo "$ac_cv_c99_lrint" >&6; } if test $ac_cv_c99_lrint = yes; then $as_echo "#define HAVE_LRINT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lrintf" >&5 $as_echo_n "checking for lrintf... " >&6; } if ${ac_cv_c99_lrintf+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { int value = lrintf (0.432) ; ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_c99_lrintf=yes else ac_cv_c99_lrintf=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_lrintf" >&5 $as_echo "$ac_cv_c99_lrintf" >&6; } if test $ac_cv_c99_lrintf = yes; then $as_echo "#define HAVE_LRINTF 1" >>confdefs.h fi if test -z "$PERL"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether perl executable path has been provided" >&5 $as_echo_n "checking whether perl executable path has been provided... " >&6; } # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; if test "$withval" != yes -a "$withval" != no; then : PERL="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else PERL="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$withval" != no; then : # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="false" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PERL+:} false; then : $as_echo_n "(cached) " >&6 else case $PERL in [\\/]* | ?:[\\/]*) ac_cv_path_PERL="$PERL" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_PERL" && ac_cv_path_PERL="false" ;; esac fi PERL=$ac_cv_path_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test "$PERL" = false; then as_fn_error $? "cannot find perl" "$LINENO" 5 fi # Make sure we have perl if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in 'Sys::Hostname' ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 $as_echo_n "checking for perl module $ax_perl_module... " >&6; } # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; ax_perl_modules_failed=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; }; fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : else : as_fn_error $? "missing Perl module Sys::Hostname" "$LINENO" 5 fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 $as_echo "$as_me: WARNING: could not find perl" >&2;} fi # Make sure we have perl if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in 'Time::Zone' ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 $as_echo_n "checking for perl module $ax_perl_module... " >&6; } # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; ax_perl_modules_failed=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; }; fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : else : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing Perl module Time::Zone" >&5 $as_echo "$as_me: WARNING: missing Perl module Time::Zone" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 $as_echo "$as_me: WARNING: could not find perl" >&2;} fi # Documentation if test "$cross_compiling" = no; then HELP2MAN=${HELP2MAN-"${am_missing_run}help2man"} else HELP2MAN=: fi can_build_doc=yes # Make sure we have perl if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in 'File::Basename' ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 $as_echo_n "checking for perl module $ax_perl_module... " >&6; } # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; ax_perl_modules_failed=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; }; fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : else : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing Perl module File::Basename" >&5 $as_echo "$as_me: WARNING: missing Perl module File::Basename" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc File::Basename" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 $as_echo "$as_me: WARNING: could not find perl" >&2;} fi # Make sure we have perl if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in 'IO::File' ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 $as_echo_n "checking for perl module $ax_perl_module... " >&6; } # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; ax_perl_modules_failed=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; }; fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : else : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing Perl module IO::File" >&5 $as_echo "$as_me: WARNING: missing Perl module IO::File" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc IO::File" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 $as_echo "$as_me: WARNING: could not find perl" >&2;} fi # Make sure we have perl if test -z "$PERL"; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PERL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PERL"; then ac_cv_prog_PERL="$PERL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PERL="perl" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PERL=$ac_cv_prog_PERL if test -n "$PERL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$PERL" != x; then ax_perl_modules_failed=0 for ax_perl_module in 'IO::Handle' ; do { $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5 $as_echo_n "checking for perl module $ax_perl_module... " >&6; } # Would be nice to log result here, but can't rely on autoconf internals $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1 if test $? -ne 0; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; }; ax_perl_modules_failed=1 else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; }; fi done # Run optional shell commands if test "$ax_perl_modules_failed" = 0; then : else : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: missing Perl module IO::Handle" >&5 $as_echo "$as_me: WARNING: missing Perl module IO::Handle" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc IO::Handle" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5 $as_echo "$as_me: WARNING: could not find perl" >&2;} fi if test -z "$GNUPLOT"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gnuplot executable path has been provided" >&5 $as_echo_n "checking whether gnuplot executable path has been provided... " >&6; } # Check whether --with-gnuplot was given. if test "${with_gnuplot+set}" = set; then : withval=$with_gnuplot; if test "$withval" != yes -a "$withval" != no; then : GNUPLOT="$withval" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUPLOT" >&5 $as_echo "$GNUPLOT" >&6; } else GNUPLOT="" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if test "$withval" != no; then : # Extract the first word of "gnuplot", so it can be a program name with args. set dummy gnuplot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GNUPLOT+:} false; then : $as_echo_n "(cached) " >&6 else case $GNUPLOT in [\\/]* | ?:[\\/]*) ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GNUPLOT" && ac_cv_path_GNUPLOT="false" ;; esac fi GNUPLOT=$ac_cv_path_GNUPLOT if test -n "$GNUPLOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUPLOT" >&5 $as_echo "$GNUPLOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } # Extract the first word of "gnuplot", so it can be a program name with args. set dummy gnuplot; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_GNUPLOT+:} false; then : $as_echo_n "(cached) " >&6 else case $GNUPLOT in [\\/]* | ?:[\\/]*) ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_path_GNUPLOT" && ac_cv_path_GNUPLOT="false" ;; esac fi GNUPLOT=$ac_cv_path_GNUPLOT if test -n "$GNUPLOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GNUPLOT" >&5 $as_echo "$GNUPLOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test "$GNUPLOT" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find gnuplot; will not be able to build documentation" >&5 $as_echo "$as_me: WARNING: cannot find gnuplot; will not be able to build documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc gnuplot" fi # Check whether --with-raster-dir was given. if test "${with_raster_dir+set}" = set; then : withval=$with_raster_dir; RASTER_DIR="$withval" else RASTER_DIR=raster fi # Extract the first word of "fig2dev", so it can be a program name with args. set dummy fig2dev; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_FIG2DEV+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$FIG2DEV"; then ac_cv_prog_FIG2DEV="$FIG2DEV" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_FIG2DEV="fig2dev" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_FIG2DEV" && ac_cv_prog_FIG2DEV="false" fi fi FIG2DEV=$ac_cv_prog_FIG2DEV if test -n "$FIG2DEV"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FIG2DEV" >&5 $as_echo "$FIG2DEV" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$FIG2DEV" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find fig2dev; will not be able to build documentation" >&5 $as_echo "$as_me: WARNING: cannot find fig2dev; will not be able to build documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc fig2dev" fi # Extract the first word of "convert", so it can be a program name with args. set dummy convert; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CONVERT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CONVERT"; then ac_cv_prog_CONVERT="$CONVERT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CONVERT="convert" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_CONVERT" && ac_cv_prog_CONVERT="false" fi fi CONVERT=$ac_cv_prog_CONVERT if test -n "$CONVERT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CONVERT" >&5 $as_echo "$CONVERT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$CONVERT" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find convert; will not be able to build documentation" >&5 $as_echo "$as_me: WARNING: cannot find convert; will not be able to build documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc convert" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed # These variables are mentioned in the AutoMake documentation as being # influential to the documentation build process. # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MAKEINFO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MAKEINFO"; then ac_cv_prog_MAKEINFO="$MAKEINFO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MAKEINFO="makeinfo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_MAKEINFO" && ac_cv_prog_MAKEINFO="false" fi fi MAKEINFO=$ac_cv_prog_MAKEINFO if test -n "$MAKEINFO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAKEINFO" >&5 $as_echo "$MAKEINFO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$MAKEINFO" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find makeinfo; will not be able to build documentation" >&5 $as_echo "$as_me: WARNING: cannot find makeinfo; will not be able to build documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc makeinfo" fi # Extract the first word of "tidy", so it can be a program name with args. set dummy tidy; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_TIDY+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$TIDY"; then ac_cv_prog_TIDY="$TIDY" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TIDY="tidy" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_TIDY" && ac_cv_prog_TIDY="false" fi fi TIDY=$ac_cv_prog_TIDY if test -n "$TIDY"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TIDY" >&5 $as_echo "$TIDY" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$TIDY" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find tidy; will not be able to build XHTML documentation" >&5 $as_echo "$as_me: WARNING: cannot find tidy; will not be able to build XHTML documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc tidy" fi # Extract the first word of "xmllint", so it can be a program name with args. set dummy xmllint; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_XMLLINT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$XMLLINT"; then ac_cv_prog_XMLLINT="$XMLLINT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_XMLLINT="xmllint" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS test -z "$ac_cv_prog_XMLLINT" && ac_cv_prog_XMLLINT="false" fi fi XMLLINT=$ac_cv_prog_XMLLINT if test -n "$XMLLINT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XMLLINT" >&5 $as_echo "$XMLLINT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "$XMLLINT" = false; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find xmllint; will not be able to build XHTML documentation" >&5 $as_echo "$as_me: WARNING: cannot find xmllint; will not be able to build XHTML documentation" >&2;} can_build_doc=no missing_for_doc="$missing_for_doc xmllint" fi if test "$can_build_doc" = yes; then BUILD_DOC_TRUE= BUILD_DOC_FALSE='#' else BUILD_DOC_TRUE='#' BUILD_DOC_FALSE= fi if test "$can_build_doc" = no; then no_doc_reason=", because of missing$missing_for_doc" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking checking whether split documentation files" >&5 $as_echo_n "checking checking whether split documentation files... " >&6; } split_doc_default="yes" # Check whether --enable-split-doc was given. if test "${enable_split_doc+set}" = set; then : enableval=$enable_split_doc; split_doc=$enableval else split_doc=$split_doc_default fi if test "$split_doc" = yes; then AM_MAKEINFOFLAGS="$AM_MAKEINFOFLAGS" AM_MAKEINFOHTMLFLAGS="$AM_MAKEINFOHTMLFLAGS" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } split_doc=yes else AM_MAKEINFOFLAGS="$AM_MAKEINFOFLAGS --no-split" AM_MAKEINFOHTMLFLAGS="$AM_MAKEINFOHTMLFLAGS --no-split --no-headers" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } split_doc=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging" >&5 $as_echo_n "checking whether to enable debugging... " >&6; } debug_default="no" # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; enable_debug=$enableval else enable_debug=$debug_default fi if test "$enable_debug" = yes; then CXXFLAGS="$CXXFLAGS -g -DDEBUG -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_debug=yes else CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG -Wall" { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_debug=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable image cache" >&5 $as_echo_n "checking whether to enable image cache... " >&6; } image_cache_default="yes" # Check whether --enable-image_cache was given. if test "${enable_image_cache+set}" = set; then : enableval=$enable_image_cache; enable_image_cache=$enableval else enable_image_cache=$image_cache_default fi if test "$enable_image_cache" = yes; then $as_echo "#define CACHE_IMAGES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } enable_image_cache=yes else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_image_cache=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to compile with OpenMP" >&5 $as_echo_n "checking whether to compile with OpenMP... " >&6; } openmp_default="no" # Check whether --enable-openmp was given. if test "${enable_openmp+set}" = set; then : enableval=$enable_openmp; enable_openmp=$enableval else enable_openmp=$openmp_default fi if test "$enable_openmp" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OpenMP flag of C++ compiler" >&5 $as_echo_n "checking for OpenMP flag of C++ compiler... " >&6; } if ${ax_cv_cxx_openmp+:} false; then : $as_echo_n "(cached) " >&6 else saveCXXFLAGS=$CXXFLAGS ax_cv_cxx_openmp=unknown # Flags to try: -fopenmp (gcc), -openmp (icc), -mp (SGI & PGI), # -xopenmp (Sun), -omp (Tru64), -qsmp=omp (AIX), none ax_openmp_flags="-fopenmp -openmp -mp -xopenmp -omp -qsmp=omp none" if test "x$OPENMP_CXXFLAGS" != x; then ax_openmp_flags="$OPENMP_CXXFLAGS $ax_openmp_flags" fi for ax_openmp_flag in $ax_openmp_flags; do case $ax_openmp_flag in none) CXXFLAGS=$saveCXX ;; *) CXXFLAGS="$saveCXXFLAGS $ax_openmp_flag" ;; esac cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char omp_set_num_threads (); int main () { return omp_set_num_threads (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ax_cv_cxx_openmp=$ax_openmp_flag; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done CXXFLAGS=$saveCXXFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_openmp" >&5 $as_echo "$ax_cv_cxx_openmp" >&6; } if test "x$ax_cv_cxx_openmp" = "xunknown"; then : else if test "x$ax_cv_cxx_openmp" != "xnone"; then OPENMP_CXXFLAGS=$ax_cv_cxx_openmp fi enable_openmp=yes fi CFLAGS="$CFLAGS $OPENMP_CFLAGS" CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" fi if test -z "$OPENMP_CXXFLAGS"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } enable_openmp=no else if test "$enable_image_cache" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: image cache and OpenMP support are mutually exclusive" >&5 $as_echo "$as_me: WARNING: image cache and OpenMP support are mutually exclusive" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: only configure like this if you want to develop a reentrant image cache" >&5 $as_echo "$as_me: WARNING: only configure like this if you want to develop a reentrant image cache" >&2;} warnings=`echo -e "$warnings\n WARNING: Image cache and OpenMP are both enabled! You are a developer, aren't you?"` fi enable_openmp=yes fi ac_config_files="$ac_config_files doc/entropy.gp doc/entropy-cutoff.gp doc/exposure-cutoff.gp doc/gaussian.gp doc/laplacian-of-gaussian.gp doc/sharp-edge.gp doc/smooth-edge.gp" ac_config_files="$ac_config_files Makefile include/Makefile include/vigra_ext/Makefile src/Makefile src/layer_selection/Makefile doc/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_DOC_TRUE}" && test -z "${BUILD_DOC_FALSE}"; then as_fn_error $? "conditional \"BUILD_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by enblend-enfuse $as_me 4.1.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ enblend-enfuse config.status 4.1.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "doc/entropy.gp") CONFIG_FILES="$CONFIG_FILES doc/entropy.gp" ;; "doc/entropy-cutoff.gp") CONFIG_FILES="$CONFIG_FILES doc/entropy-cutoff.gp" ;; "doc/exposure-cutoff.gp") CONFIG_FILES="$CONFIG_FILES doc/exposure-cutoff.gp" ;; "doc/gaussian.gp") CONFIG_FILES="$CONFIG_FILES doc/gaussian.gp" ;; "doc/laplacian-of-gaussian.gp") CONFIG_FILES="$CONFIG_FILES doc/laplacian-of-gaussian.gp" ;; "doc/sharp-edge.gp") CONFIG_FILES="$CONFIG_FILES doc/sharp-edge.gp" ;; "doc/smooth-edge.gp") CONFIG_FILES="$CONFIG_FILES doc/smooth-edge.gp" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "include/vigra_ext/Makefile") CONFIG_FILES="$CONFIG_FILES include/vigra_ext/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/layer_selection/Makefile") CONFIG_FILES="$CONFIG_FILES src/layer_selection/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # AC_OUTPUT has created "config.h" { $as_echo "$as_me:${as_lineno-$LINENO}: creating config-h.texi" >&5 $as_echo "$as_me: creating config-h.texi" >&6;} perl -ne 'if (s/^\s*#define\s+(\S+)\s+"?([^"]*)"?/\@set CFG::$1 $2/) {chomp; print "$_\n"}' \ < config.h \ > config-h.texi { $as_echo "$as_me:${as_lineno-$LINENO}: result: enblend-enfuse now configured for ${host} Source directory: ${srcdir} Installation directory: ${prefix} C++ compiler: ${CXX} CFLAGS: ${CFLAGS:-} OPENGL_CFLAGS: ${OPENGL_CFLAGS:-} CXXFLAGS: ${CXXFLAGS:-} LDFLAGS: ${LDFLAGS:-} LIBS: ${LIBS:-} OPENGL_LIBS: ${OPENGL_LIBS:-} EXTRA_LIBS (optional): ${EXTRA_LIBS:-} raster subdirectory: ${RASTER_DIR} can build all documentation: ${can_build_doc}${no_doc_reason} feature selection: split *.info and *.xhtml files: ${split_doc} enable debugging support: ${enable_debug} enable malloc debugging: ${enable_dmalloc} OpenEXR image format ${have_exr} use image cache: ${enable_image_cache} build GPU acceleration: ${can_use_gpu}${no_gpu_reason} use OpenMP: ${enable_openmp} ${warnings}" >&5 $as_echo " enblend-enfuse now configured for ${host} Source directory: ${srcdir} Installation directory: ${prefix} C++ compiler: ${CXX} CFLAGS: ${CFLAGS:-} OPENGL_CFLAGS: ${OPENGL_CFLAGS:-} CXXFLAGS: ${CXXFLAGS:-} LDFLAGS: ${LDFLAGS:-} LIBS: ${LIBS:-} OPENGL_LIBS: ${OPENGL_LIBS:-} EXTRA_LIBS (optional): ${EXTRA_LIBS:-} raster subdirectory: ${RASTER_DIR} can build all documentation: ${can_build_doc}${no_doc_reason} feature selection: split *.info and *.xhtml files: ${split_doc} enable debugging support: ${enable_debug} enable malloc debugging: ${enable_dmalloc} OpenEXR image format ${have_exr} use image cache: ${enable_image_cache} build GPU acceleration: ${can_use_gpu}${no_gpu_reason} use OpenMP: ${enable_openmp} ${warnings}" >&6; } enblend-enfuse-4.1.2+dfsg/config.h.cmake0000644000175100017510000001435512224454652020274 0ustar ametzlerametzler/* * \file configCompiler.h * This file is part of enblend. * Licence details can be found in the file COPYING. * * This is the compilation configuration file for enblend. * You might want to change some of the defaults if something goes wrong * during the compilation. */ #ifndef _CONFIG_COMPILER_H #define _CONFIG_COMPILER_H /* Default verbosity level of Enblend and Enfuse. A value of zero reduces the message output to only warnings and errors. Values of one and more make Enblend and Enfuse report progress in detail. */ #define DEFAULT_VERBOSITY 1 /* Define if you want to compile Enblend and Enfuse with image cache */ #cmakedefine CACHE_IMAGES 1 /* Define to 1 if the `closedir' function returns void instead of `int'. */ #cmakedefine CLOSEDIR_VOID 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #cmakedefine HAVE_DIRENT_H 1 /* Define if you have the header file */ #cmakedefine HAVE_EXT_SLIST 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_FENV_H 1 /* Define to 1 if you have the `fesetround' function. */ #cmakedefine HAVE_FESETROUND 1 /* Define to 1 if you have the `floor' function. */ #cmakedefine HAVE_FLOOR 1 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #cmakedefine HAVE_FSEEKO 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_INTTYPES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LIMITS_H 1 /* Define if you have C99's lrint function. */ #cmakedefine HAVE_LRINT 1 /* Define if you have C99's lrintf function. */ #cmakedefine HAVE_LRINTF 1 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #cmakedefine HAVE_MALLOC 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_MEMORY_H 1 /* Define to 1 if you have the `memset' function. */ #cmakedefine HAVE_MEMSET 1 /* Define to 1 if you have the `mkstemp' function. */ #cmakedefine HAVE_MKSTEMP 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #cmakedefine HAVE_NDIR_H 1 /* Define to 1 if you have the `pow' function. */ #cmakedefine HAVE_POW 1 /* Define if you have POSIX threads libraries and header files. */ #cmakedefine HAVE_PTHREAD 1 /* Define to 1 if the system has the type `ptrdiff_t'. */ #cmakedefine HAVE_PTRDIFF_T 1 /* Define to 1 if you have the `sqrt' function. */ #cmakedefine HAVE_SQRT 1 /* Define to 1 if stdbool.h conforms to C99. */ #cmakedefine HAVE_STDBOOL_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDINT_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STDLIB_H 1 /* Define to 1 if you have the `strchr' function. */ #cmakedefine HAVE_STRCHR 1 /* Define to 1 if you have the `strcspn' function. */ #cmakedefine HAVE_STRCSPN 1 /* Define to 1 if you have the `strdup' function. */ #cmakedefine HAVE_STRDUP 1 /* Define to 1 if you have the `strerror_r' function. */ #cmakedefine HAVE_STRERROR_R 1 /* Define to 1 if you have the `strerror' function. */ #cmakedefine HAVE_STRERROR 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRINGS_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_STRING_H 1 /* Define to 1 if you have the `strrchr' function. */ #cmakedefine HAVE_STRRCHR 1 /* Define to 1 if you have the `strtol' function. */ #cmakedefine HAVE_STRTOL 1 /* Define to 1 if you have the `strtok_r' function. */ #cmakedefine HAVE_STRTOK_R 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #cmakedefine HAVE_SYS_DIR_H 1 /* Define to 1 if you have the header file, and it defines `DIR'. */ #cmakedefine HAVE_SYS_NDIR_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_STAT_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TYPES_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H 1 /* Define to 1 if you have the header file. */ #cmakedefine HAVE_WINDOWS_H 1 /* Define to 1 if the system has the type `_Bool'. */ /* #undef HAVE__BOOL */ /* Name of package */ #define PACKAGE "enblend-enfuse" /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "https://bugs.launchpad.net/enblend" /* Define to the full name of this package. */ #define PACKAGE_NAME "enblend-enfuse" /* Define to the full name and version of this package. */ #cmakedefine PACKAGE_STRING "${PACKAGE_STRING}" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "enblend-enfuse" /* Define to the version of this package. */ #cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}" /* Define to necessary symbol if this constant uses a non-standard name on your system. */ /* #undef PTHREAD_CREATE_JOINABLE */ /* Define as the return type of signal handlers (`int' or `void'). */ #cmakedefine RETSIGTYPE ${RETSIGTYPE} /* Define to 1 if you have the ANSI C header files. */ #cmakedefine STDC_HEADERS 1 /* Define to 1 if strerror_r returns char *. */ #define STRERROR_R_CHAR_P 1 /* Version number of package */ #define VERSION "${ENBLEND_VERSION_ONLY}" /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #cmakedefine WORDS_BIGENDIAN 1 /* Define to 1 if the X Window System is missing or not being used. */ /* #undef X_DISPLAY_MISSING */ /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ /* #undef _LARGEFILE_SOURCE */ /* Define to empty if `const' does not conform to ANSI C. */ /* #undef const */ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus /* #undef inline */ #endif /* Define to rpl_malloc if the replacement function should be used. */ /* #undef malloc */ /* Define to `long int' if does not define. */ #cmakedefine HAVE_OFF_T 1 #if ! defined(HAVE_OFF_T) #define off_t long int #endif /* Define to `unsigned int' if does not define. */ #cmakedefine HAVE_SIZE_T 1 #if ! defined(HAVE_SIZE_T) #define size_t unsigned int #endif #endif enblend-enfuse-4.1.2+dfsg/README0000644000175100017510000005141512070530501016440 0ustar ametzlerametzlerCopyright (C) 2004-2012 Andrew Mihal. This file is part of Enblend. * Programs This packages contains the programs Enblend and Enfuse. The source code and further information about Enblend are available at: http://enblend.sf.net ** Enblend Enblend is a tool for compositing images using a Burt&Adelson multiresolution spline. This technique tries to make the seams between the input images invisible. The basic idea is that image features should be blended across a transition zone proportional in size to the spatial frequency of the features. For example, objects like trees and windowpanes have rapid changes in color. By blending these features in a narrow zone, you will not be able to see the seam because the eye already expects to see color changes at the edge of these features. Clouds and sky are the opposite. These features have to be blended across a wide transition zone because any sudden change in color will be immediately noticeable. Enblend expects each input file to have an alpha channel. The alpha channel should indicate the region of the file that has valid image data. Enblend compares the alpha regions in the input files to find the areas where images overlap. Alpha channels can be used to indicate to Enblend that certain portions of an input image should not contribute to the final image. Enblend does not align images for you. Use a tool like Hugin or PanoTools to do this. The files produced by these programs are exactly what Enblend is designed to work with. ** Enfuse Enfuse is a tool for automatic exposure blending, contrast blending and much more. It can be used to fuse an exposure bracketed step automatically into a nicely looking image. See doc/enfuse.info and on Windows also contrib/enfuse_droplet/enfuse_droplet_readme.txt for more information. * Installation GNU Make is required to build the project, because some of the Makefiles contain pattern rules. ** Tarball ./configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install ** Mercurial Repository *** AutoConf/AutoMake In the root directory of the project issue: make --makefile=Makefile.scm ./configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install The package fully supports VPATH builds. Thus the following command sequence builds in a separate directory. cd ROOT-DIRECTORY make --makefile=Makefile.scm mkdir BUILD-DIR cd BUILD-DIR ROOT-DIRECTORY/configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install *** CMake The canonical way to build Enblend and Enfuse is with Autotools, this is, autoconf(1) and automake(1). An alternative CMake build has been added since version 4.0. The CMake build strives to replicate the Autotools build. It may or may not work for you. It is currently maintained but not supported, meaning that it could break anywhere anytime in the future. cmake . make make install Analogously to Autotools, CMake allows for VPATH builds: mkdir BUILD-DIR cd BUILD-DIR cmake ROOT-DIRECTORY make make install * Specific Configuration Options Among the usual configuration options of the GNU autoconf system, the configure(1) script offers the following options to tailor Enblend and Enfuse. Remember that configure(1) creates a file called "config.h" that can serve for fine-tuning the configuration. We write the default values of all configuration options in capital letters. ** --enable-gpu-support=CHECK/yes/no -DENABLE_GPU=OFF/on (CMake) Enable code in Enblend to use the GPU for optimizing the seam line between two images if all necessary OpenGL libraries are found. Enfuse does not benefit of this code. OpenMP (see below) and GPU work together. Note that enabling GPU support does not mean Enblend will actually use the GPU. Besides passing option "--gpu" to Enblend the hardware as well as the X11 drivers have to fulfill certain requirements. See also option "--with-apple-opengl-framework". ** --enable-openmp=yes/NO -DENABLE_OPENMP=ON/off (CMake) Parallelize parts of Enblend and Enfuse with OpenMP. See http://www.openmp.org/ Note that OpenMP support and the ImageCache must not be activated both. The default is to configure with ImageCache and without OpenMP. If OpenMP support has been enabled, the utilization of special features of the actual, underlying OpenMP implementation can be controlled as usual with the environment variables OMP_NUM_THREADS, OMP_NESTED and OMP_DYNAMIC. See the OpenMP specification for details on the usage of these variables. ** --enable-split-doc=YES/no -DNOSPLIT=OFF/on (CMake) Split the documentation files in INFO or HTML format into small pieces. The default is "yes", split documentation. ** --enable-debug=yes/NO Compile without optimizations and enable all debug-checking code. The default is "no", build an optimized version without debugging symbols. ** --enable-image-cache=YES/no -DENABLE_IMAGECACHE=OFF/on (CMake) Activate the ImageCache feature, which allows for processing of large images. The ImageCache handles swapping parts of the images to disk. The default is "yes", enable the ImageCache. The ImageCache is recommended on systems where memory is scarce, but the images to blend or fuse are large. The ImageCache feature and OpenMP support must not be activated together. ** --with-apple-opengl-framework=yes/NO Sometimes AutoConf fails to detect Apple's OpenGL framework. Use this option on MAC OS X to force its usage without a test. See also option "--enable-gpu-support" and the section MacOSX below. ** --with-boost-filesystem=CHECK/yes/no/ Use Boost "filesystem" library to get platform-independent path generation. The default is to check for usability. "No" forces the use of the internal path generation library. Supply a LIBRARY name if you want to override the default candidates "boost_filesystem-mt" for multi-threaded compilation and "boost_filesystem" for single-thread builds. ** --with-dmalloc=yes/NO Compile with the debug-malloc library. The library is available at http://www.dmalloc.com/. ** --with-openexr=CHECK/yes/no Build with support for reading and writing OpenEXR images. See http://www.openexr.com/ for the required libraries. ** --with-raster-dir= Set the name of the raster-graphics directory, which always is a subdirectory of the XHTML documentation's root directory. Default: "raster". * CMake Specifics ** Configuration Options These options only apply to CMake. *** -DCPACK_BINARY_:BOOL=OFF/on Create a package for the specified , where is "DEB", "RPM", or "NSIS". *** -DCPACK_BINARY_:BOOL=ON/off Create other packages for the specified , where is "TBZ2", "TGZ", "STGZ", or "TZ". *** -DPACK_SOURCE_:BOOL=OFF/on Create a source package for the specified , where is "TBZ2", "TGZ", "TZ", or "ZIP". ** Configuration Example Creating a RedHat package on OpenSuSE cmake . \ -DDOC=ON -DENABLE_GPU=ON \ -DENABLE_IMAGECACHE=OFF -DENABLE_OPENMP=ON \ -DCPACK_BINARY_RPM:BOOL=ON make package This will create a package enblend-4.0.595-Linux.rpm, which you may install with sudo rpm -U enblend-4.0.595-Linux.rpm ** Important Configured Make(1) Targets help List all available targets. edit_cache If cmake-gui(1) is installed, start the GUI to edit the "CMakeCache.txt" file. enblend Create an Enblend executable. enfuse Create an Enfuse executable. man Create the manual pages for Enblend and Enfuse. doc3 Create the documentation. This includes html, info, and pdf documents, if the cmake-option DOC was set. install Install everything in the proper places. package Create package(s) specified with the CPACK_BINARY_:BOOL parameter of CMake. It is preferred to create a package and use the package manager to install it rather than using the "install" target. rebuild_cache In a changed environment (e.g. newly installed packages) this is the way to discard cached values, so that CMake again starts searching for everything. package_source Build a source package like autotools "make dist". * Extra Make(1) Variables ** Compilation You can override Makefile variables the usual way. In addition the build process supplies several variables, all starting with "EXTRA", that add their value to the "usual suspects". These are CPPFLAGS -- EXTRACPPFLAGS CFLAGS -- EXTRACFLAGS CXXFLAGS -- EXTRACXXFLAGS LDFLAGS -- EXTRALDFLAGS All these "EXTRA" are intentionally unaffected by the Automake/Autoconf generation of the Makefiles proper. That way developers can override configured settings in any make(1) run or quickly build the project with new combinations of flags. For example, to quickly add an additional define, use make EXTRACPPFLAGS=-DDEBUG_8BIT_ONLY To compile for coverage analysis, say make EXTRACXXFLAGS="-O0 --coverage" EXTRALDFLAGS="--coverage" analogously for profiling analysis make EXTRACXXFLAGS=-pg EXTRALDFLAGS=-pg ** Documentation Generation We have introduced the variable EXTRATEXI2DVIFLAGS to give the maintainers a tighter control over the generation of the hard-copy version of the documentation. Note that the variable does not have an equivalent non-EXTRA sibling in the Automake system. It is particularly useful to supply texi2dvi(1) with "--command" parameters that explicitly set the paper size, like, for example, EXTRATEXI2DVIFLAGS="--command=@afourpaper" Common paper-size commands are: @smallbook @afivepaper @afourpaper, @afourwide, @afourlatex Moreover, you can specify the height and (optionally) width of the main text area on a page with the @pagesizes HEIGHT [, WIDTH] command. Remember to supply both HEIGHT and WIDTH with appropriate units ("mm", "in", ...). Another useful Texinfo-command at this level is @finalout which suppresses the black rectangles marking overfull hboxes. Use the standard variable MAKEINFOFLAGS to control makeinfo(1), for example, to set the maximum length of lines in Info and plain text output with make MAKEINFOFLAGS="--fill-column=95" info The variable MAKEINFOHTMLFLAGS controls the formatting of XHTML; if set, it adds to MAKEINFOFLAGS. * Documentation The distribution includes some basic documentation in doc/enblend.info doc/enfuse.info and the manual pages in src/enblend.1 src/enfuse.1 After the configuration you can build documentation in PostScript, PDF, XHTML, and DocBook-XML format. make ps make pdf make xhtml make xml The make process automatically ensures the validity of the XHTML and DocBook-XML documentation. Additionally, it can be checked with make validate-xhtml make validate-xml The DocBook-XML format can be processed with, e.g. dblatex(1), like dblatex --type=ps enblend.xml dblatex --type=ps enfuse.xml selecting a format with "--type=FORMAT", where FORMAT is "tex", "dvi", "ps", or "pdf" (default). Another possibility is to use xmlto(1): xmlto xhtml-nochunks enblend.xml # or just "html" xmlto ps enblend.xml xmlto pdf enblend.xml The number of available output formats vary. (See, e.g. /usr/share/xmlto/format/docbook) Note that some additional packages are required to build these formats: convert - ImageMagick's swiss army knife of graphics format conversion found at http://www.imagemagick.org/. makeinfo - GNU documentation generator. gnuplot - Render plots (.gp) in text, PNG, EPS, and PDF formats. Check out http://www.gnuplot.info/. freefonts - Fonts for Gnuplot's PNG format. ghostscript - Convert EPS to PDF. perl - Run Perl programs. tetex - Typeset the Texinfo documents in PS or PDF. texi2html - Convert Texinfo to HTML. Find more information at http://www.nongnu.org/texi2html/. transfig - Render XFig drawings in PNG, EPS, and PDF. Check out http://www.xfig.org/ for Transfig. tidy - Convert HTML to (almost) XHTML. Tidy is available at http://tidy.sourceforge.net/. xmllint - Validate XHTML. Get Xmllint e.g. from http://www.xmlsoft.org/. * Operating System Specific Instructions and Hints ** GNU/Linux *** High-Performance Binaries To configure and compile high-performance versions of Enblend and Enfuse configure single CPU systems with --disable-image-cache SMP boxes with --disable-image-cache --enable-openmp and pass EXTRACXXFLAGS="-march=native -O2" to make(1). The resulting binaries are pretty fast, although other configuration options or compiler flags might improve their performance even more. *** Xmi and Xi To avoid direct linkage to the two X11 libraries Xmi and Xi add "--without-x" to the parameters of configure(1). ** MacOSX *** Compiling on MacOSX On MacOSX you can build Enblend/Enfuse with Fink and with MacPorts. This README only describes the MacPorts way. **** Prerequisites - XCode: Install the XCode version for your MacOSX version. Download it from http://developer.apple.com/tools/download/ - MacPorts: Install MacPorts for your MacOSX version. Download it from http://www.macports.org/ **** Provide necessary dependencies From the command line: $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial Note that Enblend/Enfuse can be build via AutoConf/AutoMake and via CMake. The latter is experimental. If you want to build via CMake, add "cmake" to the previous command line after "mercurial" like this: $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial cmake **** Compile As MacPorts resides in /opt/local, which is not a standard library/binary/include path for most source packages, you need to specify that during the configure step. Via AutoConf/AutoMake: cd enblend make --makefile=Makefile.scm mkdir build cd build CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ../configure --with-apple-opengl-framework make sudo make install Via CMake: cd enblend make --makefile=Makefile.scm mkdir build cd build CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib cmake .. make sudo make install This will install Enblend/Enfuse in /usr/local. **** Other compilation options Please also check the AutoConf/AutoMake and CMake variables for more build options. ** Win *** General There are two different archives: one with 32-bit executables, the other one with 64-bit executables. **** 32-bit versions The 32-bit archive contains two different versions of Enblend and Enfuse: ***** enblend.exe/enfuse.exe These executables are the standard release. They are using one processor core and the ImageCache (to allow for processing of very big images). ***** enblend_openmp.exe/enfuse_openmp.exe These executables can utilize several cores of modern multi-core processors and are therefore significantly faster on modern processors. But they may fail on very big images because they are working without the ImageCache. In this case, please switch to the standard version. **** 64-bit version The 64-bit archive contains multi-threaded versions of Enblend and Enfuse, both compiled without the ImageCache. All variants can utilize a modern graphic card to accelerate the optimizing of the seam line between two images. *** Compiling on Windows **** Prerequisites You will need to following tools for compiling: - MS Visual C++ 2010, Express Edition suffices or MS Visual C++ 2012, Express for Desktop suffices - CMake, at least version 2.6, though version 2.8 is preferred - Perl, e.g. ActiveState Perl CMake expects all sources and libraries in one folder. So, create a folder, e.g., "d:\src", extract Enblend/Enfuse into this folder, and also put all libraries into this folder. You need the following libraries for reading and writing different image formats. We state the version and the folder name of the libraries used as of December 2009 in square brackets. - libtiff [libtiff-4.0.3] - zlib, required by libtiff [1.2.7 in zlib] - libjpeg (optional) [jpeg-8d] - libpng (optional) [libpng-1.5.12] - OpenEXR and IlmBase (optional), compiled libraries are expected in folder "Deploy" [OpenEXR-1.7.1 and IlmBase-1.0.3] - vigra, required, should be compiled against same libtifff, libjpeg, libpng and OpenEXR as used for Enblend/Enfuse [1.8.0 in vigra] Enblend/Enfuse also depend on the following libraries: - Boost [1.51 in boost_1_51_0] - Only header files are used by default. - Optionally, Enblend/Enfuse can use the Filesystem Library. However, this library needs to compiled against STLport. - Little-CMS2 [2.4 in lcm2-2.4] For compiling with GPU support, you need: - GLUT for Win32 [3.7.6 in glut] - OpenGL Extension Wrangler Library GLEW [1.9.0 in glew] **** Compile 1. Start cmake-gui or cmake-setup. 2. Enter path to Enblend/Enfuse source in "Where is the source code". 3. Enter path where to build the executable, e.g. "d:\src\build-enblend". In following, it will be denoted as . 4. Select "Configure" when asked for a generator select the appropriate generator. 5. Activate the appropriate options. ***** ENABLE_GPU=on/OFF Enable code in Enblend to use the GPU for optimizing the seam line between two images if all necessary OpenGL libraries are found. Enfuse does not benefit of this code. OpenMP (see below) and GPU work together. Note that enabling GPU support does not mean Enblend will actually use the GPU. Besides passing option "--gpu" to Enblend the hardware as well as the graphic card drivers have to fulfill certain requirements. ***** ENABLE_IMAGECACHE=ON/off Activate the ImageCache feature, which allows for processing of large images. The ImageCache handles swapping parts of the images to disk. The default is "on", i.e., enable the ImageCache. The ImageCache is recommended on systems where memory is scarce, but the images to blend or fuse are large. The ImageCache feature and OpenMP support must not be activated together. ***** ENABLE_OPENMP=on/OFF Parallelize parts of Enblend and Enfuse with OpenMP. See http://www.openmp.org/ Note that OpenMP support and the ImageCache must not be activated both! The default is to configure with ImageCache and without OpenMP. If OpenMP support has been enabled, the utilization of special features of the actual, underlying OpenMP implementation can be controlled as usual with the environment variables OMP_NUM_THREADS, OMP_NESTED and OMP_DYNAMIC. See the OpenMP specification for details on the usage of these variables. ***** ENABLE_SSE2=on/OFF Creates executable which make use of the advanced features (SSE2) of modern processors. ***** DOC=OFF Set the variable DOC to off. Building the documentation requires more tools and not all of them are available for Windows in the current version. **** Compile (cont.) 6. Select "Configure". Maybe you need start the configuration step several times until all dependencies are resolved. 7. Select "Generate". 8. Close CMake. 9. Open solution file \enblend.sln. 10. Select "Release" in Solution Configuration pull-down menu, and then choose Build > Build Solution. This step takes some time. 11. Select project "INSTALL" in Solution Explorer, and then choose Build > Project Only > Build Only INSTALL. 12. Close Visual C++ 2008 Express Edition 13. Find the generated executables in \INSTALLDIR\FILES. * License Enblend is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Enblend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Enblend; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Local Variables: mode: outline End: enblend-enfuse-4.1.2+dfsg/COPYING0000644000175100017510000004325412070530113016614 0ustar ametzlerametzler GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. enblend-enfuse-4.1.2+dfsg/src/0000755000175100017510000000000012232763264016357 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/src/filenameparse.cc0000644000175100017510000002200012070530501021455 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // Life is tough and then you die. -- Jack Dempsey #include #include #if _WIN32 #ifndef HAVE_BOOST_FILESYSTEM #include // isalpha #endif #endif #ifdef HAVE_CONFIG_H #include #endif #include "filenameparse.h" #if defined(_MSC_VER) || defined(HAVE_WINDOWS_H) #define PATH_SEPARATOR "\\" #else #define PATH_SEPARATOR "/" #endif #define DOT "." #define DOTDOT ".." #ifdef HAVE_BOOST_FILESYSTEM #include #if BOOST_FILESYSTEM_VERSION < 3 typedef boost::filesystem::basic_path basic_path; #define GETPATHSTRING(x) x #else typedef boost::filesystem::path basic_path; #define GETPATHSTRING(x) (x).string() #endif #endif namespace enblend { bool isRelativePath(const std::string& aFilename) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path path(aFilename); return !path.has_root_directory(); #else const std::string::size_type separator = aFilename.find(PATH_SEPARATOR); #if defined(_MSC_VER) || defined(HAVE_WINDOWS_H) return !(aFilename.size() >= 3 && isalpha(aFilename[0]) && aFilename[1] == ':' && separator == 2); #else return separator != 0; #endif #endif } std::string extractDirname(const std::string& aFilename) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path path(aFilename); const std::string directory(path.branch_path().string()); return directory.empty() ? DOT : directory; #else const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); return (separator == std::string::npos) ? DOT : aFilename.substr(0, separator); #endif } std::string extractBasename(const std::string& aFilename) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path path(aFilename); return GETPATHSTRING(path.leaf()); #else const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); return (separator == std::string::npos) ? aFilename : aFilename.substr(separator + 1, aFilename.length() - separator - 1); #endif } std::string extractFilename(const std::string& aFilename) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path path(aFilename); return basename(path); #else const std::string::size_type separator = aFilename.rfind(PATH_SEPARATOR); const std::string::size_type dot = aFilename.rfind(DOT); if (separator == std::string::npos) { return (dot == std::string::npos) ? aFilename : aFilename.substr(0, dot); } else { return (dot == std::string::npos) ? aFilename.substr(separator + 1, aFilename.length() - separator - 1) : aFilename.substr(separator + 1, dot - separator - 1); } #endif } std::string extractExtension(const std::string& aFilename) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path path(aFilename); return extension(path); #else const std::string::size_type dot = aFilename.rfind(DOT); return (dot == std::string::npos) ? "" : aFilename.substr(dot, aFilename.length() - dot); #endif } typedef std::list list_t; #ifdef HAVE_BOOST_FILESYSTEM inline basic_path removeDotsBoost(const basic_path& aPath) { basic_path result; for (basic_path::const_iterator p = aPath.begin(); p != aPath.end(); ++p) { if (*p != DOT) { result /= *p; } } return result; } inline basic_path removeDotDotsBoost(const basic_path& aPath) { list_t directories; for (basic_path::const_iterator p = aPath.begin(); p != aPath.end(); ++p) { if (*p == DOTDOT && !directories.empty() && directories.back() != DOTDOT) { directories.pop_back(); } else { directories.push_back(GETPATHSTRING(*p)); } } basic_path result; for (list_t::const_iterator p = directories.begin(); p != directories.end(); ++p) { result /= *p; } return result; } #else inline std::string removeDotsCxx(const std::string& aPathname) { std::string path(aPathname); std::string::size_type predecessor = std::string::npos; std::string::size_type separator = path.find(PATH_SEPARATOR); while (separator != std::string::npos) { const std::string::size_type begin = predecessor == std::string::npos ? 0 : predecessor + 1; const std::string component = path.substr(begin, separator - predecessor - 1); if (component == DOT) { path.erase(begin, 2); } else { predecessor = separator; } separator = path.find(PATH_SEPARATOR, predecessor + 1); } if (predecessor == std::string::npos) { if (path == DOT) { path.clear(); } } else { const std::string component = path.substr(predecessor + 1); if (component == DOT) { path.erase(predecessor); } } return path; } inline std::string removeDotDotsCxx(const std::string& aPathname) { std::string path(aPathname); list_t directories; std::string::size_type predecessor = std::string::npos; std::string::size_type separator = path.find(PATH_SEPARATOR); while (separator != std::string::npos) { const std::string::size_type begin = predecessor == std::string::npos ? 0 : predecessor + 1; const std::string component = path.substr(begin, separator - predecessor - 1); if (component == DOTDOT && !directories.empty() && directories.back() != DOTDOT) { directories.pop_back(); } else { directories.push_back(component); } predecessor = separator; separator = path.find(PATH_SEPARATOR, predecessor + 1); } if (predecessor == std::string::npos) { directories.push_back(path); } else { const std::string component = path.substr(predecessor + 1); if (component == DOTDOT && !directories.empty() && directories.back() != DOTDOT) { directories.pop_back(); } else { directories.push_back(component); } } std::string result; for (list_t::const_iterator p = directories.begin(); p != directories.end(); ++p) { if (p != directories.begin()) { result.append(PATH_SEPARATOR); } result.append(*p); } return result; } #endif std::string canonicalizePath(const std::string& aPathname, bool keepDot) { #ifdef HAVE_BOOST_FILESYSTEM const basic_path result = removeDotDotsBoost(removeDotsBoost(basic_path(aPathname))); if (keepDot && result.empty()) { return std::string(DOT); } else { return result.string(); } #else std::string result = removeDotDotsCxx(removeDotsCxx(aPathname)); // For compatability with the Boost implementation: Remove a // trailing PATH_SEPARATOR unless we reference the root directory. const size_t size = result.size(); if (size >= 2 && result.substr(size - 1, 1) == PATH_SEPARATOR) { result.erase(size - 1, 1); } if (keepDot && result.empty()) { return std::string(DOT); } else { return result; } #endif } std::string concatPath(const std::string& aPathname, const std::string& anotherPathname) { #ifdef HAVE_BOOST_FILESYSTEM basic_path path(aPathname); basic_path leaf(anotherPathname); path /= leaf; return path.string(); #else if (aPathname.empty()) { return anotherPathname; } else if (anotherPathname.empty()) { return aPathname; } else { const std::string::size_type end = aPathname.find_last_not_of(PATH_SEPARATOR); const std::string path = (end == std::string::npos) ? aPathname : aPathname.substr(0, end + 1); const std::string::size_type begin = anotherPathname.find_first_not_of(PATH_SEPARATOR); const std::string leaf = (begin == std::string::npos) ? anotherPathname : anotherPathname.substr(begin); return path + PATH_SEPARATOR + leaf; } #endif } } // namespace enblend // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/CMakeLists.txt0000644000175100017510000000616112070530113021104 0ustar ametzlerametzler# This file is part of enblend/enfuse. # Licence details can be found in the file COPYING. # # Copyright (c) 2009-2012, Kornel Benko # , Ryan Sleevi # , Harry van der Wolf # # Get the version-string from ${TOP_SRC_DIR}/VERSION add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/signature.h" COMMAND ${PERL_EXECUTABLE} -I"${TOP_SRC_DIR}/src" "${TOP_SRC_DIR}/src/gen_sig" "--extra=${ENBLEND_MAJOR_VERSION}.${ENBLEND_MINOR_VERSION}-${ENBLEND_CHANGESET}" ">" "${CMAKE_CURRENT_BINARY_DIR}/signature.h" DEPENDS "${TOP_SRC_DIR}/src/gen_sig" "${TOP_SRC_DIR}/VERSION" ) set_source_files_properties("${CMAKE_CURRENT_BINARY_DIR}/signature.h" GENERATED) include_directories(${TOP_SRC_DIR}/src) #add_subdirectory(vigra_impex) set(_COMMANDS enblend enfuse) project(enblendenfuse) #set(en_libraries vigra_impex ${common_libs}) set(en_libraries ${common_libs}) file(GLOB all_sources ${TOP_SRC_DIR}/src/*.cc) foreach(_cmd ${_COMMANDS}) list(REMOVE_ITEM all_sources "${TOP_SRC_DIR}/src/${_cmd}.cc") endforeach(_cmd) if (WIN32) file(GLOB winhelper_sources ${TOP_SRC_DIR}/src/win32helpers/*.c ${TOP_SRC_DIR}/src/win32helpers/*.h) list(APPEND all_sources ${winhelper_sources}) endif(WIN32) file(GLOB layer_selection ${TOP_SRC_DIR}/src/layer_selection/*.cc ${TOP_SRC_DIR}/src/layer_selection/*.h) list(APPEND all_sources ${layer_selection}) include_directories(${TOP_SRC_DIR}/src/layer_selection) list(APPEND all_sources "${CMAKE_CURRENT_BINARY_DIR}/signature.h") include_directories(${CMAKE_CURRENT_BINARY_DIR}) set(depends2) message(STATUS "Boost_FOUND = ${Boost_FOUND}") message(STATUS "OpenMP_CXX_FLAGS = ${OpenMP_CXX_FLAGS}") foreach(_cmd ${_COMMANDS}) set(${_cmd}_sources ${all_sources} "${TOP_SRC_DIR}/src/${_cmd}.cc") add_executable(${_cmd} ${${_cmd}_sources} ) #message(STATUS "depends of ${_cmd} ${all_sources}") if(OpenMP_CXX_FLAGS AND NOT MSVC) set_target_properties(${_cmd} PROPERTIES LINK_FLAGS ${OpenMP_CXX_FLAGS}) message(STATUS "Adding PROPERTIES LINK_FLAGS to ${_cmd}") endif(OpenMP_CXX_FLAGS AND NOT MSVC) target_link_libraries(${_cmd} ${en_libraries}) install(TARGETS ${_cmd} DESTINATION bin CONFIGURATIONS Release RelWithDebInfo MinSizeRel) #add_dependencies(${_cmd} vigra_impex) list(APPEND depends2 ${_cmd}) endforeach(_cmd) add_custom_target(enblendenfuse ALL DEPENDS ${depends2}) project(man) # create enblend.1 and enfuse.1 find_program(HELP2MAN_EXE "help2man") set(depends3) foreach (_cmd ${_COMMANDS}) if (NOT DOC OR ${HELP2MAN_EXE} MATCHES "-NOTFOUND") add_custom_command( OUTPUT "${_cmd}.1" COMMAND ${CMAKE_COMMAND} -E copy "${TOP_SRC_DIR}/src/${_cmd}.1" "${_cmd}.1" DEPENDS "${TOP_SRC_DIR}/src/${_cmd}.1" ) else() add_custom_command( OUTPUT "${_cmd}.1" COMMAND "${HELP2MAN_EXE}" "--output=${_cmd}.1" "${CMAKE_BINARY_DIR}/bin/${_cmd}" DEPENDS "${CMAKE_BINARY_DIR}/bin/${_cmd}" ) endif() list(APPEND depends3 "${CMAKE_CURRENT_BINARY_DIR}/${_cmd}.1") endforeach(_cmd) add_custom_target(man ALL DEPENDS ${depends3}) add_dependencies(man enblendenfuse) enblend-enfuse-4.1.2+dfsg/src/enblend.cc0000644000175100017510000030154112100220553020260 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef _MSC_VER #define isnan _isnan #endif // _MSC_VER #ifdef _WIN32 // Make sure we bring in windows.h the right way #define _STLP_VERBOSE_AUTO_LINK #define _USE_MATH_DEFINES #define NOMINMAX #define VC_EXTRALEAN #include #undef DIFFERENCE #endif // _WIN32 #ifdef __GW32C__ #undef malloc #define BOOST_NO_STDC_NAMESPACE 1 #endif #include #include #include #include #include #include extern "C" char *optarg; extern "C" int optind; #ifndef _MSC_VER #include #endif #include #include #include #include #ifdef _WIN32 #include #endif #include #include #include #include "global.h" #include "layer_selection.h" #include "signature.h" #include "selector.h" #include "self_test.h" #include "tiff_message.h" typedef enum { UnknownDifference, HueLuminanceMaxDifference, // maximum of hue difference and luminance difference DeltaEDifference // L*a*b*-based Delta E } difference_functor_t; typedef struct { unsigned int kmax; // maximum number of moves for a line segment double tau; // temperature reduction factor, "cooling factor"; 0 < tau < 1 double deltaEMax; // maximum cost change possible by any single annealing move double deltaEMin; // minimum cost change possible by any single annealing move } anneal_para_t; // Globals const std::string command("enblend"); const int minimumVectorizeDistance = 4; //< src::minimum-vectorize-distance 4 const int coarseMaskVectorizeDistance = 4; //< src::coarse-mask-vectorize-distance 4 const int fineMaskVectorizeDistance = 20; //< src::fine-mask-vectorize-distance 20 // Global values from command line parameters. std::string OutputFileName(DEFAULT_OUTPUT_FILENAME); int Verbose = 1; //< src::default-verbosity-level 1 int ExactLevels = 0; // 0 means: automatically calculate maximum bool OneAtATime = true; boundary_t WrapAround = OpenBoundaries; bool GimpAssociatedAlphaHack = false; boost::tribool UseCIECAM = boost::indeterminate; bool OutputSizeGiven = false; int OutputWidthCmdLine = 0; int OutputHeightCmdLine = 0; int OutputOffsetXCmdLine = 0; int OutputOffsetYCmdLine = 0; MainAlgo MainAlgorithm = NFT; bool Checkpoint = false; bool UseGPU = false; bool OptimizeMask = true; bool CoarseMask = true; unsigned CoarsenessFactor = 8U; //< src::default-coarseness-factor 8 difference_functor_t PixelDifferenceFunctor = DeltaEDifference; //< src::default-difference-functor Delta-E double LuminanceDifferenceWeight = 1.0; //< src::default-luminance-difference-weight 1.0 double ChrominanceDifferenceWeight = 1.0; //< src::default-chrominance-difference-weight 1.0 double DifferenceBlurRadius = 0.0; bool SaveMasks = false; bool StopAfterMaskGeneration = false; std::string SaveMaskTemplate("mask-%n.tif"); //< src::default-mask-template mask-%n.tif bool LoadMasks = false; std::string LoadMaskTemplate(SaveMaskTemplate); std::string VisualizeTemplate("vis-%n.tif"); //< src::default-visualize-template vis-%n.tif bool VisualizeSeam = false; std::pair OptimizerWeights = std::make_pair(8.0, //< src::default-optimizer-weight-distance 8.0 1.0); //< src::default-optimizer-weight-mismatch 1.0 anneal_para_t AnnealPara = { 32, //< src::default-anneal-kmax 32 0.75, //< src::default-anneal-tau 0.75 7000.0, //< src::default-anneal-deltae-max 7000.0 5.0 //< src::default-anneal-deltae-min 5.0 }; unsigned int DijkstraRadius = 25U; //< src::default-dijkstra-radius 25 AlternativePercentage MaskVectorizeDistance(0.0, false); std::string OutputCompression; std::string OutputPixelType; TiffResolution ImageResolution; bool OutputIsValid = true; parameter_map Parameter; // Globals related to catching SIGINT #ifndef _WIN32 sigset_t SigintMask; #endif // Objects for ICC profiles cmsHPROFILE InputProfile = NULL; cmsHPROFILE XYZProfile = NULL; cmsHPROFILE LabProfile = NULL; cmsHTRANSFORM InputToXYZTransform = NULL; cmsHTRANSFORM XYZToInputTransform = NULL; cmsHTRANSFORM InputToLabTransform = NULL; cmsHTRANSFORM LabToInputTransform = NULL; cmsViewingConditions ViewingConditions; cmsHANDLE CIECAMTransform = NULL; cmsHPROFILE FallbackProfile = NULL; Signature sig; LayerSelectionHost LayerSelection; #include #include #include #include #include "common.h" #include "filespec.h" #include "enblend.h" #ifdef HAVE_LIBGLEW #include "gpu.h" #endif #ifdef DMALLOC #include "dmalloc.h" // must be last #include #endif #ifdef _WIN32 #define strdup _strdup #endif difference_functor_t differenceFunctorOfString(const char* aDifferenceFunctorName) { std::string name(aDifferenceFunctorName); boost::algorithm::erase_all(name, "-"); boost::algorithm::to_lower(name); if (name == "maximumhueluminance" || name == "maximumhuelum" || name == "maxhueluminance" || name == "maxhuelum" || name == "max") { return HueLuminanceMaxDifference; } else if (name == "deltae" || name == "de") { return DeltaEDifference; } else { return UnknownDifference; } } #define DUMP_GLOBAL_VARIABLES(...) dump_global_variables(__FILE__, __LINE__, ##__VA_ARGS__) void dump_global_variables(const char* file, unsigned line, std::ostream& out = std::cout) { out << "+ " << file << ":" << line << ": state of global variables\n" << "+ Verbose = " << Verbose << ", option \"--verbose\"\n" << "+ OutputFileName = <" << OutputFileName << ">\n" << "+ ExactLevels = " << ExactLevels << "\n" << "+ OneAtATime = " << enblend::stringOfBool(OneAtATime) << ", option \"-a\"\n" << "+ WrapAround = " << enblend::stringOfWraparound(WrapAround) << ", option \"--wrap\"\n" << "+ GimpAssociatedAlphaHack = " << enblend::stringOfBool(GimpAssociatedAlphaHack) << ", option \"-g\"\n" << "+ UseCIECAM = " << UseCIECAM << ", option \"--ciecam\"\n" << "+ FallbackProfile = " << (FallbackProfile ? enblend::profileDescription(FallbackProfile) : "[none]") << ", option \"--fallback-profile\"\n" << "+ OutputSizeGiven = " << enblend::stringOfBool(OutputSizeGiven) << ", option \"-f\"\n" << "+ OutputWidthCmdLine = " << OutputWidthCmdLine << ", argument to option \"-f\"\n" << "+ OutputHeightCmdLine = " << OutputHeightCmdLine << ", argument to option \"-f\"\n" << "+ OutputOffsetXCmdLine = " << OutputOffsetXCmdLine << ", argument to option \"-f\"\n" << "+ OutputOffsetYCmdLine = " << OutputOffsetYCmdLine << ", argument to option \"-f\"\n" << "+ Checkpoint = " << enblend::stringOfBool(Checkpoint) << ", option \"-x\"\n" << "+ UseGPU = " << enblend::stringOfBool(UseGPU) << ", option \"--gpu\"\n" << "+ OptimizeMask = " << enblend::stringOfBool(OptimizeMask) << ", options \"--optimize\" and \"--no-optimize\"\n" << "+ CoarseMask = " << enblend::stringOfBool(CoarseMask) << ", options \"--coarse-mask\" and \"--fine-mask\"\n" << "+ CoarsenessFactor = " << CoarsenessFactor << ", argument to option \"--coarse-mask\"\n" << "+ PixelDifferenceFunctor = " << stringOfPixelDifferenceFunctor(PixelDifferenceFunctor) << "+ LuminanceDifferenceWeight = " << LuminanceDifferenceWeight << "\n" << "+ ChrominanceDifferenceWeight = " << ChrominanceDifferenceWeight << ", option \"--image-difference\"\n" << "+ DifferenceBlurRadius = " << DifferenceBlurRadius << ", option \"--smooth-difference\"\n" << "+ SaveMasks = " << enblend::stringOfBool(SaveMasks) << ", option \"--save-masks\"\n" << "+ SaveMaskTemplate = <" << SaveMaskTemplate << ">, argument to option \"--save-masks\"\n" << "+ LoadMasks = " << enblend::stringOfBool(LoadMasks) << ", option \"--load-masks\"\n" << "+ LoadMaskTemplate = <" << LoadMaskTemplate << ">, argument to option \"--load-masks\"\n" << "+ VisualizeSeam = " << enblend::stringOfBool(VisualizeSeam) << ", option \"--visualize\"\n" << "+ VisualizeTemplate = <" << VisualizeTemplate << ">, argument to option \"--visualize\"\n" << "+ OptimizerWeights = {\n" << "+ distance = " << OptimizerWeights.first << ",\n" << "+ mismatch = " << OptimizerWeights.second << "\n" << "+ }, arguments to option \"--visualize\"\n" "+ AnnealPara = {\n" << "+ kmax = " << AnnealPara.kmax << ",\n" << "+ tau = " << AnnealPara.tau << ",\n" << "+ deltaEMax = " << AnnealPara.deltaEMax << ",\n" << "+ deltaEMin = " << AnnealPara.deltaEMin << "\n" << "+ }, arguments to option \"--anneal\"\n" << "+ DijkstraRadius = " << DijkstraRadius << ", option \"--dijkstra\"\n" << "+ MaskVectorizeDistance = {\n" << "+ value = " << MaskVectorizeDistance.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(MaskVectorizeDistance.is_percentage()) << "\n" << "+ }, arguments to option \"--mask-vectorize\"\n" << "+ OutputCompression = <" << OutputCompression << ">, option \"--compression\"\n" << "+ OutputPixelType = <" << OutputPixelType << ">, option \"--depth\"\n" << "+ end of global variable dump\n"; } #ifdef HAVE_LIBGLEW void inspectGPU(int argc, char** argv) { #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLContextObj cgl_context = cgl_init(); #else glutInit(&argc, argv); glutInitDisplayMode(GLUT_RGBA); const int handle = glutCreateWindow("Enblend"); if (!(handle >= 1 && glutGet(GLUT_DISPLAY_MODE_POSSIBLE))) { std::cout << " \n"; return; } #endif std::cout << " - " << GLGETSTRING(GL_VENDOR) << "\n" << " - " << GLGETSTRING(GL_RENDERER) << "\n" << " - version " << GLGETSTRING(GL_VERSION) << "\n" " - extensions\n"; const char* const extensions = GLGETSTRING(GL_EXTENSIONS); const char* const extensions_end = extensions + strlen(extensions); const unsigned extensions_per_line = 3U; unsigned count = 1U; std::cout << " "; for (const char* c = extensions; c != extensions_end; ++c) { if (*c == ' ') { if (count % extensions_per_line == 0U) { std::cout << "\n "; } else { std::cout << " "; } ++count; } else { std::cout << *c; } } std::cout << "\n\n"; #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLDestroyContext(cgl_context); #else glutDestroyWindow(handle); #endif } #endif // HAVE_LIBGLEW /** Print information on the current version and some configuration * details. */ void printVersionAndExit(int argc, char** argv) { std::cout << "enblend " << VERSION << "\n\n"; if (Verbose >= VERBOSE_VERSION_REPORTING) { std::cout << "Extra feature: dmalloc support: " << #ifdef DMALLOC "yes" << #else "no" << #endif "\n"; #ifdef CACHE_IMAGES std::cout << "Extra feature: image cache: yes\n"; { #ifdef WIN32 char lpPathBuffer[MAX_PATH]; const DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer); if (dwRetVal <= MAX_PATH && dwRetVal != 0) { std::cout << " - cache file located in \"" << lpPathBuffer << "\"\n"; } #else const char* tmpdir = getenv("TMPDIR"); std::cout << " - environment variable TMPDIR "; if (tmpdir == NULL) { std::cout << "not set, cache file in default directory \"/tmp\"\n"; } else { std::cout << "set, cache file located in \"" << tmpdir << "\"\n"; } #endif } #else std::cout << "Extra feature: image cache: no\n"; #endif #ifdef HAVE_LIBGLEW std::cout << "Extra feature: GPU acceleration: yes\n"; inspectGPU(argc, argv); #else std::cout << "Extra feature: GPU acceleration: no\n"; #endif #ifdef OPENMP const bool have_nested = have_openmp_nested(); const bool have_dynamic = have_openmp_dynamic(); std::cout << "Extra feature: OpenMP: yes\n" << " - version " << OPENMP_YEAR << '-' << OPENMP_MONTH << "\n" << " - " << (have_nested ? "" : "no ") << "support for nested parallelism;\n" << " nested parallelism " << (have_nested && omp_get_nested() ? "enabled" : "disabled") << " by default\n" << " - " << (have_dynamic ? "" : "no ") << "support for dynamic adjustment of the number of threads;\n" << " dynamic adjustment " << (have_dynamic && omp_get_dynamic() ? "enabled" : "disabled") << " by default\n" << " - using " << omp_get_num_procs() << " processor" << (omp_get_num_procs() >= 2 ? "s" : "") << " and up to " << omp_get_max_threads() << " thread" << (omp_get_max_threads() >= 2 ? "s" : "") << "\n"; #else std::cout << "Extra feature: OpenMP: no\n"; #endif std::cout << "\n" << "Supported image formats: " << vigra::impexListFormats() << "\n" << "Supported file extensions: " << vigra::impexListExtensions() << "\n\n"; std::cout << "Supported following globbing algorithms:\n"; const enblend::algorithm_list algos = enblend::known_globbing_algorithms(); for (enblend::algorithm_list::const_iterator i = algos.begin(); i != algos.end(); ++i) { std::cout << " " << i->first << "\n" << " " << i->second << "\n"; } std::cout << "\n"; } if (Verbose >= VERBOSE_SIGNATURE_REPORTING) { std::cout.flush(); std::wcout << sig.message() << L"\n\n"; std::wcout.flush(); } std::cout << "Copyright (C) 2004-2012 Andrew Mihal.\n" << "License GPLv2+: GNU GPL version 2 or later \n" << "This is free software: you are free to change and redistribute it.\n" << "There is NO WARRANTY, to the extent permitted by law.\n" << "\n" << "Written by Andrew Mihal and others." << std::endl; exit(0); } /** Print the usage information and quit. */ void printUsageAndExit(const bool error = true) { std::cout << "Usage: enblend [options] [--output=IMAGE] INPUT...\n" << "Blend INPUT images into a single IMAGE.\n" << "\n" << "INPUT... are image filenames or response filenames. Response\n" << "filenames start with an \"" << RESPONSE_FILE_PREFIX_CHAR << "\" character.\n" "\n" << "Common options:\n" << " -V, --version output version information and exit\n" << " -a pre-assemble non-overlapping images\n" << " -h, --help print this help message and exit\n" << " -l, --levels=LEVELS limit number of blending LEVELS to use (1 to " << MAX_PYRAMID_LEVELS << ");\n" << " negative number of LEVELS decreases maximum;\n" << " \"auto\" restores the default automatic maximization\n" << " -o, --output=FILE write output to FILE; default: \"" << OutputFileName << "\"\n" << " -v, --verbose[=LEVEL] verbosely report progress; repeat to\n" << " increase verbosity or directly set to LEVEL\n" << " -w, --wrap[=MODE] wrap around image boundary, where MODE is \"none\",\n" << " \"horizontal\", \"vertical\", or \"both\"; default: " << enblend::stringOfWraparound(WrapAround) << ";\n" << " without argument the option selects horizontal wrapping\n" << " -x checkpoint partial results\n" << " --compression=COMPRESSION\n" << " set compression of output image to COMPRESSION,\n" << " where COMPRESSION is:\n" << " \"deflate\", \"jpeg\", \"lzw\", \"none\", \"packbits\", for TIFF files and\n" << " 0 to 100, or \"jpeg\", \"jpeg-arith\" for JPEG files,\n" << " where \"jpeg\" and \"jpeg-arith\" accept a compression level\n" << " --layer-selector=ALGORITHM\n" << " set the layer selector ALGORITHM;\n" << " default: \"" << LayerSelection.name() << "\"; available algorithms are:\n"; for (selector::algorithm_list::const_iterator i = selector::algorithms.begin(); i != selector::algorithms.end(); ++i) { std::cout << " \"" << (*i)->name() << "\": " << (*i)->description() << "\n"; } std::cout << " --parameter=KEY1[=VALUE1][:KEY2[=VALUE2][:...]]\n" << " set one or more KEY-VALUE pairs\n" << "\n" << "Extended options:\n" << " -b BLOCKSIZE image cache BLOCKSIZE in kilobytes; default: " << (vigra_ext::CachedFileImageDirector::v().getBlockSize() / 1024LL) << "KB\n" << " -c, --ciecam use CIECAM02 to blend colors; disable with\n" << " \"--no-ciecam\"\n" << " --fallback-profile=PROFILE-FILE\n" << " use the ICC profile from PROFILE-FILE instead of sRGB\n" << " -d, --depth=DEPTH set the number of bits per channel of the output\n" << " image, where DEPTH is \"8\", \"16\", \"32\", \"r32\", or \"r64\"\n" << " -g associated-alpha hack for Gimp (before version 2)\n" << " and Cinepaint\n" << " --gpu use graphics card to accelerate seam-line optimization\n" << " -f WIDTHxHEIGHT[+xXOFFSET+yYOFFSET]\n" << " manually set the size and position of the output\n" << " image; useful for cropped and shifted input\n" << " TIFF images, such as those produced by Nona\n" << " -m CACHESIZE set image CACHESIZE in megabytes; default: " << (vigra_ext::CachedFileImageDirector::v().getAllocation() / 1048576LL) << "MB\n" << "\n" << "Mask generation options:\n" << " --primary-seam-generator=ALGORITHM\n" << " use main seam finder ALGORITHM, where ALGORITHM is\n"<< " \"nearest-feature-transform\" or \"graph-cut\";\n" << " default: \"nearest-feature-transform\"\n" << " --image-difference=ALGORITHM[:LUMINANCE-WEIGHT[:CHROMINANCE-WEIGHT]]\n" << " use ALGORITHM for calculation of the difference image,\n" << " where ALGORITHM is \"max-hue-luminance\" or \"delta-e\";\n" << " LUMINANCE-WEIGHT and CHROMINANCE-WEIGHT define the weights\n" << " of lightness and color; default: " << stringOfPixelDifferenceFunctor(PixelDifferenceFunctor) << ":" << LuminanceDifferenceWeight << ": " << ChrominanceDifferenceWeight << "\n" << " --coarse-mask[=FACTOR] shrink overlap regions by FACTOR to speedup mask\n" << " generation; this is the default; if omitted FACTOR\n" << " defaults to " << CoarsenessFactor << "\n" << " --fine-mask generate mask at full image resolution; use e.g.\n" << " if overlap regions are very narrow\n" << " --smooth-difference=RADIUS (deprecated)\n" << " smooth the difference image prior to seam-line\n" << " optimization with a Gaussian blur of RADIUS;\n" << " default: " << DifferenceBlurRadius << " pixels\n" << " --optimize turn on mask optimization; this is the default\n" << " --no-optimize turn off mask optimization\n" << " --optimizer-weights=DISTANCE-WEIGHT[:MISMATCH-WEIGHT]\n" << " set the optimizer's weigths for distance and mismatch;\n" << " default: " << OptimizerWeights.first << ':' << OptimizerWeights.second << "\n" << " --mask-vectorize=LENGTH\n" << " set LENGTH of single seam segment; append \"%\" for\n" << " relative value; defaults: " << coarseMaskVectorizeDistance << " for coarse masks and\n" << " " << fineMaskVectorizeDistance << " for fine masks\n" << " --anneal=TAU[:DELTAE-MAX[:DELTAE-MIN[:K-MAX]]]\n" << " set annealing parameters of optimizer strategy 1;\n" << " defaults: " << AnnealPara.tau << ':' << AnnealPara.deltaEMax << ':' << AnnealPara.deltaEMin << ':' << AnnealPara.kmax << "\n" << " --dijkstra=RADIUS set search RADIUS of optimizer strategy 2; default:\n" << " " << DijkstraRadius << " pixels\n" << " --save-masks[=TEMPLATE]\n" << " save generated masks in TEMPLATE; default: \"" << SaveMaskTemplate << "\";\n" << " conversion chars: \"%i\": mask index, \"%n\": mask number,\n" << " \"%p\": full path, \"%d\": dirname, \"%b\": basename,\n" << " \"%f\": filename, \"%e\": extension; lowercase characters\n" << " refer to input images uppercase to the output image\n" << " --load-masks[=TEMPLATE]\n" << " use existing masks in TEMPLATE instead of generating\n" << " them; same template characters as \"--save-masks\";\n" << " default: \"" << LoadMaskTemplate << "\"\n" << " --visualize[=TEMPLATE] save results of optimizer in TEMPLATE; same template\n" << " characters as \"--save-masks\"; default: \"" << VisualizeTemplate << "\"\n" << "Enblend accepts arguments to any option in uppercase as\n" << "well as in lowercase letters.\n" << "\n" << "Report bugs at <" PACKAGE_BUGREPORT ">." << std::endl; exit(error ? 1 : 0); } void cleanup_output(void) { #if DEBUG std::cout << "+ cleanup_output\n"; #endif if (!OutputIsValid) { std::cerr << command << ": info: remove invalid output image \"" << OutputFileName << "\"\n"; errno = 0; if (unlink(OutputFileName.c_str()) != 0) { std::cerr << command << ": warning: could not remove invalid output image \"" << OutputFileName << "\": " << enblend::errorMessage(errno) << "\n"; } } } /** Make sure all cached file images get destroyed, and hence the * temporary files deleted, if we are killed. */ void sigint_handler(int sig) { std::cerr << std::endl << command << ": interrupted" << std::endl; cleanup_output(); #ifdef HAVE_LIBGLEW if (UseGPU) { // FIXME what if this occurs in a GL atomic section? wrapupGPU(); } #endif #if !defined(__GW32C__) && !defined(_WIN32) struct sigaction action; action.sa_handler = SIG_DFL; sigemptyset(&(action.sa_mask)); sigaction(sig, &action, NULL); #else signal(sig, SIG_DFL); #endif raise(sig); } enum AllPossibleOptions { VersionOption, PreAssembleOption /* -a */, HelpOption, LevelsOption, OutputOption, VerboseOption, WrapAroundOption /* -w */, CheckpointOption /* -x */, CompressionOption, LZWCompressionOption, BlockSizeOption, CIECAM02Option, NoCIECAM02Option, FallbackProfileOption, DepthOption, AssociatedAlphaOption /* -g */, GPUOption, SizeAndPositionOption /* -f */, CacheSizeOption, VisualizeOption, CoarseMaskOption, FineMaskOption, OptimizeOption, NoOptimizeOption, SaveMasksOption, LoadMasksOption, ImageDifferenceOption, AnnealOption, DijkstraRadiusOption, MaskVectorizeDistanceOption, SmoothDifferenceOption, OptimizerWeightsOption, LayerSelectorOption, NearestFeatureTransformOption, GraphCutOption, // currently below the radar... SequentialBlendingOption }; typedef std::set OptionSetType; bool contains(const OptionSetType& optionSet, enum AllPossibleOptions anOption) { return optionSet.count(anOption) != 0; } /** Warn if options given at the command line have no effect. */ void warn_of_ineffective_options(const OptionSetType& optionSet) { if (contains(optionSet, LoadMasksOption)) { if (contains(optionSet, GPUOption)) { std::cerr << command << ": warning: option \"--gpu\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, VisualizeOption)) { std::cerr << command << ": warning: option \"--visualize\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, CoarseMaskOption)) { std::cerr << command << ": warning: option \"--coarse-mask\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, FineMaskOption)) { std::cerr << command << ": warning: option \"--fine-mask\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, OptimizeOption)) { std::cerr << command << ": warning: option \"--optimize\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, NoOptimizeOption)) { std::cerr << command << ": warning: option \"--no-optimize\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, AnnealOption)) { std::cerr << command << ": warning: option \"--anneal\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, DijkstraRadiusOption)) { std::cerr << command << ": warning: option \"--dijkstra\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, MaskVectorizeDistanceOption)) { std::cerr << command << ": warning: option \"--mask-vectorize\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, SmoothDifferenceOption)) { std::cerr << command << ": warning: option \"--smooth-difference\" has no effect with \"--load-masks\"" << std::endl; } if (contains(optionSet, OptimizerWeightsOption)) { std::cerr << command << ": warning: option \"--optimizer-weights\" has no effect with \"--load-masks\"" << std::endl; } } if (contains(optionSet, SaveMasksOption) && !contains(optionSet, OutputOption)) { if (contains(optionSet, LevelsOption)) { std::cerr << command << ": warning: option \"--levels\" has no effect with \"--save-masks\" and no \"--output\"" << std::endl; } if (contains(optionSet, WrapAroundOption)) { std::cerr << command << ": warning: option \"--wrap\" has no effect with \"--save-masks\" and no \"--output\"" << std::endl; } if (contains(optionSet, CompressionOption)) { std::cerr << command << ": warning: option \"--compression\" has no effect with \"--save-masks\" and no \"--output\"" << std::endl; } if (contains(optionSet, DepthOption)) { std::cerr << command << ": warning: option \"--depth\" has no effect with \"--save-masks\" and no \"--output\"" << std::endl; } if (contains(optionSet, SizeAndPositionOption)) { std::cerr << command << ": warning: option \"-f\" has no effect with \"--save-masks\" and no \"--output\"" << std::endl; } } if (contains(optionSet, CompressionOption) && !(enblend::getFileType(OutputFileName) == "TIFF" || enblend::getFileType(OutputFileName) == "JPEG")) { std::cerr << command << ": warning: compression is not supported with output\n" << command << ": warning: file type \"" << enblend::getFileType(OutputFileName) << "\"" << std::endl; } if (contains(optionSet, AssociatedAlphaOption) && enblend::getFileType(OutputFileName) != "TIFF") { std::cerr << command << ": warning: option \"-g\" has no effect with output\n" << command << ": warning: file type \"" << enblend::getFileType(OutputFileName) << "\"" << std::endl; } if (!OptimizeMask) { if (contains(optionSet, AnnealOption)) { std::cerr << command << ": warning: option \"--anneal\" without mask optimization has\n" << command << ": warning: no effect" << std::endl; } if (contains(optionSet, DijkstraRadiusOption)) { std::cerr << command << ": warning: option \"--dijkstra\" without mask optimization\n" << command << ": warning: has no effect" << std::endl; } if (contains(optionSet, SmoothDifferenceOption)) { std::cerr << command << ": warning: option \"--smooth-difference\" without mask optimization\n" << command << ": warning: has no effect" << std::endl; } if (contains(optionSet, OptimizerWeightsOption)) { std::cerr << command << ": warning: option \"--optimizer-weights\" without mask optimization\n" << command << ": warning: has no effect" << std::endl; } } if (!(OptimizeMask || CoarseMask) && contains(optionSet, MaskVectorizeDistanceOption)) { std::cerr << command << ": warning: option \"--mask-vectorize\" without mask optimization\n" << command << ": warning: or coarse mask has no effect" << std::endl; } if (!CoarseMask && MainAlgorithm == GraphCut && contains(optionSet, FineMaskOption)) { std::cerr << command << ": warning: option \"--fine-mask\" combined with option \"--primary-seam-generator=graphcut\"\n" << command << ": warning: incompatible with mask optimization,\n" << command << ": warning: defaulting to no optimization" << std::endl; OptimizeMask = false; } #ifndef CACHE_IMAGES if (contains(optionSet, CacheSizeOption)) { std::cerr << command << ": warning: option \"-m\" has no effect in this " << command << " binary,\n" << command << ": warning: because it was compiled without image cache" << std::endl; } if (contains(optionSet, BlockSizeOption)) { std::cerr << command << ": warning: option \"-b\" has no effect in this " << command << " binary,\n" << command << ": warning: because it was compiled without image cache" << std::endl; } #endif } int process_options(int argc, char** argv) { enum OptionId { OPTION_ID_OFFSET = 1023, // Ids start at 1024 UseGpuId, CoarseMaskId, FineMaskId, OptimizeMaskId, NoOptimizeMaskId, SaveMaskId, LoadMaskId, VisualizeId, AnnealId, DijkstraRadiusId, MaskVectorizeDistanceId, CompressionId, VerboseId, HelpId, VersionId, DepthId, OutputId, WrapAroundId, SmoothDifferenceId, OptimizerWeightsId, LevelsId, CiecamId, NoCiecamId, FallbackProfileId, LayerSelectorId, MainAlgoId, ImageDifferenceId, ParameterId, NoParameterId }; static struct option long_options[] = { {"gpu", no_argument, 0, UseGpuId}, {"coarse-mask", optional_argument, 0, CoarseMaskId}, {"fine-mask", no_argument, 0, FineMaskId}, {"optimize", no_argument, 0, OptimizeMaskId}, {"no-optimize", no_argument, 0, NoOptimizeMaskId}, {"save-mask", optional_argument, 0, SaveMaskId}, // singular form: not documented, not deprecated {"save-masks", optional_argument, 0, SaveMaskId}, {"load-mask", optional_argument, 0, LoadMaskId}, // singular form: not documented, not deprecated {"load-masks", optional_argument, 0, LoadMaskId}, {"visualize", optional_argument, 0, VisualizeId}, {"anneal", required_argument, 0, AnnealId}, {"dijkstra", required_argument, 0, DijkstraRadiusId}, {"mask-vectorize", required_argument, 0, MaskVectorizeDistanceId}, {"compression", required_argument, 0, CompressionId}, {"verbose", optional_argument, 0, VerboseId}, {"help", no_argument, 0, HelpId}, {"version", no_argument, 0, VersionId}, {"depth", required_argument, 0, DepthId}, {"output", required_argument, 0, OutputId}, {"wrap", optional_argument, 0, WrapAroundId}, {"smooth-difference", required_argument, 0, SmoothDifferenceId}, {"optimizer-weights", required_argument, 0, OptimizerWeightsId}, {"levels", required_argument, 0, LevelsId}, {"ciecam", no_argument, 0, CiecamId}, {"no-ciecam", no_argument, 0, NoCiecamId}, {"fallback-profile", required_argument, 0, FallbackProfileId}, {"layer-selector", required_argument, 0, LayerSelectorId}, {"primary-seam-generator", required_argument, 0, MainAlgoId}, {"image-difference", required_argument, 0, ImageDifferenceId}, {"parameter", required_argument, 0, ParameterId}, {"no-parameter", required_argument, 0, NoParameterId}, {0, 0, 0, 0} }; bool failed = false; bool justPrintVersion = false; bool justPrintUsage = false; OptionSetType optionSet; opterr = 0; // we have our own "unrecognized option" message while (true) { int option_index; const int code = getopt_long(argc, argv, "Vab:cd:f:ghl:m:o:sv::w::x", long_options, &option_index); if (code == -1) { break; } switch (code) { case UseGpuId: UseGPU = true; optionSet.insert(GPUOption); break; case FineMaskId: CoarseMask = false; optionSet.insert(FineMaskOption); break; case OptimizeMaskId: OptimizeMask = true; optionSet.insert(OptimizeOption); break; case NoOptimizeMaskId: OptimizeMask = false; optionSet.insert(NoOptimizeOption); break; case 'h': // FALLTHROUGH case HelpId: justPrintUsage = true; optionSet.insert(HelpOption); break; case 'V': // FALLTHROUGH case VersionId: justPrintVersion = true; optionSet.insert(VersionOption); break; case 'w': // FALLTHROUGH case WrapAroundId: if (optarg != NULL && *optarg != 0) { WrapAround = enblend::wraparoundOfString(optarg); if (WrapAround == UnknownWrapAround) { std::cerr << command << ": unrecognized wrap-around mode \"" << optarg << "\"\n" << std::endl; failed = true; } } else { WrapAround = HorizontalStrip; } optionSet.insert(WrapAroundOption); break; case SaveMaskId: if (optarg != NULL && *optarg != 0) { SaveMaskTemplate = optarg; } SaveMasks = true; optionSet.insert(SaveMasksOption); break; case LoadMaskId: if (optarg != NULL && *optarg != 0) { LoadMaskTemplate = optarg; } LoadMasks = true; optionSet.insert(LoadMasksOption); break; case VisualizeId: if (optarg != NULL && *optarg != 0) { VisualizeTemplate = optarg; } VisualizeSeam = true; optionSet.insert(VisualizeOption); break; case CompressionId: if (optarg != NULL && *optarg != 0) { std::string upper_opt(optarg); boost::algorithm::to_upper(upper_opt); if (upper_opt == "NONE") { ; // stick with default } else if (upper_opt == "DEFLATE" || upper_opt == "LZW" || upper_opt == "PACKBITS") { OutputCompression = upper_opt; } else if (upper_opt.find_first_not_of("0123456789") == std::string::npos) { OutputCompression = "JPEG QUALITY=" + upper_opt; } else if (enblend::starts_with(upper_opt, "JPEG") || enblend::starts_with(upper_opt, "JPEG-ARITH")) { const std::string::size_type delimiter_position = upper_opt.find_first_of(NUMERIC_OPTION_DELIMITERS); if (delimiter_position == std::string::npos) { if (upper_opt == "JPEG" || upper_opt == "JPEG-ARITH") { OutputCompression = upper_opt; } else { std::cerr << command << ": trailing garbage in JPEG compression \"" << optarg << "\"" << std::endl; failed = true; } } else { const std::string algorithm(upper_opt.substr(0, delimiter_position)); if (algorithm == "JPEG" || algorithm == "JPEG-ARITH") { const std::string level(upper_opt.substr(delimiter_position + 1U)); if (level.length() >= 1U && level.find_first_not_of("0123456789") == std::string::npos) { upper_opt.replace(delimiter_position, 1U, " QUALITY="); OutputCompression = upper_opt; } else { std::cerr << command << ": invalid JPEG compression level \"" << level << "\"" << std::endl; failed = true; } } else { std::cerr << command << ": unrecognized JPEG compression \"" << optarg << "\"" << std::endl; failed = true; } } } else { std::cerr << command << ": unrecognized compression \"" << optarg << "\"" << std::endl; failed = true; } } else { std::cerr << command << ": option \"--compression\" requires an argument" << std::endl; failed = true; } optionSet.insert(CompressionOption); break; case 'd': // FALLTHROUGH case DepthId: if (optarg != NULL && *optarg != 0) { OutputPixelType = enblend::outputPixelTypeOfString(optarg); } else { std::cerr << command << ": options \"-d\" or \"--depth\" require arguments" << std::endl; failed = true; } optionSet.insert(DepthOption); break; case 'o': // FALLTHROUGH case OutputId: if (contains(optionSet, OutputOption)) { std::cerr << command << ": warning: more than one output file specified" << std::endl; } if (optarg != NULL && *optarg != 0) { OutputFileName = optarg; } else { std::cerr << command << ": options \"-o\" or \"--output\" require arguments" << std::endl; failed = true; } optionSet.insert(OutputOption); break; case ImageDifferenceId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); char* tail; if (token == NULL || *token == 0) { std::cerr << command << ": option \"--image-difference\" requires an argument" << std::endl; failed = true; } else { PixelDifferenceFunctor = differenceFunctorOfString(token); if (PixelDifferenceFunctor == UnknownDifference) { std::cerr << command << ": unknown image difference algorithm \"" << token << "\"" << std::endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; LuminanceDifferenceWeight = strtod(token, &tail); if (errno == 0) { if (*tail != 0) { std::cerr << command << ": unrecognized luminance weight \"" << tail << "\" in \"" << token << "\"" << std::endl; failed = true; } if (LuminanceDifferenceWeight < 0.0) { std::cerr << command << ": luminance weight must be non-negative" << std::endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of luminance weight: " << enblend::errorMessage(errno) << std::endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; ChrominanceDifferenceWeight = strtod(token, &tail); if (errno == 0) { if (*tail != 0) { std::cerr << command << ": unrecognized chrominance weight \"" << tail << "\" in \"" << token << "\"" << std::endl; failed = true; } if (ChrominanceDifferenceWeight < 0.0) { std::cerr << command << ": chrominance weight must be non-negative" << std::endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of chrominance weight: " << enblend::errorMessage(errno) << std::endl; failed = true; } } if (save_ptr != NULL && *save_ptr != 0) { std::cerr << command << ": warning: ignoring trailing garbage \"" << save_ptr << "\" in argument to \"--image-difference\"" << std::endl; } if (LuminanceDifferenceWeight + ChrominanceDifferenceWeight == 0.0) { std::cerr << command << ": luminance weight and chrominance weight cannot both be zero" << std::endl; failed = true; } optionSet.insert(ImageDifferenceOption); break; } case AnnealId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); char* tail; if (token != NULL && *token != 0) { errno = 0; double tau = strtod(token, &tail); if (errno != 0) { std::cerr << command << ": option \"--anneal\": illegal numeric format \"" << token << "\" of tau: " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { if (*tail == '%') { tau /= 100.0; } else { std::cerr << command << ": --anneal: trailing garbage \"" << tail << "\" in tau: \"" << token << "\"" << std::endl; failed = true; } } //< src::minimum-anneal-tau 0 if (tau <= 0.0) { std::cerr << command << ": option \"--anneal\": tau must be larger than zero" << std::endl; failed = true; } //< src::maximum-anneal-tau 1 if (tau >= 1.0) { std::cerr << command << ": option \"--anneal\": tau must be less than one" << std::endl; failed = true; } AnnealPara.tau = tau; } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; AnnealPara.deltaEMax = strtod(token, &tail); if (errno != 0) { std::cerr << command << ": option \"--anneal\": illegal numeric format \"" << token << "\" of deltaE_max: " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { std::cerr << command << ": option \"--anneal\": trailing garbage \"" << tail << "\" in deltaE_max: \"" << token << "\"" << std::endl; failed = true; } //< src::minimum-anneal-deltae-max 0 if (AnnealPara.deltaEMax <= 0.0) { std::cerr << command << ": option \"--anneal\": deltaE_max must be larger than zero" << std::endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; AnnealPara.deltaEMin = strtod(token, &tail); if (errno != 0) { std::cerr << command << ": option \"--anneal\": illegal numeric format \"" << token << "\" of deltaE_min: " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { std::cerr << command << ": option \"--anneal\": trailing garbage \"" << tail << "\" in deltaE_min: \"" << token << "\"" << std::endl; failed = true; } //< src::minimum-anneal-deltae-min 0 if (AnnealPara.deltaEMin <= 0.0) { std::cerr << command << ": option \"--anneal\": deltaE_min must be larger than zero" << std::endl; failed = true; } } if (AnnealPara.deltaEMin >= AnnealPara.deltaEMax) { std::cerr << command << ": option \"--anneal\": deltaE_min must be less than deltaE_max" << std::endl; failed = true; } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; const long int kmax = strtol(token, &tail, 10); if (errno != 0) { std::cerr << command << ": option \"--anneal\": illegal numeric format \"" << token << "\" of k_max: " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { std::cerr << command << ": option \"--anneal\": trailing garbage \"" << tail << "\" in k_max: \"" << token << "\"" << std::endl; failed = true; } //< src::minimum-anneal-kmax 3 if (kmax < 3L) { std::cerr << command << ": option \"--anneal\": k_max must larger or equal to 3" << std::endl; failed = true; } AnnealPara.kmax = static_cast(kmax); } optionSet.insert(AnnealOption); break; } case MaskVectorizeDistanceId: { char* tail; MaskVectorizeDistance.set_percentage(false); errno = 0; MaskVectorizeDistance.set_value(strtod(optarg, &tail)); if (errno != 0) { std::cerr << command << ": option \"--mask-vectorize\": illegal numeric format \"" << optarg << "\": " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { if (*tail == '%') { MaskVectorizeDistance.set_percentage(true); } else { std::cerr << command << ": option \"--mask-vectorize\": trailing garbage \"" << tail << "\" in \"" << optarg << "\"" << std::endl; failed = true; } } if (MaskVectorizeDistance.value() <= 0.0) { std::cerr << command << ": option \"--mask-vectorize\": distance must be positive" << std::endl; failed = true; } optionSet.insert(MaskVectorizeDistanceOption); break; } case SmoothDifferenceId: { char* tail; errno = 0; const double radius = strtod(optarg, &tail); if (errno != 0) { std::cerr << command << ": option \"--smooth-difference\": illegal numeric format \"" << optarg << "\": " << enblend::errorMessage(errno) << std::endl; failed = true; } if (*tail != 0) { std::cerr << command << ": option \"--smooth-difference\": trailing garbage \"" << tail << "\" in \"" << optarg << "\"" << std::endl; failed = true; } //< src::minimum-smooth-difference 0.0 if (radius < 0.0) { std::cerr << command << ": option \"--smooth-difference\": negative radius; will not blur" << std::endl; DifferenceBlurRadius = 0.0; } else { DifferenceBlurRadius = radius; } optionSet.insert(SmoothDifferenceOption); break; } case OptimizerWeightsId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); OptimizerWeights.first = enblend::numberOfString(token, _1 >= 0.0, "negative optimizer weight; will use 0.0", 0.0); token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { OptimizerWeights.second = enblend::numberOfString(token, _1 >= 0.0, "negative optimizer weight; will use 0.0", 0.0); } if (OptimizerWeights.first == 0.0 && OptimizerWeights.second == 0.0) { std::cerr << command << ": optimizer weights cannot be both zero" << std::endl; } optionSet.insert(OptimizerWeightsOption); break; } case 'v': // FALLTHROUGH case VerboseId: if (optarg != NULL && *optarg != 0) { Verbose = enblend::numberOfString(optarg, _1 >= 0, //< src::minimum-verbosity-level 0 "verbosity level less than 0; will use 0", 0); } else { Verbose++; } optionSet.insert(VerboseOption); break; case CoarseMaskId: CoarseMask = true; if (optarg != NULL && *optarg != 0) { CoarsenessFactor = enblend::numberOfString(optarg, _1 >= 1U, "coarseness factor less or equal to 0; will use 1", 1U); } optionSet.insert(CoarseMaskOption); break; case DijkstraRadiusId: DijkstraRadius = enblend::numberOfString(optarg, _1 >= 1U, //< src::minimum-dijkstra-radius 1 "Dijkstra radius is 0; will use 1", 1U); optionSet.insert(DijkstraRadiusOption); break; case 'a': OneAtATime = false; optionSet.insert(PreAssembleOption); break; case 'b': if (optarg != NULL && *optarg != 0) { const int cache_block_size = enblend::numberOfString(optarg, _1 >= 1, //< src::minimum-cache-block-size 1@dmn{KB} "cache block size must be 1 KB or more; will use 1 KB", 1); vigra_ext::CachedFileImageDirector::v().setBlockSize(static_cast(cache_block_size) << 10); } else { std::cerr << command << ": option \"-b\" requires an argument" << std::endl; failed = true; } optionSet.insert(BlockSizeOption); break; case 'c': // FALLTHROUGH case CiecamId: UseCIECAM = true; optionSet.insert(CIECAM02Option); break; case NoCiecamId: UseCIECAM = false; optionSet.insert(NoCIECAM02Option); break; case FallbackProfileId: if (enblend::can_open_file(optarg)) { FallbackProfile = cmsOpenProfileFromFile(optarg, "r"); if (FallbackProfile == NULL) { std::cerr << command << ": failed to open fallback ICC profile file \"" << optarg << "\"\n"; exit(1); } } else { exit(1); } optionSet.insert(FallbackProfileOption); break; case MainAlgoId: if (optarg != NULL && *optarg != 0) { std::string algo_name(optarg); boost::algorithm::to_upper(algo_name); if (algo_name == "GRAPH-CUT" || algo_name == "GRAPHCUT" || algo_name == "GC") { MainAlgorithm = GraphCut; optionSet.insert(GraphCutOption); } else if (algo_name == "NEAREST-FEATURE-TRANSFORM" || algo_name == "NEARESTFEATURETRANSFORM" || algo_name == "NFT") { MainAlgorithm = NFT; optionSet.insert(NearestFeatureTransformOption); } else { std::cerr << command << ": warning: option \"--primary-seam-generator\": " << "unrecognized argument \"" << optarg << "\", defaulting to NFT" << std::endl; MainAlgorithm = NFT; optionSet.insert(NearestFeatureTransformOption); } } else { std::cerr << command << ": option \"--primary-seam-generator\" requires an argument" << std::endl; failed = true; } break; case 'f': if (optarg != NULL && *optarg != 0) { const int n = sscanf(optarg, "%dx%d+%d+%d", &OutputWidthCmdLine, &OutputHeightCmdLine, &OutputOffsetXCmdLine, &OutputOffsetYCmdLine); if (n == 4) { ; // ok: full geometry string } else if (n == 2) { OutputOffsetXCmdLine = 0; OutputOffsetYCmdLine = 0; } else { std::cerr << command << ": option \"-f\" requires 2 or 4 arguments" << std::endl; failed = true; } } else { std::cerr << command << ": option \"-f\" requires 2 or 4 arguments" << std::endl; failed = true; } OutputSizeGiven = true; optionSet.insert(SizeAndPositionOption); break; case 'g': GimpAssociatedAlphaHack = true; optionSet.insert(AssociatedAlphaOption); break; case 'l': // FALLTHROUGH case LevelsId: if (optarg != NULL && *optarg != 0) { std::string levels(optarg); boost::algorithm::to_upper(levels); if (levels == "AUTO" || levels == "AUTOMATIC") { ExactLevels = 0; } else if (levels.find_first_not_of("+-0123456789") != std::string::npos) { std::cerr << command << ": options \"-l\" or \"--levels\" require an integer argument or \"auto\"" << std::endl; failed = true; } else { std::ostringstream oss; oss << "cannot use more than " << MAX_PYRAMID_LEVELS << " pyramid levels; will use at most " << MAX_PYRAMID_LEVELS << " levels"; ExactLevels = enblend::numberOfString(optarg, _1 != 0, "cannot blend with zero levels; will use one level", 1, _1 <= MAX_PYRAMID_LEVELS, oss.str(), MAX_PYRAMID_LEVELS); } } else { std::cerr << command << ": options \"-l\" or \"--levels\" require an argument" << std::endl; failed = true; } optionSet.insert(LevelsOption); break; case 'm': if (optarg != NULL && *optarg != 0) { const int cache_size = enblend::numberOfString(optarg, _1 >= 1, //< src::minimum-cache-size 1@dmn{MB} "cache memory limit less than 1 MB; will use 1 MB", 1); vigra_ext::CachedFileImageDirector::v().setAllocation(static_cast(cache_size) << 20); } else { std::cerr << command << ": option \"-m\" requires an argument" << std::endl; failed = true; } optionSet.insert(CacheSizeOption); break; case 's': // Deprecated sequential blending flag. OneAtATime = true; std::cerr << command << ": warning: flag \"-s\" is deprecated." << std::endl; optionSet.insert(SequentialBlendingOption); break; case 'x': Checkpoint = true; optionSet.insert(CheckpointOption); break; case LayerSelectorId: { selector::algorithm_list::const_iterator selector = selector::find_by_name(optarg); if (selector != selector::algorithms.end()) { LayerSelection.set_selector(*selector); } else { std::cerr << command << ": unknown selector algorithm \"" << optarg << "\""; exit(1); } optionSet.insert(LayerSelectorOption); break; } case ParameterId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = strtok_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); while (token != NULL) { std::string key; std::string value; char* delimiter = strpbrk(token, ASSIGNMENT_CHARACTERS); if (delimiter == NULL) { key = token; } else { key = std::string(token, delimiter); value = delimiter + 1; } boost::trim(key); boost::trim(value); if (enblend::parameter::is_valid_identifier(key)) { Parameter.insert(parameter_map::value_type(key, ParameterValue(value))); } else { std::cerr << command << ": warning: key \"" << key << "\" of pair \"" << token << "\" is not a valid identifier; ignoring\n"; } token = strtok_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); } break; } case NoParameterId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = strtok_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); while (token != NULL) { std::string key(token); boost::trim(key); if (key == "*") { Parameter.clear(); } else if (enblend::parameter::is_valid_identifier(key)) { Parameter.erase(key); } else { std::cerr << command << ": warning: key \"" << key << "\" is not a valid identifier; ignoring\n"; } token = strtok_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); } break; } case '?': switch (optopt) { case 0: // unknown long option std::cerr << command << ": unknown option \"" << argv[optind - 1] << "\"\n"; break; case 'b': // FALLTHROUGH case 'd': // FALLTHROUGH case 'f': // FALLTHROUGH case 'l': // FALLTHROUGH case 'm': // FALLTHROUGH case 'o': std::cerr << command << ": option \"-" << static_cast(optopt) << "\" requires an argument" << std::endl; break; default: std::cerr << command << ": unknown option "; if (isprint(optopt)) { std::cerr << "\"-" << static_cast(optopt) << "\""; } else { std::cerr << "character 0x" << std::hex << optopt; } std::cerr << std::endl; } std::cerr << "Try \"enblend --help\" for more information." << std::endl; exit(1); default: std::cerr << command << ": internal error: unhandled command line option" << std::endl; exit(1); } } if (contains(optionSet, SaveMasksOption) && contains(optionSet, LoadMasksOption)) { std::cerr << command << ": options \"--load-masks\" and \"--save-masks\" are mutually exclusive" << std::endl; failed = true; } if (failed) { exit(1); } if (justPrintUsage) { printUsageAndExit(false); // never reached } if (justPrintVersion) { printVersionAndExit(argc, argv); // never reached } StopAfterMaskGeneration = contains(optionSet, SaveMasksOption) && !contains(optionSet, OutputOption); warn_of_ineffective_options(optionSet); return optind; } int main(int argc, char** argv) { #ifdef _MSC_VER // Make sure the FPU is set to rounding mode so that the lrint // functions in float_cast.h will work properly. // See changes in vigra numerictraits.hxx _controlfp(_RC_NEAR, _MCW_RC); #else fesetround(FE_TONEAREST); #endif #ifndef _WIN32 sigemptyset(&SigintMask); sigaddset(&SigintMask, SIGINT); struct sigaction action; action.sa_handler = sigint_handler; sigemptyset(&(action.sa_mask)); sigaction(SIGINT, &action, NULL); #else signal(SIGINT, sigint_handler); #endif if (atexit(cleanup_output) != 0) { std::cerr << command << ": warning: could not install cleanup routine\n"; } sig.initialize(); gsl_set_error_handler_off(); TIFFSetWarningHandler(tiff_warning); TIFFSetErrorHandler(tiff_error); //< src::layer-selector all-layers LayerSelection.set_selector(*selector::find_by_id(selector::AllLayersId)); if (!getopt_long_works_ok()) { std::cerr << command << ": cannot reliably parse command line; giving up\n"; exit(1); } int optind; try { optind = process_options(argc, argv); } catch (vigra::StdException& e) { std::cerr << command << ": error while processing command line options\n" << command << ": " << e.what() << std::endl; exit(1); } enblend::TraceableFileNameList inputTraceableFileNameList; // Remaining parameters are input files. while (optind < argc) { enblend::TraceableFileNameList files; enblend::unfold_filename(files, std::string(argv[optind])); inputTraceableFileNameList.insert(inputTraceableFileNameList.end(), files.begin(), files.end()); optind++; } if (inputTraceableFileNameList.empty()) { std::cerr << command << ": no input files specified\n"; exit(1); } #ifdef DEBUG_DUMP_GLOBAL_VARIABLES DUMP_GLOBAL_VARIABLES(); #endif if (UseGPU) { #ifdef HAVE_LIBGLEW initGPU(&argc, argv); #else std::cerr << command << ": warning: no GPU support compiled in; option \"--gpu\" has no effect" << std::endl; #endif } sig.check(); for (enblend::TraceableFileNameList::iterator i = inputTraceableFileNameList.begin(); i != inputTraceableFileNameList.end(); ++i) { if (!enblend::can_open_file(i->filename())) { i->unroll_trace(); exit(1); } } LayerSelection.retrieve_image_information(inputTraceableFileNameList.begin(), inputTraceableFileNameList.end()); //if (vigra_ext::CachedFileImageDirector::v()->getManagedBlocks() < 4) { // // Max simultaneous image access is in: // // 4 in any of many calls to combineThreeImages // // 4 gaussian pyramid init (src image layer, src alpha layer, dest pyramid image layer 0, dest pyramid alpha layer 0) // // 4 in reduce (src image layer N, src alpha layer N, dest image layer N+1, dest alpha layer N+1) // // FIXME complain or automatically adjust blocksize to get ManagedBlocks above 4? //} // List of info structures for each input image. std::list imageInfoList; std::list::iterator imageInfoIterator; bool isColor = false; std::string pixelType; TiffResolution resolution; vigra::ImageImportInfo::ICCProfile iccProfile; vigra::Rect2D inputUnion; // Check that all input images have the same parameters. int minDim = INT_MAX; unsigned layer = 0; unsigned layers = 0; enblend::FileNameList inputFileNameList; enblend::TraceableFileNameList::iterator inputFileNameIterator = inputTraceableFileNameList.begin(); while (inputFileNameIterator != inputTraceableFileNameList.end()) { vigra::ImageImportInfo* inputInfo = NULL; std::string filename(inputFileNameIterator->filename()); try { vigra::ImageImportInfo info(filename.c_str()); if (layers == 0) { // OPTIMIZATION: call only once per file layers = info.numImages(); } inputInfo = new vigra::ImageImportInfo(info); inputInfo->setImageIndex(layer); ++layer; } catch (vigra::ContractViolation& exception) { std::cerr << command << ": cannot load image \"" << filename << "\"\n" << command << ": " << exception.what() << "\n"; if (enblend::maybe_response_file(filename)) { std::cerr << command << ": info: Maybe you meant a response file and forgot the initial '" << RESPONSE_FILE_PREFIX_CHAR << "'?\n"; } exit(1); } LayerSelection.set_selector(inputFileNameIterator->selector()); if (LayerSelection.accept(filename, layer)) { if (Verbose >= VERBOSE_LAYER_SELECTION) { std::cerr << command << ": info: layer selector \"" << LayerSelection.name() << "\" accepts\n" << command << ": info: layer " << layer << " of " << layers << " in image \"" << filename << "\"\n"; } // Save this image info in the list. imageInfoList.push_back(inputInfo); inputFileNameList.push_back(filename); if (Verbose >= VERBOSE_INPUT_IMAGE_INFO_MESSAGES) { std::cerr << command << ": info: input image \"" << inputFileNameIterator->filename() << "\" " << layer << '/' << layers << ' '; if (inputInfo->isColor()) { std::cerr << "RGB "; } if (!inputInfo->getICCProfile().empty()) { std::cerr << "ICC "; } std::cerr << inputInfo->getPixelType() << " position=" << inputInfo->getPosition().x << "x" << inputInfo->getPosition().y << " " << "size=" << inputInfo->width() << "x" << inputInfo->height() << std::endl; } if (inputInfo->numExtraBands() < 1) { // Complain about lack of alpha channel. std::cerr << command << ": input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " does not have an alpha channel\n"; inputFileNameIterator->unroll_trace(); exit(1); } // Get input image's position and size. vigra::Rect2D imageROI(vigra::Point2D(inputInfo->getPosition()), vigra::Size2D(inputInfo->width(), inputInfo->height())); if (inputFileNameIterator == inputTraceableFileNameList.begin()) { // First input image minDim = std::min(inputInfo->width(), inputInfo->height()); inputUnion = imageROI; isColor = inputInfo->isColor(); pixelType = inputInfo->getPixelType(); resolution = TiffResolution(inputInfo->getXResolution(), inputInfo->getYResolution()); iccProfile = inputInfo->getICCProfile(); if (!iccProfile.empty()) { InputProfile = cmsOpenProfileFromMem(iccProfile.data(), iccProfile.size()); if (InputProfile == NULL) { std::cerr << std::endl << command << ": error parsing ICC profile data from file \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << std::endl; inputFileNameIterator->unroll_trace(); exit(1); } } } else { // Second and later images inputUnion |= imageROI; if (isColor != inputInfo->isColor()) { std::cerr << command << ": input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " is " << (inputInfo->isColor() ? "color" : "grayscale") << "\n" << command << ": but previous images are " << (isColor ? "color" : "grayscale") << std::endl; inputFileNameIterator->unroll_trace(); exit(1); } if (pixelType != inputInfo->getPixelType()) { std::cerr << command << ": input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " has pixel type " << inputInfo->getPixelType() << ",\n" << command << ": but previous images have pixel type " << pixelType << std::endl; inputFileNameIterator->unroll_trace(); exit(1); } if (resolution != TiffResolution(inputInfo->getXResolution(), inputInfo->getYResolution())) { std::cerr << command << ": info: input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " has resolution " << inputInfo->getXResolution() << " dpi x " << inputInfo->getYResolution() << " dpi,\n" << command << ": info: but first image has resolution " << resolution.x << " dpi x " << resolution.y << " dpi" << std::endl; inputFileNameIterator->unroll_trace(); } // IMPLEMENTATION NOTE: Newer Vigra libraries have // ICCProfile::operator==. We substitute STL's equal // function plus some extra checks for the case of empty // profiles. -- cls @ Thu May 27 14:21:57 UTC 2010 if (iccProfile.empty() != inputInfo->getICCProfile().empty() || !std::equal(iccProfile.begin(), iccProfile.end(), inputInfo->getICCProfile().begin())) { vigra::ImageImportInfo::ICCProfile mismatchProfile = inputInfo->getICCProfile(); cmsHPROFILE newProfile = NULL; if (!mismatchProfile.empty()) { newProfile = cmsOpenProfileFromMem(mismatchProfile.data(), mismatchProfile.size()); if (newProfile == NULL) { std::cerr << std::endl << command << ": error parsing ICC profile data from file \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << std::endl; inputFileNameIterator->unroll_trace(); exit(1); } } std::cerr << std::endl << command << ": warning: input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << "\n"; inputFileNameIterator->unroll_trace(); std::cerr << command << ": warning: has "; if (newProfile) { std::cerr << "ICC profile \"" << enblend::profileDescription(newProfile) << "\",\n"; } else { std::cerr << "no ICC profile,\n"; } std::cerr << command << ": warning: but first image has "; if (InputProfile) { std::cerr << "ICC profile \"" << enblend::profileDescription(InputProfile) << "\";\n"; } else { std::cerr << "no ICC profile;\n"; } std::cerr << command << ": warning: blending images with different color spaces\n" << command << ": warning: may have unexpected results" << std::endl; } if (inputInfo->width() < minDim) { minDim = inputInfo->width(); } if (inputInfo->height() < minDim) { minDim = inputInfo->height(); } } } else { if (Verbose >= VERBOSE_LAYER_SELECTION) { std::cerr << command << ": info: layer selector \"" << LayerSelection.name() << "\" rejects\n" << command << ": info: layer " << layer << " of " << layers << " in image \"" << filename << "\"\n"; } } if (layers == 1 || layer == layers) { layer = 0; layers = 0; ++inputFileNameIterator; } else { // We are about to process the next layer in the _same_ // image. The imageInfoList already has been updated, but // inputTraceableFileNameList still lacks the filename. inputTraceableFileNameList.insert(inputFileNameIterator, *inputFileNameIterator); } } // Check that more than one input file was given. if (imageInfoList.size() <= 1) { const size_t n = inputTraceableFileNameList.size(); const size_t m = imageInfoList.size(); if (n > m) { std::cerr << command << ": warning: selector has rejected " << n - m << " out of " << n << " images\n"; } switch (m) { case 0: std::cerr << command << ": no input images given\n"; exit(1); break; case 1: std::cerr << command << ": warning: only one input image given;\n" << command << ": warning: Enblend needs two or more overlapping input images in order to do\n" << command << ": warning: blending calculations. The output will be the same as the input.\n"; break; } } if (resolution == TiffResolution()) { std::cerr << command << ": warning: no usable resolution found in first image \"" << inputTraceableFileNameList.begin()->filename() << "\";\n" << command << ": warning: will use " << DEFAULT_TIFF_RESOLUTION << " dpi\n"; ImageResolution = TiffResolution(DEFAULT_TIFF_RESOLUTION, DEFAULT_TIFF_RESOLUTION); } else { ImageResolution = resolution; } // Switch to fine mask, if the smallest coarse mask would be less // than 64 pixels wide or high. if (minDim / 8 < 64 && CoarseMask) { std::cerr << command << ": warning: input images too small for coarse mask; switching to fine mask" << std::endl; CoarseMask = false; if (MainAlgorithm == GraphCut) { std::cerr << command << ": warning: fine mask combined with graphcut incompatible with mask optimization;\n" << command <<": warning: defaulting to no optimization." << std::endl; OptimizeMask = false; } } if (MaskVectorizeDistance.value() == 0) { MaskVectorizeDistance.set_percentage(false); MaskVectorizeDistance.set_value(CoarseMask ? coarseMaskVectorizeDistance : fineMaskVectorizeDistance); } // Create the Info for the output file. vigra::ImageExportInfo outputImageInfo(OutputFileName.c_str()); if (!StopAfterMaskGeneration) { OutputIsValid = false; // Make sure that inputUnion is at least as big as given by the -f paramater. if (OutputSizeGiven) { inputUnion |= vigra::Rect2D(OutputOffsetXCmdLine, OutputOffsetYCmdLine, OutputOffsetXCmdLine + OutputWidthCmdLine, OutputOffsetYCmdLine + OutputHeightCmdLine); } if (!OutputCompression.empty()) { outputImageInfo.setCompression(OutputCompression.c_str()); } // If not overridden by the command line, the pixel type of the // output image is the same as the input images'. If the pixel // type is not supported by the output format, replace it with the // best match. { const std::string outputFileType = enblend::getFileType(OutputFileName); const std::string neededPixelType = OutputPixelType.empty() ? std::string(pixelType) : OutputPixelType; const std::string bestPixelType = enblend::bestPixelType(outputFileType, neededPixelType); if (neededPixelType != bestPixelType) { std::cerr << command << ": warning: " << (OutputPixelType.empty() ? "deduced" : "requested") << " output pixel type is \"" << neededPixelType << "\", but image type \"" << outputFileType << "\"\n" << command << ": warning: supports \"" << bestPixelType << "\" at best; will use \"" << bestPixelType << "\"" << std::endl; } outputImageInfo.setPixelType(bestPixelType.c_str()); pixelType = enblend::maxPixelType(pixelType, bestPixelType); } // Set the output image ICC profile outputImageInfo.setICCProfile(iccProfile); if (UseCIECAM == true || (boost::indeterminate(UseCIECAM) && !iccProfile.empty())) { UseCIECAM = true; if (InputProfile == NULL) { std::cerr << command << ": warning: input images do not have ICC profiles;\n"; if (FallbackProfile == NULL) { std::cerr << command << ": warning: assuming sRGB profile" << std::endl; InputProfile = cmsCreate_sRGBProfile(); } else { std::cerr << command << ": warning: using fallback profile \"" << enblend::profileDescription(FallbackProfile) << "\"" << std::endl; InputProfile = FallbackProfile; FallbackProfile = NULL; // avoid double freeing } } XYZProfile = cmsCreateXYZProfile(); InputToXYZTransform = cmsCreateTransform(InputProfile, TYPE_RGB_DBL, XYZProfile, TYPE_XYZ_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (InputToXYZTransform == NULL) { std::cerr << command << ": error building color transform from \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\" to XYZ space" << std::endl; exit(1); } XYZToInputTransform = cmsCreateTransform(XYZProfile, TYPE_XYZ_DBL, InputProfile, TYPE_RGB_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (XYZToInputTransform == NULL) { std::cerr << command << ": error building color transform from XYZ space to \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\"" << std::endl; exit(1); } // P2 Viewing Conditions: D50, 500 lumens ViewingConditions.whitePoint.X = XYZ_SCALE * cmsD50_XYZ()->X; ViewingConditions.whitePoint.Y = XYZ_SCALE * cmsD50_XYZ()->Y; ViewingConditions.whitePoint.Z = XYZ_SCALE * cmsD50_XYZ()->Z; ViewingConditions.Yb = 20.0; ViewingConditions.La = 31.83; ViewingConditions.surround = AVG_SURROUND; ViewingConditions.D_value = 1.0; CIECAMTransform = cmsCIECAM02Init(NULL, &ViewingConditions); if (!CIECAMTransform) { std::cerr << std::endl << command << ": error initializing CIECAM02 transform" << std::endl; exit(1); } cmsCIExyY white_point; if (cmsIsTag(InputProfile, cmsSigMediaWhitePointTag)) { cmsXYZ2xyY(&white_point, (const cmsCIEXYZ*) cmsReadTag(InputProfile, cmsSigMediaWhitePointTag)); if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { double temperature; cmsTempFromWhitePoint(&temperature, &white_point); std::cerr << command << ": info: using white point of input profile at " << temperature << "K" << std::endl; } } else { memcpy(&white_point, cmsD50_xyY(), sizeof(cmsCIExyY)); if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { double temperature; cmsTempFromWhitePoint(&temperature, &white_point); std::cerr << command << ": info: falling back to predefined (D50) white point at " << temperature << "K" << std::endl; } } LabProfile = cmsCreateLab2Profile(&white_point); InputToLabTransform = cmsCreateTransform(InputProfile, TYPE_RGB_DBL, LabProfile, TYPE_Lab_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (!InputToLabTransform) { std::cerr << command << ": error building color transform from \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\" to Lab space" << std::endl; exit(1); } LabToInputTransform = cmsCreateTransform(LabProfile, TYPE_Lab_DBL, InputProfile, TYPE_RGB_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (!LabToInputTransform) { std::cerr << command << ": error building color transform from Lab space to \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\"" << std::endl; exit(1); } } else { if (FallbackProfile != NULL) { std::cerr << command << ": warning: blending in RGB cube; option \"--fallback-profile\" has no effect" << std::endl; } } // The size of the output image. if (Verbose >= VERBOSE_INPUT_UNION_SIZE_MESSAGES) { std::cerr << command << ": info: output image size: " << inputUnion << std::endl; } // Set the output image position and resolution. outputImageInfo.setXResolution(ImageResolution.x); outputImageInfo.setYResolution(ImageResolution.y); outputImageInfo.setPosition(inputUnion.upperLeft()); // Sanity check on the output image file. try { // This seems to be a reasonable way to check if // the output file is going to work after blending // is done. encoder(outputImageInfo); } catch (vigra::StdException & e) { std::cerr << std::endl << command << ": error opening output file \"" << OutputFileName << "\";\n" << command << ": " << e.what() << std::endl; exit(1); } if (!OutputPixelType.empty()) { pixelType = enblend::maxPixelType(pixelType, OutputPixelType); } } // Invoke templatized blender. try { if (isColor) { if (pixelType == "UINT8") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #ifndef DEBUG_8BIT_ONLY else if (pixelType == "INT8") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT16") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT16") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT32") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT32") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "FLOAT") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "DOUBLE") enblend::enblendMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #endif else { std::cerr << command << ": RGB images with pixel type \"" << pixelType << "\" are not supported" << std::endl; exit(1); } } else { if (pixelType == "UINT8") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #ifndef DEBUG_8BIT_ONLY else if (pixelType == "INT8") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT16") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT16") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT32") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT32") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "FLOAT") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "DOUBLE") enblend::enblendMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #endif else { std::cerr << command << ": black&white images with pixel type \"" << pixelType << "\" are not supported" << std::endl; exit(1); } } for (std::list::iterator i = imageInfoList.begin(); i != imageInfoList.end(); ++i) { delete *i; } } catch (std::bad_alloc& e) { std::cerr << std::endl << command << ": out of memory\n" << command << ": " << e.what() << std::endl; exit(1); } catch (vigra::StdException& e) { std::cerr << std::endl << command << ": an exception occured\n" << command << ": " << e.what() << std::endl; exit(1); } if (FallbackProfile) {cmsCloseProfile(FallbackProfile);} if (LabProfile) {cmsCloseProfile(LabProfile);} if (InputToLabTransform) {cmsCIECAM02Done(InputToLabTransform);} if (LabToInputTransform) {cmsCIECAM02Done(LabToInputTransform);} if (CIECAMTransform) {cmsCIECAM02Done(CIECAMTransform);} if (InputToXYZTransform) {cmsDeleteTransform(InputToXYZTransform);} if (XYZToInputTransform) {cmsDeleteTransform(XYZToInputTransform);} if (XYZProfile) {cmsCloseProfile(XYZProfile);} if (InputProfile) {cmsCloseProfile(InputProfile);} #ifdef HAVE_LIBGLEW if (UseGPU) { wrapupGPU(); } #endif // Success. return 0; } enblend-enfuse-4.1.2+dfsg/src/blend.h0000644000175100017510000000740012070530501017577 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __BLEND_H__ #define __BLEND_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "fixmath.h" namespace enblend { /** Functor for blending a black and white pyramid level using a mask * pyramid level. */ template class CartesianBlendFunctor { public: CartesianBlendFunctor(MaskPixelType w) : white(vigra::NumericTraits::toRealPromote(w)) {} template ImagePixelType operator()(const MaskPixelType& maskP, const ImagePixelType& wP, const ImagePixelType& bP) const { typedef typename vigra::NumericTraits::RealPromote RealImagePixelType; // Convert mask pixel to blend coefficient in range [0.0, 1.0]. double whiteCoeff = vigra::NumericTraits::toRealPromote(maskP) / white; // Sometimes masked image data is invalid. For floating point samples // this includes possible NaN's in the data. In that case, computing // the output sample will result in a NaN output if the weight on that // pixel is 0 (since 0*NaN = NaN ) // Handle this by explicitly ignoring fully masked pixels if (whiteCoeff >= 1.0) { return wP; } if (whiteCoeff <= 0.0) { return bP; } const double blackCoeff = 1.0 - whiteCoeff; RealImagePixelType rwP = vigra::NumericTraits::toRealPromote(wP); RealImagePixelType rbP = vigra::NumericTraits::toRealPromote(bP); RealImagePixelType blendP = (whiteCoeff * rwP) + (blackCoeff * rbP); return vigra::NumericTraits::fromRealPromote(blendP); } protected: double white; }; /** Blend black and white pyramids using mask pyramid. */ template void blend(std::vector* maskGP, std::vector* whiteLP, std::vector* blackLP, typename MaskPyramidType::value_type maskPyramidWhiteValue) { if (Verbose >= VERBOSE_BLEND_MESSAGES) { std::cerr << command << ": info: blending layers: "; std::cerr.flush(); } for (unsigned int layer = 0; layer < maskGP->size(); layer++) { if (Verbose >= VERBOSE_BLEND_MESSAGES) { std::cerr << " l" << layer; std::cerr.flush(); } combineThreeImagesMP(srcImageRange(*((*maskGP)[layer])), srcImage(*((*whiteLP)[layer])), srcImage(*((*blackLP)[layer])), destImage(*((*blackLP)[layer])), CartesianBlendFunctor(maskPyramidWhiteValue)); } if (Verbose >= VERBOSE_BLEND_MESSAGES) { std::cerr << endl; } } } // namespace enblend #endif /* __BLEND_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/bounds.h0000644000175100017510000001431612070530113020010 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __BOUNDS_H__ #define __BOUNDS_H__ #ifdef HAVE_CONFIG_H #include #endif #include "common.h" #include "pyramid.h" namespace enblend { /** Characterize the overlap between src1 and src2. * The images may overlap completely (CompleteOverlap), * partially (PartialOverlap), * or not at all (NoOverlap). */ template Overlap inspectOverlap(SrcImageIterator src1_upperleft, SrcImageIterator src1_lowerright, SrcAccessor s1a, SrcImageIterator src2_upperleft, SrcAccessor s2a) { SrcImageIterator s1y = src1_upperleft; SrcImageIterator s2y = src2_upperleft; SrcImageIterator send = src1_lowerright; bool foundOverlap = false; bool foundDistinctS2 = false; for (; s1y.y < send.y; ++s1y.y, ++s2y.y) { SrcImageIterator s1x = s1y; SrcImageIterator s2x = s2y; for (; s1x.x < send.x; ++s1x.x, ++s2x.x) { if (s1a(s1x) && s2a(s2x)) { foundOverlap = true; } else if (s2a(s2x)) { foundDistinctS2 = true; } if (foundOverlap && foundDistinctS2) { // If we have found a pixel where there is overlap, // and also a pixel where src2 alone contributes, // then we know it's PartialOverlap and we can quit. return PartialOverlap; } } } if (foundOverlap) { return CompleteOverlap; } else { return NoOverlap; } }; // Argument object factory version. template Overlap inspectOverlap(vigra::triple src1, vigra::pair src2) { return inspectOverlap(src1.first, src1.second, src1.third, src2.first, src2.second); }; /** Determine the region-of-interest and number of blending levels to use, * given the current mask-bounding-box and intersection-bounding-box. * We also need to know if the image is a 360-degree pano so we can check * for the case that the ROI wraps around the left and right edges. */ template unsigned int roiBounds(const vigra::Rect2D& inputUnion, const vigra::Rect2D& iBB, const vigra::Rect2D& mBB, const vigra::Rect2D& uBB, vigra::Rect2D& roiBB, // roiBB is an _output_ parameter! bool wraparoundForMask) { roiBB = mBB; roiBB.addBorder(filterHalfWidth(MAX_PYRAMID_LEVELS)); if (wraparoundForMask && (roiBB.left() < 0 || roiBB.right() > uBB.right())) { // If the ROI goes off either edge of the uBB, and the uBB is // the full size of the output image, and the wraparound flag // is specified, then make roiBB the full width of uBB. roiBB.setUpperLeft(vigra::Point2D(0, roiBB.top())); roiBB.setLowerRight(vigra::Point2D(uBB.right(), roiBB.bottom())); } // ROI must not be bigger than uBB. roiBB &= uBB; if (Verbose >= VERBOSE_ROIBB_SIZE_MESSAGES) { std::cerr << command << ": info: region-of-interest bounding box: " << roiBB << std::endl; } // Verify the number of levels based on the size of the ROI. unsigned int roiShortDimension = std::min(roiBB.width(), roiBB.height()); const unsigned int minimumPyramidLevels = 1U; //< src::minimum-pyramid-levels 1 unsigned int allowableLevels = minimumPyramidLevels; while (allowableLevels <= MAX_PYRAMID_LEVELS) { if (roiShortDimension <= 8U) { // ROI dimensions preclude using more levels than allowableLevels. break; } roiShortDimension = (roiShortDimension + 1U) >> 1; ++allowableLevels; } if (allowableLevels <= minimumPyramidLevels) { std::cerr << command << ": info: overlap region is too small to make more than " << minimumPyramidLevels << " pyramid level(s)" << std::endl; } else { if (ExactLevels >= 1) { if (ExactLevels > static_cast(allowableLevels)) { std::cerr << command << ": warning: cannot blend with " << ExactLevels << " pyramid level(s) as\n" << command << ": warning: image geometry precludes using more than " << allowableLevels << " pyramid level(s)" << std::endl; } allowableLevels = std::min(allowableLevels, static_cast(ExactLevels)); } else if (ExactLevels < 0) { if (static_cast(allowableLevels) + ExactLevels >= static_cast(minimumPyramidLevels)) { allowableLevels -= static_cast(-ExactLevels); } else { std::cerr << ": warning: cannot sensibly blend with " << allowableLevels << ExactLevels << " levels\n" << command << ": warning: will not use less than " << minimumPyramidLevels << " pyramid level(s)" << std::endl; allowableLevels = minimumPyramidLevels; } } } if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << command << ": info: using " << allowableLevels << " blending level(s)" << std::endl; } assert(allowableLevels >= minimumPyramidLevels); assert(allowableLevels <= MAX_PYRAMID_LEVELS); return allowableLevels; } } // namespace enblend #endif /* __BOUNDS_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/tiff_message.cc0000644000175100017510000000472612070530113021314 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include "tiff_message.h" extern const std::string command; std::set tiff_messages; void flush_buffers() { fflush(stdout); std::cout.flush(); std::wcout.flush(); } /** tiff_message mangles the error and warning messages from the TIFF * library to make them look more like Enblend/Enfuse messages. * * For the messages tend to occur repeatedly, we keep track of every * message and only pass on their first appearance. The library * always includes the name of the offending TIFF file, thus we get * each message once for each file. */ void tiff_message(const char* message_class, const char* /*module*/, const char* format, va_list arguments) { const size_t buffer_size = 4096; boost::scoped_ptr buffer(new char[buffer_size]); vsnprintf(buffer.get(), buffer_size, format, arguments); const std::string message(buffer.get()); if (tiff_messages.count(message) == 0) { tiff_messages.insert(message); // IMPLEMENTATION NOTE: We do not know, where we are called, // therefore we must flush all buffers before we print our // message. flush_buffers(); std::cerr << command << ": " << message_class << ": " << message << std::endl; } } void tiff_warning(const char* module, const char* format, va_list arguments) { tiff_message("warning", module, format, arguments); } void tiff_error(const char* module, const char* format, va_list arguments) { tiff_message("error", module, format, arguments); } enblend-enfuse-4.1.2+dfsg/src/filenameparse.h0000644000175100017510000000427412070530113021333 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __FILENAMEPARSE_H__ #define __FILENAMEPARSE_H__ #include namespace enblend { /** Answer whether aFilename is specified with a relative path not * an absolute one. */ bool isRelativePath(const std::string& aFilename); /** Answer the directory part of aFilename. The function duplicates * dirname(1). */ std::string extractDirname(const std::string& aFilename); /** Answer the non-directory part of aFilename. The function * duplicates basename(1). */ std::string extractBasename(const std::string& aFilename); /** Answer the filename part of aFilename. This is the basename of * aFilename without extension. */ std::string extractFilename(const std::string& aFilename); /** Answer the extension part of aFilename including the leading * dot. */ std::string extractExtension(const std::string& aFilename); /** Answer aPathname with all superfluous "." and ".." removed. * If keepDot is true an empty path gets normalized to "." * instead of the empty string. */ std::string canonicalizePath(const std::string& aPathname, bool keepDot); /** Answer the concatenation of aPathname and anotherPathname. */ std::string concatPath(const std::string& aPathname, const std::string& anotherPathname); } // namespace enblend #endif /* __FILENAMEPARSE_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/enfuse.cc0000644000175100017510000031005712076002432020146 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include #endif #ifdef _MSC_VER #define isnan _isnan #endif // _MSC_VER #ifdef _WIN32 // Make sure we bring in windows.h the right way #define _STLP_VERBOSE_AUTO_LINK #define _USE_MATH_DEFINES #define NOMINMAX #define VC_EXTRALEAN #include #undef DIFFERENCE #endif // _WIN32 #ifdef __GW32C__ #undef malloc #define BOOST_NO_STDC_NAMESPACE 1 #endif #include #include #include #include #include #include extern "C" char *optarg; extern "C" int optind; #ifndef _MSC_VER #include #endif #include #include #include #include #ifdef _WIN32 #include #endif #include #include #include "global.h" #include "layer_selection.h" #include "signature.h" #include "selector.h" #include "self_test.h" #include "tiff_message.h" // Globals const std::string command("enfuse"); // Global values from command line parameters. std::string OutputFileName(DEFAULT_OUTPUT_FILENAME); int Verbose = 1; //< src::default-verbosity-level 1 int ExactLevels = 0; // 0 means: automatically calculate maximum bool OneAtATime = true; boundary_t WrapAround = OpenBoundaries; bool GimpAssociatedAlphaHack = false; boost::tribool UseCIECAM = boost::indeterminate; bool OutputSizeGiven = false; int OutputWidthCmdLine = 0; int OutputHeightCmdLine = 0; int OutputOffsetXCmdLine = 0; int OutputOffsetYCmdLine = 0; std::string OutputCompression; std::string OutputPixelType; double WExposure = 1.0; //< src::default-weight-exposure 1.0 AlternativePercentage ExposureLowerCutoff(0.0, true); //< src::default-exposure-lower-cutoff 0% AlternativePercentage ExposureUpperCutoff(100.0, true); //< src::default-exposure-upper-cutoff 100% std::string ExposureLowerCutoffGrayscaleProjector("anti-value"); //< src::default-exposure-lower-cutoff-projector anti-value std::string ExposureUpperCutoffGrayscaleProjector("value"); //< src::default-exposure-upper-cutoff-projector value double WContrast = 0.0; //< src::default-weight-contrast 0.0 double WSaturation = 0.2; //< src::default-weight-saturation 0.2 double WEntropy = 0.0; //< src::default-weight-entropy 0.0 double WMu = 0.5; //< src::default-exposure-mu 0.5 double WSigma = 0.2; //< src::default-exposure-sigma 0.2 bool WSaturationIsDefault = true; int ContrastWindowSize = 5; //< src::default-contrast-window-size 5 std::string GrayscaleProjector; struct EdgeFilterConfiguration {double edgeScale, lceScale, lceFactor;} FilterConfig = { 0.0, //< src::default-edge-scale 0.0 0.0, //< src::default-lce-scale 0.0 0.0 //< src::default-lce-factor 0.0 }; AlternativePercentage MinCurvature(0.0, false); //< src::default-minimum-curvature 0 int EntropyWindowSize = 3; //< src::default-entropy-window-size 3 AlternativePercentage EntropyLowerCutoff(0.0, true); //< src::default-entropy-lower-cutoff 0% AlternativePercentage EntropyUpperCutoff(100.0, true); //< src::default-entropy-upper-cutoff 100% bool UseHardMask = false; bool SaveMasks = false; bool StopAfterMaskGeneration = false; bool LoadMasks = false; std::string SoftMaskTemplate("softmask-%n.tif"); //< src::default-soft-mask-template softmask-%n.tif std::string HardMaskTemplate("hardmask-%n.tif"); //< src::default-hard-mask-template hardmask-%n.tif TiffResolution ImageResolution; bool OutputIsValid = true; parameter_map Parameter; // Globals related to catching SIGINT #ifndef _WIN32 sigset_t SigintMask; #endif // Objects for ICC profiles cmsHPROFILE InputProfile = NULL; cmsHPROFILE XYZProfile = NULL; cmsHPROFILE LabProfile = NULL; cmsHTRANSFORM InputToXYZTransform = NULL; cmsHTRANSFORM XYZToInputTransform = NULL; cmsHTRANSFORM InputToLabTransform = NULL; cmsHTRANSFORM LabToInputTransform = NULL; cmsViewingConditions ViewingConditions; cmsHANDLE CIECAMTransform = NULL; cmsHPROFILE FallbackProfile = NULL; Signature sig; LayerSelectionHost LayerSelection; #include #include #include #include #include "common.h" #include "enfuse.h" #ifdef DMALLOC #include "dmalloc.h" // must be last #include #endif #ifdef _WIN32 #define strdup _strdup #endif // Initialize data structures for precomputed entropy and logarithm. template size_t enblend::Histogram::precomputedSize = 0; template double* enblend::Histogram::precomputedLog = NULL; template double* enblend::Histogram::precomputedEntropy = NULL; #define DUMP_GLOBAL_VARIABLES(...) dump_global_variables(__FILE__, __LINE__, ##__VA_ARGS__) void dump_global_variables(const char* file, unsigned line, std::ostream& out = std::cout) { out << "+ " << file << ":" << line << ": state of global variables\n" << "+ Verbose = " << Verbose << ", option \"--verbose\"\n" << "+ OutputFileName = <" << OutputFileName << ">\n" << "+ ExactLevels = " << ExactLevels << "\n" << "+ OneAtATime = " << enblend::stringOfBool(OneAtATime) << ", option \"-a\"\n" << "+ WrapAround = " << enblend::stringOfWraparound(WrapAround) << ", option \"--wrap\"\n" << "+ GimpAssociatedAlphaHack = " << enblend::stringOfBool(GimpAssociatedAlphaHack) << ", option \"-g\"\n" << "+ UseCIECAM = " << UseCIECAM << ", option \"--ciecam\"\n" << "+ FallbackProfile = " << (FallbackProfile ? enblend::profileDescription(FallbackProfile) : "[none]") << ", option \"--fallback-profile\"\n" << "+ OutputSizeGiven = " << enblend::stringOfBool(OutputSizeGiven) << ", option \"-f\"\n" << "+ OutputWidthCmdLine = " << OutputWidthCmdLine << ", argument to option \"-f\"\n" << "+ OutputHeightCmdLine = " << OutputHeightCmdLine << ", argument to option \"-f\"\n" << "+ OutputOffsetXCmdLine = " << OutputOffsetXCmdLine << ", argument to option \"-f\"\n" << "+ OutputOffsetYCmdLine = " << OutputOffsetYCmdLine << ", argument to option \"-f\"\n" << "+ WExposure = " << WExposure << ", argument to option \"--exposure-weight\"\n" << "+ WMu = " << WMu << ", argument to option \"--exposure-mu\"\n" << "+ WSigma = " << WSigma << ", argument to option \"--exposure-sigma\"\n" << "+ ExposureLowerCutoff = {\n" "+ value = " << ExposureLowerCutoff.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(ExposureLowerCutoff.is_percentage()) << "\n" << "+ }, first argument to option \"--exposure-cutoff\"\n" << "+ ExposureUpperCutoff = {\n" "+ value = " << ExposureUpperCutoff.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(ExposureUpperCutoff.is_percentage()) << "\n" << "+ }, second argument to option \"--exposure-cutoff\"\n" << "+ ExposureLowerCutoffGrayscaleProjector = <" << ExposureLowerCutoffGrayscaleProjector << ">, third argument to option \"--exposure-cutoff\"\n" << "+ ExposureUpperCutoffGrayscaleProjector = <" << ExposureUpperCutoffGrayscaleProjector << ">, fourth argument to option \"--exposure-cutoff\"\n" << "+ WContrast = " << WContrast << ", argument to option \"--contrast-weight\"\n" << "+ WSaturation = " << WSaturation << ", argument to option \"--saturation-weight\"\n" << "+ WEntropy = " << WEntropy << ", argument to option \"--entropy-weight\"\n" << "+ WSaturationIsDefault = " << enblend::stringOfBool(WSaturationIsDefault) << "\n" << "+ ContrastWindowSize = " << ContrastWindowSize << ", argument to option \"--contrast-window-size\"\n" << "+ GrayscaleProjector = <" << GrayscaleProjector << ">, argument to option \"--gray-projector\"\n" << "+ FilterConfig = {\n" << "+ edgeScale = " << FilterConfig.edgeScale << ",\n" << "+ lceScale = " << FilterConfig.lceScale << ",\n" << "+ lceFactor = " << FilterConfig.lceFactor << "\n" << "+ }, arguments to option \"--contrast-edge-scale\"\n" << "+ MinCurvature = {\n" "+ value = " << MinCurvature.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(MinCurvature.is_percentage()) << "\n" << "+ }, arguments to option \"--contrast-min-curvature\"\n" << "+ EntropyWindowSize = " << EntropyWindowSize << ", argument to option \"--entropy-window-size\"\n" << "+ EntropyLowerCutoff = {\n" "+ value = " << EntropyLowerCutoff.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(EntropyLowerCutoff.is_percentage()) << "\n" << "+ }, first argument to option \"--entropy-cutoff\"\n" << "+ EntropyUpperCutoff = {\n" "+ value = " << EntropyUpperCutoff.value() << ",\n" << "+ is_percentage = " << enblend::stringOfBool(EntropyUpperCutoff.is_percentage()) << "\n" << "+ }, second argument to option \"--entropy-cutoff\"\n" << "+ UseHardMask = " << enblend::stringOfBool(UseHardMask) << ", option \"--hard-mask\" or \"--soft-mask\"\n" << "+ SaveMasks = " << enblend::stringOfBool(SaveMasks) << ", option \"--save-masks\"\n" << "+ SoftMaskTemplate = <" << SoftMaskTemplate << ">, first argument to option \"--save-masks\"\n" << "+ HardMaskTemplate = <" << HardMaskTemplate << ">, second argument to option \"--save-masks\"\n" << "+ OutputCompression = <" << OutputCompression << ">, option \"--compression\"\n" << "+ OutputPixelType = <" << OutputPixelType << ">, option \"--depth\"\n" << "+ end of global variable dump\n"; } /** Print information on the current version and some configuration * details. */ void printVersionAndExit() { std::cout << "enfuse " << VERSION << "\n\n"; if (Verbose >= VERBOSE_VERSION_REPORTING) { std::cout << "Extra feature: dmalloc support: " << #ifdef DMALLOC "yes" << #else "no" << #endif "\n"; #ifdef CACHE_IMAGES std::cout << "Extra feature: image cache: yes\n"; { #ifdef WIN32 char lpPathBuffer[MAX_PATH]; const DWORD dwRetVal = GetTempPath(MAX_PATH, lpPathBuffer); if (dwRetVal <= MAX_PATH && dwRetVal != 0) { std::cout << " - cache file located in \"" << lpPathBuffer << "\"\n"; } #else const char* tmpdir = getenv("TMPDIR"); std::cout << " - environment variable TMPDIR "; if (tmpdir == NULL) { std::cout << "not set, cache file in default directory \"/tmp\"\n"; } else { std::cout << "set, cache file located in \"" << tmpdir << "\"\n"; } #endif } #else std::cout << "Extra feature: image cache: no\n"; #endif #ifdef OPENMP const bool have_nested = have_openmp_nested(); const bool have_dynamic = have_openmp_dynamic(); std::cout << "Extra feature: OpenMP: yes\n" << " - version " << OPENMP_YEAR << '-' << OPENMP_MONTH << "\n" << " - " << (have_nested ? "" : "no ") << "support for nested parallelism;\n" << " nested parallelism " << (have_nested && omp_get_nested() ? "enabled" : "disabled") << " by default\n" << " - " << (have_dynamic ? "" : "no ") << "support for dynamic adjustment of the number of threads;\n" << " dynamic adjustment " << (have_dynamic && omp_get_dynamic() ? "enabled" : "disabled") << " by default\n" << " - using " << omp_get_num_procs() << " processor" << (omp_get_num_procs() >= 2 ? "s" : "") << " and up to " << omp_get_max_threads() << " thread" << (omp_get_max_threads() >= 2 ? "s" : "") << "\n"; #else std::cout << "Extra feature: OpenMP: no\n"; #endif std::cout << "\n" << "Supported image formats: " << vigra::impexListFormats() << "\n" << "Supported file extensions: " << vigra::impexListExtensions() << "\n\n"; std::cout << "Supported following globbing algorithms:\n"; const enblend::algorithm_list algos = enblend::known_globbing_algorithms(); for (enblend::algorithm_list::const_iterator i = algos.begin(); i != algos.end(); ++i) { std::cout << " " << i->first << "\n" << " " << i->second << "\n"; } std::cout << "\n"; } if (Verbose >= VERBOSE_SIGNATURE_REPORTING) { std::cout.flush(); std::wcout << sig.message() << L"\n\n"; std::wcout.flush(); } std::cout << "Copyright (C) 2004-2012 Andrew Mihal.\n" << "License GPLv2+: GNU GPL version 2 or later \n" << "This is free software: you are free to change and redistribute it.\n" << "There is NO WARRANTY, to the extent permitted by law.\n" << "\n" << "Written by Andrew Mihal and others." << endl; exit(0); } /** Print the usage information and quit. */ void printUsageAndExit(const bool error = true) { std::cout << "Usage: enfuse [options] [--output=IMAGE] INPUT...\n" << "Fuse INPUT images into a single IMAGE.\n" << "\n" << "INPUT... are image filenames or response filenames. Response\n" << "filenames start with an \"" << RESPONSE_FILE_PREFIX_CHAR << "\" character.\n" "\n" << "Common options:\n" << " -V, --version output version information and exit\n" << " -h, --help print this help message and exit\n" << " -l, --levels=LEVELS limit number of blending LEVELS to use (1 to " << MAX_PYRAMID_LEVELS << ");\n" << " negative number of LEVELS decreases maximum;\n" << " \"auto\" restores the default automatic maximization\n" << " -o, --output=FILE write output to FILE; default: \"" << OutputFileName << "\"\n" << " -v, --verbose[=LEVEL] verbosely report progress; repeat to\n" << " increase verbosity or directly set to LEVEL\n" << " -w, --wrap[=MODE] wrap around image boundary, where MODE is \"none\",\n" << " \"horizontal\", \"vertical\", or \"both\"; default: " << enblend::stringOfWraparound(WrapAround) << ";\n" << " without argument the option selects horizontal wrapping\n" << " --compression=COMPRESSION\n" << " set compression of output image to COMPRESSION,\n" << " where COMPRESSION is:\n" << " \"deflate\", \"jpeg\", \"lzw\", \"none\", \"packbits\", for TIFF files and\n" << " 0 to 100, or \"jpeg\", \"jpeg-arith\" for JPEG files,\n" << " where \"jpeg\" and \"jpeg-arith\" accept a compression level\n" << " --layer-selector=ALGORITHM\n" << " set the layer selector ALGORITHM;\n" << " default: \"" << LayerSelection.name() << "\"; available algorithms are:\n"; for (selector::algorithm_list::const_iterator i = selector::algorithms.begin(); i != selector::algorithms.end(); ++i) { std::cout << " \"" << (*i)->name() << "\": " << (*i)->description() << "\n"; } std::cout << " --parameter=KEY1[=VALUE1][:KEY2[=VALUE2][:...]]\n" << " set one or more KEY-VALUE pairs\n" << "\n" << "Extended options:\n" << " -b BLOCKSIZE image cache BLOCKSIZE in kilobytes; default: " << (vigra_ext::CachedFileImageDirector::v().getBlockSize() / 1024LL) << "KB\n" << " -c, --ciecam use CIECAM02 to blend colors; disable with\n" << " \"--no-ciecam\"\n" << " --fallback-profile=PROFILE-FILE\n" << " use the ICC profile from PROFILE-FILE instead of sRGB\n" << " -d, --depth=DEPTH set the number of bits per channel of the output\n" << " image, where DEPTH is \"8\", \"16\", \"32\", \"r32\", or \"r64\"\n" << " -g associated-alpha hack for Gimp (before version 2)\n" << " and Cinepaint\n" << " -f WIDTHxHEIGHT[+xXOFFSET+yYOFFSET]\n" << " manually set the size and position of the output\n" << " image; useful for cropped and shifted input\n" << " TIFF images, such as those produced by Nona\n" << " -m CACHESIZE set image CACHESIZE in megabytes; default: " << (vigra_ext::CachedFileImageDirector::v().getAllocation() / 1048576LL) << "MB\n" << "\n" << "Fusion options:\n" << " --exposure-weight=WEIGHT\n" << " weight given to well-exposed pixels\n" << " (0 <= WEIGHT <= 1); default: " << WExposure << "\n" << " --saturation-weight=WEIGHT\n" << " weight given to highly-saturated pixels\n" << " (0 <= WEIGHT <= 1); default: " << WSaturation << "\n" << " --contrast-weight=WEIGHT\n" << " weight given to pixels in high-contrast neighborhoods \n" << " (0 <= WEIGHT <= 1); default: " << WContrast << "\n" << " --entropy-weight=WEIGHT\n" << " weight given to pixels in high entropy neighborhoods\n" << " (0 <= WEIGHT <= 1); default: " << WEntropy << "\n" << " --exposure-mu=MEAN center also known as MEAN of Gaussian weighting\n" << " function (0 <= MEAN <= 1); default: " << WMu << "\n" << " --exposure-sigma=SIGMA\n" << " standard deviation of Gaussian weighting\n" << " function (SIGMA > 0); default: " << WSigma << "\n" << " --soft-mask average over all masks; this is the default\n" << " --hard-mask force hard blend masks and no averaging on finest\n" << " scale; this is especially useful for focus\n" << " stacks with thin and high contrast features,\n" << " but leads to increased noise\n" << "\n" << "Expert options:\n" << " --exposure-cutoff=LOWERCUTOFF[:UPPERCUTOFF[:LOWERPROJECTOR[:UPPERPROJECTOR]]]\n" << " LOWERCUTOFF and UPPERCUTOFF are the values below\n" << " or above of which pixels are weighted with zero\n" << " weight in exposure weighting; append \"%\" signs\n" << " for relative values; default: " << ExposureLowerCutoff.str() << ":" << ExposureUpperCutoff.str() << ":" << ExposureLowerCutoffGrayscaleProjector << ":" << ExposureUpperCutoffGrayscaleProjector << "\n" << " --contrast-window-size=SIZE\n" << " set window SIZE for local-contrast analysis\n" << " (SIZE >= 3); default: " << ContrastWindowSize << "\n" << " --gray-projector=PROJECTOR\n" << " apply gray-scale PROJECTOR in exposure or contrast\n" << " weighing, where PROJECTOR is one of \"anti-value\",\n" << " \"average\", \"l-star\", \"lightness\", \"luminance\",\n" << " \"pl-star\", \"value\", or\n" << " \"channel-mixer:RED-WEIGHT:GREEN-WEIGHT:BLUE-WEIGHT\";\n" << " default: \"" << enblend::MultiGrayscaleAccessor::Promote>::defaultGrayscaleAccessorName() << "\"\n" << " --contrast-edge-scale=EDGESCALE[:LCESCALE[:LCEFACTOR]]\n" << " set scale on which to look for edges; positive\n" << " LCESCALE switches on local contrast enhancement\n" << " by LCEFACTOR (EDGESCALE, LCESCALE, LCEFACTOR >= 0);\n" << " append \"%\" to LCESCALE for values relative to\n" << " EDGESCALE; append \"%\" to LCEFACTOR for relative\n" << " value; default: " << FilterConfig.edgeScale << ":" << FilterConfig.lceScale << ":" << FilterConfig.lceFactor << "\n" << " --contrast-min-curvature=CURVATURE\n" << " minimum CURVATURE for an edge to qualify; append\n" << " \"%\" for relative values; default: " << MinCurvature.str() << "\n" << " --entropy-window-size=SIZE\n" << " set window SIZE for local entropy analysis\n" << " (SIZE >= 3); default: " << EntropyWindowSize << "\n" << " --entropy-cutoff=LOWERCUTOFF[:UPPERCUTOFF]\n" << " LOWERCUTOFF is the value below of which pixels are\n" << " treated as black and UPPERCUTOFF is the value above\n" << " of which pixels are treated as white in the entropy\n" << " weighting; append \"%\" signs for relative values;\n" << " default: " << EntropyLowerCutoff.str() << ":" << EntropyUpperCutoff.str() << "\n" << " --save-masks[=SOFT-TEMPLATE[:HARD-TEMPLATE]]\n" << " save weight masks in SOFT-TEMPLATE and HARD-TEMPLATE;\n" << " conversion chars: \"%i\": mask index, \"%n\": mask number,\n" << " \"%p\": full path, \"%d\": dirname, \"%b\": basename,\n" << " \"%f\": filename, \"%e\": extension; lowercase characters\n" << " refer to input images uppercase to the output image\n" << " default: \"" << SoftMaskTemplate << "\":\"" << HardMaskTemplate << "\"\n" << " --load-masks[=SOFT-TEMPLATE[:HARD-TEMPLATE]]\n" << " skip calculation of weight maps and use the ones \n" << " in the files matching the templates instead. These\n" << " can be either hard or soft masks. For template\n" << " syntax see \"--save-masks\";\n" << " default: \"" << SoftMaskTemplate << "\":\"" << HardMaskTemplate << "\"\n" << "\n" << "Enfuse accepts arguments to any option in uppercase as\n" << "well as in lowercase letters.\n" << "\n" << "Report bugs at <" PACKAGE_BUGREPORT ">." << endl; exit(error ? 1 : 0); } void cleanup_output(void) { #if DEBUG std::cout << "+ cleanup_output\n"; #endif if (!OutputIsValid) { std::cerr << command << ": info: remove invalid output image \"" << OutputFileName << "\"\n"; errno = 0; if (unlink(OutputFileName.c_str()) != 0) { std::cerr << command << ": warning: could not remove invalid output image \"" << OutputFileName << "\": " << enblend::errorMessage(errno) << "\n"; } } } /** Make sure all cached file images get destroyed, and hence the * temporary files deleted, if we are killed. */ void sigint_handler(int sig) { std::cerr << endl << command << ": interrupted" << endl; cleanup_output(); #if !defined(__GW32C__) && !defined(_WIN32) struct sigaction action; action.sa_handler = SIG_DFL; sigemptyset(&(action.sa_mask)); sigaction(sig, &action, NULL); #else signal(sig, SIG_DFL); #endif raise(sig); } enum AllPossibleOptions { VersionOption, HelpOption, LevelsOption, OutputOption, VerboseOption, WrapAroundOption /* -w */, CompressionOption, LZWCompressionOption, BlockSizeOption, CIECAM02Option, NoCIECAM02Option, FallbackProfileOption, DepthOption, AssociatedAlphaOption /* -g */, SizeAndPositionOption /* -f */, CacheSizeOption, ExposureWeightOption, ExposureCutoffOption, SaturationWeightOption, ContrastWeightOption, EntropyWeightOption, ExposureMuOption /* --contrast-mu */, ExposureSigmaOption /* --contrast-sigma */, SoftMaskOption, HardMaskOption, ContrastWindowSizeOption, GrayProjectorOption, EdgeScaleOption, MinCurvatureOption, EntropyWindowSizeOption, EntropyCutoffOption, DebugOption, SaveMasksOption, LoadMasksOption, LayerSelectorOption }; typedef std::set OptionSetType; bool contains(const OptionSetType& optionSet, enum AllPossibleOptions anOption) { return optionSet.count(anOption) != 0; } /** Warn if options given at the command line have no effect. */ void warn_of_ineffective_options(const OptionSetType& optionSet) { if (contains(optionSet, LoadMasksOption)) { if (contains(optionSet, ExposureWeightOption)) { std::cerr << command << ": warning: option \"--exposure-weight\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, ExposureCutoffOption)) { std::cerr << command << ": warning: option \"--exposure-cutoff\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, SaturationWeightOption)) { std::cerr << command << ": warning: option \"--saturation-weight\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, ContrastWeightOption)) { std::cerr << command << ": warning: option \"--contrast-weight\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, EntropyWeightOption)) { std::cerr << command << ": warning: option \"--entropy-weight\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, ExposureMuOption)) { std::cerr << command << ": warning: option \"--exposure-mu\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, ExposureSigmaOption)) { std::cerr << command << ": warning: option \"--exposure-sigma\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, ContrastWindowSizeOption)) { std::cerr << command << ": warning: option \"--contrast-window-size\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, GrayProjectorOption)) { std::cerr << command << ": warning: option \"--gray-projector\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, EdgeScaleOption)) { std::cerr << command << ": warning: option \"--contrast-edge-scale\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, MinCurvatureOption)) { std::cerr << command << ": warning: option \"--contrast-min-curvature\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, EntropyWindowSizeOption)) { std::cerr << command << ": warning: option \"--entropy-window-size\" has no effect with \"--load-masks\"" << endl; } if (contains(optionSet, EntropyCutoffOption)) { std::cerr << command << ": warning: option \"--entropy-cutoff\" has no effect with \"--load-masks\"" << endl; } } if (contains(optionSet, SaveMasksOption) && !contains(optionSet, OutputOption)) { if (contains(optionSet, LevelsOption)) { std::cerr << command << ": warning: option \"--levels\" has no effect with \"--save-masks\" and no \"--output\"" << endl; } if (contains(optionSet, WrapAroundOption)) { std::cerr << command << ": warning: option \"--wrap\" has no effect with \"--save-masks\" and no \"--output\"" << endl; } if (contains(optionSet, CompressionOption)) { std::cerr << command << ": warning: option \"--compression\" has no effect with \"--save-masks\" and no \"--output\"" << endl; } if (contains(optionSet, DepthOption)) { std::cerr << command << ": warning: option \"--depth\" has no effect with \"--save-masks\" and no \"--output\"" << endl; } if (contains(optionSet, SizeAndPositionOption)) { std::cerr << command << ": warning: option \"-f\" has no effect with \"--save-masks\" and no \"--output\"" << endl; } } if (WExposure == 0.0 && contains(optionSet, ExposureWeightOption)) { if (contains(optionSet, ExposureMuOption)) { std::cerr << command << ": warning: option \"--exposure-mu\" has no effect as exposure weight\n" << command << ": warning: is zero" << endl; } if (contains(optionSet, ExposureSigmaOption)) { std::cerr << command << ": warning: option \"--exposure-sigma\" has no effect as exposure weight\n" << command << ": warning: is zero" << endl; } } if (WExposure == 0.0 && contains(optionSet, ExposureCutoffOption)) { std::cerr << command << ": warning: option \"--exposure-cutoff\" has no effect as exposure weight\n" << command << ": warning: is zero" << endl; } if (WContrast == 0.0 && contains(optionSet, ContrastWindowSizeOption)) { std::cerr << command << ": warning: option \"--contrast-window-size\" has no effect as contrast\n" << command << ": warning: weight is zero" << endl; } if (WExposure == 0.0 && WContrast == 0.0 && contains(optionSet, GrayProjectorOption)) { std::cerr << command << ": warning: option \"--gray-projector\" has no effect as exposure\n" << command << ": warning: and contrast weight both are zero" << endl; } if (WContrast == 0.0) { if (contains(optionSet, EdgeScaleOption)) { std::cerr << command << ": warning: option \"--contrast-edge-scale\" has no effect as contrast\n" << command << ": warning: weight is zero" << endl; } if (contains(optionSet, MinCurvatureOption)) { std::cerr << command << ": warning: option \"--contrast-min-curvature\" has no effect as contrast\n" << command << ": warning: weight is zero" << endl; } } else { if (FilterConfig.edgeScale > 0.0 && contains(optionSet, ContrastWindowSizeOption) && MinCurvature.value() <= 0.0) { std::cerr << command << ": warning: option \"--contrast-window-size\" has no effect as\n" << command << ": warning: EDGESCALE in \"--contrast-edge-scale\" is positive and" << command << ": warning: \"--contrast-min-curvature\" is non-positive" << endl; } } if (WEntropy == 0.0) { if (contains(optionSet, EntropyWindowSizeOption)) { std::cerr << command << ": warning: option \"--entropy-window-size\" has no effect as\n" << command << ": warning: entropy weight is zero" << endl; } if (contains(optionSet, EntropyCutoffOption)) { std::cerr << command << ": warning: option \"--entropy-cutoff\" has no effect as entropy\n" << command << ": warning: weight is zero" << endl; } } if (contains(optionSet, CompressionOption) && !(enblend::getFileType(OutputFileName) == "TIFF" || enblend::getFileType(OutputFileName) == "JPEG")) { std::cerr << command << ": warning: compression is not supported with output\n" << command << ": warning: file type \"" << enblend::getFileType(OutputFileName) << "\"" << endl; } if (contains(optionSet, AssociatedAlphaOption) && enblend::getFileType(OutputFileName) != "TIFF") { std::cerr << command << ": warning: option \"-g\" has no effect with output\n" << command << ": warning: file type \"" << enblend::getFileType(OutputFileName) << "\"" << endl; } #ifndef CACHE_IMAGES if (contains(optionSet, CacheSizeOption)) { std::cerr << command << ": warning: option \"-m\" has no effect in this " << command << " binary,\n" << command << ": warning: because it was compiled without image cache" << endl; } if (contains(optionSet, BlockSizeOption)) { std::cerr << command << ": warning: option \"-b\" has no effect in this " << command << " binary,\n" << command << ": warning: because it was compiled without image cache" << endl; } #endif } void fill_mask_templates(const char* an_option_argument, std::string& a_soft_mask_template, std::string& a_hard_mask_template, const std::string& an_option_name) { if (an_option_argument != NULL && *an_option_argument != 0) { char* s = new char[strlen(an_option_argument) + 1]; strcpy(s, an_option_argument); char* save_ptr = NULL; char* token = enblend::strtoken_r(s, PATH_OPTION_DELIMITERS, &save_ptr); a_soft_mask_template = token; token = enblend::strtoken_r(NULL, PATH_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { a_hard_mask_template = token; } token = enblend::strtoken_r(NULL, PATH_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { std::cerr << command << ": warning: ignoring trailing garbage in \"" << an_option_name << "\"" << endl; } delete [] s; } } int process_options(int argc, char** argv) { enum OptionId { OPTION_ID_OFFSET = 1023, // Ids start at 1024 CompressionId, WeightExposureId, WeightContrastId, WeightSaturationId, WeightMuId, WeightSigmaId, MinCurvatureId, EdgeScaleId, ContrastWindowSizeId, HardMaskId, GrayProjectorId, WeightEntropyId, EntropyWindowSizeId, EntropyCutoffId, SoftMaskId, VerboseId, HelpId, VersionId, DepthId, OutputId, SaveMasksId, WrapAroundId, LevelsId, CiecamId, NoCiecamId, FallbackProfileId, ExposureCutoffId, LoadMasksId, LayerSelectorId, ParameterId, NoParameterId }; static struct option long_options[] = { {"compression", required_argument, 0, CompressionId}, {"exposure-weight", required_argument, 0, WeightExposureId}, {"contrast-weight", required_argument, 0, WeightContrastId}, {"saturation-weight", required_argument, 0, WeightSaturationId}, {"exposure-mu", required_argument, 0, WeightMuId}, {"exposure-sigma", required_argument, 0, WeightSigmaId}, {"contrast-min-curvature", required_argument, 0, MinCurvatureId}, {"contrast-edge-scale", required_argument, 0, EdgeScaleId}, {"contrast-window-size", required_argument, 0, ContrastWindowSizeId}, {"hard-mask", no_argument, 0, HardMaskId}, {"gray-projector", required_argument, 0, GrayProjectorId}, {"entropy-weight", required_argument, 0, WeightEntropyId}, {"entropy-window-size", required_argument, 0, EntropyWindowSizeId}, {"entropy-cutoff", required_argument, 0, EntropyCutoffId}, {"soft-mask", no_argument, 0, SoftMaskId}, {"verbose", optional_argument, 0, VerboseId}, {"help", no_argument, 0, HelpId}, {"version", no_argument, 0, VersionId}, {"depth", required_argument, 0, DepthId}, {"output", required_argument, 0, OutputId}, {"save-mask", optional_argument, 0, SaveMasksId}, // singular form: not documented, not deprecated {"save-masks", optional_argument, 0, SaveMasksId}, {"wrap", optional_argument, 0, WrapAroundId}, {"levels", required_argument, 0, LevelsId}, {"ciecam", no_argument, 0, CiecamId}, {"no-ciecam", no_argument, 0, NoCiecamId}, {"fallback-profile", required_argument, 0, FallbackProfileId}, {"exposure-cutoff", required_argument, 0, ExposureCutoffId}, {"load-mask", optional_argument, 0, LoadMasksId}, // singular form: not documented, not deprecated {"load-masks", optional_argument, 0, LoadMasksId}, {"layer-selector", required_argument, 0, LayerSelectorId}, {"parameter", required_argument, 0, ParameterId}, {"no-parameter", required_argument, 0, NoParameterId}, {0, 0, 0, 0} }; bool failed = false; bool justPrintVersion = false; bool justPrintUsage = false; OptionSetType optionSet; opterr = 0; // we have our own "unrecognized option" message while (true) { int option_index; const int code = getopt_long(argc, argv, "Vb:cd:f:ghl:m:o:v::w::", long_options, &option_index); if (code == -1) { break; } switch (code) { case HardMaskId: UseHardMask = true; optionSet.insert(HardMaskOption); break; case SoftMaskId: UseHardMask = false; optionSet.insert(SoftMaskOption); break; case 'h': // FALLTHROUGH case HelpId: justPrintUsage = true; optionSet.insert(HelpOption); break; case 'V': // FALLTHROUGH case VersionId: justPrintVersion = true; optionSet.insert(VersionOption); break; case 'w': // FALLTHROUGH case WrapAroundId: if (optarg != NULL && *optarg != 0) { WrapAround = enblend::wraparoundOfString(optarg); if (WrapAround == UnknownWrapAround) { std::cerr << command << ": unrecognized wrap-around mode \"" << optarg << "\"\n" << endl; failed = true; } } else { WrapAround = HorizontalStrip; } optionSet.insert(WrapAroundOption); break; case MinCurvatureId: { char *tail; errno = 0; MinCurvature.set_value(strtod(optarg, &tail)); if (errno == 0) { if (*tail == 0) { MinCurvature.set_percentage(false); } else if (strcmp(tail, "%") == 0) { MinCurvature.set_percentage(true); } else { std::cerr << command << ": unrecognized minimum gradient \"" << optarg << "\" specification." << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << optarg << "\" for minimum gradient: " << enblend::errorMessage(errno) << endl; failed = true; } optionSet.insert(MinCurvatureOption); break; } case EdgeScaleId: { char* s = new char[strlen(optarg) + 1]; strcpy(s, optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s, NUMERIC_OPTION_DELIMITERS, &save_ptr); char* tail; if (token == NULL || *token == 0) { std::cerr << command << ": no scale given to \"--contrast-edge-scale\". " << "scale is required." << endl; failed = true; } else { errno = 0; FilterConfig.edgeScale = strtod(token, &tail); if (errno == 0) { if (*tail != 0) { std::cerr << command << ": could not decode \"" << tail << "\" in edge scale specification \"" << token << "\" for edge scale." << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" for edge scale: " << enblend::errorMessage(errno) << endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; FilterConfig.lceScale = strtod(token, &tail); if (errno == 0) { if (strcmp(tail, "%") == 0) { FilterConfig.lceScale *= FilterConfig.edgeScale / 100.0; } else if (*tail != 0) { std::cerr << command << ": could not decode \"" << tail << "\" in specification \"" << token << "\" for LCE-scale." << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" for LCE-Scale: " << enblend::errorMessage(errno) << endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; FilterConfig.lceFactor = strtod(token, &tail); if (errno == 0) { if (strcmp(tail, "%") == 0) { FilterConfig.lceFactor /= 100.0; } else if (*tail != 0) { std::cerr << command << ": could not decode \"" << tail << "\" in specification \"" << token << "\" for LCE-factor." << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" for LCE-factor: " << enblend::errorMessage(errno) << endl; failed = true; } } if (save_ptr != NULL && *save_ptr != 0) { std::cerr << command << ": warning: ignoring trailing garbage \"" << save_ptr << "\" in argument to \"--contrast-edge-scale\"" << endl; } delete [] s; optionSet.insert(EdgeScaleOption); break; } case EntropyCutoffId: { char* s = new char[strlen(optarg) + 1]; strcpy(s, optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s, NUMERIC_OPTION_DELIMITERS, &save_ptr); char* tail; if (token == NULL || *token == 0) { std::cerr << command << ": no scale given to \"--entropy-cutoff\". " << "lower cutoff is required." << endl; failed = true; } else { errno = 0; EntropyLowerCutoff.set_value(strtod(token, &tail)); if (errno == 0) { if (*tail == 0) { EntropyLowerCutoff.set_percentage(false); } else if (strcmp(tail, "%") == 0) { EntropyLowerCutoff.set_percentage(true); } else { std::cerr << command << ": unrecognized entropy's lower cutoff \"" << tail << "\" in \"" << token << "\"" << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of entropy's lower cutoff: " << enblend::errorMessage(errno) << endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; EntropyUpperCutoff.set_value(strtod(token, &tail)); if (errno == 0) { if (*tail == 0) { EntropyUpperCutoff.set_percentage(false); } else if (strcmp(tail, "%") == 0) { EntropyUpperCutoff.set_percentage(true); } else { std::cerr << command << ": unrecognized entropy's upper cutoff \"" << tail << "\" in \"" << token << "\"" << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of entropy's upper cutoff: " << enblend::errorMessage(errno) << endl; failed = true; } } if (save_ptr != NULL && *save_ptr != 0) { std::cerr << command << ": warning: ignoring trailing garbage \"" << save_ptr << "\" in argument to \"--entropy-cutoff\"" << endl; } delete [] s; optionSet.insert(EntropyCutoffOption); break; } case ExposureCutoffId: { char* s = new char[strlen(optarg) + 1]; strcpy(s, optarg); char* save_ptr = NULL; char* token = enblend::strtoken_r(s, NUMERIC_OPTION_DELIMITERS, &save_ptr); char* tail; if (token == NULL || *token == 0) { std::cerr << command << ": no scale given to \"--exposure-cutoff\". " << "lower cutoff is required." << endl; failed = true; } else { errno = 0; ExposureLowerCutoff.set_value(strtod(token, &tail)); if (errno == 0) { if (*tail == 0) { ExposureLowerCutoff.set_percentage(false); } else if (strcmp(tail, "%") == 0) { ExposureLowerCutoff.set_percentage(true); } else { std::cerr << command << ": unrecognized exposure's lower cutoff \"" << tail << "\" in \"" << token << "\"" << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of exposure's lower cutoff: " << enblend::errorMessage(errno) << endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { errno = 0; ExposureUpperCutoff.set_value(strtod(token, &tail)); if (errno == 0) { if (*tail == 0) { ExposureUpperCutoff.set_percentage(false); } else if (strcmp(tail, "%") == 0) { ExposureUpperCutoff.set_percentage(true); } else { std::cerr << command << ": unrecognized exposure's upper cutoff \"" << tail << "\" in \"" << token << "\"" << endl; failed = true; } } else { std::cerr << command << ": illegal numeric format \"" << token << "\" of exposure's upper cutoff: " << enblend::errorMessage(errno) << endl; failed = true; } } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { ExposureLowerCutoffGrayscaleProjector = token; } token = enblend::strtoken_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); if (token != NULL && *token != 0) { ExposureUpperCutoffGrayscaleProjector = token; } if (save_ptr != NULL && *save_ptr != 0) { std::cerr << command << ": warning: ignoring trailing garbage \"" << save_ptr << "\" in argument to \"--exposure-cutoff\"" << endl; } delete [] s; optionSet.insert(ExposureCutoffOption); break; } case CompressionId: if (optarg != NULL && *optarg != 0) { std::string upper_opt(optarg); boost::algorithm::to_upper(upper_opt); if (upper_opt == "NONE") { ; // stick with default } else if (upper_opt == "DEFLATE" || upper_opt == "LZW" || upper_opt == "PACKBITS") { OutputCompression = upper_opt; } else if (upper_opt.find_first_not_of("0123456789") == std::string::npos) { OutputCompression = "JPEG QUALITY=" + upper_opt; } else if (enblend::starts_with(upper_opt, "JPEG") || enblend::starts_with(upper_opt, "JPEG-ARITH")) { const std::string::size_type delimiter_position = upper_opt.find_first_of(NUMERIC_OPTION_DELIMITERS); if (delimiter_position == std::string::npos) { if (upper_opt == "JPEG" || upper_opt == "JPEG-ARITH") { OutputCompression = upper_opt; } else { std::cerr << command << ": trailing garbage in JPEG compression \"" << optarg << "\"" << std::endl; failed = true; } } else { const std::string algorithm(upper_opt.substr(0, delimiter_position)); if (algorithm == "JPEG" || algorithm == "JPEG-ARITH") { const std::string level(upper_opt.substr(delimiter_position + 1U)); if (level.length() >= 1U && level.find_first_not_of("0123456789") == std::string::npos) { upper_opt.replace(delimiter_position, 1U, " QUALITY="); OutputCompression = upper_opt; } else { std::cerr << command << ": invalid JPEG compression level \"" << level << "\"" << std::endl; failed = true; } } else { std::cerr << command << ": unrecognized JPEG compression \"" << optarg << "\"" << std::endl; failed = true; } } } else { std::cerr << command << ": unrecognized compression \"" << optarg << "\"" << std::endl; failed = true; } } else { std::cerr << command << ": option \"--compression\" requires an argument" << std::endl; failed = true; } optionSet.insert(CompressionOption); break; case GrayProjectorId: if (optarg != NULL && *optarg != 0) { GrayscaleProjector = optarg; } else { std::cerr << command << ": option \"--gray-projector\" requires an argument" << endl; failed = true; } optionSet.insert(GrayProjectorOption); break; case 'd': // FALLTHROUGH case DepthId: if (optarg != NULL && *optarg != 0) { OutputPixelType = enblend::outputPixelTypeOfString(optarg); } else { std::cerr << command << ": options \"-d\" or \"--depth\" require arguments" << endl; failed = true; } optionSet.insert(DepthOption); break; case 'o': // FALLTHROUGH case OutputId: if (contains(optionSet, OutputOption)) { std::cerr << command << ": warning: more than one output file specified" << endl; } if (optarg != NULL && *optarg != 0) { OutputFileName = optarg; } else { std::cerr << command << ": options \"-o\" or \"--output\" require arguments" << endl; failed = true; } optionSet.insert(OutputOption); break; case LoadMasksId: fill_mask_templates(optarg, SoftMaskTemplate, HardMaskTemplate, "--load-masks"); LoadMasks = true; optionSet.insert(LoadMasksOption); break; case SaveMasksId: fill_mask_templates(optarg, SoftMaskTemplate, HardMaskTemplate, "--save-masks"); SaveMasks = true; optionSet.insert(SaveMasksOption); break; case WeightExposureId: if (optarg != NULL && *optarg != 0) { WExposure = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-weight-exposure 0 "exposure weight less than 0; will use 0", 0.0, _1 <= 1.0, //< src::maximum-weight-exposure 1 "exposure weight greater than 1; will use 1", 1.0); } else { std::cerr << command << ": option \"--exposure-weight\" requires an argument" << endl; failed = true; } optionSet.insert(ExposureWeightOption); break; case WeightContrastId: if (optarg != NULL && *optarg != 0) { WContrast = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-weight-contrast 0 "contrast weight less than 0; will use 0", 0.0, _1 <= 1.0, //< src::maximum-weight-contrast 1 "contrast weight greater than 1; will use 1", 0.0); } else { std::cerr << command << ": option \"--contrast-weight\" requires an argument" << endl; failed = true; } optionSet.insert(ContrastWeightOption); break; case WeightSaturationId: if (optarg != NULL && *optarg != 0) { WSaturation = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-weight-saturation 0 "saturation weight less than 0; will use 0", 0.0, _1 <= 1.0, //< src::maximum-weight-saturation 1 "saturation weight greater than 1; will use 1", 1.0); } else { std::cerr << command << ": option \"--saturation-weight\" requires an argument" << endl; failed = true; } WSaturationIsDefault = false; optionSet.insert(SaturationWeightOption); break; case WeightMuId: if (optarg != NULL && *optarg != 0) { WMu = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-exposure-mu 0 "exposure center value (mu) less than 0; will use 0", 0.0, _1 <= 1.0, //< src::maximum-exposure-mu 1 "exposure center value (mu) geater than 1; will use 1", 1.0); } else { std::cerr << command << ": option \"--exposure-mu\" requires an argument" << endl; failed = true; } optionSet.insert(ExposureMuOption); break; case WeightSigmaId: if (optarg != NULL && *optarg != 0) { WSigma = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-exposure-sigma 0 "exposure standard deviation (sigma) less than 0; will use 1/1024", 1.0 / 1024.0); } else { std::cerr << command << ": option \"--exposure-sigma\" requires an argument" << endl; failed = true; } optionSet.insert(ExposureSigmaOption); break; case WeightEntropyId: if (optarg != NULL && *optarg != 0) { WEntropy = enblend::numberOfString(optarg, _1 >= 0.0, //< src::minimum-weight-entropy 0 "entropy weight less than 0; will use 0", 0.0, _1 <= 1.0, //< src::maximum-weight-entropy 1 "entropy weight greater than 1; will use 1", 1.0); } else { std::cerr << command << ": option \"--entropy-weight\" requires an argument" << endl; failed = true; } optionSet.insert(EntropyWeightOption); break; case 'v': // FALLTHROUGH case VerboseId: if (optarg != NULL && *optarg != 0) { Verbose = enblend::numberOfString(optarg, _1 >= 0, //< src::minimum-verbosity-level 0 "verbosity level less than 0; will use 0", 0); } else { Verbose++; } optionSet.insert(VerboseOption); break; case ContrastWindowSizeId: if (optarg != NULL && *optarg != 0) { ContrastWindowSize = enblend::numberOfString(optarg, _1 >= 3, //< src::minimum-contrast-window-size 3 "contrast window size to small; will use size = 3", 3); if (ContrastWindowSize % 2 != 1) { std::cerr << command << ": warning: contrast window size \"" << ContrastWindowSize << "\" is even; increasing size to next odd number" << endl; ContrastWindowSize++; } } else { std::cerr << command << ": option \"--contrast-window-size\" requires an argument" << endl; failed = true; } optionSet.insert(ContrastWindowSizeOption); break; case EntropyWindowSizeId: if (optarg != NULL && *optarg != 0) { EntropyWindowSize = enblend::numberOfString(optarg, _1 >= 3, //< src::minimum-entropy-window-size 3 "entropy window size to small; will use size = 3", 3); if (EntropyWindowSize % 2 != 1) { std::cerr << command << ": warning: entropy window size \"" << EntropyWindowSize << "\" is even; increasing size to next odd number" << endl; EntropyWindowSize++; } } else { std::cerr << command << ": option \"--entropy-window-size\" requires an argument" << endl; failed = true; } optionSet.insert(EntropyWindowSizeOption); break; case 'b': if (optarg != NULL && *optarg != 0) { const int cache_block_size = enblend::numberOfString(optarg, _1 >= 1, //< src::minimum-cache-block-size 1@dmn{KB} "cache block size must be 1 KB or more; will use 1 KB", 1); vigra_ext::CachedFileImageDirector::v().setBlockSize(static_cast(cache_block_size) << 10); } else { std::cerr << command << ": option \"-b\" requires an argument" << endl; failed = true; } optionSet.insert(BlockSizeOption); break; case 'c': // FALLTHROUGH case CiecamId: UseCIECAM = true; optionSet.insert(CIECAM02Option); break; case NoCiecamId: UseCIECAM = false; optionSet.insert(NoCIECAM02Option); break; case FallbackProfileId: if (enblend::can_open_file(optarg)) { FallbackProfile = cmsOpenProfileFromFile(optarg, "r"); if (FallbackProfile == NULL) { std::cerr << command << ": failed to open fallback ICC profile file \"" << optarg << "\"\n"; exit(1); } } else { exit(1); } optionSet.insert(FallbackProfileOption); break; case 'f': if (optarg != NULL && *optarg != 0) { const int n = sscanf(optarg, "%dx%d+%d+%d", &OutputWidthCmdLine, &OutputHeightCmdLine, &OutputOffsetXCmdLine, &OutputOffsetYCmdLine); if (n == 4) { ; // ok: full geometry string } else if (n == 2) { OutputOffsetXCmdLine = 0; OutputOffsetYCmdLine = 0; } else { std::cerr << command << ": option \"-f\" requires 2 or 4 arguments" << endl; failed = true; } } else { std::cerr << command << ": option \"-f\" requires 2 or 4 arguments" << endl; failed = true; } OutputSizeGiven = true; optionSet.insert(SizeAndPositionOption); break; case 'g': GimpAssociatedAlphaHack = true; optionSet.insert(AssociatedAlphaOption); break; case 'l': // FALLTHROUGH case LevelsId: if (optarg != NULL && *optarg != 0) { std::string levels(optarg); boost::algorithm::to_upper(levels); if (levels == "AUTO" || levels == "AUTOMATIC") { ExactLevels = 0; } else if (levels.find_first_not_of("+-0123456789") != std::string::npos) { std::cerr << command << ": options \"-l\" or \"--levels\" require an integer argument or \"auto\"" << endl; failed = true; } else { std::ostringstream oss; oss << "cannot use more than " << MAX_PYRAMID_LEVELS << " pyramid levels; will use at most " << MAX_PYRAMID_LEVELS << " levels"; ExactLevels = enblend::numberOfString(optarg, _1 != 0, "cannot blend with zero levels; will use one level", 1, _1 <= MAX_PYRAMID_LEVELS, oss.str(), MAX_PYRAMID_LEVELS); } } else { std::cerr << command << ": options \"-l\" or \"--levels\" require an argument" << endl; failed = true; } optionSet.insert(LevelsOption); break; case 'm': if (optarg != NULL && *optarg != 0) { const int cache_size = enblend::numberOfString(optarg, _1 >= 1, //< src::minimum-cache-size 1@dmn{MB} "cache memory limit less than 1 MB; will use 1 MB", 1); vigra_ext::CachedFileImageDirector::v().setAllocation(static_cast(cache_size) << 20); } else { std::cerr << command << ": option \"-m\" requires an argument" << endl; failed = true; } optionSet.insert(CacheSizeOption); break; case LayerSelectorId: { selector::algorithm_list::const_iterator selector = selector::find_by_name(optarg); if (selector != selector::algorithms.end()) { LayerSelection.set_selector(*selector); } else { std::cerr << command << ": unknown selector algorithm \"" << optarg << "\""; exit(1); } optionSet.insert(LayerSelectorOption); break; } case ParameterId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = strtok_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); while (token != NULL) { std::string key; std::string value; char* delimiter = strpbrk(token, ASSIGNMENT_CHARACTERS); if (delimiter == NULL) { key = token; } else { key = std::string(token, delimiter); value = delimiter + 1; } boost::trim(key); boost::trim(value); if (enblend::parameter::is_valid_identifier(key)) { Parameter.insert(parameter_map::value_type(key, ParameterValue(value))); } else { std::cerr << command << ": warning: key \"" << key << "\" of pair \"" << token << "\" is not a valid identifier; ignoring\n"; } token = strtok_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); } break; } case NoParameterId: { boost::scoped_ptr s(new char[strlen(optarg) + 1]); strcpy(s.get(), optarg); char* save_ptr = NULL; char* token = strtok_r(s.get(), NUMERIC_OPTION_DELIMITERS, &save_ptr); while (token != NULL) { std::string key(token); boost::trim(key); if (key == "*") { Parameter.clear(); } else if (enblend::parameter::is_valid_identifier(key)) { Parameter.erase(key); } else { std::cerr << command << ": warning: key \"" << key << "\" is not a valid identifier; ignoring\n"; } token = strtok_r(NULL, NUMERIC_OPTION_DELIMITERS, &save_ptr); } break; } case '?': switch (optopt) { case 0: // unknown long option std::cerr << command << ": unknown option \"" << argv[optind - 1] << "\"\n"; break; case 'b': // FALLTHROUGH case 'd': // FALLTHROUGH case 'f': // FALLTHROUGH case 'l': // FALLTHROUGH case 'm': // FALLTHROUGH case 'o': std::cerr << command << ": option \"-" << static_cast(optopt) << "\" requires an argument" << endl; break; default: std::cerr << command << ": unknown option "; if (isprint(optopt)) { std::cerr << "\"-" << static_cast(optopt) << "\""; } else { std::cerr << "character 0x" << std::hex << optopt; } std::cerr << endl; } std::cerr << "Try \"enfuse --help\" for more information." << endl; exit(1); default: std::cerr << command << ": internal error: unhandled command line option" << endl; exit(1); } } if (contains(optionSet, SaveMasksOption) && contains(optionSet, LoadMasksOption)) { std::cerr << command << ": options \"--load-masks\" and \"--save-masks\" are mutually exclusive" << endl; failed = true; } if (failed) { exit(1); } if (justPrintUsage) { printUsageAndExit(false); // never reached } if (justPrintVersion) { printVersionAndExit(); // never reached } StopAfterMaskGeneration = contains(optionSet, SaveMasksOption) && !contains(optionSet, OutputOption); warn_of_ineffective_options(optionSet); return optind; } int main(int argc, char** argv) { #ifdef _MSC_VER // Make sure the FPU is set to rounding mode so that the lrint // functions in float_cast.h will work properly. // See changes in vigra numerictraits.hxx _controlfp(_RC_NEAR, _MCW_RC); #else fesetround(FE_TONEAREST); #endif #ifndef _WIN32 sigemptyset(&SigintMask); sigaddset(&SigintMask, SIGINT); struct sigaction action; action.sa_handler = sigint_handler; sigemptyset(&(action.sa_mask)); sigaction(SIGINT, &action, NULL); #else signal(SIGINT, sigint_handler); #endif if (atexit(cleanup_output) != 0) { std::cerr << command << ": warning: could not install cleanup routine\n"; } sig.initialize(); gsl_set_error_handler_off(); TIFFSetWarningHandler(tiff_warning); TIFFSetErrorHandler(tiff_error); //< src::layer-selector all-layers LayerSelection.set_selector(*selector::find_by_id(selector::AllLayersId)); if (!getopt_long_works_ok()) { std::cerr << command << ": cannot reliably parse command line; giving up\n"; exit(1); } int optind; try { optind = process_options(argc, argv); } catch (vigra::StdException& e) { std::cerr << command << ": error while processing command line options\n" << command << ": " << e.what() << endl; exit(1); } enblend::TraceableFileNameList inputTraceableFileNameList; // Remaining parameters are input files. while (optind < argc) { enblend::TraceableFileNameList files; enblend::unfold_filename(files, std::string(argv[optind])); inputTraceableFileNameList.insert(inputTraceableFileNameList.end(), files.begin(), files.end()); optind++; } if (inputTraceableFileNameList.empty()) { std::cerr << command << ": no input files specified\n"; exit(1); } #ifdef DEBUG_DUMP_GLOBAL_VARIABLES DUMP_GLOBAL_VARIABLES(); #endif sig.check(); for (enblend::TraceableFileNameList::iterator i = inputTraceableFileNameList.begin(); i != inputTraceableFileNameList.end(); ++i) { if (!enblend::can_open_file(i->filename())) { i->unroll_trace(); exit(1); } } LayerSelection.retrieve_image_information(inputTraceableFileNameList.begin(), inputTraceableFileNameList.end()); // List of info structures for each input image. std::list imageInfoList; std::list::iterator imageInfoIterator; bool isColor = false; std::string pixelType; TiffResolution resolution; vigra::ImageImportInfo::ICCProfile iccProfile; vigra::Rect2D inputUnion; // Check that all input images have the same parameters. unsigned layer = 0; unsigned layers = 0; enblend::FileNameList inputFileNameList; enblend::TraceableFileNameList::iterator inputFileNameIterator = inputTraceableFileNameList.begin(); while (inputFileNameIterator != inputTraceableFileNameList.end()) { vigra::ImageImportInfo* inputInfo = NULL; std::string filename(inputFileNameIterator->filename()); try { vigra::ImageImportInfo info(filename.c_str()); if (layers == 0) { // OPTIMIZATION: call only once per file layers = info.numImages(); } inputInfo = new vigra::ImageImportInfo(info); inputInfo->setImageIndex(layer); ++layer; } catch (vigra::ContractViolation& exception) { std::cerr << command << ": cannot load image \"" << filename << "\"\n" << command << ": " << exception.what() << "\n"; if (enblend::maybe_response_file(filename)) { std::cerr << command << ": info: Maybe you meant a response file and forgot the initial '" << RESPONSE_FILE_PREFIX_CHAR << "'?\n"; } exit(1); } LayerSelection.set_selector(inputFileNameIterator->selector()); if (LayerSelection.accept(filename, layer)) { if (Verbose >= VERBOSE_LAYER_SELECTION) { std::cerr << command << ": info: layer selector \"" << LayerSelection.name() << "\" accepts\n" << command << ": info: layer " << layer << " of " << layers << " in image \"" << filename << "\"\n"; } // Save this image info in the list. imageInfoList.push_back(inputInfo); inputFileNameList.push_back(filename); if (Verbose >= VERBOSE_INPUT_IMAGE_INFO_MESSAGES) { std::cerr << command << ": info: input image \"" << inputFileNameIterator->filename() << "\" " << layer << '/' << layers << ' '; if (inputInfo->isColor()) { std::cerr << "RGB "; } if (!inputInfo->getICCProfile().empty()) { std::cerr << "ICC "; } std::cerr << inputInfo->getPixelType() << " position=" << inputInfo->getPosition().x << "x" << inputInfo->getPosition().y << " " << "size=" << inputInfo->width() << "x" << inputInfo->height() << endl; } if (inputInfo->numExtraBands() < 1) { // Complain about lack of alpha channel. std::cerr << command << ": info: input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " does not have an alpha channel;\n"; inputFileNameIterator->unroll_trace(); std::cerr << command << ": info: assuming all pixels should contribute to the final image" << endl; } // Get input image's position and size. vigra::Rect2D imageROI(vigra::Point2D(inputInfo->getPosition()), vigra::Size2D(inputInfo->width(), inputInfo->height())); if (inputFileNameIterator == inputTraceableFileNameList.begin()) { // First input image inputUnion = imageROI; isColor = inputInfo->isColor(); pixelType = inputInfo->getPixelType(); resolution = TiffResolution(inputInfo->getXResolution(), inputInfo->getYResolution()); iccProfile = inputInfo->getICCProfile(); if (!iccProfile.empty()) { InputProfile = cmsOpenProfileFromMem(iccProfile.data(), iccProfile.size()); if (InputProfile == NULL) { std::cerr << endl << command << ": error parsing ICC profile data from file \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << endl; inputFileNameIterator->unroll_trace(); exit(1); } } } else { // Second and later images inputUnion |= imageROI; if (isColor != inputInfo->isColor()) { std::cerr << command << ": input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " is " << (inputInfo->isColor() ? "color" : "grayscale") << "\n" << command << ": but previous images are " << (isColor ? "color" : "grayscale") << endl; inputFileNameIterator->unroll_trace(); exit(1); } if (pixelType != inputInfo->getPixelType()) { std::cerr << command << ": input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " has pixel type " << inputInfo->getPixelType() << ",\n" << command << ": but previous images have pixel type " << pixelType << endl; inputFileNameIterator->unroll_trace(); exit(1); } if (resolution != TiffResolution(inputInfo->getXResolution(), inputInfo->getYResolution())) { std::cerr << command << ": info: input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << " has resolution " << inputInfo->getXResolution() << " dpi x " << inputInfo->getYResolution() << " dpi,\n" << command << ": info: but first image has resolution " << resolution.x << " dpi x " << resolution.y << " dpi" << endl; inputFileNameIterator->unroll_trace(); } // IMPLEMENTATION NOTE: Newer Vigra libraries have // ICCProfile::operator==. We substitute STL's equal // function plus some extra checks for the case of empty // profiles. -- cls @ Thu May 27 14:21:57 UTC 2010 if (iccProfile.empty() != inputInfo->getICCProfile().empty() || !std::equal(iccProfile.begin(), iccProfile.end(), inputInfo->getICCProfile().begin())) { vigra::ImageImportInfo::ICCProfile mismatchProfile = inputInfo->getICCProfile(); cmsHPROFILE newProfile = NULL; if (!mismatchProfile.empty()) { newProfile = cmsOpenProfileFromMem(mismatchProfile.data(), mismatchProfile.size()); if (newProfile == NULL) { std::cerr << endl << command << ": error parsing ICC profile data from file \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << endl; inputFileNameIterator->unroll_trace(); exit(1); } } std::cerr << endl << command << ": warning: input image \"" << inputFileNameIterator->filename() << "\"" << enblend::optional_layer_name(layer, layers) << "\n"; inputFileNameIterator->unroll_trace(); std::cerr << command << ": warning: has "; if (newProfile) { std::cerr << "ICC profile \"" << enblend::profileDescription(newProfile) << "\",\n"; } else { std::cerr << "no ICC profile,\n"; } std::cerr << command << ": warning: but first image has "; if (InputProfile) { std::cerr << "ICC profile \"" << enblend::profileDescription(InputProfile) << "\";\n"; } else { std::cerr << "no ICC profile;\n"; } std::cerr << command << ": warning: blending images with different color spaces\n" << command << ": warning: may have unexpected results" << endl; } } } else { if (Verbose >= VERBOSE_LAYER_SELECTION) { std::cerr << command << ": info: layer selector \"" << LayerSelection.name() << "\" rejects\n" << command << ": info: layer " << layer << " of " << layers << " in image \"" << filename << "\"\n"; } } if (layers == 1 || layer == layers) { layer = 0; layers = 0; ++inputFileNameIterator; } else { // We are about to process the next layer in the _same_ // image. The imageInfoList already has been updated, but // inputTraceableFileNameList still lacks the filename. inputTraceableFileNameList.insert(inputFileNameIterator, *inputFileNameIterator); } } // Check that more than one input file was given. if (imageInfoList.size() <= 1) { const size_t n = inputTraceableFileNameList.size(); const size_t m = imageInfoList.size(); if (n > m) { std::cerr << command << ": warning: selector has rejected " << n - m << " out of " << n << " images\n"; } switch (m) { case 0: std::cerr << command << ": no input images given\n"; exit(1); break; case 1: std::cerr << command << ": warning: only one input image given;\n" << command << ": warning: Enfuse needs two or more overlapping input images in order to do\n" << command << ": warning: blending calculations. The output will be the same as the input.\n"; break; } } if (resolution == TiffResolution()) { std::cerr << command << ": warning: no usable resolution found in first image \"" << inputTraceableFileNameList.begin()->filename() << "\";\n" << command << ": warning: will use " << DEFAULT_TIFF_RESOLUTION << " dpi\n"; ImageResolution = TiffResolution(DEFAULT_TIFF_RESOLUTION, DEFAULT_TIFF_RESOLUTION); } else { ImageResolution = resolution; } // Create the Info for the output file. vigra::ImageExportInfo outputImageInfo(OutputFileName.c_str()); if (!StopAfterMaskGeneration) { OutputIsValid = false; // Make sure that inputUnion is at least as big as given by the -f paramater. if (OutputSizeGiven) { inputUnion |= vigra::Rect2D(OutputOffsetXCmdLine, OutputOffsetYCmdLine, OutputOffsetXCmdLine + OutputWidthCmdLine, OutputOffsetYCmdLine + OutputHeightCmdLine); } if (!OutputCompression.empty()) { outputImageInfo.setCompression(OutputCompression.c_str()); } // If not overridden by the command line, the pixel type of the // output image is the same as the input images'. If the pixel // type is not supported by the output format, replace it with the // best match. { const std::string outputFileType = enblend::getFileType(OutputFileName); const std::string neededPixelType = OutputPixelType.empty() ? std::string(pixelType) : OutputPixelType; const std::string bestPixelType = enblend::bestPixelType(outputFileType, neededPixelType); if (neededPixelType != bestPixelType) { std::cerr << command << ": warning: " << (OutputPixelType.empty() ? "deduced" : "requested") << " output pixel type is \"" << neededPixelType << "\", but image type \"" << outputFileType << "\"\n" << command << ": warning: supports \"" << bestPixelType << "\" at best; will use \"" << bestPixelType << "\"" << endl; } outputImageInfo.setPixelType(bestPixelType.c_str()); pixelType = enblend::maxPixelType(pixelType, bestPixelType); } // Set the output image ICC profile outputImageInfo.setICCProfile(iccProfile); if (UseCIECAM == true || (boost::indeterminate(UseCIECAM) && !iccProfile.empty())) { UseCIECAM = true; if (InputProfile == NULL) { std::cerr << command << ": warning: input images do not have ICC profiles;\n"; if (FallbackProfile == NULL) { std::cerr << command << ": warning: assuming sRGB profile" << endl; InputProfile = cmsCreate_sRGBProfile(); } else { std::cerr << command << ": warning: using fallback profile \"" << enblend::profileDescription(FallbackProfile) << "\"" << endl; InputProfile = FallbackProfile; FallbackProfile = NULL; // avoid double freeing } } XYZProfile = cmsCreateXYZProfile(); InputToXYZTransform = cmsCreateTransform(InputProfile, TYPE_RGB_DBL, XYZProfile, TYPE_XYZ_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (InputToXYZTransform == NULL) { std::cerr << command << ": error building color transform from \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\" to XYZ space" << endl; exit(1); } XYZToInputTransform = cmsCreateTransform(XYZProfile, TYPE_XYZ_DBL, InputProfile, TYPE_RGB_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (XYZToInputTransform == NULL) { std::cerr << command << ": error building color transform from XYZ space to \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\"" << endl; exit(1); } // P2 Viewing Conditions: D50, 500 lumens ViewingConditions.whitePoint.X = XYZ_SCALE * cmsD50_XYZ()->X; ViewingConditions.whitePoint.Y = XYZ_SCALE * cmsD50_XYZ()->Y; ViewingConditions.whitePoint.Z = XYZ_SCALE * cmsD50_XYZ()->Z; ViewingConditions.Yb = 20.0; ViewingConditions.La = 31.83; ViewingConditions.surround = AVG_SURROUND; ViewingConditions.D_value = 1.0; CIECAMTransform = cmsCIECAM02Init(NULL, &ViewingConditions); if (!CIECAMTransform) { std::cerr << endl << command << ": error initializing CIECAM02 transform" << endl; exit(1); } cmsCIExyY white_point; if (cmsIsTag(InputProfile, cmsSigMediaWhitePointTag)) { cmsXYZ2xyY(&white_point, (const cmsCIEXYZ*) cmsReadTag(InputProfile, cmsSigMediaWhitePointTag)); if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { double temperature; cmsTempFromWhitePoint(&temperature, &white_point); std::cerr << command << ": info: using white point of input profile at " << temperature << "K" << endl; } } else { memcpy(&white_point, cmsD50_xyY(), sizeof(cmsCIExyY)); if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { double temperature; cmsTempFromWhitePoint(&temperature, &white_point); std::cerr << command << ": info: falling back to predefined (D50) white point at " << temperature << "K" << endl; } } LabProfile = cmsCreateLab2Profile(cmsD50_xyY()); InputToLabTransform = cmsCreateTransform(InputProfile, TYPE_RGB_DBL, LabProfile, TYPE_Lab_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (!InputToLabTransform) { std::cerr << command << ": error building color transform from \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\" to Lab space" << endl; exit(1); } LabToInputTransform = cmsCreateTransform(LabProfile, TYPE_Lab_DBL, InputProfile, TYPE_RGB_DBL, RENDERING_INTENT_FOR_BLENDING, TRANSFORMATION_FLAGS_FOR_BLENDING); if (!LabToInputTransform) { std::cerr << command << ": error building color transform from Lab space to \"" << enblend::profileName(InputProfile) << " " << enblend::profileDescription(InputProfile) << "\"" << endl; exit(1); } } else { if (FallbackProfile != NULL) { std::cerr << command << ": warning: fusing in RGB cube; option \"--fallback-profile\" has no effect" << endl; } } // The size of the output image. if (Verbose >= VERBOSE_INPUT_UNION_SIZE_MESSAGES) { std::cerr << command << ": info: output image size: " << inputUnion << endl; } // Set the output image position and resolution. outputImageInfo.setXResolution(ImageResolution.x); outputImageInfo.setYResolution(ImageResolution.y); outputImageInfo.setPosition(inputUnion.upperLeft()); // Sanity check on the output image file. try { // This seems to be a reasonable way to check if // the output file is going to work after blending // is done. encoder(outputImageInfo); } catch (vigra::StdException& e) { std::cerr << endl << command << ": error opening output file \"" << OutputFileName << "\";\n" << command << ": " << e.what() << endl; exit(1); } if (!OutputPixelType.empty()) { pixelType = enblend::maxPixelType(pixelType, OutputPixelType); } } // Invoke templatized blender. try { if (isColor) { if (pixelType == "UINT8") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #ifndef DEBUG_8BIT_ONLY else if (pixelType == "INT8") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT16") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT16") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT32") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT32") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "FLOAT") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "DOUBLE") enblend::enfuseMain >(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #endif else { std::cerr << command << ": RGB images with pixel type \"" << pixelType << "\" are not supported" << endl; exit(1); } } else { if (!WSaturationIsDefault && (WSaturation != 0.0)) { std::cerr << command << ": warning: \"--WSaturation\" is not applicable to grayscale images;\n" << command << ": warning: this parameter will have no effect" << endl; WSaturation = 0.0; } if (pixelType == "UINT8") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #ifndef DEBUG_8BIT_ONLY else if (pixelType == "INT8") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT16") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT16") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "UINT32") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "INT32") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "FLOAT") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); else if (pixelType == "DOUBLE") enblend::enfuseMain(inputFileNameList, imageInfoList, outputImageInfo, inputUnion); #endif else { std::cerr << command << ": black&white images with pixel type \"" << pixelType << "\" are not supported" << endl; exit(1); } } for (std::list::iterator i = imageInfoList.begin(); i != imageInfoList.end(); ++i) { delete *i; } } catch (std::bad_alloc& e) { std::cerr << endl << command << ": out of memory\n" << command << ": " << e.what() << endl; exit(1); } catch (vigra::StdException& e) { std::cerr << endl << command << ": an exception occured\n" << command << ": " << e.what() << endl; exit(1); } if (FallbackProfile) {cmsCloseProfile(FallbackProfile);} if (LabProfile) {cmsCloseProfile(LabProfile);} if (InputToLabTransform) {cmsCIECAM02Done(InputToLabTransform);} if (LabToInputTransform) {cmsCIECAM02Done(LabToInputTransform);} if (CIECAMTransform) {cmsCIECAM02Done(CIECAMTransform);} if (InputToXYZTransform) {cmsDeleteTransform(InputToXYZTransform);} if (XYZToInputTransform) {cmsDeleteTransform(XYZToInputTransform);} if (XYZProfile) {cmsCloseProfile(XYZProfile);} if (InputProfile) {cmsCloseProfile(InputProfile);} // Success. return 0; } enblend-enfuse-4.1.2+dfsg/src/anneal.h0000644000175100017510000007174512224465706020005 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ANNEAL_H__ #define __ANNEAL_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #ifdef _WIN32 #include #else #include #endif #include #include #include "masktypedefs.h" #include "muopt.h" #ifdef HAVE_LIBGLEW #include "gpu.h" #endif using boost::lambda::bind; using boost::lambda::_1; using boost::lambda::delete_ptr; // Nicol N. Schraudolph // "A Fast, Compact Approximation of the Exponential Function" // Neural Computation, vol. 11, pages 853--862, 1999. #define SCHRAUDOLPH_EXPONENT_A (1048576.0 / M_LN2) #define SCHRAUDOLPH_EXPONENT_A_INT 1512775 inline static double schraudolph_exp(double x) { if (EXPECT_RESULT(x > 709.0, false)) // log(std::numeric_limits::max()) = 709.783 { return std::numeric_limits::infinity(); } else if (EXPECT_RESULT(x < -708.0, false)) // log(std::numeric_limits::min()) = -708.396 { return double(); } else { union schraudolph { double floating_point_value; struct { #if __BYTE_ORDER == __LITTLE_ENDIAN unsigned least_significant_part; int most_significant_part; #else int most_significant_part; unsigned least_significant_part; #endif } integral_decomposition; } s; s.integral_decomposition.least_significant_part = 0U; s.integral_decomposition.most_significant_part = SCHRAUDOLPH_EXPONENT_A * x + (0x3ff00000 - 60801); return s.floating_point_value; } } namespace enblend { template class GDAConfiguration { public: typedef typename CostImage::PixelType CostImagePixelType; typedef typename vigra::NumericTraits::Promote CostImagePromoteType; GDAConfiguration(const CostImage* const d, Segment* v, VisualizeImage* const vi) : costImage(d), visualizeStateSpaceImage(vi) { kMax = 1; distanceWeight = 1.0; mismatchWeight = 1.0; const int costImageShortDimension = std::min(costImage->width(), costImage->height()); // Determine state space of currentPoint const int stateSpaceWidth = costImageShortDimension / 3; vigra::Point2D previousPoint = v->back().second; for (Segment::iterator current = v->begin(); current != v->end();) { bool currentMoveable = current->first; vigra::Point2D currentPoint = current->second; ++current; vigra::Point2D nextPoint = current == v->end() ? v->begin()->second : current->second; mfEstimates.push_back(currentPoint); std::vector* stateSpace = new std::vector(); pointStateSpaces.push_back(stateSpace); std::vector* stateDistances = new std::vector(); pointStateDistances.push_back(stateDistances); if (currentMoveable) { // vp = std::vector from previousPoint to currentPoint vigra::Diff2D vp(currentPoint.x - previousPoint.x, currentPoint.y - previousPoint.y); // vn = std::vector from currentPoint to nextPoint vigra::Diff2D vn(nextPoint.x - currentPoint.x, nextPoint.y - currentPoint.y); // np = normal to vp vigra::Diff2D np(-vp.y, vp.x); // nn = normal to vn vigra::Diff2D nn(-vn.y, vn.x); // normal = normal vector at currentPoint // normal points to the left of vp and vn. vigra::Diff2D normal = np + nn; normal *= stateSpaceWidth / normal.magnitude(); vigra::Diff2D leftPoint = currentPoint + normal; vigra::Diff2D rightPoint = currentPoint - normal; // Choose a reasonable number of state points between these extremes const int lineLength = std::max(std::abs(rightPoint.x - leftPoint.x), std::abs(rightPoint.y - leftPoint.y)); const int spaceBetweenPoints = static_cast(ceil(lineLength / static_cast(AnnealPara.kmax))); vigra::LineIterator linePoint(currentPoint, leftPoint); for (int i = 0; i < (lineLength + 1) / 2; ++i, ++linePoint) { // Stop searching along the line if we leave the // cost image or enter a max-cost region. if (!costImage->isInside(*linePoint)) { break; } else if ((*costImage)[*linePoint] == vigra::NumericTraits::max()) { break; } else if (i % spaceBetweenPoints == 0) { stateSpace->push_back(vigra::Point2D(*linePoint)); stateDistances->push_back(std::max(std::abs(linePoint->x - currentPoint.x), std::abs(linePoint->y - currentPoint.y)) / 2); if (visualizeStateSpaceImage) { (*visualizeStateSpaceImage)[*linePoint] = VISUALIZE_STATE_SPACE; } } } linePoint = vigra::LineIterator(currentPoint, rightPoint); ++linePoint; for (int i = 1; i < 1 + lineLength / 2; ++i, ++linePoint) { // Stop searching along the line if we leave the // cost image or enter a max-cost region. if (!costImage->isInside(*linePoint)) { break; } else if ((*costImage)[*linePoint] == vigra::NumericTraits::max()) { break; } else if (i % spaceBetweenPoints == 0) { stateSpace->push_back(vigra::Point2D(*linePoint)); stateDistances->push_back(std::max(std::abs(linePoint->x - currentPoint.x), std::abs(linePoint->y - currentPoint.y)) / 2); if (visualizeStateSpaceImage) { (*visualizeStateSpaceImage)[*linePoint] = VISUALIZE_STATE_SPACE; } } } } if (stateSpace->size() == 0) { stateSpace->push_back(currentPoint); stateDistances->push_back(0); if (visualizeStateSpaceImage && costImage->isInside(currentPoint)) { (*visualizeStateSpaceImage)[currentPoint] = VISUALIZE_STATE_SPACE_INSIDE; } } const unsigned int localK = stateSpace->size(); if (localK > AnnealPara.kmax) { cerr << command << ": local k = " << localK << " > k_max = " << AnnealPara.kmax << endl; exit(1); } kMax = std::max(kMax, localK); pointStateProbabilities.push_back(new std::vector(localK, 1.0 / localK)); convergedPoints.push_back(localK < 2); previousPoint = currentPoint; } tau = AnnealPara.tau; deltaEMax = AnnealPara.deltaEMax; deltaEMin = AnnealPara.deltaEMin; const double kmax = static_cast(kMax); tInitial = ceil(deltaEMax / log(kmax / (kmax - 2.0))); tFinal = deltaEMin / log(kmax * kmax - kmax - 1.0); } ~GDAConfiguration() { std::for_each(pointStateSpaces.begin(), pointStateSpaces.end(), bind(delete_ptr(), _1)); std::for_each(pointStateProbabilities.begin(), pointStateProbabilities.end(), bind(delete_ptr(), _1)); std::for_each(pointStateDistances.begin(), pointStateDistances.end(), bind(delete_ptr(), _1)); } void run() { int progressIndicator = 1; int numIterations = static_cast(ceil(log(tFinal / tInitial) / log(tau))); int iterationCount = 0; int iterationsPerTick = (numIterations + 3) / 4; #ifdef HAVE_LIBGLEW if (UseGPU) { configureGPUTextures(kMax, pointStateSpaces.size()); } #endif tCurrent = tInitial; while (kMax > 1 && tCurrent > tFinal) { const double epsilon = 1.0 / kMax; const unsigned int eta = static_cast(ceil(log(epsilon) / log(((kMax - 2.0) / (2.0 * kMax) * exp(-tCurrent / deltaEMax)) + 0.5))); if (Verbose >= VERBOSE_GDA_MESSAGES) { const std::ios_base::fmtflags ioFlags(cerr.flags()); cerr << "\n" << command << ": info: t = " << std::scientific << std::setprecision(3) << tCurrent << ", eta = " << std::setw(4) << eta << ", k_max = " << std::setw(3) << kMax; cerr.flush(); cerr.flags(ioFlags); } for (unsigned int i = 0; i < eta; i++) { iterate(); } tCurrent *= tau; if (Verbose >= VERBOSE_GDA_MESSAGES) { int numConvergedPoints = 0; for (unsigned int i = 0; i < convergedPoints.size(); i++) { if (convergedPoints[i]) { numConvergedPoints++; } } cerr << ", " << numConvergedPoints << " of " << convergedPoints.size() << " points converged"; cerr.flush(); } else if (Verbose >= VERBOSE_MASK_MESSAGES && iterationCount % iterationsPerTick == 0) { cerr << " " << progressIndicator << "/4"; progressIndicator++; cerr.flush(); } iterationCount++; } #ifdef HAVE_LIBGLEW if (UseGPU) { clearGPUTextures(); } #endif if (visualizeStateSpaceImage) { // Remaining unconverged state space points for (unsigned int i = 0; i < pointStateSpaces.size(); ++i) { std::vector* stateSpace = pointStateSpaces[i]; for (unsigned int j = 0; j < stateSpace->size(); ++j) { vigra::Point2D point = (*stateSpace)[j]; if (visualizeStateSpaceImage->isInside(point)) { (*visualizeStateSpaceImage)[point] = VISUALIZE_STATE_SPACE_UNCONVERGED; } } } } if (Verbose >= VERBOSE_GDA_MESSAGES) { cerr << endl; for (unsigned int i = 0; i < convergedPoints.size(); i++) { if (!convergedPoints[i]) { cerr << command << ": info: unconverged point: " << endl; std::vector* stateSpace = pointStateSpaces[i]; std::vector* stateProbabilities = pointStateProbabilities[i]; const unsigned int localK = stateSpace->size(); for (unsigned int state = 0; state < localK; ++state) { cerr << command << ": info: state " << (*stateSpace)[state] << ", weight = " << (*stateProbabilities)[state] << endl; } cerr << command << ": info: mfEstimate = " << mfEstimates[i] << endl; } } } } const std::vector& getCurrentPoints() const { return mfEstimates; } void setOptimizerWeights(double aDistanceWeight, double aMismatchWeight) { // IMPLEMENTATION NOTE: We normalize to 2.0, because we // want to reproduce the results of Enblend-3.2. Up to // Enblend-3.2 the distanceWeight and mismatchWeight were both // fixed at 1.0. const double sum = 0.5 * (aDistanceWeight + aMismatchWeight); assert(aDistanceWeight >= 0.0); assert(aMismatchWeight >= 0.0); assert(sum > 0.0); distanceWeight = aDistanceWeight / sum; mismatchWeight = aMismatchWeight / sum; } protected: void calculateStateProbabilities() { const int mf_size = static_cast(mfEstimates.size()); #ifdef OPENMP #pragma omp parallel #endif { double* E = new double[kMax]; double* Pi = new double[kMax]; #ifdef OPENMP #pragma omp for nowait schedule(guided) #endif for (int index = 0; index < mf_size; ++index) { // Skip updating points that have already converged. convergedPointsLock.set(); if (convergedPoints[index]) { convergedPointsLock.unset(); continue; } convergedPointsLock.unset(); const std::vector* stateSpace = pointStateSpaces[index]; std::vector* stateProbabilities = pointStateProbabilities[index]; const std::vector* stateDistances = pointStateDistances[index]; const unsigned int localK = stateSpace->size(); const int lastIndex = index == 0 ? mf_size - 1 : index - 1; const unsigned int nextIndex = (index + 1) % mf_size; const vigra::Point2D lastPointEstimate = mfEstimates[lastIndex]; const bool lastPointInCostImage = costImage->isInside(lastPointEstimate); const vigra::Point2D nextPointEstimate = mfEstimates[nextIndex]; const bool nextPointInCostImage = costImage->isInside(nextPointEstimate); // Calculate E values. for (unsigned i = 0U; i < localK; ++i) { const vigra::Point2D currentPoint = (*stateSpace)[i]; const int distanceCost = (*stateDistances)[i]; int mismatchCost = 0; if (lastPointInCostImage) { mismatchCost += costImageCost(lastPointEstimate, currentPoint); } if (nextPointInCostImage) { mismatchCost += costImageCost(currentPoint, nextPointEstimate); } const double cost = distanceWeight * static_cast(distanceCost) + mismatchWeight * static_cast(mismatchCost); E[i] = cost / tCurrent; Pi[i] = 0.0; } // Calculate new stateProbabilities // An = 1 / (1 + exp((E[j] - E[i]) / tCurrent)) // pi[j]' = 1/K * sum_(0)_(k-1) An(i,j) * (pi[i] + pi[j]) for (unsigned j = 0U; j < localK; ++j) { const double piTj = (*stateProbabilities)[j]; Pi[j] += piTj; const double ej = E[j]; for (unsigned i = j + 1U; i < localK; ++i) { const double piT = (*stateProbabilities)[i] + piTj; double piTAn = piT / (1.0 + schraudolph_exp(ej - E[i])); if ( #if defined(_MSC_VER) || defined(__sun__) isnan(piTAn) #else std::isnan(piTAn) #endif ) { // exp term is infinity or zero. piTAn = ej > E[i] ? 0.0 : piT; } Pi[j] += piTAn; Pi[i] += piT - piTAn; } (*stateProbabilities)[j] = Pi[j] / localK; } } delete [] E; delete [] Pi; } // omp parallel } #ifdef HAVE_LIBGLEW void calculateStateProbabilitiesGPU() { const unsigned int mf_size = mfEstimates.size(); unsigned int unconvergedPoints = 0; float* EF = new float[kMax * mfEstimates.size()]; float* PiF = new float[kMax * mfEstimates.size()]; for (unsigned int index = 0; index < mf_size; ++index) { // Skip updating points that have already converged. if (convergedPoints[index]) { continue; } const unsigned int rowIndex = unconvergedPoints / 4; const unsigned int vectorIndex = unconvergedPoints % 4; float* EFbase = &(EF[(rowIndex * kMax * 4) + vectorIndex]); float* PiFbase = &(PiF[(rowIndex * kMax * 4) + vectorIndex]); const std::vector* stateSpace = pointStateSpaces[index]; std::vector* stateProbabilities = pointStateProbabilities[index]; const std::vector* stateDistances = pointStateDistances[index]; const unsigned int localK = stateSpace->size(); const unsigned int lastIndex = index == 0 ? mf_size - 1 : index - 1; const unsigned int nextIndex = (index + 1) % mf_size; const vigra::Point2D lastPointEstimate = mfEstimates[lastIndex]; const bool lastPointInCostImage = costImage->isInside(lastPointEstimate); const vigra::Point2D nextPointEstimate = mfEstimates[nextIndex]; const bool nextPointInCostImage = costImage->isInside(nextPointEstimate); // Calculate E values. for (unsigned int i = 0; i < localK; ++i) { const vigra::Point2D currentPoint = (*stateSpace)[i]; const int distanceCost = (*stateDistances)[i]; int mismatchCost = 0; if (lastPointInCostImage) { mismatchCost += costImageCost(lastPointEstimate, currentPoint); } if (nextPointInCostImage) { mismatchCost += costImageCost(currentPoint, nextPointEstimate); } const float cost = distanceWeight * static_cast(distanceCost) + mismatchWeight * static_cast(mismatchCost); EFbase[4 * i] = cost; PiFbase[4 * i] = static_cast((*stateProbabilities)[i]); } for (unsigned int i = localK; i < kMax; ++i) { PiFbase[4 * i] = 0.0f; } unconvergedPoints++; } // Calculate all of the new PiF values on the GPU in parallel gpuGDAKernel(kMax, unconvergedPoints, tCurrent, EF, PiF, PiF); // Write the results back to pointStateProbabilities unconvergedPoints = 0; for (unsigned int index = 0; index < mf_size; ++index) { // Skip updating points that have already converged. if (convergedPoints[index]) { continue; } const unsigned int rowIndex = unconvergedPoints / 4; const unsigned int vectorIndex = unconvergedPoints % 4; float* PiFbase = &(PiF[(rowIndex * kMax * 4) + vectorIndex]); std::vector* stateProbabilities = pointStateProbabilities[index]; const unsigned int localK = stateProbabilities->size(); for (unsigned int i = 0; i < localK; ++i) { (*stateProbabilities)[i] = static_cast(PiFbase[4 * i]); } unconvergedPoints++; } delete [] EF; delete [] PiF; } #endif void iterate() { #ifdef HAVE_LIBGLEW if (UseGPU) { calculateStateProbabilitiesGPU(); } else { calculateStateProbabilities(); } #else calculateStateProbabilities(); #endif kMax = 1; size_t kmax_local = 1; ::omp::lock lock_cerr; ::omp::lock lock_update; #ifdef OPENMP #pragma omp parallel firstprivate(kmax_local) #endif { #ifdef OPENMP #pragma omp for nowait schedule(guided) #endif for (int index = 0; index < static_cast(pointStateSpaces.size()); ++index) { convergedPointsLock.set(); if (convergedPoints[index]) { convergedPointsLock.unset(); continue; } convergedPointsLock.unset(); std::vector* stateSpace = pointStateSpaces[index]; std::vector* stateProbabilities = pointStateProbabilities[index]; std::vector* stateDistances = pointStateDistances[index]; unsigned int localK = stateSpace->size(); double estimateX = 0.0; double estimateY = 0.0; // Make new mean field estimates. double totalWeight = 0.0; bool hasHighWeightState = false; for (unsigned int k = 0; k < localK; ++k) { const double weight = (*stateProbabilities)[k]; totalWeight += weight; if (weight > 0.99) { hasHighWeightState = true; } const vigra::Point2D state = (*stateSpace)[k]; estimateX += weight * static_cast(state.x); estimateY += weight * static_cast(state.y); } estimateX /= totalWeight; estimateY /= totalWeight; vigra::Point2D newEstimate(vigra::NumericTraits::fromRealPromote(estimateX), vigra::NumericTraits::fromRealPromote(estimateY)); // Sanity check if (!costImage->isInside(newEstimate)) { lock_cerr.set(); std::cerr << command << ": warning: new mean field estimate outside cost image" << std::endl; for (unsigned int state = 0; state < localK; ++state) { std::cerr << command << ": info: state " << (*stateSpace)[state] << " weight = " << (*stateProbabilities)[state] << std::endl; } std::cerr << command << ": info: new estimate = " << newEstimate << std::endl; lock_cerr.unset(); // Skip this point from now on. convergedPointsLock.set(); convergedPoints[index] = true; convergedPointsLock.unset(); continue; } mfEstimates[index] = newEstimate; // Remove improbable solutions from the search space double totalWeights = 0.0; const double cutoffWeight = hasHighWeightState ? 0.50 : 0.00001; for (unsigned int k = 0; k < stateSpace->size(); ) { const double weight = (*stateProbabilities)[k]; if (weight < cutoffWeight) { // Replace this state with last state (*stateProbabilities)[k] = (*stateProbabilities)[stateProbabilities->size() - 1]; (*stateSpace)[k] = (*stateSpace)[stateSpace->size() - 1]; (*stateDistances)[k] = (*stateDistances)[stateDistances->size() - 1]; // Delete last state stateProbabilities->pop_back(); stateSpace->pop_back(); stateDistances->pop_back(); } else { totalWeights += weight; ++k; } } // Renormalize for (unsigned int k = 0; k < stateSpace->size(); ++k) { (*stateProbabilities)[k] /= totalWeights; } localK = stateSpace->size(); if (localK < 2) { convergedPointsLock.set(); convergedPoints[index] = true; convergedPointsLock.unset(); } kmax_local = std::max(kmax_local, stateProbabilities->size()); } lock_update.set(); kMax = std::max(kMax, static_cast(kmax_local)); lock_update.unset(); } // omp parallel } int costImageCost(const vigra::Point2D& start_point, const vigra::Point2D& end_point) const { typedef typename CostImage::ConstIterator CostIterator; const int shortLineThreshold = 8; // We penalize lines below this limit. const CostIterator end(costImage->upperLeft() + end_point); vigra::LineIterator lineEnd(end, end); vigra::LineIterator line(costImage->upperLeft() + start_point, end); int cost = 0; while (line != lineEnd) { cost += *line; ++line; } const int lineLength = std::max(std::abs(end_point.x - start_point.x), std::abs(end_point.y - start_point.y)); if (lineLength < shortLineThreshold) { cost += vigra::NumericTraits::max() * (shortLineThreshold - lineLength); } return cost; } bool segmentIntersect(const vigra::Point2D& l1a, const vigra::Point2D& l1b, const vigra::Point2D& l2a, const vigra::Point2D& l2b) const { int denom = (l2b.y - l2a.y) * (l1b.x - l1a.x) - (l2b.x - l2a.x) * (l1b.y - l1a.y); if (denom == 0) { return false; // lines are parallel or coincident } int uaNum = (l2b.x - l2a.x) * (l1a.y - l2a.y) - (l2b.y - l2a.y) * (l1a.x - l2a.x); int ubNum = (l1b.x - l1a.x) * (l1a.y - l2a.y) - (l1b.y - l1a.y) * (l1a.x - l2a.x); if (denom < 0) { uaNum *= -1; ubNum *= -1; denom *= -1; } if (uaNum > 0 && uaNum < denom && ubNum > 0 && ubNum < denom) { return true; } return false; } const CostImage *costImage; VisualizeImage *visualizeStateSpaceImage; // Mean-field estimates of current point locations std::vector mfEstimates; // State spaces of each point std::vector*> pointStateSpaces; // Probability vectors for each state space std::vector*> pointStateProbabilities; std::vector*> pointStateDistances; // Flags indicate which points have converged std::vector convergedPoints; omp::lock convergedPointsLock; // Initial Temperature double tInitial; // Final Temperature double tFinal; // Current Temperature double tCurrent; // Cooling constant double tau; // Maximum cost change possible by any single annealing move double deltaEMax; // Minimum cost change possible by any single annealing move double deltaEMin; // Largest state space over all points unsigned int kMax; // Weight factors for the distance of a point from the initial // seam line and the total mismatch accumulated along the seam // line segment. double distanceWeight;; double mismatchWeight; }; template void annealSnake(const CostImage* const ci, const std::pair& optimizerWeights, Segment* snake, VisualizeImage* const vi) { GDAConfiguration cfg(ci, snake, vi); cfg.setOptimizerWeights(optimizerWeights.first, optimizerWeights.second); cfg.run(); std::vector::const_iterator annealedPoint = cfg.getCurrentPoints().begin(); for (Segment::iterator snakePoint = snake->begin(); snakePoint != snake->end(); ++snakePoint, ++annealedPoint) { snakePoint->second = *annealedPoint; } } } // namespace enblend #endif /* __ANNEAL_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/filespec.cc0000644000175100017510000006403612070530113020452 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef _WIN32 #include #elif defined(__sun__) #include #include #else #include #include #endif #include #include #include #include #include #include #include #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include "global.h" #include "error_message.h" #include "filenameparse.h" #include "filespec.h" #include "layer_selection.h" #include "selector.h" // How many lines at the beginning of a response file we check to // guess that it actually is a response file. #define RESPONSE_FILE_LINES_TO_CHECK 20U // Separator of key and value in a syntactic comment #define KEY_VALUE_SEPARATOR_CHAR ':' typedef std::pair key_value_pair; extern const std::string command; extern int Verbose; extern LayerSelectionHost LayerSelection; namespace enblend { #ifdef _WIN32 /** Add all files which match filename to filelist. filename can * contain the wildcards '*' and '?' in the leaf position, but not in * the path. */ void glob_filename_win32(FileNameList& filelist, const std::string& filename) { // There has got to be an easier way... char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char fname[_MAX_FNAME]; char ext[_MAX_EXT]; char newFile[_MAX_PATH]; _splitpath(filename.c_str(), drive, dir, NULL, NULL); struct _finddata_t finddata; intptr_t findhandle = _findfirst(filename.c_str(), &finddata); if (findhandle != -1) { do { _splitpath(finddata.name, NULL, NULL, fname, ext); _makepath(newFile, drive, dir, fname, ext); filelist.push_back(std::string(newFile)); } while (_findnext(findhandle, &finddata) == 0); _findclose(findhandle); } } #endif // ANTICIPATED CHANGE: We already have the same function in // "common.h". static bool can_open_file(const std::string& aFilename) { errno = 0; std::ifstream file(aFilename.c_str()); if (!file) { std::cerr << command << ": failed to open \"" << aFilename << "\": " << errorMessage(errno) << "\n"; return false; } else { errno = 0; file.close(); if (file.fail()) { std::cerr << command << ": info: problems when closing \"" << aFilename << "\": " << errorMessage(errno) << "\n"; } return true; } } /** Convert a_string in a string that is printable. This is it only * contains printable characters. */ std::string printable_string(const std::string& a_string) { std::string result; for (std::string::const_iterator c = a_string.begin(); c != a_string.end(); ++c) { if (isprint(*c)) { result.push_back(*c); } else { std::ostringstream oss; oss << "\\x" << std::hex << std::setw(2) << std::setfill('0') << (static_cast(*c) & 0xff); result.append(oss.str()); } } return result; } /** Answer line with leading and trailing whitespace removed. * Normalize blank lines and lines starting with a comment character * to an empty string. Remove all whitespace between the * response-file character and the following filename. */ std::string normalize_response_file_line(const std::string& line) { std::string result; std::string::size_type begin = line.find_first_not_of(WHITESPACE_CHARS); if (begin != std::string::npos && line[begin] != RESPONSE_FILE_COMMENT_CHAR) { const std::string::size_type end = line.find_last_not_of(WHITESPACE_CHARS); if (line[begin] == RESPONSE_FILE_PREFIX_CHAR) { begin = line.find_first_not_of(WHITESPACE_CHARS, begin + 1); result += RESPONSE_FILE_PREFIX_CHAR; } if (begin != std::string::npos) { result += line.substr(begin, end - begin + 1); } } return result; } static const key_value_pair empty_pair(std::make_pair(std::string(), std::string())); /** Answer the key-value pair in line or a pair of null strings, if * line does not define a syntactic comment. * * A syntactic comment line matches * ^[ \t]* # [ \t]* ([A-Za-z-]*) [ \t]* : [ \t]* ([^ \t]*) [ \t]*$ * where the first captured string is the key and second one is the * value. */ key_value_pair get_syntactic_comment(const std::string& line) { std::string::size_type begin = line.find_first_not_of(WHITESPACE_CHARS); if (begin != std::string::npos && line[begin] == RESPONSE_FILE_COMMENT_CHAR) { begin = line.find_first_not_of(WHITESPACE_CHARS, begin + 1); if (begin != std::string::npos) { std::string::size_type end = begin + 1; while (end < line.size() && (isalpha(line[end]) || line[end] == '-')) { ++end; } const std::string key = line.substr(begin, end - begin); begin = line.find_first_not_of(WHITESPACE_CHARS, end); if (begin != std::string::npos && line[begin] == KEY_VALUE_SEPARATOR_CHAR) { begin = line.find_first_not_of(WHITESPACE_CHARS, begin + 1); if (begin == std::string::npos) { return std::make_pair(key, std::string()); } else { end = line.find_last_not_of(WHITESPACE_CHARS); return std::make_pair(key, line.substr(begin, end - begin + 1)); } } else { return empty_pair; } } else { return empty_pair; } } else { return empty_pair; } } void unroll_trace(const FilePositionTrace& trace) { for (FilePositionTrace::const_iterator t = trace.begin(); t != trace.end(); ++t) { std::cerr << command << ": info: included from \"" << t->first << "\" line " << t->second << '\n'; } } class AbstractGlobbingAlgorithm { public: virtual FileNameList do_glob(const std::string& a_filename, const FilePositionTrace& trace) = 0; virtual ~AbstractGlobbingAlgorithm() {} virtual std::string description() const = 0; }; class LiteralGlobbingAlgorithm: public AbstractGlobbingAlgorithm { public: FileNameList do_glob(const std::string& a_filename, const FilePositionTrace& trace) { FileNameList result; result.push_back(a_filename); return result; } std::string description() const { return "Do not glob. Treat filenames as literals."; } }; #ifdef _WIN32 class WildcardGlobbingAlgorithm: public AbstractGlobbingAlgorithm { public: FileNameList do_glob(const std::string& a_filespec, const FilePositionTrace& trace) { FileNameList result; glob_filename_win32(result, a_filespec); return result; } std::string description() const { return "Glob only filenames, but not paths."; } }; #else class WildcardGlobbingAlgorithm: public AbstractGlobbingAlgorithm { public: WildcardGlobbingAlgorithm() : result_vector_(new glob_t) {} ~WildcardGlobbingAlgorithm() {delete result_vector_;} void run_glob(const std::string& a_filespec, const FilePositionTrace& trace, int flags) { errno = 0; if (glob(a_filespec.c_str(), flags, NULL, // (*errfunc)(const char* filename, int error_code) result_vector_) != 0) { std::cerr << command << ": warning: globbing \"" << a_filespec << "\" failed: " << errorMessage(errno) << "\n"; unroll_trace(trace); } } void convert_to_list() { result_.clear(); for (char** path = result_vector_->gl_pathv; *path != NULL; ++path) { result_.push_back(*path); } } FileNameList do_glob(const std::string& a_filespec, const FilePositionTrace& trace) { run_glob(a_filespec, trace, GLOB_ERR); convert_to_list(); globfree(result_vector_); return result_; } std::string description() const { return "Glob with wildcards '?', '*', '[', and ']'. See glob(7)."; } protected: glob_t* result_vector_; FileNameList result_; }; class ShellGlobbingAlgorithm : public WildcardGlobbingAlgorithm { public: FileNameList do_glob(const std::string& a_filespec, const FilePositionTrace& trace) { int flags = GLOB_ERR | GLOB_BRACE; #ifndef __sun__ flags |= GLOB_TILDE; #endif run_glob(a_filespec, trace, flags); convert_to_list(); globfree(result_vector_); return result_; } std::string description() const { return "Glob like UN*X shells do. Like \"wildcard\" plus '{', '}', and '~'. See glob(7)."; } }; #endif // _WIN32 #define MAKE_ALGORITHM(m_algorithm_pointer) \ std::make_pair(false, static_cast(m_algorithm_pointer)) #define MAKE_ALIAS(m_algorithm_pointer) \ std::make_pair(true, m_algorithm_pointer) class Globbing { // Map from the names of the algorithms or aliases to the // algorithm itself. The boolean flag indicates whether we point // to the algorithm proper or the name is just an alias to an // existing algorithm. typedef std::map > algorithm_map; public: Globbing() : algorithm_name_("literal"), algorithm_(NULL) { installed_algorithms_ = boost::assign::map_list_of ("literal", MAKE_ALGORITHM(new LiteralGlobbingAlgorithm)) ("wildcard", MAKE_ALGORITHM(new WildcardGlobbingAlgorithm)) #ifndef _WIN32 ("shell", MAKE_ALGORITHM(new ShellGlobbingAlgorithm)) #endif ; setup_alias("literal", "none"); #ifndef _WIN32 setup_alias("shell", "sh"); #endif } ~Globbing() { for (algorithm_map::const_iterator i = installed_algorithms_.begin(); i != installed_algorithms_.end(); ++i) { if (!i->second.first) // not an alias { delete i->second.second; } } algorithm_ = NULL; } const std::string& get_algorithm() const { return algorithm_name_; } bool set_algorithm(const std::string& an_algorithm_name) { algorithm_map::const_iterator a = installed_algorithms_.find(an_algorithm_name); if (a != installed_algorithms_.end()) { algorithm_name_ = a->first; algorithm_ = a->second.second; return true; } else { return false; } } FileNameList expand(const std::string& a_filename, const FilePositionTrace& trace) { if (algorithm_ == NULL) { set_algorithm(algorithm_name_); } return algorithm_->do_glob(a_filename, trace); } algorithm_list get_known_algorithms() const { algorithm_list result; for (algorithm_map::const_iterator i = installed_algorithms_.begin(); i != installed_algorithms_.end(); ++i) { std::string description = i->second.second->description(); if (i->second.first) { description += " (alias)"; } result.push_back(make_pair(i->first, description)); } return result; } void setup_alias(const std::string& an_algorithm_name, const std::string& an_alias) { algorithm_map::const_iterator a = installed_algorithms_.find(an_algorithm_name); installed_algorithms_[an_alias] = MAKE_ALIAS(a->second.second); } private: std::string algorithm_name_; AbstractGlobbingAlgorithm* algorithm_; algorithm_map installed_algorithms_; }; algorithm_list known_globbing_algorithms() { Globbing glob; return glob.get_known_algorithms(); } //< src::RESPONSE_FILE_MAX_NESTING_LEVEL 63 #define RESPONSE_FILE_MAX_NESTING_LEVEL 63U struct TraceInfo { TraceInfo() : nesting_level(0U), current_directory(), file_position(), selection_algorithm() { selection_algorithm.push_front(LayerSelection.get_selector()); } unsigned nesting_level; const std::string current_directory; FilePositionTrace file_position; typedef std::list selection_algorithm_stack; selection_algorithm_stack selection_algorithm; }; void unfold_filename_iter(TraceableFileNameList& result, TraceInfo& trace_info, const std::string& filename) { // Checking the nesting_lavel acts as an emergency break in the // case our usual recursion detection fails. if (trace_info.nesting_level > RESPONSE_FILE_MAX_NESTING_LEVEL) { std::cerr << command << ": warning: excessive nesting of " << trace_info.nesting_level << " levels of response files;\n" << command << ": warning: possible infinite recursion in \"" << printable_string(filename) << "\"\n"; unroll_trace(trace_info.file_position); return; } selector::Abstract* selector = trace_info.selection_algorithm.front(); if (filename.empty()) { std::cerr << command << ": info: empty filename\n"; unroll_trace(trace_info.file_position); return; } else if (filename[0] == RESPONSE_FILE_PREFIX_CHAR) { const std::string response_filename(filename, 1); // filename alone #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: concatPath = <" << concatPath(trace_info.current_directory, response_filename) << ">\n"; #endif const std::string response_filepath = // filename in the right path enblend::canonicalizePath(enblend::isRelativePath(response_filename) ? concatPath(trace_info.current_directory, response_filename) : response_filename, false); for (FilePositionTrace::const_iterator t = trace_info.file_position.begin(); t != trace_info.file_position.end(); ++t) { if (t->first == response_filepath) { std::cerr << command << ": warning: response file \"" << printable_string(response_filepath) << "\" recursively\n"; unroll_trace(trace_info.file_position); return; } } #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: current_directory = " << trace_info.current_directory << "\n" << "+ unfold_filename_iter: response_filename = " << response_filename << "\n" << "+ unfold_filename_iter: response_filepath = " << response_filepath << "\n"; #endif if (Verbose >= VERBOSE_RESPONSE_FILES) { std::cerr << command << ": info: consulting response file \"" << printable_string(response_filepath) << "\"\n"; } if (!can_open_file(response_filepath)) { std::cerr << command << ": failed to open response file \"" << printable_string(response_filepath) << "\": " << errorMessage(errno) << "\n"; unroll_trace(trace_info.file_position); exit(1); } if (!maybe_response_file(response_filepath)) { std::cerr << command << ": warning: malformed response file \"" << printable_string(response_filepath) << "\"\n"; unroll_trace(trace_info.file_position); return; } std::ifstream response_file(response_filepath.c_str()); Globbing glob; // instatiating a new Glob object restores the defaults unsigned line_number = 0U; while (true) { std::string buffer; errno = 0; getline(response_file, buffer); if (!response_file.good()) { if (!buffer.empty()) { std::cerr << command << ": warning: ignoring last line of response file \"" << printable_string(response_filepath) << "\" line " << line_number + 1U << ",\n" << command << ": warning: because it does not end with a newline\n"; unroll_trace(trace_info.file_position); } break; } ++line_number; key_value_pair comment = get_syntactic_comment(buffer); boost::algorithm::to_lower(comment.first); boost::algorithm::to_lower(comment.second); if ((comment.first == "glob" || comment.first == "globbing" || comment.first == "filename-globbing") && !comment.second.empty()) { if (!glob.set_algorithm(comment.second)) { std::cerr << command << ": warning: requested unknown globbing algorithm \"" << comment.second << "\" in response file \"" << printable_string(response_filepath) << "\" line " << line_number << "\n" << command << ": warning: will stick with algorithm \"" << glob.get_algorithm() << "\"\n"; unroll_trace(trace_info.file_position); } #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: new globbing algorithm = " << glob.get_algorithm() << "\n"; #endif } if (comment.first == "layer-selector" && !comment.second.empty()) { selector::algorithm_list::const_iterator new_selector = selector::find_by_name(comment.second); if (new_selector == selector::algorithms.end()) { std::cerr << command << ": warning: requested unknown default layer selector \"" << comment.second << "\" in response file \"" << printable_string(response_filepath) << "\" line " << line_number << "\n" << command << ": warning: will stick with selector \"" << LayerSelection.name() << "\"\n"; unroll_trace(trace_info.file_position); } else { selector = *new_selector; #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: new layer selection algorithm = " << selector->name() << "\n"; #endif } } const std::string line(normalize_response_file_line(buffer)); if (line.empty()) { continue; } const std::string response_directory = extractDirname(response_filepath); #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: response_directory = " << response_directory << "\n"; #endif TraceableFileNameList partial_result; trace_info.selection_algorithm.push_front(selector); trace_info.file_position.push_front(std::make_pair(response_filepath, line_number)); ++trace_info.nesting_level; unfold_filename_iter(partial_result, trace_info, line); for (TraceableFileNameList::const_iterator p = partial_result.begin(); p != partial_result.end(); ++p) { const FileNameList expanded_partial_result = glob.expand(p->filename(), trace_info.file_position); for (FileNameList::const_iterator q = expanded_partial_result.begin(); q != expanded_partial_result.end(); ++q) { if (enblend::isRelativePath(*q)) { const std::string path = enblend::canonicalizePath(concatPath(response_directory, *q), false); #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: relative path\n" << "+ unfold_filename_iter: q = " << *q << "\n" << "+ unfold_filename_iter: path = <" << path << ">\n"; #endif result.insert(result.end(), enblend::TraceableFileName(path, p->trace(), p->selector())); } else { #ifdef DEBUG_FILESPEC std::cout << "+ unfold_filename_iter: absolute path\n" << "+ unfold_filename_iter: q = " << *q << "\n"; #endif result.insert(result.end(), enblend::TraceableFileName(*q, p->trace(), p->selector())); } } } trace_info.file_position.pop_front(); trace_info.selection_algorithm.pop_front(); } if (!response_file.eof()) { std::cerr << command << ": warning: filesystem signals problems in response file \"" << printable_string(response_filepath) << "\" line " << line_number << ": " << errorMessage(errno) << "\n"; unroll_trace(trace_info.file_position); } } else { result.push_back(enblend::TraceableFileName(filename, trace_info.file_position, selector)); } } void unfold_filename(TraceableFileNameList& result, const std::string& filename) { #ifdef _WIN32 // This stupid wannbe OS, lacking a shell that deserves the name, // passes unexpanded wildcards in filename. We ameliorate the // situation by doing some of the globbing ourselves; see // glob_filename_win32(). FileNameList initial_files; if (!filename.empty() && filename[0] == RESPONSE_FILE_PREFIX_CHAR) { initial_files.push_back(filename); } else { // Not a response file, so we expand wildcards. glob_filename_win32(initial_files, filename); } for (FileNameList::const_iterator i = initial_files.begin(); i != initial_files.end(); ++i) { TraceInfo trace_info; unfold_filename_iter(result, trace_info, *i); } #else TraceInfo trace_info; unfold_filename_iter(result, trace_info, filename); #endif #ifdef DEBUG_FILESPEC for (TraceableFileNameList::const_iterator i = result.begin(); i != result.end(); ++i) { std::cout << "+ unfold_filename: filename: \"" << i->filename() << "\", selector \"" << i->selector()->name() << "\"\n"; for (FilePositionTrace::const_iterator j = i->trace().begin(); j != i->trace().end(); ++j) { std::cout << "+ unfold_filename: pos = (" << j->first << ", " << j->second << ")\n"; } } #endif } bool is_known_extension_to_vigra(const std::string& filename) { const std::string known_extensions = vigra::impexListExtensions(); std::string extension = filename.substr(filename.rfind(".") + 1); boost::algorithm::to_lower(extension); return known_extensions.find(extension) != std::string::npos; } bool maybe_response_file(const std::string& filename) { std::ifstream file(filename.c_str()); if (file) { unsigned line_number = 0U; unsigned score = 0U; while (line_number < RESPONSE_FILE_LINES_TO_CHECK) { std::string buffer; getline(file, buffer); if (!file.good()) { break; } ++line_number; if (line_number == 1U) { const key_value_pair comment = get_syntactic_comment(buffer); if ((comment.first == "response-file" || comment.first == "enblend-response-file" || comment.first == "enfuse-response-file") && comment.second == "true") { return true; } } const std::string line(normalize_response_file_line(buffer)); if (line.empty()) { ++score; continue; } if (line[0] == RESPONSE_FILE_PREFIX_CHAR || is_known_extension_to_vigra(line)) { score += 2U; } } #ifdef DEBUG_FILESPEC std::cout << "+ maybe_response_file: score = " << score << ", lines = " << line_number << "\n"; #endif return score >= line_number; } else { return false; } } } // namespace enblend enblend-enfuse-4.1.2+dfsg/src/mga.h0000644000175100017510000002176512070530113017270 0ustar ametzlerametzler/* * Copyright (C) 2008-2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MGA_H__ #define __MGA_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "common.h" namespace enblend { template class MultiGrayscaleAccessor { public: typedef ResultType value_type; MultiGrayscaleAccessor(const std::string& accessorName) { typedef typename vigra::NumericTraits::isScalar srcIsScalar; initializeTypeSpecific(srcIsScalar()); initialize(accessorName); } ResultType operator()(const InputType& x) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(x, srcIsScalar()); } template ResultType operator()(const Iterator& i) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(i, srcIsScalar()); } template ResultType operator()(const Iterator& i, Difference d) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(i, d, srcIsScalar()); } static const std::string defaultGrayscaleAccessorName() {return "average";} private: typedef enum AccessorKind { AVERAGE, LSTAR, PRIMED_LSTAR, LIGHTNESS, VALUE, ANTI_VALUE, LUMINANCE, MIXER } AccKindType; typedef std::map NameMapType; typedef typename NameMapType::const_iterator NameMapConstIterType; #define CHANNEL_MIXER "channel-mixer" void initializeAccessorNameMap() { nameMap["average"] = AVERAGE; nameMap["l-star"] = LSTAR; nameMap["pl-star"] = PRIMED_LSTAR; nameMap["lightness"] = LIGHTNESS; nameMap["value"] = VALUE; nameMap["anti-value"] = ANTI_VALUE; nameMap["luminance"] = LUMINANCE; nameMap[CHANNEL_MIXER] = MIXER; } void initialize(const std::string& accessorName) { initializeAccessorNameMap(); if (accessorName.empty()) { kind = nameMap[defaultGrayscaleAccessorName()]; } else { std::string name(accessorName); std::transform(name.begin(), name.end(), name.begin(), tolower); NameMapConstIterType const k = nameMap.find(name); if (k == nameMap.end()) { char dummy; double red, green, blue; if (sscanf(name.c_str(), CHANNEL_MIXER "%[" NUMERIC_OPTION_DELIMITERS "]%lf%[" NUMERIC_OPTION_DELIMITERS "]%lf%[" NUMERIC_OPTION_DELIMITERS "]%lf", &dummy, &red, &dummy, &green, &dummy, &blue) == 6) { check_weights(red, green, blue); const double sum = red + green + blue; redWeight = red / sum; greenWeight = green / sum; blueWeight = blue / sum; kind = MIXER; } else { std::cerr << command << ": unknown grayscale projector \"" << accessorName << "\"" << std::endl; exit(1); } } else { kind = k->second; if (kind == MIXER) { std::cerr << command << ": \"" CHANNEL_MIXER "\" is a grayscale projector requiring\n" << command << ": arguments like e.g. \"channel-mixer:0.30:0.59:0.11\"" << std::endl; exit(1); } } } } void check_weights(double red, double green, double blue) const { // TODO: check for isnormal(WEIGHT) before comparison if (red < 0.0) { std::cerr << command << ": nonsensical weight of red channel (" << red << ")" << std::endl; exit(1); } if (green < 0.0) { std::cerr << command << ": nonsensical weight of green channel (" << green << ")" << std::endl; exit(1); } if (blue < 0.0) { std::cerr << command << ": nonsensical weight of blue channel (" << blue << ")" << std::endl; exit(1); } if (red + green + blue == 0.0) { std::cerr << command << ": sum of channel weights is zero" << std::endl; exit(1); } } void initializeTypeSpecific(vigra::VigraTrueType) {} void initializeTypeSpecific(vigra::VigraFalseType) { typedef typename InputType::value_type ValueType; rgb_to_lab_fun = vigra::RGB2LabFunctor(vigra::NumericTraits::max()); rgb_prime_to_lab_fun = vigra::RGBPrime2LabFunctor(vigra::NumericTraits::max()); } ResultType project(const InputType& x) const { typedef typename InputType::value_type ValueType; switch (kind) { case AVERAGE: return vigra::NumericTraits::fromRealPromote ((vigra::NumericTraits::toRealPromote(x.red()) + vigra::NumericTraits::toRealPromote(x.green()) + vigra::NumericTraits::toRealPromote(x.blue())) / 3.0); case LSTAR: { typedef typename vigra::RGB2LabFunctor::result_type LABResultType; const LABResultType y = rgb_to_lab_fun.operator()(x) / 100.0; return vigra::NumericTraits::fromRealPromote(vigra::NumericTraits::max() * y[0]); } case PRIMED_LSTAR: { typedef typename vigra::RGBPrime2LabFunctor::result_type LABResultType; const LABResultType y = rgb_prime_to_lab_fun.operator()(x) / 100.0; return vigra::NumericTraits::fromRealPromote(vigra::NumericTraits::max() * y[0]); } case LIGHTNESS: return vigra::NumericTraits::fromRealPromote ((std::min(x.red(), std::min(x.green(), x.blue())) + std::max(x.red(), std::max(x.green(), x.blue()))) / 2.0); case VALUE: return std::max(x.red(), std::max(x.green(), x.blue())); case ANTI_VALUE: return std::min(x.red(), std::min(x.green(), x.blue())); case LUMINANCE: return vigra::NumericTraits::fromRealPromote(x.luminance()); case MIXER: return vigra::NumericTraits::fromRealPromote (redWeight * vigra::NumericTraits::toRealPromote(x.red()) + greenWeight * vigra::NumericTraits::toRealPromote(x.green()) + blueWeight * vigra::NumericTraits::toRealPromote(x.blue())); } // never reached return ResultType(); } // RGB ResultType f(const InputType& x, vigra::VigraFalseType) const { return project(x); } template ResultType f(const Iterator& i, vigra::VigraFalseType) const { return project(*i); } template ResultType f(const Iterator& i, Difference d, vigra::VigraFalseType) const { return project(i[d]); } // grayscale ResultType f(const InputType& x, vigra::VigraTrueType) const {return x;} template ResultType f(const Iterator& i, vigra::VigraTrueType) const {return *i;} template ResultType f(const Iterator& i, Difference d, vigra::VigraTrueType) const {return i[d];} NameMapType nameMap; AccKindType kind; double redWeight, greenWeight, blueWeight; vigra::RGB2LabFunctor rgb_to_lab_fun; vigra::RGBPrime2LabFunctor rgb_prime_to_lab_fun; }; } // namespace enblend #endif /* __MGA_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/gen_sig0000644000175100017510000000666212070530113017710 0ustar ametzlerametzler#! /usr/bin/env perl # name: gen_sig # synopsis: generate signature in Harry-van-der-Wolf style # author: Dr. Christoph L. Spiel # perl version: 5.10.0 # This file is part of Enblend. # Licence details can be found in the file COPYING. use strict; use warnings; use Sig; sub octalize_string { my ($string, $prefix) = @_; $prefix = '' unless $prefix; my $result; my $max_chars = 8; my $length = length $string; for (my $i = 1; $i <= $length; $i++) { $result .= sprintf "\\%03o", ord(substr $string, $i - 1, 1); if ($i % $max_chars == 0 and $i != $length) { $result .= qq("\n $prefix"); } } return qq($prefix"$result"); } sub emit_class { my ($signature, $checksum, $extra_checksum) = @_; print < extern const std::string command; class Signature { public: Signature(): checksum_(@{[sprintf "0%011o", $checksum]}U), neg_checksum_(0U) {} const wchar_t* message() const { return @{[octalize_string($signature, q(L))]}; } void initialize() { #ifdef DEBUG_FORCE_SIGNATURE_CHECK_FAILURE checksum_++; neg_checksum_ = checksum_; #else neg_checksum_ = ~checksum_; #endif } void check() const { #if DEBUG_SIGNATURE_CHECK if (checksum_ != ~neg_checksum_) { std::cerr << "+ static checksum " << checksum_ << " does not match static shadow checksum " << ~neg_checksum_ << "\\n"; } if (generate_checksum() != checksum_) { std::cerr << "+ dynamic checksum " << generate_checksum() << " does not match static checksum " << checksum_ << ", where\\n" << "+ message is <" << message() << ">\\n"; } #endif if (generate_checksum() != checksum_ || checksum_ != ~neg_checksum_) { std::cerr << command.c_str(); // MSVC chokes without c_str() #ifdef WANT_AGGRESSIVE_SIGNATURE_CHECK std::cerr << @{[octalize_string(qq(: tampered binary\n))]}; exit(1); #else std::cerr << @{[octalize_string(qq(: warning: signature check failed\n))]}; #endif } } unsigned generate_checksum() const { const wchar_t* m = message(); return m == NULL ? 0U : std::accumulate(m, m + wcslen(m), 0U) & 037777777777U; } private: unsigned checksum_; unsigned neg_checksum_; }; #endif // SIGNATURE_H_INCLUDED_ END_OF_CLASS } sub self_test { my $sig = Sig->new(); my $ok = 1; print "// self-test...\n"; unless ($sig->get_username()) { print "// no user name\n"; $ok = 0; } unless ($sig->get_hostname()) { print "// no hostname\n"; $ok = 0; } unless ($sig->get_date()) { print "// no date\n"; $ok = 0; } unless ($sig->get_time()) { print "// no time\n"; $ok = 0; } print "// ", $sig->signature(), "\n"; print "// passed\n" if $ok; } sub main { if ($ARGV[0] and $ARGV[0] =~ m/--extra=(.*)/) { my $sig = Sig->new(); emit_class($sig->signature(), unpack("%32C*", $sig->signature()), unpack("%32C*", $1)); } else { self_test(); } } main(); enblend-enfuse-4.1.2+dfsg/src/numerictraits.h0000644000175100017510000002171012070530501021404 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __NUMERICTRAITS_H__ #define __NUMERICTRAITS_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include "vigra_ext/cachedfileimage.hxx" #include "common.h" namespace enblend { struct Error_EnblendNumericTraits_not_specialized_for_this_case {}; template struct EnblendNumericTraits { // Types related to input images typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImagePixelComponentType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImagePixelType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImageType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImageIsScalar; typedef Error_EnblendNumericTraits_not_specialized_for_this_case AlphaPixelType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case AlphaType; // Types related to the mask typedef Error_EnblendNumericTraits_not_specialized_for_this_case MaskPixelType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case MaskType; // Types related to image pyramids typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImagePyramidPixelComponentType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImagePyramidPixelType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case ImagePyramidType; enum { ImagePyramidIntegerBits = 0 }; enum { ImagePyramidFractionBits = 0 }; // Pixel type used by SKIPSM algorithm for intermediate image pixel calculations typedef Error_EnblendNumericTraits_not_specialized_for_this_case SKIPSMImagePixelType; // Pixel type used by SKIPSM algorithm for intermediate alpha pixel calculations typedef Error_EnblendNumericTraits_not_specialized_for_this_case SKIPSMAlphaPixelType; // Types related to mask pyramid typedef Error_EnblendNumericTraits_not_specialized_for_this_case MaskPyramidPixelType; typedef Error_EnblendNumericTraits_not_specialized_for_this_case MaskPyramidType; enum { MaskPyramidIntegerBits = 0 }; enum { MaskPyramidFractionBits = 0 }; typedef Error_EnblendNumericTraits_not_specialized_for_this_case SKIPSMMaskPixelType; }; #define DEFINE_ENBLENDNUMERICTRAITS(IMAGE, IMAGECOMPONENT, ALPHA, MASK, PYRAMIDCOMPONENT, PYRAMIDINTEGER, PYRAMIDFRACTION, SKIPSMIMAGE, SKIPSMALPHA, MASKPYRAMID, MASKPYRAMIDINTEGER, MASKPYRAMIDFRACTION, SKIPSMMASK) \ template<> \ struct EnblendNumericTraits { \ typedef IMAGECOMPONENT ImagePixelComponentType; \ typedef IMAGECOMPONENT ImagePixelType; \ typedef IMAGE ImageType; \ typedef vigra::VigraTrueType ImageIsScalar; \ typedef ALPHA AlphaPixelType; \ typedef IMAGE AlphaType; \ typedef MASK MaskPixelType; \ typedef IMAGE MaskType; \ typedef PYRAMIDCOMPONENT ImagePyramidPixelComponentType; \ typedef PYRAMIDCOMPONENT ImagePyramidPixelType; \ typedef IMAGE ImagePyramidType; \ enum {ImagePyramidIntegerBits = PYRAMIDINTEGER}; \ enum {ImagePyramidFractionBits = PYRAMIDFRACTION}; \ typedef SKIPSMIMAGE SKIPSMImagePixelComponentType; \ typedef SKIPSMIMAGE SKIPSMImagePixelType; \ typedef SKIPSMALPHA SKIPSMAlphaPixelType; \ typedef MASKPYRAMID MaskPyramidPixelType; \ typedef IMAGE MaskPyramidType; \ enum {MaskPyramidIntegerBits = MASKPYRAMIDINTEGER}; \ enum {MaskPyramidFractionBits = MASKPYRAMIDFRACTION}; \ typedef SKIPSMMASK SKIPSMMaskPixelType; \ };\ template<> \ struct EnblendNumericTraits > { \ typedef IMAGECOMPONENT ImagePixelComponentType; \ typedef vigra::RGBValue ImagePixelType; \ typedef IMAGE > ImageType; \ typedef vigra::VigraFalseType ImageIsScalar; \ typedef ALPHA AlphaPixelType; \ typedef IMAGE AlphaType; \ typedef MASK MaskPixelType; \ typedef IMAGE MaskType; \ typedef PYRAMIDCOMPONENT ImagePyramidPixelComponentType; \ typedef vigra::RGBValue ImagePyramidPixelType; \ typedef IMAGE > ImagePyramidType; \ enum {ImagePyramidIntegerBits = PYRAMIDINTEGER}; \ enum {ImagePyramidFractionBits = PYRAMIDFRACTION}; \ typedef SKIPSMIMAGE SKIPSMImagePixelComponentType; \ typedef vigra::RGBValue SKIPSMImagePixelType; \ typedef SKIPSMALPHA SKIPSMAlphaPixelType; \ typedef MASKPYRAMID MaskPyramidPixelType; \ typedef IMAGE MaskPyramidType; \ enum {MaskPyramidIntegerBits = MASKPYRAMIDINTEGER}; \ enum {MaskPyramidFractionBits = MASKPYRAMIDFRACTION}; \ typedef SKIPSMMASK SKIPSMMaskPixelType; \ } // Traits for converting between image pixel types and pyramid pixel types // Pyramids require one more bit of precision than the regular image type. // SKIPSM math requires 6 bits on top of the pyramid type. // IMCOMP ALPHA MASK IMPYR I F SKIPI SKIPA MASKPYR I F SKIPM DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::Int8, vigra::UInt8, vigra::UInt8, vigra::Int16, 9, 7, vigra::Int32, vigra::Int16, vigra::Int16, 9, 7, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::UInt8, vigra::UInt8, vigra::UInt8, vigra::Int16, 9, 7, vigra::Int32, vigra::Int16, vigra::Int16, 9, 7, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::Int16, vigra::UInt8, vigra::UInt8, vigra::Int32, 17, 7, vigra::Int32, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::UInt16, vigra::UInt8, vigra::UInt8, vigra::Int32, 17, 7, vigra::Int32, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); //DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::Int32, vigra::UInt8, vigra::UInt8, vigra::Int64, 33, 25, vigra::Int64, vigra::Int16, vigra::Int32, 9, 17, vigra::Int32); //DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::UInt32, vigra::UInt8, vigra::UInt8, vigra::Int64, 33, 25, vigra::Int64, vigra::Int16, vigra::Int32, 9, 17, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::Int32, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::UInt32, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); //DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::Int64, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 17, vigra::Int32); //DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, vigra::UInt64, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 17, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, float, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); DEFINE_ENBLENDNUMERICTRAITS(IMAGETYPE, double, vigra::UInt8, vigra::UInt8, double, 8, 0, double, vigra::Int16, vigra::Int32, 9, 15, vigra::Int32); // Traits for correctly handling alpha/mask values in floating point files // This differs from NumericTraits for floating point values #define ALPHA_TRAITS(T1,S) \ template<> \ struct AlphaTraits \ { \ static T1 max() \ { \ return S; \ } \ static T1 zero() \ { \ return 0; \ } \ }; \ template<> \ struct AlphaTraits > \ { \ static T1 max() \ { \ return S; \ } \ static T1 zero() \ { \ return 0; \ } \ } template struct AlphaTraits; ALPHA_TRAITS(unsigned char, UCHAR_MAX); ALPHA_TRAITS(signed char, SCHAR_MAX); ALPHA_TRAITS(unsigned short, USHRT_MAX); ALPHA_TRAITS(signed short, SHRT_MAX); ALPHA_TRAITS(unsigned int, UINT_MAX); ALPHA_TRAITS(signed int, INT_MAX); ALPHA_TRAITS(float, 1.0); ALPHA_TRAITS(double, 1.0); #undef ALPHA_TRAITS } // namespace enblend #endif /* __NUMERICTRAITS_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/openmp.h0000644000175100017510000006032612224464371020033 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef OPENMP_H_INCLUDED_ #define OPENMP_H_INCLUDED_ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #if _OPENMP >= 200203 // at least OpenMP version 2.0 #include #include "muopt.h" #define OPENMP #define OPENMP_YEAR (_OPENMP / 100) #define OPENMP_MONTH (_OPENMP % 100) namespace omp { class lock { public: lock() {omp_init_lock(&lock_);} ~lock() {omp_destroy_lock(&lock_);} void set() {omp_set_lock(&lock_);} void unset() {omp_unset_lock(&lock_);} bool test() {return omp_test_lock(&lock_);} private: lock(const lock&); // not implemented lock& operator=(const lock&); // not implemented omp_lock_t lock_; }; } template inline void combineTwoImagesMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& functor) { #pragma omp parallel { const vigra::Size2D size(src1_lowerright - src1_upperleft); Functor f(functor); #pragma omp for schedule(guided) nowait for (int y = 0; y < size.y; ++y) { const vigra::Diff2D begin(0, y); const vigra::Diff2D end(size.x, y + 1); vigra::combineTwoImages(src1_upperleft + begin, src1_upperleft + end, src1_acc, src2_upperleft + begin, src2_acc, dest_upperleft + begin, dest_acc, f); } } // omp parallel } template inline void combineTwoImagesIfMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& functor) { #pragma omp parallel { const vigra::Size2D size(src1_lowerright - src1_upperleft); Functor f(functor); #pragma omp for schedule(guided) nowait for (int y = 0; y < size.y; ++y) { const vigra::Diff2D begin(0, y); const vigra::Diff2D end(size.x, y + 1); vigra::combineTwoImagesIf(src1_upperleft + begin, src1_upperleft + end, src1_acc, src2_upperleft + begin, src2_acc, mask_upperleft + begin, mask_acc, dest_upperleft + begin, dest_acc, f); } } // omp parallel } template inline void combineThreeImagesMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, SrcImageIterator3 src3_upperleft, SrcAccessor3 src3_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& functor) { #pragma omp parallel { const vigra::Size2D size(src1_lowerright - src1_upperleft); Functor f(functor); #pragma omp for schedule(guided) nowait for (int y = 0; y < size.y; ++y) { const vigra::Diff2D begin(0, y); const vigra::Diff2D end(size.x, y + 1); vigra::combineThreeImages(src1_upperleft + begin, src1_upperleft + end, src1_acc, src2_upperleft + begin, src2_acc, src3_upperleft + begin, src3_acc, dest_upperleft + begin, dest_acc, f); } } // omp parallel } template inline void transformImageMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& functor) { #pragma omp parallel { const vigra::Size2D size(src_lowerright - src_upperleft); Functor f(functor); #pragma omp for schedule(guided) nowait for (int y = 0; y < size.y; ++y) { const vigra::Diff2D begin(0, y); const vigra::Diff2D end(size.x, y + 1); vigra::transformImage(src_upperleft + begin, src_upperleft + end, src_acc, dest_upperleft + begin, dest_acc, f); } } // omp parallel } template inline void transformImageIfMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& functor) { #pragma omp parallel { const vigra::Size2D size(src_lowerright - src_upperleft); Functor f(functor); #pragma omp for schedule(guided) nowait for (int y = 0; y < size.y; ++y) { const vigra::Diff2D begin(0, y); const vigra::Diff2D end(size.x, y + 1); vigra::transformImageIf(src_upperleft + begin, src_upperleft + end, src_acc, mask_upperleft + begin, mask_acc, dest_upperleft + begin, dest_acc, f); } } // omp parallel } namespace fh { namespace detail { template inline static ValueType square(ValueType x) { return x * x; } // Pedro F. Felzenszwalb, Daniel P. Huttenlocher // "Distance Transforms of Sampled Functions" template struct ChessboardTransform1D { typedef ValueType value_type; int id() const {return 0;} void operator()(ValueType*, const ValueType*, int) const { vigra_fail("fh::detail::ChessboardTransform1D: not implemented"); } }; template struct ManhattanTransform1D { typedef ValueType value_type; int id() const {return 1;} void operator()(ValueType* d, const ValueType* f, int n) const { const ValueType one = static_cast(1); d[0] = f[0]; for (int q = 1; q < n; ++q) { d[q] = std::min(f[q], d[q - 1] + one); } for (int q = n - 2; q >= 0; --q) { d[q] = std::min(d[q], d[q + 1] + one); } } }; template struct EuclideanTransform1D { typedef ValueType value_type; int id() const {return 2;} void operator()(ValueType* d, const ValueType* f, int n) const { // IMPLEMENTATION NOTE: Defining math_t as float instead // of double would speed up the computation especially on // 64bit systems, but in rare occasions causes multiple // seam lines when using OpenMP. typedef double math_t; const math_t max = static_cast(std::numeric_limits::max()); int* v = new int[n]; math_t* z = new math_t[n + 1]; int k = 0; v[0] = 0; z[0] = -max; z[1] = max; for (int q = 1; q < n; ++q) { const math_t sum_q = static_cast(f[q]) + square(static_cast(q)); math_t s = (sum_q - (f[v[k]] + square(v[k]))) / (2 * (q - v[k])); while (s <= z[k]) { --k; s = (sum_q - (f[v[k]] + square(v[k]))) / (2 * (q - v[k])); } ++k; v[k] = q; z[k] = s; z[k + 1] = max; } k = 0; for (int q = 0; q < n; ++q) { while (z[k + 1] < static_cast(q)) { ++k; } d[q] = square(q - v[k]) + f[v[k]]; } delete [] v; delete [] z; } }; template void fhDistanceTransform(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, ValueType background, Transform1dFunctor transform1d) { typedef typename Transform1dFunctor::value_type DistanceType; typedef typename vigra::NumericTraits DistanceTraits; typedef vigra::BasicImage DistanceImageType; const vigra::Diff2D size(src_lowerright - src_upperleft); const int greatest_length = std::max(size.x, size.y); DistanceImageType intermediate(size); #pragma omp parallel { DistanceType* f = new DistanceType[greatest_length]; DistanceType* d = new DistanceType[greatest_length]; // IMPLEMENTATION NOTE // We need "guided" schedule to reduce the waiting time at the // (implicit) barriers. This holds true for the next OpenMP // parallelized "for" loop, too. #pragma omp for schedule(guided) for (int x = 0; x < size.x; ++x) { SrcImageIterator si(src_upperleft + vigra::Diff2D(x, 0)); for (DistanceType* pf = f; pf != f + size.y; ++pf, ++si.y) { *pf = sa(si) == background ? DistanceTraits::max() : DistanceTraits::zero(); } transform1d(d, f, size.y); typename DistanceImageType::column_iterator ci(intermediate.columnBegin(x)); for (DistanceType* pd = d; pd != d + size.y; ++pd, ++ci) { *ci = *pd; // IMPLEMENTATION NOTE // PREFETCH() about halves the number of stalls // per instruction of this loop! PREFETCH((ci + 1).operator->(), PREPARE_FOR_WRITE, HIGH_TEMPORAL_LOCALITY); } } #pragma omp for nowait schedule(guided) for (int y = 0; y < size.y; ++y) { transform1d(d, &intermediate(0, y), size.x); DestImageIterator i(dest_upperleft + vigra::Diff2D(0, y)); if (transform1d.id() == 2) { for (DistanceType* pd = d; pd != d + size.x; ++pd, ++i.x) { da.set(sqrt(*pd), i); } } else { for (DistanceType* pd = d; pd != d + size.x; ++pd, ++i.x) { da.set(*pd, i); } } } delete [] d; delete [] f; } // omp parallel } } // namespace detail } // namespace fh template void distanceTransformMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, ValueType background, int norm) { switch (norm) { case 0: fh::detail::fhDistanceTransform(src_upperleft, src_lowerright, sa, dest_upperleft, da, background, fh::detail::ChessboardTransform1D()); break; case 1: fh::detail::fhDistanceTransform(src_upperleft, src_lowerright, sa, dest_upperleft, da, background, fh::detail::ManhattanTransform1D()); break; case 2: // FALLTHROUGH default: fh::detail::fhDistanceTransform(src_upperleft, src_lowerright, sa, dest_upperleft, da, background, fh::detail::EuclideanTransform1D()); } } #else #undef OPENMP #define OPENMP_YEAR 0 #define OPENMP_MONTH 0 inline void omp_set_num_threads(int) {} inline int omp_get_num_threads() {return 1;} inline int omp_get_max_threads() {return 1;} inline int omp_get_thread_num() {return 0;} inline int omp_get_num_procs() {return 1;} inline void omp_set_dynamic(int) {} inline int omp_get_dynamic() {return 0;} inline int omp_in_parallel() {return 0;} inline void omp_set_nested(int) {} inline int omp_get_nested() {return 0;} namespace omp { class lock { public: lock() {} ~lock() {} void set() {} void unset() {} bool test() {return false;} private: lock(const lock&); // not implemented lock& operator=(const lock&); // not implemented }; } template inline void combineTwoImagesMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& func) { vigra::combineTwoImages(src1_upperleft, src1_lowerright, src1_acc, src2_upperleft, src2_acc, dest_upperleft, dest_acc, func); } template inline void combineTwoImagesIfMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& func) { vigra::combineTwoImagesIf(src1_upperleft, src1_lowerright, src1_acc, src2_upperleft, src2_acc, mask_upperleft, mask_acc, dest_upperleft, dest_acc, func); } template inline void combineThreeImagesMP(SrcImageIterator1 src1_upperleft, SrcImageIterator1 src1_lowerright, SrcAccessor1 src1_acc, SrcImageIterator2 src2_upperleft, SrcAccessor2 src2_acc, SrcImageIterator3 src3_upperleft, SrcAccessor3 src3_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& func) { vigra::combineThreeImages(src1_upperleft, src1_lowerright, src1_acc, src2_upperleft, src2_acc, src3_upperleft, src3_acc, dest_upperleft, dest_acc, func); } template inline void transformImageMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& func) { vigra::transformImage(src_upperleft, src_lowerright, src_acc, dest_upperleft, dest_acc, func); } template inline void transformImageIfMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, MaskImageIterator mask_upperleft, MaskAccessor mask_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, const Functor& func) { vigra::transformImageIf(src_upperleft, src_lowerright, src_acc, mask_upperleft, mask_acc, dest_upperleft, dest_acc, func); } template void distanceTransformMP(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor src_acc, DestImageIterator dest_upperleft, DestAccessor dest_acc, ValueType background, int norm) { vigra::distanceTransform(src_upperleft, src_lowerright, src_acc, dest_upperleft, dest_acc, background, norm); } #endif // _OPENMP >= 200505 // Answer whether the underlying OpenMP implementation really (thinks // that it) supports nested parallelism. inline static bool have_openmp_nested() { const bool openmp_nested = omp_get_nested(); omp_set_nested(true); const bool result = omp_get_nested() != 0; omp_set_nested(openmp_nested); return result; } // Answer whether the underlying OpenMP implementation really (thinks // that it) supports dynamic adjustment of the number of threads. inline static bool have_openmp_dynamic() { const bool openmp_dynamic = omp_get_dynamic(); omp_set_dynamic(true); const bool result = omp_get_dynamic() != 0; omp_set_dynamic(openmp_dynamic); return result; } // // Argument Object Factory versions // template inline void combineTwoImagesMP(vigra::triple src1, vigra::pair src2, vigra::pair dest, const Functor& functor) { combineTwoImagesMP(src1.first, src1.second, src1.third, src2.first, src2.second, dest.first, dest.second, functor); } template inline void combineTwoImagesIfMP(vigra::triple src1, vigra::pair src2, vigra::pair mask, vigra::pair dest, const Functor& functor) { combineTwoImagesIfMP(src1.first, src1.second, src1.third, src2.first, src2.second, mask.first, mask.second, dest.first, dest.second, functor); } template inline void combineThreeImagesMP(vigra::triple src1, vigra::pair src2, vigra::pair src3, vigra::pair dest, const Functor& functor) { combineThreeImagesMP(src1.first, src1.second, src1.third, src2.first, src2.second, src3.first, src3.second, dest.first, dest.second, functor); } template inline void transformImageMP(vigra::triple src, vigra::pair dest, const Functor& functor) { transformImageMP(src.first, src.second, src.third, dest.first, dest.second, functor); } template inline void transformImageIfMP(vigra::triple src, vigra::pair mask, vigra::pair dest, const Functor& functor) { transformImageIfMP(src.first, src.second, src.third, mask.first, mask.second, dest.first, dest.second, functor); } template inline void distanceTransformMP(vigra::triple src, vigra::pair dest, ValueType background, int norm) { distanceTransformMP(src.first, src.second, src.third, dest.first, dest.second, background, norm); } #endif // OPENMP_H_INCLUDED_ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/filespec.h0000644000175100017510000000563312070530113020312 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __FILESPEC_H__ #define __FILESPEC_H__ #include #include #include "selector.h" #define RESPONSE_FILE_PREFIX_CHAR '@' #define RESPONSE_FILE_COMMENT_CHAR '#' #define WHITESPACE_CHARS "\n\r\t " namespace enblend { typedef std::list FileNameList; typedef std::pair FilePosition; /** Filename, line number pairs */ typedef std::list FilePositionTrace; /** Traceback to a file position */ /** Print the (back-)trace of all response files opened so far. */ void unroll_trace(const FilePositionTrace& a_trace); class TraceableFileName { public: TraceableFileName(const std::string& a_filename, const FilePositionTrace& a_trace, selector::Abstract* a_selector) : filename_(a_filename), trace_(a_trace), selector_(a_selector) {} virtual ~TraceableFileName() {} const std::string& filename() const {return filename_;} const FilePositionTrace& trace() const {return trace_;} void unroll_trace() const {enblend::unroll_trace(trace_);} selector::Abstract* selector() const {return selector_;} private: const std::string filename_; const FilePositionTrace trace_; selector::Abstract* const selector_; }; typedef std::list TraceableFileNameList; /** */ /** Recursively unfold filename which may be a literal name or a * response file. The result is a list of only literal * filenames. */ void unfold_filename(TraceableFileNameList& result, const std::string& filename); /** Answer whether we suspect filename is a response file. */ bool maybe_response_file(const std::string& filename); /** List of algorithm name / algorithm description pairs */ typedef std::list > algorithm_list; /** Answer a list of all globbing algorithms including aliases * that are known, i.e., have been compiled in. */ algorithm_list known_globbing_algorithms(); } #endif /* __FILESPEC_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/global.h0000644000175100017510000002330412070530113017753 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __GLOBAL_H__ #define __GLOBAL_H__ // Here we define macros and types that we already need in the // definitions of global variables. #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef HAVE_UNORDERED_MAP #include #else #include #endif #include #include // Defines to control how many -v flags are required for each type // of message to be produced on stdout. #define VERBOSE_ASSEMBLE_MESSAGES 1 #define VERBOSE_CHECKPOINTING_MESSAGES 1 #define VERBOSE_BLEND_MESSAGES 2 #define VERBOSE_GPU_MESSAGES 2 #define VERBOSE_MASK_MESSAGES 2 #define VERBOSE_NFT_MESSAGES 2 #define VERBOSE_PYRAMID_MESSAGES 2 #define VERBOSE_SIGNATURE_REPORTING 2 #define VERBOSE_VERSION_REPORTING 2 #define VERBOSE_COLOR_CONVERSION_MESSAGES 3 #define VERBOSE_DIFFERENCE_STATISTICS 3 #define VERBOSE_LAYER_SELECTION 3 #define VERBOSE_RESPONSE_FILES 3 #define VERBOSE_ABB_MESSAGES 4 #define VERBOSE_IBB_MESSAGES 4 #define VERBOSE_INPUT_IMAGE_INFO_MESSAGES 4 #define VERBOSE_INPUT_UNION_SIZE_MESSAGES 4 #define VERBOSE_ROIBB_SIZE_MESSAGES 4 #define VERBOSE_UBB_MESSAGES 4 #define VERBOSE_CFI_MESSAGES 5 #define VERBOSE_GDA_MESSAGES 5 #define VERBOSE_MEMORY_ESTIMATION_MESSAGES 6 //< src::default-output-filename a.tif #define DEFAULT_OUTPUT_FILENAME "a.tif" // Safely retrieve the string associated with m_name from OpenGL. #define GLGETSTRING(m_name) \ (glGetString(m_name) == NULL ? \ "" : \ (const char*) (glGetString(m_name))) class AlternativePercentage { public: AlternativePercentage(double value, bool is_percentage) : value_(value), is_percentage_(is_percentage) {} double value() const {return value_;} double is_percentage() const {return is_percentage_;} void set_value(double value) {value_ = value;} void set_percentage(bool is_percentage) {is_percentage_ = is_percentage;} std::string str() const { std::ostringstream oss; oss << value_; if (is_percentage_) { oss << "%"; } return oss.str(); } template bool is_effective() const { return value_ > 0.0 && ((is_percentage_ && value_ < 100.0) || (!is_percentage_ && value_ < vigra::NumericTraits::max())); } template T instantiate() const { return is_percentage_ ? value_ * static_cast(vigra::NumericTraits::max()) / 100.0 : value_; } private: double value_; bool is_percentage_; }; /** The different kinds of boundary conditions we can impose upon an * image. */ typedef enum BoundaryKind { UnknownWrapAround, // unknown kind OpenBoundaries, // contractible HorizontalStrip, // contractible along 2nd axis VerticalStrip, // contractible along 1st axis DoubleStrip // non-contractible } boundary_t; enum MainAlgo { NFT, GraphCut }; //< src::default-tiff-resolution 300@dmn{dpi} #define DEFAULT_TIFF_RESOLUTION 300.0f struct TiffResolution { TiffResolution() : x(0.0f), y(0.0f) {} TiffResolution(float anXresolution, float aYresolution) : x(anXresolution), y(aYresolution) {} bool operator==(const TiffResolution& anOther) const { return this->x == anOther.x && this->y == anOther.y; } bool operator!=(const TiffResolution& anOther) const { return !operator==(anOther); } float x; float y; }; struct conversion_error : public std::runtime_error { conversion_error(const std::string& a_message) : std::runtime_error(a_message) {} }; class ParameterValue { public: ParameterValue() : value_as_string(std::string()), integer(NULL), unsigned_integer(NULL), floating_point(NULL), boolean(NULL) {initialize();} ParameterValue(const std::string& a_string) : value_as_string(a_string), integer(NULL), unsigned_integer(NULL), floating_point(NULL), boolean(NULL) {initialize();} ParameterValue(const ParameterValue& parameter_value) : value_as_string(parameter_value.value_as_string), integer(NULL), unsigned_integer(NULL), floating_point(NULL), boolean(NULL) {copy_cached_values(parameter_value);} ParameterValue& operator=(const ParameterValue& parameter_value) { if (this != ¶meter_value) { value_as_string = parameter_value.value_as_string; release_memory(); copy_cached_values(parameter_value); } return *this; } virtual ~ParameterValue() {release_memory();} std::string as_string() const {return value_as_string;} const char* as_c_string() const {return value_as_string.c_str();} int as_integer() const { if (integer == NULL) { throw conversion_error("cannot convert \"" + value_as_string + "\" to an integer"); } else { return *integer; } } unsigned as_unsigned() const { if (unsigned_integer == NULL) { throw conversion_error("cannot convert \"" + value_as_string + "\" to an unsigned integer"); } else { return *unsigned_integer; } } double as_double() const { if (floating_point == NULL) { throw conversion_error("cannot convert \"" + value_as_string + "\" to a floating-point number"); } else { return *floating_point; } } bool as_boolean() const { if (boolean == NULL) { throw conversion_error("cannot convert \"" + value_as_string + "\" to a boolean"); } else { return *boolean; } } private: void initialize() { initialize_integer(); initialize_unsigned_integer(); initialize_floating_point(); initialize_boolean(); } void initialize_integer() { char* end; errno = 0; const int i = strtol(value_as_string.c_str(), &end, 10); if (errno == 0 && *end == 0) { integer = new int; *integer = i; } } void initialize_unsigned_integer() { char* end; errno = 0; const unsigned u = strtoul(value_as_string.c_str(), &end, 10); if (errno == 0 && *end == 0) { unsigned_integer = new unsigned; *unsigned_integer = u; } } void initialize_floating_point() { char* end; errno = 0; const double x = strtod(value_as_string.c_str(), &end); if (errno == 0 && *end == 0) { floating_point = new double; *floating_point = x; } } void initialize_boolean() { std::string s(value_as_string); boost::algorithm::to_lower(s); bool b; if (s.empty() || s == "f" || s == "false") { b = false; } else if (s == "t" || s == "true") { b = true; } else { char* end; errno = 0; b = strtol(value_as_string.c_str(), &end, 10); if (errno != 0 || *end != 0) { return; } } boolean = new bool; *boolean = b; } void copy_cached_values(const ParameterValue& parameter_value) { if (parameter_value.integer != NULL) { integer = new int; *integer = *parameter_value.integer; } if (parameter_value.unsigned_integer != NULL) { unsigned_integer = new unsigned; *unsigned_integer = *parameter_value.unsigned_integer; } if (parameter_value.floating_point != NULL) { floating_point = new double; *floating_point = *parameter_value.floating_point; } if (parameter_value.boolean != NULL) { boolean = new bool; *boolean = *parameter_value.boolean; } } void release_memory() { delete integer; delete unsigned_integer; delete floating_point; delete boolean; } std::string value_as_string; int* integer; unsigned* unsigned_integer; double* floating_point; bool* boolean; }; #ifdef HAVE_UNORDERED_MAP typedef std::unordered_map parameter_map; #else typedef std::map parameter_map; #endif #endif /* __GLOBAL_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/postoptimizer.h0000644000175100017510000005224712070530501021454 0ustar ametzlerametzler/* * Copyright (C) 2011-2012 Mikolaj Leszczynski * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __POSTOPTIMIZER_H__ #define __POSTOPTIMIZER_H__ #include #include "vigra_ext/rect2d.hxx" #include "anneal.h" #include "masktypedefs.h" #include "mask.h" using vigra::functor::Arg1; using vigra::functor::Arg2; using vigra::functor::Arg3; using vigra::functor::ifThenElse; using vigra::functor::Param; using vigra::functor::UnaryFunctor; namespace enblend { // Base abstract class for optimizer plugins template class PostOptimizer { public: PostOptimizer(MismatchImageType* aMismatchImage, VisualizeImageType* aVisualizeImage, vigra::Size2D* aMismatchImageSize, int* aMismatchImageStride, vigra::Diff2D* aUVBBStrideOffset, ContourVector* someContours, const vigra::Rect2D* aUBB, vigra::Rect2D* aVBB, std::vector* someParameters, const AlphaType* aWhiteAlpha, const AlphaType* aBlackAlpha, const vigra::Rect2D* aUVBB) : mismatchImage(aMismatchImage), visualizeImage(aVisualizeImage), mismatchImageSize(aMismatchImageSize), mismatchImageStride(aMismatchImageStride), uvBBStrideOffset(aUVBBStrideOffset), contours(someContours), uBB(aUBB), vBB(aVBB), parameters(*someParameters), whiteAlpha(aWhiteAlpha), blackAlpha(aBlackAlpha), uvBB(aUVBB) {} virtual void runOptimizer() {} virtual ~PostOptimizer() {} protected: virtual void configureOptimizer() {} MismatchImageType* mismatchImage; VisualizeImageType* visualizeImage; vigra::Size2D* mismatchImageSize; int* mismatchImageStride; vigra::Diff2D* uvBBStrideOffset; ContourVector* contours; const vigra::Rect2D* uBB; vigra::Rect2D* vBB; std::vector parameters; const AlphaType* whiteAlpha; const AlphaType* blackAlpha; const vigra::Rect2D* uvBB; private: PostOptimizer(PostOptimizer* other); // NOT IMPLEMENTED PostOptimizer& operator=(const PostOptimizer &other); // NOT IMPLEMENTED PostOptimizer(); // NOT IMPLEMENTED }; // Optimizer strategy 1: Anneal optimizer template class AnnealOptimizer : public PostOptimizer { public: typedef PostOptimizer super; AnnealOptimizer(MismatchImageType* mismatchImage, VisualizeImageType* visualizeImage, vigra::Size2D* mismatchImageSize, int* mismatchImageStride, vigra::Diff2D* uvBBStrideOffset, ContourVector* contours, const vigra::Rect2D* uBB, vigra::Rect2D* vBB, std::vector* parameters, const AlphaType* whiteAlpha, const AlphaType* blackAlpha, const vigra::Rect2D* uvBB) : super(mismatchImage, visualizeImage, mismatchImageSize, mismatchImageStride, uvBBStrideOffset, contours, uBB, vBB, parameters, whiteAlpha, blackAlpha, uvBB) {} virtual void runOptimizer() { configureOptimizer(); int segmentNumber; for (ContourVector::iterator currentContour = (*this->contours).begin(); currentContour != (*this->contours).end(); ++currentContour) { segmentNumber = 0; for (Contour::iterator currentSegment = (*currentContour)->begin(); currentSegment != (*currentContour)->end(); ++currentSegment, ++segmentNumber) { Segment* snake = *currentSegment; if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << command << ": info: Annealing Optimizer, s" << segmentNumber << ":"; cerr.flush(); } if (snake->empty()) { cerr << endl << command << ": warning: seam s" << segmentNumber - 1 << " is a tiny closed contour and was removed before optimization" << endl; continue; } annealSnake(this->mismatchImage, OptimizerWeights, snake, this->visualizeImage); // Post-process annealed vertices Segment::iterator lastVertex = enblend::prev(snake->end()); for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end();) { if (vertexIterator->first && (*this->mismatchImage)[vertexIterator->second] == vigra::NumericTraits::max()) { // Vertex is still in max-cost region. Delete it. if (vertexIterator == snake->begin()) { snake->pop_front(); vertexIterator = snake->begin(); } else { vertexIterator = snake->erase(enblend::next(lastVertex)); } bool needsBreak = false; if (vertexIterator == snake->end()) { vertexIterator = snake->begin(); needsBreak = true; } // vertexIterator now points to next entry. // It is conceivable but very unlikely that every vertex in a closed contour // ended up in the max-cost region after annealing. if (snake->empty()) { break; } if (!(lastVertex->first || vertexIterator->first)) { // We deleted an entire range of moveable points between two nonmoveable points. // insert dummy point after lastVertex so dijkstra can work over this range. if (vertexIterator == snake->begin()) { snake->push_front(std::make_pair(true, vertexIterator->second)); lastVertex = snake->begin(); } else { lastVertex = snake->insert(enblend::next(lastVertex), std::make_pair(true, vertexIterator->second)); } } if (needsBreak) { break; } } else { lastVertex = vertexIterator; ++vertexIterator; } } if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << endl; } // Print an explanation if every vertex in a closed contour ended up in the // max-cost region after annealing. // FIXME: explain how to fix this problem in the error message! if (snake->empty()) { cerr << endl << command << ": seam s" << segmentNumber - 1 << " is a tiny closed contour and was removed after optimization" << endl; } } } } virtual ~AnnealOptimizer() {} private: void configureOptimizer() { // Areas other than intersection region have maximum cost. combineThreeImagesMP(vigra_ext::stride(*this->mismatchImageStride, *this->mismatchImageStride, vigra_ext::apply(*this->uvBB, srcImageRange(*this->whiteAlpha))), vigra_ext::stride(*this->mismatchImageStride, *this->mismatchImageStride, vigra_ext::apply(*this->uvBB, srcImage(*this->blackAlpha))), srcIter((this->mismatchImage)->upperLeft() + *this->uvBBStrideOffset), destIter((this->mismatchImage)->upperLeft() + *this->uvBBStrideOffset), ifThenElse(Arg1() & Arg2(), Arg3(), Param(vigra::NumericTraits::max()))); } AnnealOptimizer(AnnealOptimizer* other); // NOT IMPLEMENTED AnnealOptimizer& operator=(const AnnealOptimizer &other); // NOT IMPLEMENTED AnnealOptimizer(); // NOT IMPLEMENTED }; // Optimizer Strategy 2: Dijkstra optimizer template class DijkstraOptimizer : public PostOptimizer { public: typedef PostOptimizer super; DijkstraOptimizer(MismatchImageType* mismatchImage, VisualizeImageType* visualizeImage, vigra::Size2D* mismatchImageSize, int* mismatchImageStride, vigra::Diff2D* uvBBStrideOffset, ContourVector* contours, const vigra::Rect2D* uBB, vigra::Rect2D* vBB, std::vector* parameters, const AlphaType* whiteAlpha, const AlphaType* blackAlpha, const vigra::Rect2D* uvBB) : super(mismatchImage, visualizeImage, mismatchImageSize, mismatchImageStride, uvBBStrideOffset, contours, uBB, vBB, parameters, whiteAlpha, blackAlpha, uvBB) {} virtual void runOptimizer() { configureOptimizer(); vigra::Rect2D withinMismatchImage(*this->mismatchImageSize); int segmentNumber; if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << command << ": info: Dijkstra Optimizer:"; cerr.flush(); } // Use Dijkstra to route between moveable snake vertices over mismatchImage. for (ContourVector::iterator currentContour = (*this->contours).begin(); currentContour != (*this->contours).end(); ++currentContour) { segmentNumber = 0; for (Contour::iterator currentSegment = (*currentContour)->begin(); currentSegment != (*currentContour)->end(); ++currentSegment, ++segmentNumber) { Segment* snake = *currentSegment; if (snake->empty()) { continue; } if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << " s" << segmentNumber; cerr.flush(); } for (Segment::iterator currentVertex = snake->begin(); ; ) { Segment::iterator nextVertex = currentVertex; ++nextVertex; if (nextVertex == snake->end()) { nextVertex = snake->begin(); } if (currentVertex->first || nextVertex->first) { // Find shortest path between these points vigra::Point2D currentPoint = currentVertex->second; vigra::Point2D nextPoint = nextVertex->second; vigra::Rect2D pointSurround(currentPoint, vigra::Size2D(1, 1)); pointSurround |= vigra::Rect2D(nextPoint, vigra::Size2D(1, 1)); pointSurround.addBorder(DijkstraRadius); pointSurround &= withinMismatchImage; // Make BasicImage to hold pointSurround portion of mismatchImage. // min cost path needs inexpensive random access to cost image. vigra::BasicImage mismatchROIImage(pointSurround.size()); copyImage(vigra_ext::apply(pointSurround, srcImageRange(*this->mismatchImage)), destImage(mismatchROIImage)); std::vector* shortPath = minCostPath(srcImageRange(mismatchROIImage), vigra::Point2D(nextPoint - pointSurround.upperLeft()), vigra::Point2D(currentPoint - pointSurround.upperLeft())); for (std::vector::iterator shortPathPoint = shortPath->begin(); shortPathPoint != shortPath->end(); ++shortPathPoint) { snake->insert(enblend::next(currentVertex), std::make_pair(false, *shortPathPoint + pointSurround.upperLeft())); if (this->visualizeImage) { (*this->visualizeImage)[*shortPathPoint + pointSurround.upperLeft()] = VISUALIZE_SHORT_PATH_VALUE; } } delete shortPath; if (this->visualizeImage) { (*this->visualizeImage)[currentPoint] = currentVertex->first ? VISUALIZE_FIRST_VERTEX_VALUE : VISUALIZE_NEXT_VERTEX_VALUE; (*this->visualizeImage)[nextPoint] = nextVertex->first ? VISUALIZE_FIRST_VERTEX_VALUE : VISUALIZE_NEXT_VERTEX_VALUE; } } currentVertex = nextVertex; if (nextVertex == snake->begin()) { break; } } } } if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << endl; } } virtual ~DijkstraOptimizer() {} private: void configureOptimizer() { combineThreeImagesMP(vigra_ext::stride(*this->mismatchImageStride, *this->mismatchImageStride, vigra_ext::apply(*this->uvBB, srcImageRange(*this->whiteAlpha))), vigra_ext::stride(*this->mismatchImageStride, *this->mismatchImageStride, vigra_ext::apply(*this->uvBB, srcImage(*this->blackAlpha))), srcIter((this->mismatchImage)->upperLeft() + *this->uvBBStrideOffset), destIter((this->mismatchImage)->upperLeft() + *this->uvBBStrideOffset), ifThenElse(!(Arg1() || Arg2()), Param(vigra::NumericTraits::one()), Arg3())); } DijkstraOptimizer(DijkstraOptimizer* other); // NOT IMPLEMENTED DijkstraOptimizer& operator=(const DijkstraOptimizer &other); // NOT IMPLEMENTED DijkstraOptimizer(); // NOT IMPLEMENTED }; template class OptimizerChain : public PostOptimizer { public: typedef PostOptimizer super; typedef std::vector optimizer_list_t; OptimizerChain(MismatchImageType* mismatchImage, VisualizeImageType* visualizeImage, vigra::Size2D* mismatchImageSize, int* mismatchImageStride, vigra::Diff2D* uvBBStrideOffset, ContourVector* contours, const vigra::Rect2D* uBB, vigra::Rect2D* vBB, std::vector* parameters, const AlphaType* whiteAlpha, const AlphaType* blackAlpha, const vigra::Rect2D* uvBB) : super(mismatchImage, visualizeImage, mismatchImageSize, mismatchImageStride, uvBBStrideOffset, contours, uBB, vBB, parameters, whiteAlpha, blackAlpha, uvBB), currentOptimizer(0) {} void addOptimizer(const std::string& anOptimizerName) { typedef enum {NO_OPTIMIZER, ANNEAL_OPTIMIZER, DIJKSTRA_OPTIMIZER} optimizer_id_t; optimizer_id_t id = NO_OPTIMIZER; if (anOptimizerName == "anneal") { id = ANNEAL_OPTIMIZER; } else if (anOptimizerName == "dijkstra") { id = DIJKSTRA_OPTIMIZER; } switch (id) { case ANNEAL_OPTIMIZER: optimizerList.push_back(new AnnealOptimizer (this->mismatchImage, this->visualizeImage, this->mismatchImageSize, this->mismatchImageStride, this->uvBBStrideOffset, this->contours, this->uBB, this->vBB, &this->parameters, this->whiteAlpha, this->blackAlpha, this->uvBB)); break; case DIJKSTRA_OPTIMIZER: optimizerList.push_back(new DijkstraOptimizer (this->mismatchImage, this->visualizeImage, this->mismatchImageSize, this->mismatchImageStride, this->uvBBStrideOffset, this->contours, this->uBB, this->vBB, &this->parameters, this->whiteAlpha, this->blackAlpha, this->uvBB)); break; default: throw never_reached("switch control expression \"id\" (optimizer selection) out of range"); } } //Runs every optimizer added to the list sequentially in FIFO order void runOptimizerChain() { for (typename optimizer_list_t::iterator i = optimizerList.begin(); i != optimizerList.end(); ++i) { (*i)->runOptimizer(); } } /*Runs current optimizer and increments the counter provided there are still * optimizers in the chain to run. Used primarily for debugging purposes. * For other uses, use the runOptimizerChain() function */ void runCurrentOptimizer() { if (currentOptimizer < optimizerList.size()) { optimizerList[currentOptimizer]->runOptimizer(); ++currentOptimizer; } } virtual ~OptimizerChain() { std::for_each(optimizerList.begin(), optimizerList.end(), bind(delete_ptr(), boost::lambda::_1)); } private: OptimizerChain(OptimizerChain* other); // NOT IMPLEMENTED OptimizerChain& operator=(const OptimizerChain &other); // NOT IMPLEMENTED OptimizerChain(); // NOT IMPLEMENTED optimizer_list_t optimizerList; size_t currentOptimizer; }; } // namespace enblend #endif /* __POSTOPTIMIZER_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/DefaultSig.pm0000644000175100017510000001022712070530113020727 0ustar ametzlerametzler# name: DefaultSig.pm # synopsis: base class for signature generation # author: Dr. Christoph L. Spiel # perl version: 5.10.0 # This file is part of Enblend. # Licence details can be found in the file COPYING. package DefaultSig; use strict; use warnings; use English; use Sys::Hostname; our %HAVE_MODULE; BEGIN { foreach my $module (qw(Time::Zone)) { eval "use $module ()"; # import, but keep module's original name space for clarity $HAVE_MODULE{$module} = $EVAL_ERROR eq ''; } } sub new { my ($class, $do_use_gmt) = @_; my $self = {}; bless $self, $class; $self->_initialize($do_use_gmt); return $self; } sub _initialize { my ($self, $do_use_gmt) = @_; $self->{USERNAME} = $self->_real_user_name(); $self->{HOSTNAME} = $self->_clean_hostname(); $self->use_gmt($do_use_gmt); $self->update_date_and_time(); } sub get_username {my $self = shift; return $self->{USERNAME}} sub get_hostname {my $self = shift; return $self->{HOSTNAME}} sub get_date {my $self = shift; return $self->{DATE}} sub get_time {my $self = shift; return $self->{TIME}} sub is_using_gmt {my $self = shift; return $self->{USE_GMT} != 0} sub use_gmt { my ($self, $x) = @_; $self->{USE_GMT} = $x ? ($x == 0 ? 0 : 1) : 0; } # Answer a formatted date based on the current date. # # 1 <= $day_of_month <= 31 # 1 <= $month <= 12 # 1900 <= $year # 0 <= $day_of_week <= 7 # $weekday: Mon, Tue, ... # $monthname: Jan, Feb, ... sub format_date { my ($self, $day_of_month, $month, $year, $day_of_week, $weekday, $monthname) = @_; return sprintf("%s, %s %02u %u", $weekday, $monthname, $day_of_month, $year); } # Answer a formatted time based on the current time. sub format_time { my ($self, $second, $minute, $hour) = @_; my $time = sprintf("%02u:%02u:%02u", $hour, $minute, $second); if ($self->is_using_gmt()) { $time .= " GMT"; } else { if ($HAVE_MODULE{'Time::Zone'}) { $time .= sprintf(" GMT%+d", Time::Zone::tz_offset($ENV{'TZ'}) / 3600.0); # alternatively: # $time .= " " . Time::Zone::tz_name($ENV{'TZ'}); } } return $time; } sub weekdays {my $self = shift; return [qw(Sun Mon Tue Wed Thu Fri Sat)]} sub monthnames {my $self = shift; return [qw(Jan Feb Mar May Jun Jul Aug Sep Oct Nov Dec)]} # Update date and time fields simultaneously to get a consistent time # stamp. If is_using_gmt() use GMT instead of the local time (maybe # defined by the TZ environment variable). sub update_date_and_time { my $self = shift; my ($second, $minute, $hour, $day_of_month, $month, $year, $day_of_week) = $self->is_using_gmt() ? gmtime : localtime; $self->{DATE} = $self->format_date($day_of_month, $month, $year + 1900, $day_of_week, $self->weekdays->[$day_of_week], $self->monthnames->[$month - 1]); $self->{TIME} = $self->format_time($second, $minute, $hour); } sub signature { my $self = shift; return sprintf("Compiled on %s by %s on %s, %s.", $self->get_hostname(), $self->get_username(), $self->get_date(), $self->get_time()); } sub _login_name { my $self = shift; return getlogin or 'anonymous'; } # Try to derive the real user name from Perl's built-in user id. # Answer the user's login name if we do not find a real name. sub _real_user_name { my $self = shift; if ($OSNAME eq 'MSWin32') { return $self->_login_name(); } else { my ($login_name, undef, undef, undef, undef, undef, $gcos) = getpwuid $REAL_USER_ID; if ($gcos) { my ($real_user_name) = split m/,/, $gcos; return $real_user_name if $real_user_name; } if ($login_name) { return $login_name; } else { return $self->_login_name(); } } } sub _clean_hostname { my $self = shift; my $hostname = hostname(); if ($OSNAME =~ m/MacOS/) { $hostname =~ s/^(.*?)[-.].*$/$1/; } return $hostname; } 1; enblend-enfuse-4.1.2+dfsg/src/tiff_message.h0000644000175100017510000000231012070530113021141 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __TIFF_MESSAGE_H__ #define __TIFF_MESSAGE_H__ #include /** Function that intercepts warnings from the TIFF library */ void tiff_warning(const char* module, const char* format, va_list arguments); /** Function that intercepts errors from the TIFF library */ void tiff_error(const char* module, const char* format, va_list arguments); #endif /* __TIFF_MESSAGE_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/Makefile.in0000664000175100017510000015474512232763264020446 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = enblend$(EXEEXT) enfuse$(EXEEXT) subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" PROGRAMS = $(bin_PROGRAMS) am_enblend_OBJECTS = enblend-enblend.$(OBJEXT) enblend-gpu.$(OBJEXT) \ enblend-error_message.$(OBJEXT) \ enblend-filenameparse.$(OBJEXT) enblend-filespec.$(OBJEXT) \ enblend-self_test.$(OBJEXT) enblend-tiff_message.$(OBJEXT) enblend_OBJECTS = $(am_enblend_OBJECTS) am__DEPENDENCIES_1 = enblend_DEPENDENCIES = layer_selection/liblayersel.a \ $(am__DEPENDENCIES_1) enblend_LINK = $(CXXLD) $(enblend_CXXFLAGS) $(CXXFLAGS) \ $(enblend_LDFLAGS) $(LDFLAGS) -o $@ am_enfuse_OBJECTS = enfuse-enfuse.$(OBJEXT) \ enfuse-error_message.$(OBJEXT) enfuse-filenameparse.$(OBJEXT) \ enfuse-filespec.$(OBJEXT) enfuse-self_test.$(OBJEXT) \ enfuse-tiff_message.$(OBJEXT) enfuse_OBJECTS = $(am_enfuse_OBJECTS) enfuse_DEPENDENCIES = layer_selection/liblayersel.a enfuse_LINK = $(CXXLD) $(enfuse_CXXFLAGS) $(CXXFLAGS) \ $(enfuse_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(enblend_SOURCES) $(enfuse_SOURCES) DIST_SOURCES = $(enblend_SOURCES) $(enfuse_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 NROFF = nroff MANS = $(man_MANS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = $(EXTRACPPFLAGS) AM_CFLAGS = $(EXTRACFLAGS) AM_CXXFLAGS = $(EXTRACXXFLAGS) AM_LDFLAGS = $(EXTRALDFLAGS) SUBDIRS = layer_selection enblend_SOURCES = anneal.h assemble.h blend.h bounds.h \ common.h enblend.h enblend.cc fixmath.h \ global.h gpu.cc gpu.h graphcut.h \ maskcommon.h masktypedefs.h mask.h postoptimizer.h \ nearest.h numerictraits.h openmp.h path.h pyramid.h \ error_message.h error_message.cc \ filenameparse.h filenameparse.cc \ filespec.h filespec.cc \ self_test.h self_test.cc \ tiff_message.h tiff_message.cc \ minimizer.h muopt.h enblend_LDFLAGS = $(AM_LDFLAGS) $(OPENGL_CFLAGS) enblend_LDADD = layer_selection/liblayersel.a \ $(GSL_LIBS) $(OPENGL_LIBS) @EXTRA_LIBS@ enblend_CXXFLAGS = $(AM_CXXFLAGS) $(GSL_CFLAGS) $(OPENGL_CFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src/layer_selection enfuse_SOURCES = assemble.h blend.h bounds.h common.h \ enfuse.h enfuse.cc fixmath.h \ global.h mga.h numerictraits.h openmp.h pyramid.h \ error_message.h error_message.cc \ filenameparse.h filenameparse.cc \ filespec.h filespec.cc \ self_test.h self_test.cc \ tiff_message.h tiff_message.cc \ minimizer.h muopt.h enfuse_LDFLAGS = $(AM_LDFLAGS) enfuse_LDADD = layer_selection/liblayersel.a \ $(GSL_LIBS) @EXTRA_LIBS@ enfuse_CXXFLAGS = $(AM_CXXFLAGS) $(GSL_CFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src/layer_selection EXTRA_DIST = enblend.1 enfuse.1 \ gen_sig DefaultSig.pm Sig.pm \ CMakeLists.txt DISTCLEANFILES = enblend.1 enfuse.1 # Generated sources BUILT_SOURCES = signature.h CLEANFILES = signature.h # Documentation man_MANS = enblend.1 enfuse.1 all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) enblend$(EXEEXT): $(enblend_OBJECTS) $(enblend_DEPENDENCIES) $(EXTRA_enblend_DEPENDENCIES) @rm -f enblend$(EXEEXT) $(AM_V_CXXLD)$(enblend_LINK) $(enblend_OBJECTS) $(enblend_LDADD) $(LIBS) enfuse$(EXEEXT): $(enfuse_OBJECTS) $(enfuse_DEPENDENCIES) $(EXTRA_enfuse_DEPENDENCIES) @rm -f enfuse$(EXEEXT) $(AM_V_CXXLD)$(enfuse_LINK) $(enfuse_OBJECTS) $(enfuse_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-enblend.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-error_message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-filenameparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-filespec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-gpu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-self_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enblend-tiff_message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-enfuse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-error_message.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-filenameparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-filespec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-self_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/enfuse-tiff_message.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` enblend-enblend.o: enblend.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-enblend.o -MD -MP -MF $(DEPDIR)/enblend-enblend.Tpo -c -o enblend-enblend.o `test -f 'enblend.cc' || echo '$(srcdir)/'`enblend.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-enblend.Tpo $(DEPDIR)/enblend-enblend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enblend.cc' object='enblend-enblend.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-enblend.o `test -f 'enblend.cc' || echo '$(srcdir)/'`enblend.cc enblend-enblend.obj: enblend.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-enblend.obj -MD -MP -MF $(DEPDIR)/enblend-enblend.Tpo -c -o enblend-enblend.obj `if test -f 'enblend.cc'; then $(CYGPATH_W) 'enblend.cc'; else $(CYGPATH_W) '$(srcdir)/enblend.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-enblend.Tpo $(DEPDIR)/enblend-enblend.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enblend.cc' object='enblend-enblend.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-enblend.obj `if test -f 'enblend.cc'; then $(CYGPATH_W) 'enblend.cc'; else $(CYGPATH_W) '$(srcdir)/enblend.cc'; fi` enblend-gpu.o: gpu.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-gpu.o -MD -MP -MF $(DEPDIR)/enblend-gpu.Tpo -c -o enblend-gpu.o `test -f 'gpu.cc' || echo '$(srcdir)/'`gpu.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-gpu.Tpo $(DEPDIR)/enblend-gpu.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gpu.cc' object='enblend-gpu.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-gpu.o `test -f 'gpu.cc' || echo '$(srcdir)/'`gpu.cc enblend-gpu.obj: gpu.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-gpu.obj -MD -MP -MF $(DEPDIR)/enblend-gpu.Tpo -c -o enblend-gpu.obj `if test -f 'gpu.cc'; then $(CYGPATH_W) 'gpu.cc'; else $(CYGPATH_W) '$(srcdir)/gpu.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-gpu.Tpo $(DEPDIR)/enblend-gpu.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='gpu.cc' object='enblend-gpu.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-gpu.obj `if test -f 'gpu.cc'; then $(CYGPATH_W) 'gpu.cc'; else $(CYGPATH_W) '$(srcdir)/gpu.cc'; fi` enblend-error_message.o: error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-error_message.o -MD -MP -MF $(DEPDIR)/enblend-error_message.Tpo -c -o enblend-error_message.o `test -f 'error_message.cc' || echo '$(srcdir)/'`error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-error_message.Tpo $(DEPDIR)/enblend-error_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='error_message.cc' object='enblend-error_message.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-error_message.o `test -f 'error_message.cc' || echo '$(srcdir)/'`error_message.cc enblend-error_message.obj: error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-error_message.obj -MD -MP -MF $(DEPDIR)/enblend-error_message.Tpo -c -o enblend-error_message.obj `if test -f 'error_message.cc'; then $(CYGPATH_W) 'error_message.cc'; else $(CYGPATH_W) '$(srcdir)/error_message.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-error_message.Tpo $(DEPDIR)/enblend-error_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='error_message.cc' object='enblend-error_message.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-error_message.obj `if test -f 'error_message.cc'; then $(CYGPATH_W) 'error_message.cc'; else $(CYGPATH_W) '$(srcdir)/error_message.cc'; fi` enblend-filenameparse.o: filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-filenameparse.o -MD -MP -MF $(DEPDIR)/enblend-filenameparse.Tpo -c -o enblend-filenameparse.o `test -f 'filenameparse.cc' || echo '$(srcdir)/'`filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-filenameparse.Tpo $(DEPDIR)/enblend-filenameparse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filenameparse.cc' object='enblend-filenameparse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-filenameparse.o `test -f 'filenameparse.cc' || echo '$(srcdir)/'`filenameparse.cc enblend-filenameparse.obj: filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-filenameparse.obj -MD -MP -MF $(DEPDIR)/enblend-filenameparse.Tpo -c -o enblend-filenameparse.obj `if test -f 'filenameparse.cc'; then $(CYGPATH_W) 'filenameparse.cc'; else $(CYGPATH_W) '$(srcdir)/filenameparse.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-filenameparse.Tpo $(DEPDIR)/enblend-filenameparse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filenameparse.cc' object='enblend-filenameparse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-filenameparse.obj `if test -f 'filenameparse.cc'; then $(CYGPATH_W) 'filenameparse.cc'; else $(CYGPATH_W) '$(srcdir)/filenameparse.cc'; fi` enblend-filespec.o: filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-filespec.o -MD -MP -MF $(DEPDIR)/enblend-filespec.Tpo -c -o enblend-filespec.o `test -f 'filespec.cc' || echo '$(srcdir)/'`filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-filespec.Tpo $(DEPDIR)/enblend-filespec.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filespec.cc' object='enblend-filespec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-filespec.o `test -f 'filespec.cc' || echo '$(srcdir)/'`filespec.cc enblend-filespec.obj: filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-filespec.obj -MD -MP -MF $(DEPDIR)/enblend-filespec.Tpo -c -o enblend-filespec.obj `if test -f 'filespec.cc'; then $(CYGPATH_W) 'filespec.cc'; else $(CYGPATH_W) '$(srcdir)/filespec.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-filespec.Tpo $(DEPDIR)/enblend-filespec.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filespec.cc' object='enblend-filespec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-filespec.obj `if test -f 'filespec.cc'; then $(CYGPATH_W) 'filespec.cc'; else $(CYGPATH_W) '$(srcdir)/filespec.cc'; fi` enblend-self_test.o: self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-self_test.o -MD -MP -MF $(DEPDIR)/enblend-self_test.Tpo -c -o enblend-self_test.o `test -f 'self_test.cc' || echo '$(srcdir)/'`self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-self_test.Tpo $(DEPDIR)/enblend-self_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='self_test.cc' object='enblend-self_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-self_test.o `test -f 'self_test.cc' || echo '$(srcdir)/'`self_test.cc enblend-self_test.obj: self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-self_test.obj -MD -MP -MF $(DEPDIR)/enblend-self_test.Tpo -c -o enblend-self_test.obj `if test -f 'self_test.cc'; then $(CYGPATH_W) 'self_test.cc'; else $(CYGPATH_W) '$(srcdir)/self_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-self_test.Tpo $(DEPDIR)/enblend-self_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='self_test.cc' object='enblend-self_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-self_test.obj `if test -f 'self_test.cc'; then $(CYGPATH_W) 'self_test.cc'; else $(CYGPATH_W) '$(srcdir)/self_test.cc'; fi` enblend-tiff_message.o: tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-tiff_message.o -MD -MP -MF $(DEPDIR)/enblend-tiff_message.Tpo -c -o enblend-tiff_message.o `test -f 'tiff_message.cc' || echo '$(srcdir)/'`tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-tiff_message.Tpo $(DEPDIR)/enblend-tiff_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tiff_message.cc' object='enblend-tiff_message.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-tiff_message.o `test -f 'tiff_message.cc' || echo '$(srcdir)/'`tiff_message.cc enblend-tiff_message.obj: tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -MT enblend-tiff_message.obj -MD -MP -MF $(DEPDIR)/enblend-tiff_message.Tpo -c -o enblend-tiff_message.obj `if test -f 'tiff_message.cc'; then $(CYGPATH_W) 'tiff_message.cc'; else $(CYGPATH_W) '$(srcdir)/tiff_message.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enblend-tiff_message.Tpo $(DEPDIR)/enblend-tiff_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tiff_message.cc' object='enblend-tiff_message.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enblend_CXXFLAGS) $(CXXFLAGS) -c -o enblend-tiff_message.obj `if test -f 'tiff_message.cc'; then $(CYGPATH_W) 'tiff_message.cc'; else $(CYGPATH_W) '$(srcdir)/tiff_message.cc'; fi` enfuse-enfuse.o: enfuse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-enfuse.o -MD -MP -MF $(DEPDIR)/enfuse-enfuse.Tpo -c -o enfuse-enfuse.o `test -f 'enfuse.cc' || echo '$(srcdir)/'`enfuse.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-enfuse.Tpo $(DEPDIR)/enfuse-enfuse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enfuse.cc' object='enfuse-enfuse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-enfuse.o `test -f 'enfuse.cc' || echo '$(srcdir)/'`enfuse.cc enfuse-enfuse.obj: enfuse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-enfuse.obj -MD -MP -MF $(DEPDIR)/enfuse-enfuse.Tpo -c -o enfuse-enfuse.obj `if test -f 'enfuse.cc'; then $(CYGPATH_W) 'enfuse.cc'; else $(CYGPATH_W) '$(srcdir)/enfuse.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-enfuse.Tpo $(DEPDIR)/enfuse-enfuse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='enfuse.cc' object='enfuse-enfuse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-enfuse.obj `if test -f 'enfuse.cc'; then $(CYGPATH_W) 'enfuse.cc'; else $(CYGPATH_W) '$(srcdir)/enfuse.cc'; fi` enfuse-error_message.o: error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-error_message.o -MD -MP -MF $(DEPDIR)/enfuse-error_message.Tpo -c -o enfuse-error_message.o `test -f 'error_message.cc' || echo '$(srcdir)/'`error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-error_message.Tpo $(DEPDIR)/enfuse-error_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='error_message.cc' object='enfuse-error_message.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-error_message.o `test -f 'error_message.cc' || echo '$(srcdir)/'`error_message.cc enfuse-error_message.obj: error_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-error_message.obj -MD -MP -MF $(DEPDIR)/enfuse-error_message.Tpo -c -o enfuse-error_message.obj `if test -f 'error_message.cc'; then $(CYGPATH_W) 'error_message.cc'; else $(CYGPATH_W) '$(srcdir)/error_message.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-error_message.Tpo $(DEPDIR)/enfuse-error_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='error_message.cc' object='enfuse-error_message.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-error_message.obj `if test -f 'error_message.cc'; then $(CYGPATH_W) 'error_message.cc'; else $(CYGPATH_W) '$(srcdir)/error_message.cc'; fi` enfuse-filenameparse.o: filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-filenameparse.o -MD -MP -MF $(DEPDIR)/enfuse-filenameparse.Tpo -c -o enfuse-filenameparse.o `test -f 'filenameparse.cc' || echo '$(srcdir)/'`filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-filenameparse.Tpo $(DEPDIR)/enfuse-filenameparse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filenameparse.cc' object='enfuse-filenameparse.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-filenameparse.o `test -f 'filenameparse.cc' || echo '$(srcdir)/'`filenameparse.cc enfuse-filenameparse.obj: filenameparse.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-filenameparse.obj -MD -MP -MF $(DEPDIR)/enfuse-filenameparse.Tpo -c -o enfuse-filenameparse.obj `if test -f 'filenameparse.cc'; then $(CYGPATH_W) 'filenameparse.cc'; else $(CYGPATH_W) '$(srcdir)/filenameparse.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-filenameparse.Tpo $(DEPDIR)/enfuse-filenameparse.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filenameparse.cc' object='enfuse-filenameparse.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-filenameparse.obj `if test -f 'filenameparse.cc'; then $(CYGPATH_W) 'filenameparse.cc'; else $(CYGPATH_W) '$(srcdir)/filenameparse.cc'; fi` enfuse-filespec.o: filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-filespec.o -MD -MP -MF $(DEPDIR)/enfuse-filespec.Tpo -c -o enfuse-filespec.o `test -f 'filespec.cc' || echo '$(srcdir)/'`filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-filespec.Tpo $(DEPDIR)/enfuse-filespec.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filespec.cc' object='enfuse-filespec.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-filespec.o `test -f 'filespec.cc' || echo '$(srcdir)/'`filespec.cc enfuse-filespec.obj: filespec.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-filespec.obj -MD -MP -MF $(DEPDIR)/enfuse-filespec.Tpo -c -o enfuse-filespec.obj `if test -f 'filespec.cc'; then $(CYGPATH_W) 'filespec.cc'; else $(CYGPATH_W) '$(srcdir)/filespec.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-filespec.Tpo $(DEPDIR)/enfuse-filespec.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='filespec.cc' object='enfuse-filespec.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-filespec.obj `if test -f 'filespec.cc'; then $(CYGPATH_W) 'filespec.cc'; else $(CYGPATH_W) '$(srcdir)/filespec.cc'; fi` enfuse-self_test.o: self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-self_test.o -MD -MP -MF $(DEPDIR)/enfuse-self_test.Tpo -c -o enfuse-self_test.o `test -f 'self_test.cc' || echo '$(srcdir)/'`self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-self_test.Tpo $(DEPDIR)/enfuse-self_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='self_test.cc' object='enfuse-self_test.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-self_test.o `test -f 'self_test.cc' || echo '$(srcdir)/'`self_test.cc enfuse-self_test.obj: self_test.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-self_test.obj -MD -MP -MF $(DEPDIR)/enfuse-self_test.Tpo -c -o enfuse-self_test.obj `if test -f 'self_test.cc'; then $(CYGPATH_W) 'self_test.cc'; else $(CYGPATH_W) '$(srcdir)/self_test.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-self_test.Tpo $(DEPDIR)/enfuse-self_test.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='self_test.cc' object='enfuse-self_test.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-self_test.obj `if test -f 'self_test.cc'; then $(CYGPATH_W) 'self_test.cc'; else $(CYGPATH_W) '$(srcdir)/self_test.cc'; fi` enfuse-tiff_message.o: tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-tiff_message.o -MD -MP -MF $(DEPDIR)/enfuse-tiff_message.Tpo -c -o enfuse-tiff_message.o `test -f 'tiff_message.cc' || echo '$(srcdir)/'`tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-tiff_message.Tpo $(DEPDIR)/enfuse-tiff_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tiff_message.cc' object='enfuse-tiff_message.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-tiff_message.o `test -f 'tiff_message.cc' || echo '$(srcdir)/'`tiff_message.cc enfuse-tiff_message.obj: tiff_message.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -MT enfuse-tiff_message.obj -MD -MP -MF $(DEPDIR)/enfuse-tiff_message.Tpo -c -o enfuse-tiff_message.obj `if test -f 'tiff_message.cc'; then $(CYGPATH_W) 'tiff_message.cc'; else $(CYGPATH_W) '$(srcdir)/tiff_message.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/enfuse-tiff_message.Tpo $(DEPDIR)/enfuse-tiff_message.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='tiff_message.cc' object='enfuse-tiff_message.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(enfuse_CXXFLAGS) $(CXXFLAGS) -c -o enfuse-tiff_message.obj `if test -f 'tiff_message.cc'; then $(CYGPATH_W) 'tiff_message.cc'; else $(CYGPATH_W) '$(srcdir)/tiff_message.cc'; fi` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.1[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(MANS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-man1 install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-man uninstall-man: uninstall-man1 .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-binPROGRAMS clean-generic cscopelist-am \ ctags ctags-am distclean distclean-compile distclean-generic \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-binPROGRAMS install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-man uninstall-man1 signature.h: $(srcdir)/gen_sig $(srcdir)/DefaultSig.pm $(srcdir)/Sig.pm @ $(PERL) -I$(srcdir) $< --extra=$(VERSION) > $@ #dist_man_MANS = enblend.1 enfuse.1 .PHONY: man man: enblend.1 enfuse.1 enblend.1: enblend $(HELP2MAN) --output=$@ ./enblend enfuse.1: enfuse $(HELP2MAN) --output=$@ ./enfuse # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/src/masktypedefs.h0000644000175100017510000000222612070530113021212 0ustar ametzlerametzler/* * Copyright (C) 2011-2012 Mikolaj Leszczynski * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MASKTYPEDEFS_H__ #define __MASKTYPEDEFS_H__ #include #include namespace enblend { typedef std::pair SegmentPoint; typedef std::list Segment; typedef std::vector Contour; typedef std::vector ContourVector; } #endif /* __MASKTYPEDEFS_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/nearest.h0000644000175100017510000004147512070530501020166 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __NEAREST_H__ #define __NEAREST_H__ #ifdef HAVE_CONFIG_H #include #endif #include #ifdef _WIN32 #include #else #include #endif #include #include #include #include #include #include "vigra_ext/stdcachedfileimage.hxx" namespace enblend { template void quadruple_image(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, boundary_t boundary) { const vigra::Diff2D size_x(src_lowerright.x - src_upperleft.x, 0); const vigra::Diff2D size_y(0, src_lowerright.y - src_upperleft.y); switch (boundary) { case OpenBoundaries: copyImage(src_upperleft, src_lowerright, sa, dest_upperleft, da); break; case HorizontalStrip: copyImage(src_upperleft, src_lowerright, sa, dest_upperleft, da); // 11 copyImage(src_upperleft, src_lowerright, sa, dest_upperleft + size_x, da); // 12 break; case VerticalStrip: copyImage(src_upperleft, src_lowerright, sa, dest_upperleft, da); // 11 copyImage(src_upperleft, src_lowerright, sa, dest_upperleft + size_y, da); // 21 break; case DoubleStrip: copyImage(src_upperleft, src_lowerright, sa, dest_upperleft, da); // 11 copyImage(src_upperleft, src_lowerright, sa, dest_upperleft + size_x, da); // 12 copyImage(src_upperleft, src_lowerright, sa, dest_upperleft + size_y, da); // 21 copyImage(src_upperleft, src_lowerright, sa, dest_upperleft + size_x + size_y, da); // 22 break; default: throw never_reached("switch control expression \"boundary\" out of range"); } } template inline void quadruple_image(vigra::triple src, vigra::pair dest, boundary_t boundary) { quadruple_image(src.first, src.second, src.third, dest.first, dest.second, boundary); } template void quater_image(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, boundary_t boundary) { const vigra::Diff2D size_x(src_lowerright.x - src_upperleft.x, 0); const vigra::Diff2D size_y(0, src_lowerright.y - src_upperleft.y); const vigra::Diff2D size_x2(size_x / 2); const vigra::Diff2D size_y2(size_y / 2); const vigra::Diff2D size_x4(size_x2 / 2); const vigra::Diff2D size_y4(size_y2 / 2); // destination image // | 11 12 | // | | // | 21 22 | switch (boundary) { case OpenBoundaries: copyImage(src_upperleft, src_lowerright, sa, dest_upperleft, da); break; case HorizontalStrip: copyImage(src_upperleft + size_x2, src_upperleft + size_x2 + size_x4 + size_y, sa, dest_upperleft, da); // 11 copyImage(src_upperleft + size_x4, src_upperleft + size_x2 + size_y, sa, dest_upperleft + size_x4, da); // 12 break; case VerticalStrip: copyImage(src_upperleft + size_y2, src_upperleft + size_y2 + size_y4 + size_x, sa, dest_upperleft, da); // 21 copyImage(src_upperleft + size_y4, src_upperleft + size_y2 + size_x, sa, dest_upperleft + size_y4, da); // 22 break; case DoubleStrip: copyImage(src_upperleft + size_x2 + size_y2, src_upperleft + size_x2 + size_y2 + size_x4 + size_y4, sa, dest_upperleft, da); // 11 copyImage(src_upperleft + size_x4 + size_y2, src_upperleft + size_x2 + size_y2 + size_y4, sa, dest_upperleft + size_x4, da); // 12 copyImage(src_upperleft + size_x2 + size_y4, src_upperleft + size_x2 + size_x4 + size_y2, sa, dest_upperleft + size_y4, da); // 21 copyImage(src_upperleft + size_x4 + size_y4, src_upperleft + size_x2 + size_y2, sa, dest_upperleft + size_x4 + size_y4, da); // 22 break; default: throw never_reached("switch control expression \"boundary\" out of range"); } } template inline void quater_image(vigra::triple src, vigra::pair dest, boundary_t boundary) { quater_image(src.first, src.second, src.third, dest.first, dest.second, boundary); } template void periodicDistanceTransform(SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestAccessor da, ValueType background, int norm, boundary_t boundary) { typedef typename SrcImageIterator::value_type SrcValueType; typedef typename DestImageIterator::value_type DestValueType; const vigra::Diff2D size(src_lowerright.x - src_upperleft.x, src_lowerright.y - src_upperleft.y); int size_x; int size_y; switch (boundary) { case OpenBoundaries: size_x = size.x; size_y = size.y; break; case HorizontalStrip: size_x = 2 * size.x; size_y = size.y; break; case VerticalStrip: size_x = size.x; size_y = 2 * size.y; break; case DoubleStrip: size_x = 2 * size.x; size_y = 2 * size.y; break; default: throw never_reached("switch control expression \"boundary\" out of range"); } vigra::BasicImage periodic(size_x, size_y); vigra::BasicImage distance(periodic.size()); quadruple_image(src_upperleft, src_lowerright, sa, periodic.upperLeft(), periodic.accessor(), boundary); distanceTransformMP(srcImageRange(periodic), destImage(distance), background, norm); quater_image(srcImageRange(distance), destIter(dest_upperleft, da), boundary); } template inline void periodicDistanceTransform(vigra::triple src, vigra::pair dest, ValueType background, int norm, boundary_t boundary) { periodicDistanceTransform(src.first, src.second, src.third, dest.first, dest.second, background, norm, boundary); } template struct saturating_subtract { typedef ValueType first_argument_type; typedef ValueType second_argument_type; typedef ValueType result_type; result_type operator()(const first_argument_type& v1, const second_argument_type& v2) const { typedef vigra::NumericTraits traits; return v2 < v1 ? v1 - v2 : traits::zero(); } }; template inline unsigned quick_tally(SrcImageIterator begin, SrcImageIterator end, SrcAccessor acc, unsigned threshold) { typedef typename SrcAccessor::value_type SrcValueType; unsigned count = 0U; SrcImageIterator i = begin; while (count < threshold && i != end) { if (acc(i) != SrcValueType()) { ++count; } ++i; } return count; } template inline unsigned quick_tally(vigra::triple src, unsigned threshold) { return quick_tally(src.first, src.second, src.third, threshold); } // Compute a mask (dest) that defines the seam line given the // blackmask (src1) and the whitemask (src2) of the overlapping // images. // // The idea of the algorithm is from // Yalin Xiong, Ken Turkowski // "Registration, Calibration and Blending in Creating High Quality Panoramas" // Proceedings of the 4th IEEE Workshop on Applications of Computer Vision (WACV'98) // where we find: // "To locate the mask boundary, we perform the grassfire // transform on two images individually. The resulting distance // maps represent how far away each pixel is from its nearest // boundary. The pixel values of the blend mask is then set to // either 0 or 1 by comparing the distance values at each pixel // in the two distance maps." // // Though we prefer the Distance Transform to the Grassfire Transform. template void nearestFeatureTransform(SrcImageIterator src1_upperleft, SrcImageIterator src1_lowerright, SrcAccessor sa1, SrcImageIterator src2_upperleft, SrcAccessor sa2, DestImageIterator dest_upperleft, DestAccessor da, nearest_neighbor_metric_t norm, boundary_t boundary) { typedef typename SrcAccessor::value_type SrcPixelType; typedef vigra::NumericTraits SrcPixelTraits; typedef typename SrcPixelTraits::Promote SrcPromoteType; typedef typename DestAccessor::value_type DestPixelType; typedef vigra::NumericTraits DestPixelTraits; const SrcPixelType background = SrcPixelTraits::zero(); const vigra::Diff2D size(src1_lowerright.x - src1_upperleft.x, src1_lowerright.y - src1_upperleft.y); IMAGETYPE dist12(size); IMAGETYPE dist21(size); if (Verbose >= VERBOSE_NFT_MESSAGES) { std::cerr << command << ": info: creating "; if (CoarseMask) { std::cerr << "coarse/" << CoarsenessFactor; } else { std::cerr << "fine"; } std::cerr << " blend mask: 1/3"; std::cerr.flush(); } const unsigned overlap_threshold = // Arbitrary threshold of overlapping pixels below which we // consider the overlap of the masks to be complete, i.e. the // image pair as useless. // // The current value is 2x the circumference of the overlap // rectangle. 2U * 2U * (static_cast(size.x) + static_cast(size.y)); unsigned tally12; unsigned tally21; #ifdef OPENMP #pragma omp parallel sections #endif { #ifdef OPENMP #pragma omp section #endif { IMAGETYPE diff12(size); combineTwoImagesMP(src1_upperleft, src1_lowerright, sa1, src2_upperleft, sa2, diff12.upperLeft(), diff12.accessor(), saturating_subtract()); tally12 = quick_tally(diff12.begin(), diff12.end(), diff12.accessor(), overlap_threshold); switch (boundary) { case OpenBoundaries: distanceTransformMP(srcImageRange(diff12), destImage(dist12), background, norm); break; case HorizontalStrip: // FALLTHROUGH case VerticalStrip: // FALLTHROUGH case DoubleStrip: periodicDistanceTransform(srcImageRange(diff12), destImage(dist12), background, norm, boundary); break; default: throw never_reached("switch control expression \"boundary\" out of range"); } } // omp section #ifdef OPENMP #pragma omp section #endif { if (Verbose >= VERBOSE_NFT_MESSAGES) { std::cerr << " 2/3"; std::cerr.flush(); } IMAGETYPE diff21(size); combineTwoImagesMP(src2_upperleft, src2_upperleft + size, sa2, src1_upperleft, sa1, diff21.upperLeft(), diff21.accessor(), saturating_subtract()); tally21 = quick_tally(diff21.begin(), diff21.end(), diff21.accessor(), overlap_threshold); switch (boundary) { case OpenBoundaries: distanceTransformMP(srcImageRange(diff21), destImage(dist21), background, norm); break; case HorizontalStrip: // FALLTHROUGH case VerticalStrip: // FALLTHROUGH case DoubleStrip: periodicDistanceTransform(srcImageRange(diff21), destImage(dist21), background, norm, boundary); break; default: throw never_reached("switch control expression \"boundary\" out of range"); } } // omp section } // omp parallel sections if (Verbose >= VERBOSE_NFT_MESSAGES) { std::cerr << " 3/3"; std::cerr.flush(); } const unsigned overlap_tally = std::max(tally12, tally21); if (overlap_tally < overlap_threshold) { std::cerr << "\n" << command << ": excessive overlap detected; remove one of the images\n"; #ifdef DEBUG_NEAREST_FEATURE_TRANSFORM cout << "+ nearestFeatureTransform: overlap area size = " << size << "\n" << "+ nearestFeatureTransform: threshold is " << overlap_threshold << " pixels for this pair of images\n" << "+ nearestFeatureTransform: only " << overlap_tally << " of " << size.x * size.y << " pixels do not overlap\n"; #endif exit(1); } combineTwoImagesMP(dist12.upperLeft(), dist12.lowerRight(), dist12.accessor(), dist21.upperLeft(), dist21.accessor(), dest_upperleft, da, ifThenElse(vigra::functor::Arg1() < vigra::functor::Arg2(), vigra::functor::Param(DestPixelTraits::max()), vigra::functor::Param(DestPixelTraits::zero()))); if (Verbose >= VERBOSE_NFT_MESSAGES) { std::cerr << std::endl; } } template inline void nearestFeatureTransform(vigra::triple src1, vigra::pair src2, vigra::pair dest, nearest_neighbor_metric_t norm, boundary_t boundary) { nearestFeatureTransform(src1.first, src1.second, src1.third, src2.first, src2.second, dest.first, dest.second, norm, boundary); } } // namespace enblend #endif /* __NEAREST_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/assemble.h0000644000175100017510000003625712070530501020322 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ASSEMBLE_H__ #define __ASSEMBLE_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #ifndef _WIN32 #include #endif #include #include #include #include #include #include #include "vigra_ext/functoraccessor.hxx" #include "vigra_ext/impexalpha.hxx" #include "common.h" #include "fixmath.h" namespace enblend { template struct IntegralSelect {typedef T Result;}; template <> struct IntegralSelect {typedef vigra::UInt32 Result;}; template <> struct IntegralSelect {typedef vigra::UInt32 Result;}; template <> struct IntegralSelect > { typedef vigra::RGBValue Result; }; template <> struct IntegralSelect > { typedef vigra::RGBValue Result; }; template void exportImagePreferablyWithAlpha(const ImageType* image, const AlphaType* mask, const AlphaAccessor& mask_accessor, const vigra::ImageExportInfo& outputImageInfo) { try { vigra_ext::exportImageAlpha(srcImageRange(*image), srcIter(mask->upperLeft(), mask_accessor), outputImageInfo); } catch (std::exception& e) { #ifdef DEBUG std::cerr << "+ exportImagePreferablyWithAlpha: fallback to export without alpha channel\n"; std::cerr << "+ exportImagePreferablyWithAlpha: because of " << e.what() << "\n"; #endif exportImage(srcImageRange(*image), outputImageInfo); } OutputIsValid = true; } /** Write output images. */ template void checkpoint(const std::pair& p, const vigra::ImageExportInfo& outputImageInfo) { typedef typename ImageType::PixelType ImagePixelType; typedef typename EnblendNumericTraits::ImagePixelComponentType ImagePixelComponentType; typedef typename AlphaType::Accessor AlphaAccessor; typedef typename AlphaType::PixelType AlphaPixelType; ImageType* image = p.first; AlphaType* mask = p.second; vigra_ext::ReadFunctorAccessor, AlphaAccessor> ata(vigra::Threshold (AlphaTraits::zero(), AlphaTraits::zero(), AlphaTraits::max(), AlphaTraits::zero()), mask->accessor()); const std::pair outputRange = enblend::rangeOfPixelType(outputImageInfo.getPixelType()); const ImagePixelComponentType inputMin = vigra::NumericTraits::isIntegral::asBool ? vigra::NumericTraits::min() : 0.0; const ImagePixelComponentType inputMax = vigra::NumericTraits::isIntegral::asBool ? vigra::NumericTraits::max() : 1.0; #ifdef DEBUG std::cerr << "+ checkpoint: input range: (" << static_cast(inputMin) << ", " << static_cast(inputMax) << ")\n" << "+ checkpoint: output range: (" << outputRange.first << ", " << outputRange.second << ")" << std::endl; #endif if (inputMin <= outputRange.first && inputMax >= outputRange.second) { if (inputMin == outputRange.first && inputMax == outputRange.second) { // No rescaling is necessary here: We skip the redundant // transformation of the input to the output range and // leave the channel width alone. ; #ifdef DEBUG std::cerr << "+ checkpoint: leaving channel width alone" << std::endl; #endif exportImagePreferablyWithAlpha(image, mask, ata, outputImageInfo); } else { std::string pixel_type(outputImageInfo.getPixelType()); boost::algorithm::to_lower(pixel_type); std::cerr << command << ": info: narrowing channel width for output as \"" << pixel_type << "\"" << std::endl; ImageType lowDepthImage(image->width(), image->height()); transformImageMP(srcImageRange(*image), destImage(lowDepthImage), vigra::linearRangeMapping(ImagePixelType(inputMin), ImagePixelType(inputMax), ImagePixelType(outputRange.first), ImagePixelType(outputRange.second))); exportImagePreferablyWithAlpha(&lowDepthImage, mask, ata, outputImageInfo); } } else { std::string pixel_type(outputImageInfo.getPixelType()); boost::algorithm::to_lower(pixel_type); std::cerr << command << ": info: rescaling floating-point data for output as \"" << pixel_type << "\"" << std::endl; typedef typename IntegralSelect::Result IntegralPixelType; typedef typename EnblendNumericTraits::ImagePixelComponentType IntegralPixelComponentType; IMAGETYPE integralImage(image->width(), image->height()); vigra_ext::ReadFunctorAccessor, AlphaAccessor> ata(vigra::Threshold (AlphaTraits::zero(), AlphaTraits::zero(), AlphaTraits::max(), AlphaTraits::zero()), mask->accessor()); transformImageMP(srcImageRange(*image), destImage(integralImage), vigra::linearRangeMapping(ImagePixelType(inputMin), ImagePixelType(inputMax), IntegralPixelType(outputRange.first), IntegralPixelType(outputRange.second))); exportImagePreferablyWithAlpha(&integralImage, mask, ata, outputImageInfo); } } template void import(const vigra::ImageImportInfo& info, const std::pair& image, const std::pair& alpha) { typedef typename DestIterator::PixelType ImagePixelType; typedef typename EnblendNumericTraits::ImagePixelComponentType ImagePixelComponentType; typedef typename AlphaIterator::PixelType AlphaPixelType; const vigra::Diff2D extent = vigra::Diff2D(info.width(), info.height()); const std::string pixelType = info.getPixelType(); const range_t inputRange = enblend::rangeOfPixelType(pixelType); if (info.numExtraBands() > 0) { // Threshold the alpha mask so that all pixels are either // contributing or not contributing. vigra_ext::WriteFunctorAccessor, AlphaAccessor> ata(vigra::Threshold (inputRange.second / 2, inputRange.second, AlphaTraits::zero(), AlphaTraits::max()), alpha.second); vigra_ext::importImageAlpha(info, image, vigra::destIter(alpha.first, ata)); } else { // Import image without alpha. Initialize the alpha image to 100%. importImage(info, image.first, image.second); initImage(srcIterRange(alpha.first, alpha.first + extent, alpha.second), AlphaTraits::max()); } // Performance Optimization: Transform only if ranges do not // match. const double min = vigra::NumericTraits::isIntegral::asBool ? static_cast(vigra::NumericTraits::min()) : 0.0; const double max = vigra::NumericTraits::isIntegral::asBool ? static_cast(vigra::NumericTraits::max()) : 1.0; if (inputRange.first != min || inputRange.second != max) { transformImageMP(srcIterRange(image.first, image.first + extent, image.second), vigra::destIter(image.first, image.second), vigra::linearRangeMapping(ImagePixelType(inputRange.first), ImagePixelType(inputRange.second), ImagePixelType(min), ImagePixelType(max))); } } /** Find images that do not overlap and assemble them into one image. * Uses a greedy heuristic. * Removes used images from given list of ImageImportInfos. * Returns an ImageImportInfo for the temporary file. * memory xsection = 2 * (ImageType*inputUnion + AlphaType*inputUnion) */ template std::pair assemble(std::list& imageInfoList, vigra::Rect2D& inputUnion, vigra::Rect2D& bb) { typedef typename AlphaType::traverser AlphaIteratorType; typedef typename AlphaType::Accessor AlphaAccessor; // No more images to assemble? if (imageInfoList.empty()) { return std::pair(static_cast(NULL), static_cast(NULL)); } // Create an image to assemble input images into. ImageType* image = new ImageType(inputUnion.size()); AlphaType* imageA = new AlphaType(inputUnion.size()); if (Verbose >= VERBOSE_ASSEMBLE_MESSAGES) { const std::string filename(imageInfoList.front()->getFileName()); const int layer(imageInfoList.front()->getImageIndex()); const int layers(imageInfoList.front()->numImages()); if (OneAtATime) { std::cerr << command << ": info: loading next image: " << filename << " " << layer + 1 << '/' << layers << std::endl; } else { std::cerr << command << ": info: combining non-overlapping images: " << filename << " " << layer + 1 << '/' << layers; std::cerr.flush(); } } const vigra::Diff2D imagePos = imageInfoList.front()->getPosition(); import(*imageInfoList.front(), vigra::destIter(image->upperLeft() + imagePos - inputUnion.upperLeft()), vigra::destIter(imageA->upperLeft() + imagePos - inputUnion.upperLeft())); imageInfoList.erase(imageInfoList.begin()); if (!OneAtATime) { // Attempt to assemble additional non-overlapping images. // List of ImageImportInfos we decide to assemble. std::list::iterator> toBeRemoved; std::list::iterator i; for (i = imageInfoList.begin(); i != imageInfoList.end(); i++) { vigra::ImageImportInfo* info = *i; // Load the next image. ImageType* src = new ImageType(info->size()); AlphaType* srcA = new AlphaType(info->size()); import(*info, destImage(*src), destImage(*srcA)); // Check for overlap. bool overlapFound = false; AlphaIteratorType dy = imageA->upperLeft() - inputUnion.upperLeft() + info->getPosition(); AlphaAccessor da = imageA->accessor(); AlphaIteratorType sy = srcA->upperLeft(); AlphaIteratorType send = srcA->lowerRight(); AlphaAccessor sa = srcA->accessor(); for(; sy.y < send.y; ++sy.y, ++dy.y) { AlphaIteratorType sx = sy; AlphaIteratorType dx = dy; for(; sx.x < send.x; ++sx.x, ++dx.x) { if (sa(sx) && da(dx)) { overlapFound = true; break; } } if (overlapFound) { break; } } if (!overlapFound) { // Copy src and srcA into image and imageA. if (Verbose >= VERBOSE_ASSEMBLE_MESSAGES) { std::cerr << " " << info->getFileName(); std::cerr.flush(); } const vigra::Diff2D srcPos = info->getPosition(); vigra::copyImageIf(srcImageRange(*src), maskImage(*srcA), vigra::destIter(image->upperLeft() - inputUnion.upperLeft() + srcPos)); vigra::copyImageIf(srcImageRange(*srcA), maskImage(*srcA), vigra::destIter(imageA->upperLeft() - inputUnion.upperLeft() + srcPos)); // Remove info from list later. toBeRemoved.push_back(i); } delete src; delete srcA; } // Erase the ImageImportInfos we used. for (std::list::iterator>::iterator r = toBeRemoved.begin(); r != toBeRemoved.end(); ++r) { imageInfoList.erase(*r); } } if (Verbose >= VERBOSE_ASSEMBLE_MESSAGES && !OneAtATime) { std::cerr << std::endl; } // Calculate bounding box of image. vigra::FindBoundingRectangle unionRect; vigra::inspectImageIf(srcIterRange(vigra::Diff2D(), vigra::Diff2D() + image->size()), srcImage(*imageA), unionRect); bb = unionRect(); if (Verbose >= VERBOSE_ABB_MESSAGES) { std::cerr << command << ": info: assembled images bounding box: " << unionRect() << std::endl; } return std::pair(image, imageA); } } // namespace enblend #endif /* __ASSEMBLE_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/pyramid.h0000644000175100017510000021571512070530113020171 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PYRAMID_H__ #define __PYRAMID_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include "fixmath.h" namespace enblend { #define IMUL6(A) (A * SKIPSMImagePixelType(6)) #define IMUL5(A) (A * SKIPSMImagePixelType(5)) #define IMUL4(A) (A * SKIPSMImagePixelType(4)) #define IMUL11(A) (A * SKIPSMImagePixelType(11)) #define AMUL6(A) (A * SKIPSMAlphaPixelType(6)) /** Calculate the half-width of a n-level filter. * Assumes that the input function is a left-handed function, * and the last non-zero input is at location 0. * Returns the location of the last non-zero output. */ inline unsigned int filterHalfWidth(const unsigned int levels) { vigra_precondition(levels >= 1 && levels <= MAX_PYRAMID_LEVELS, "filterHalfWidth: levels outside of permissible range"); // This is the arithmetic half width. return levels == 1 ? 0 : (1 << (levels + 1)) - 4; } /** The Burt & Adelson Reduce operation. * This version is for images with alpha channels. * Gaussian blur, downsampling, and extrapolation in one pass over * the input image using SKIPSM-based algorithm. * Uses only integer math, visits each pixel only once. * * Reference: * Frederick M. Waltz and John W.V. Miller. * An efficient algorithm for Gaussian blur using finite-state machines. * SPIE Conf. on Machine Vision Systems for Inspection and Metrology VII. November 1998. * * ************************************************************************************************* * 1-D explanation of algorithm: * * src image pixels: A B C D E F G * dst image pixels: W X Y Z * * Algorithm iterates over src image pixels from left to right. * At even src image pixels, the output of the previous dst image pixel is calculated. * For example, when visiting E, the value of X is written to the dst image. * * State variables before visiting E: * sr0 = C * sr1 = A + 4B * srp = 4D * * State variables after visiting E: * sr0 = E * sr1 = C + 4D * srp = 4D * X = A + 4B + 6C + 4D + E * * Updates when visiting even source pixel: * (all updates occur in parallel) * sr0 <= current * sr1 <= sr0 + srp * dst(-1) <= sr1 + 6*sr0 + srp + current * * Updates when visiting odd source pixel: * srp <= 4*current * * ************************************************************************************************* * 2-D explanation: * * src image pixels: A B C D E dst image pixels: a b c * F G H I J * K L M N O d e f * P Q R S T * U V W X Y g h i * * Algorithm visits all src image pixels from left to right and top to bottom. * When visiting src pixel Y, the value of e will be written to the dst image. * * State variables before visiting Y: * sr0 = W * sr1 = U + 4V * srp = 4X * sc0[2] = K + 4L + 6M + 4N + O * sc1[2] = (A + 4B + 6C + 4D + E) + 4*(F + 4G + 6H + 4I + J) * scp[2] = 4*(P + 4Q + 6R + 4S + T) * * State variables after visiting Y: * sr0 = Y * sr1 = W + 4X * srp = 4X * sc0[2] = U + 4V + 6W + 4X + Y * sc1[2] = (K + 4L + 6M + 4N + O) + 4*(P + 4Q + 6R + 4S + T) * scp[2] = 4*(P + 4Q + 6R + 4S + T) * e = 1 * (A + 4B + 6C + 4D + E) * + 4 * (F + 4G + 6H + 4I + J) * + 6 * (K + 4L + 6M + 4N + O) * + 4 * (P + 4Q + 6R + 4S + T) * + 1 * (U + 4V + 6W + 4X + Y) * * Updates when visiting (even x, even y) source pixel: * (all updates occur in parallel) * sr0 <= current * sr1 <= sr0 + srp * sc0[x] <= sr1 + 6*sr0 + srp + current * sc1[x] <= sc0[x] + scp[x] * dst(-1,-1) <= sc1[x] + 6*sc0[x] + scp + (new sc0[x]) * * Updates when visiting (odd x, even y) source pixel: * srp <= 4*current * * Updates when visiting (even x, odd y) source pixel: * sr0 <= current * sr1 <= sr0 + srp * scp[x] <= 4*(sr1 + 6*sr0 + srp + current) * * Updates when visting (odd x, odd y) source pixel: * srp <= 4*current */ template inline void reduce(bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, AlphaIterator alpha_upperleft, AlphaAccessor aa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da, DestAlphaIterator dest_alpha_upperleft, DestAlphaIterator dest_alpha_lowerright, DestAlphaAccessor daa) { typedef typename DestAccessor::value_type DestPixelType; typedef typename DestAlphaAccessor::value_type DestAlphaPixelType; int src_w = src_lowerright.x - src_upperleft.x; int src_h = src_lowerright.y - src_upperleft.y; int dst_w = dest_lowerright.x - dest_upperleft.x; //int dst_h = dest_lowerright.y - dest_upperleft.y; vigra_precondition(src_w > 1 && src_h > 1, "src image too small in reduce"); // State variables for source image pixel values SKIPSMImagePixelType isr0, isr1, isrp; SKIPSMImagePixelType* isc0 = new SKIPSMImagePixelType[dst_w + 1]; SKIPSMImagePixelType* isc1 = new SKIPSMImagePixelType[dst_w + 1]; SKIPSMImagePixelType* iscp = new SKIPSMImagePixelType[dst_w + 1]; // State variables for source mask pixel values SKIPSMAlphaPixelType asr0, asr1, asrp; SKIPSMAlphaPixelType* asc0 = new SKIPSMAlphaPixelType[dst_w + 1]; SKIPSMAlphaPixelType* asc1 = new SKIPSMAlphaPixelType[dst_w + 1]; SKIPSMAlphaPixelType* ascp = new SKIPSMAlphaPixelType[dst_w + 1]; // Convenient constants const SKIPSMImagePixelType SKIPSMImageZero(vigra::NumericTraits::zero()); const SKIPSMAlphaPixelType SKIPSMAlphaZero(vigra::NumericTraits::zero()); const SKIPSMAlphaPixelType SKIPSMAlphaOne(vigra::NumericTraits::one()); const DestPixelType DestImageZero(vigra::NumericTraits::zero()); const DestAlphaPixelType DestAlphaZero(vigra::NumericTraits::zero()); const DestAlphaPixelType DestAlphaMax(vigra::NumericTraits::max()); DestImageIterator dy = dest_upperleft; DestImageIterator dx = dy; SrcImageIterator sy = src_upperleft; SrcImageIterator sx = sy; AlphaIterator ay = alpha_upperleft; AlphaIterator ax = ay; DestAlphaIterator day = dest_alpha_upperleft; DestAlphaIterator dax = day; bool evenY = true; bool evenX = true; int srcy = 0; int srcx = 0; //int dsty = 0; int dstx = 0; // First row { if (wraparound) { asr0 = aa(ay, vigra::Diff2D(src_w - 2, 0)) ? SKIPSMAlphaOne : SKIPSMAlphaZero; asr1 = SKIPSMAlphaZero; asrp = aa(ay, vigra::Diff2D(src_w - 1, 0)) ? (SKIPSMAlphaOne * 4) : SKIPSMAlphaZero; isr0 = aa(ay, vigra::Diff2D(src_w - 2, 0)) ? SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 2, 0))) : SKIPSMImageZero; isr1 = SKIPSMImageZero; isrp = aa(ay, vigra::Diff2D(src_w - 1, 0)) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1, 0))) * 4) : SKIPSMImageZero; } else { asr0 = SKIPSMAlphaZero; asr1 = SKIPSMAlphaZero; asrp = SKIPSMAlphaZero; isr0 = SKIPSMImageZero; isr1 = SKIPSMImageZero; isrp = SKIPSMImageZero; } for (sx = sy, ax = ay, evenX = true, srcx = 0, dstx = 0; srcx < src_w; ++srcx, ++sx.x, ++ax.x) { SKIPSMAlphaPixelType mcurrent(aa(ax) ? SKIPSMAlphaOne : SKIPSMAlphaZero); SKIPSMImagePixelType icurrent(aa(ax) ? SKIPSMImagePixelType(sa(sx)) : SKIPSMImageZero); if (evenX) { asc1[dstx] = SKIPSMAlphaZero; asc0[dstx] = asr1 + AMUL6(asr0) + asrp + mcurrent; asr1 = asr0 + asrp; asr0 = mcurrent; isc1[dstx] = SKIPSMImageZero; isc0[dstx] = isr1 + IMUL6(isr0) + isrp + icurrent; isr1 = isr0 + isrp; isr0 = icurrent; } else { asrp = mcurrent * 4; isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in first row if (!evenX) { // previous srcx was even ++dstx; if (wraparound) { asc1[dstx] = SKIPSMAlphaZero; asc0[dstx] = asr1 + AMUL6(asr0) + (aa(ay) ? (SKIPSMAlphaOne * 4) : SKIPSMAlphaZero) + (aa(ay, vigra::Diff2D(1,0)) ? SKIPSMAlphaOne : SKIPSMAlphaZero); isc1[dstx] = SKIPSMImageZero; isc0[dstx] = isr1 + IMUL6(isr0) + (aa(ay) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy)) * 4) : SKIPSMImageZero) + (aa(ay, vigra::Diff2D(1, 0)) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0)))) : SKIPSMImageZero); } else { asc1[dstx] = SKIPSMAlphaZero; asc0[dstx] = asr1 + AMUL6(asr0); isc1[dstx] = SKIPSMImageZero; isc0[dstx] = isr1 + IMUL6(isr0); } } else { // previous srcx was odd if (wraparound) { asc1[dstx] = SKIPSMAlphaZero; asc0[dstx] = asr1 + AMUL6(asr0) + asrp + (aa(ay) ? SKIPSMAlphaOne : SKIPSMAlphaZero); isc1[dstx] = SKIPSMImageZero; isc0[dstx] = isr1 + IMUL6(isr0) + isrp + (aa(ay) ? SKIPSMImagePixelType(sa(sy)) : SKIPSMImageZero); } else { asc1[dstx] = SKIPSMAlphaZero; asc0[dstx] = asr1 + AMUL6(asr0) + asrp; isc1[dstx] = SKIPSMImageZero; isc0[dstx] = isr1 + IMUL6(isr0) + isrp; } } } ++sy.y; ++ay.y; // Main Rows { for (evenY = false, srcy = 1; srcy < src_h; ++srcy, ++sy.y, ++ay.y) { if (wraparound) { asr0 = aa(ay, vigra::Diff2D(src_w - 2, 0)) ? SKIPSMAlphaOne : SKIPSMAlphaZero; asr1 = SKIPSMAlphaZero; asrp = aa(ay, vigra::Diff2D(src_w - 1, 0)) ? (SKIPSMAlphaOne * 4) : SKIPSMAlphaZero; isr0 = aa(ay, vigra::Diff2D(src_w - 2, 0)) ? SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 2,0))) : SKIPSMImageZero; isr1 = SKIPSMImageZero; isrp = aa(ay, vigra::Diff2D(src_w - 1, 0)) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1,0))) * 4) : SKIPSMImageZero; } else { asr0 = SKIPSMAlphaZero; asr1 = SKIPSMAlphaZero; asrp = SKIPSMAlphaZero; isr0 = SKIPSMImageZero; isr1 = SKIPSMImageZero; isrp = SKIPSMImageZero; } if (evenY) { // Even-numbered row // First entry in row sx = sy; ax = ay; if (wraparound) { asr1 = asr0 + asrp; isr1 = isr0 + isrp; } asr0 = aa(ax) ? SKIPSMAlphaOne : SKIPSMAlphaZero; isr0 = aa(ax) ? SKIPSMImagePixelType(sa(sx)) : SKIPSMImageZero; // isc*[0] are never used ++sx.x; ++ax.x; dx = dy; dax = day; // Main entries in row for (evenX = false, srcx = 1, dstx = 0; srcx < src_w; ++srcx, ++sx.x, ++ax.x) { SKIPSMAlphaPixelType mcurrent(aa(ax) ? SKIPSMAlphaOne : SKIPSMAlphaZero); SKIPSMImagePixelType icurrent(aa(ax) ? SKIPSMImagePixelType(sa(sx)) : SKIPSMImageZero); if (evenX) { SKIPSMAlphaPixelType ap = asc1[dstx] + AMUL6(asc0[dstx]) + ascp[dstx]; asc1[dstx] = asc0[dstx] + ascp[dstx]; asc0[dstx] = asr1 + AMUL6(asr0) + asrp + mcurrent; asr1 = asr0 + asrp; asr0 = mcurrent; ap += asc0[dstx]; SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; isc0[dstx] = isr1 + IMUL6(isr0) + isrp + icurrent; isr1 = isr0 + isrp; isr0 = icurrent; if (ap) { ip += isc0[dstx]; ip /= SKIPSMImagePixelType(ap); da.set(DestPixelType(ip), dx); daa.set(DestAlphaMax, dax); } else { da.set(DestImageZero, dx); daa.set(DestAlphaZero, dax); } ++dx.x; ++dax.x; } else { asrp = mcurrent * 4; isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in row if (!evenX) { // previous srcx was even ++dstx; SKIPSMAlphaPixelType ap = asc1[dstx] + AMUL6(asc0[dstx]) + ascp[dstx]; asc1[dstx] = asc0[dstx] + ascp[dstx]; if (wraparound) { asc0[dstx] = asr1 + AMUL6(asr0) + (aa(ay) ? (SKIPSMAlphaOne * 4) : SKIPSMAlphaZero) + (aa(ay, vigra::Diff2D(1,0)) ? SKIPSMAlphaOne : SKIPSMAlphaZero); } else { asc0[dstx] = asr1 + AMUL6(asr0); } ap += asc0[dstx]; SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + (aa(ay) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy)) * 4) : SKIPSMImageZero) + (aa(ay, vigra::Diff2D(1, 0)) ? SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0))) : SKIPSMImageZero); } else { isc0[dstx] = isr1 + IMUL6(isr0); } if (ap) { ip += isc0[dstx]; ip /= SKIPSMImagePixelType(ap); da.set(DestPixelType(ip), dx); daa.set(DestAlphaMax, dax); } else { da.set(DestImageZero, dx); daa.set(DestAlphaZero, dax); } } else { // Previous srcx was odd SKIPSMAlphaPixelType ap = asc1[dstx] + AMUL6(asc0[dstx]) + ascp[dstx]; asc1[dstx] = asc0[dstx] + ascp[dstx]; if (wraparound) { asc0[dstx] = asr1 + AMUL6(asr0) + asrp + (aa(ay) ? SKIPSMAlphaOne : SKIPSMAlphaZero); } else { asc0[dstx] = asr1 + AMUL6(asr0) + asrp; } ap += asc0[dstx]; SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + (aa(ay) ? SKIPSMImagePixelType(sa(sy)) : SKIPSMImageZero); } else { isc0[dstx] = isr1 + IMUL6(isr0) + isrp; } if (ap) { ip += isc0[dstx]; ip /= SKIPSMImagePixelType(ap); da.set(DestPixelType(ip), dx); daa.set(DestAlphaMax, dax); } else { da.set(DestImageZero, dx); daa.set(DestAlphaZero, dax); } } ++dy.y; ++day.y; } else { // First entry in odd-numbered row sx = sy; ax = ay; if (wraparound) { asr1 = asr0 + asrp; isr1 = isr0 + isrp; } asr0 = aa(ax) ? SKIPSMAlphaOne : SKIPSMAlphaZero; isr0 = aa(ax) ? SKIPSMImagePixelType(sa(sx)) : SKIPSMImageZero; // isc*[0] are never used ++sx.x; ++ax.x; // Main entries in odd-numbered row for (evenX = false, srcx = 1, dstx = 0; srcx < src_w; ++srcx, ++sx.x, ++ax.x) { SKIPSMAlphaPixelType mcurrent(aa(ax) ? SKIPSMAlphaOne : SKIPSMAlphaZero); SKIPSMImagePixelType icurrent(aa(ax) ? SKIPSMImagePixelType(sa(sx)) : SKIPSMImageZero); if (evenX) { ascp[dstx] = (asr1 + AMUL6(asr0) + asrp + mcurrent) * 4; asr1 = asr0 + asrp; asr0 = mcurrent; iscp[dstx] = (isr1 + IMUL6(isr0) + isrp + icurrent) * 4; isr1 = isr0 + isrp; isr0 = icurrent; } else { asrp = mcurrent * 4; isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in row if (!evenX) { // previous srcx was even ++dstx; if (wraparound) { ascp[dstx] = (asr1 + AMUL6(asr0) + (aa(ay) ? (SKIPSMAlphaOne * 4) : SKIPSMAlphaZero) + (aa(ay, vigra::Diff2D(1,0)) ? SKIPSMAlphaOne : SKIPSMAlphaZero)) * 4; iscp[dstx] = (isr1 + IMUL6(isr0) + (aa(ay) ? vigra::NumericTraits::fromRealPromote(SKIPSMImagePixelType(sa(sy)) * 4) : SKIPSMImageZero) + (aa(ay, vigra::Diff2D(1, 0)) ? SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0))) : SKIPSMImageZero)) * 4; } else { ascp[dstx] = (asr1 + AMUL6(asr0)) * 4; iscp[dstx] = (isr1 + IMUL6(isr0)) * 4; } } else { // previous srcx was odd if (wraparound) { ascp[dstx] = (asr1 + AMUL6(asr0) + asrp + (aa(ay) ? SKIPSMAlphaOne : SKIPSMAlphaZero)) * 4; iscp[dstx] = (isr1 + IMUL6(isr0) + isrp + (aa(ay) ? SKIPSMImagePixelType(sa(sy)) : SKIPSMImageZero)) * 4; } else { ascp[dstx] = (asr1 + AMUL6(asr0) + asrp) * 4; iscp[dstx] = (isr1 + IMUL6(isr0) + isrp) * 4; } } } evenY = !evenY; } } // Last Rows { if (!evenY) { // Last srcy was even // odd row will set all iscp[] to zero // even row will do: //isc0[dstx] = 0; //isc1[dstx] = isc0[dstx] + 4*iscp[dstx] //out = isc1[dstx] + 6*isc0[dstx] + 4*iscp[dstx] + newisc0[dstx] for (dstx = 1, dx = dy, dax = day; dstx < dst_w + 1; ++dstx, ++dx.x, ++dax.x) { SKIPSMAlphaPixelType ap = asc1[dstx] + AMUL6(asc0[dstx]); if (ap) { SKIPSMImagePixelType ip = (isc1[dstx] + IMUL6(isc0[dstx])) / SKIPSMImagePixelType(ap); da.set(DestPixelType(ip), dx); daa.set(DestAlphaMax, dax); } else { da.set(DestImageZero, dx); daa.set(DestAlphaZero, dax); } } } else { // Last srcy was odd // even row will do: // isc0[dstx] = 0; // isc1[dstx] = isc0[dstx] + 4*iscp[dstx] // out = isc1[dstx] + 6*isc0[dstx] + 4*iscp[dstx] + newisc0[dstx] for (dstx = 1, dx = dy, dax = day; dstx < dst_w + 1; ++dstx, ++dx.x, ++dax.x) { SKIPSMAlphaPixelType ap = asc1[dstx] + AMUL6(asc0[dstx]) + ascp[dstx]; if (ap) { SKIPSMImagePixelType ip = (isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]) / SKIPSMImagePixelType(ap); da.set(DestPixelType(ip), dx); daa.set(DestAlphaMax, dax); } else { da.set(DestImageZero, dx); daa.set(DestAlphaZero, dax); } } } } delete [] isc0; delete [] isc1; delete [] iscp; delete [] asc0; delete [] asc1; delete [] ascp; } // Version using argument object factories. template inline void reduce(bool wraparound, vigra::triple src, vigra::pair mask, vigra::triple dest, vigra::triple destMask) { reduce(wraparound, src.first, src.second, src.third, mask.first, mask.second, dest.first, dest.second, dest.third, destMask.first, destMask.second, destMask.third); }; /** The Burt & Adelson Reduce operation. * This version is for images that do not have alpha channels. */ template inline void reduce(bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da) { typedef typename DestAccessor::value_type DestPixelType; const int src_w = src_lowerright.x - src_upperleft.x; const int src_h = src_lowerright.y - src_upperleft.y; const int dst_w = dest_lowerright.x - dest_upperleft.x; //const int dst_h = dest_lowerright.y - dest_upperleft.y; vigra_precondition(src_w > 1 && src_h > 1, "src image too small in reduce"); // State variables for source image pixel values SKIPSMImagePixelType isr0, isr1, isrp; SKIPSMImagePixelType* isc0 = new SKIPSMImagePixelType[dst_w + 1]; SKIPSMImagePixelType* isc1 = new SKIPSMImagePixelType[dst_w + 1]; SKIPSMImagePixelType* iscp = new SKIPSMImagePixelType[dst_w + 1]; // Convenient constants const SKIPSMImagePixelType SKIPSMImageZero(vigra::NumericTraits::zero()); DestImageIterator dy = dest_upperleft; DestImageIterator dx = dy; SrcImageIterator sy = src_upperleft; SrcImageIterator sx = sy; bool evenY = true; bool evenX = true; int srcy = 0; int srcx = 0; //int dsty = 0; int dstx = 0; // First row { if (wraparound) { isr0 = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 2, 0))); isr1 = SKIPSMImageZero; isrp = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1, 0))) * 4; } else { isr0 = SKIPSMImagePixelType(sa(sy)); isr1 = SKIPSMImageZero; isrp = SKIPSMImagePixelType(sa(sy)) * 4; } // Main pixels in first row for (sx = sy, evenX = true, srcx = 0, dstx = 0; srcx < src_w; ++srcx, ++sx.x) { SKIPSMImagePixelType icurrent(SKIPSMImagePixelType(sa(sx))); if (evenX) { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + icurrent; isc1[dstx] = IMUL5(isc0[dstx]); isr1 = isr0 + isrp; isr0 = icurrent; } else { isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in first row if (!evenX) { // previous srcx was even ++dstx; if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + (SKIPSMImagePixelType(sa(sy)) * 4) + SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0))); isc1[dstx] = IMUL5(isc0[dstx]); } else { isc0[dstx] = isr1 + IMUL11(isr0); isc1[dstx] = IMUL5(isc0[dstx]); } } else { // previous srcx was odd if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + SKIPSMImagePixelType(sa(sy)); isc1[dstx] = IMUL5(isc0[dstx]); } else { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + (isrp / 4); isc1[dstx] = IMUL5(isc0[dstx]); } } } ++sy.y; // Main Rows { for (evenY = false, srcy = 1; srcy < src_h; ++srcy, ++sy.y) { if (wraparound) { isr0 = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 2, 0))); isr1 = SKIPSMImageZero; isrp = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1, 0))) * 4; } else { isr0 = SKIPSMImagePixelType(sa(sy)); isr1 = SKIPSMImageZero; isrp = SKIPSMImagePixelType(sa(sy)) * 4; } if (evenY) { // Even-numbered row // First entry in row sx = sy; isr1 = isr0 + isrp; isr0 = SKIPSMImagePixelType(sa(sx)); // isc*[0] are never used ++sx.x; dx = dy; // Main entries in row for (evenX = false, srcx = 1, dstx = 0; srcx < src_w; ++srcx, ++sx.x) { SKIPSMImagePixelType icurrent(SKIPSMImagePixelType(sa(sx))); if (evenX) { SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; isc0[dstx] = isr1 + IMUL6(isr0) + isrp + icurrent; isr1 = isr0 + isrp; isr0 = icurrent; ip += isc0[dstx]; ip /= 256; da.set(DestPixelType(ip), dx); ++dx.x; } else { isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in row if (!evenX) { // previous srcx was even ++dstx; SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + (SKIPSMImagePixelType(sa(sy)) * 4) + SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0))); } else { isc0[dstx] = isr1 + IMUL11(isr0); } ip += isc0[dstx]; ip /= 256; da.set(DestPixelType(ip), dx); } else { // Previous srcx was odd SKIPSMImagePixelType ip = isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx]; isc1[dstx] = isc0[dstx] + iscp[dstx]; if (wraparound) { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + SKIPSMImagePixelType(sa(sy)); } else { isc0[dstx] = isr1 + IMUL6(isr0) + isrp + (isrp / 4); } ip += isc0[dstx]; ip /= 256; da.set(DestPixelType(ip), dx); } ++dy.y; } else { // First entry in odd-numbered row sx = sy; isr1 = isr0 + isrp; isr0 = SKIPSMImagePixelType(sa(sx)); // isc*[0] are never used ++sx.x; // Main entries in odd-numbered row for (evenX = false, srcx = 1, dstx = 0; srcx < src_w; ++srcx, ++sx.x) { SKIPSMImagePixelType icurrent(SKIPSMImagePixelType(sa(sx))); if (evenX) { iscp[dstx] = (isr1 + IMUL6(isr0) + isrp + icurrent) * 4; isr1 = isr0 + isrp; isr0 = icurrent; } else { isrp = icurrent * 4; ++dstx; } evenX = !evenX; } // Last entries in row if (!evenX) { // previous srcx was even ++dstx; if (wraparound) { iscp[dstx] = (isr1 + IMUL6(isr0) + (SKIPSMImagePixelType(sa(sy)) * 4) + SKIPSMImagePixelType(sa(sy, vigra::Diff2D(1, 0))) ) * 4; } else { iscp[dstx] = (isr1 + IMUL11(isr0)) * 4; } } else { // previous srcx was odd if (wraparound) { iscp[dstx] = (isr1 + IMUL6(isr0) + isrp + SKIPSMImagePixelType(sa(sy))) * 4; } else { iscp[dstx] = (isr1 + IMUL6(isr0) + isrp + (isrp / 4)) * 4; } } } evenY = !evenY; } } // Last Rows { if (!evenY) { // Last srcy was even // odd row will set all iscp[] to zero // even row will do: //isc0[dstx] = 0; //isc1[dstx] = isc0[dstx] + 4*iscp[dstx] //out = isc1[dstx] + 6*isc0[dstx] + 4*iscp[dstx] + newisc0[dstx] for (dstx = 1, dx = dy; dstx < dst_w + 1; ++dstx, ++dx.x) { SKIPSMImagePixelType ip = (isc1[dstx] + IMUL11(isc0[dstx])) / 256; da.set(DestPixelType(ip), dx); } } else { // Last srcy was odd // even row will do: // isc0[dstx] = 0; // isc1[dstx] = isc0[dstx] + 4*iscp[dstx] // out = isc1[dstx] + 6*isc0[dstx] + 4*iscp[dstx] + newisc0[dstx] for (dstx = 1, dx = dy; dstx < dst_w + 1; ++dstx, ++dx.x) { SKIPSMImagePixelType ip = (isc1[dstx] + IMUL6(isc0[dstx]) + iscp[dstx] + (iscp[dstx] / 4)) / 256; da.set(DestPixelType(ip), dx); } } } delete [] isc0; delete [] isc1; delete [] iscp; } // Version using argument object factories. template inline void reduce(bool wraparound, vigra::triple src, vigra::triple dest) { reduce(wraparound, src.first, src.second, src.third, dest.first, dest.second, dest.third); } // SKIPSM update routine used when visiting a pixel in the top two rows // and the left two rows. #define SKIPSM_EXPAND(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11) \ do { \ current = SKIPSMImagePixelType(sa(sx)); \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out01 = sc0a[srcx]; \ out11 = sc0b[srcx]; \ sc1a[srcx] = sc0a[srcx]; \ sc1b[srcx] = sc0b[srcx]; \ sc0a[srcx] = sr1 + IMUL6(sr0) + current; \ sc0b[srcx] = (sr0 + current) * 4; \ sr1 = sr0; \ sr0 = current; \ out00 += sc0a[srcx]; \ out10 += sc0b[srcx]; \ out01 += sc0a[srcx]; \ out11 += sc0b[srcx]; \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ out10 /= SKIPSMImagePixelType(SCALE_OUT10); \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ out11 /= SKIPSMImagePixelType(SCALE_OUT11); \ da.set(cf(SKIPSMImagePixelType(da(dx)), out00), dx); \ ++dx.x; \ da.set(cf(SKIPSMImagePixelType(da(dx)), out10), dx); \ ++dx.x; \ da.set(cf(SKIPSMImagePixelType(da(dxx)), out01), dxx); \ ++dxx.x; \ da.set(cf(SKIPSMImagePixelType(da(dxx)), out11), dxx); \ ++dxx.x; \ } while (false) // SKIPSM update routine used for the extra row under the main image body. #define SKIPSM_EXPAND_ROW_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11) \ do { \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ out10 /= SKIPSMImagePixelType(SCALE_OUT10); \ da.set(cf(da(dx), out00), dx); \ ++dx.x; \ da.set(cf(da(dx), out10), dx); \ ++dx.x; \ if (dst_h_even) { \ out01 = sc0a[srcx]; \ out11 = sc0b[srcx]; \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ out11 /= SKIPSMImagePixelType(SCALE_OUT11); \ da.set(cf(da(dxx), out01), dxx); \ ++dxx.x; \ da.set(cf(da(dxx), out11), dxx); \ ++dxx.x; \ } \ } while (false) // SKIPSM update routine used for the extra column to the right // of the main image body. #define SKIPSM_EXPAND_COLUMN_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11) \ do { \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out01 = sc0a[srcx]; \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out11 = sc0b[srcx]; \ sc1a[srcx] = sc0a[srcx]; \ sc1b[srcx] = sc0b[srcx]; \ sc0a[srcx] = sr1 + IMUL6(sr0); \ sc0b[srcx] = sr0 * 4; \ out00 += sc0a[srcx]; \ out01 += sc0a[srcx]; \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ da.set(cf(da(dx), out00), dx); \ da.set(cf(da(dxx), out01), dxx); \ if (dst_w_even) { \ ++dx.x; \ ++dxx.x; \ out10 += sc0b[srcx]; \ out11 += sc0b[srcx]; \ out10 /= SKIPSMImagePixelType(SCALE_OUT10); \ out11 /= SKIPSMImagePixelType(SCALE_OUT11); \ da.set(cf(da(dx), out10), dx); \ da.set(cf(da(dxx), out11), dxx); \ } \ } while (false) // SKIPSM update routine used for the extra column to the right // of the main image body, with wraparound boundary conditions. // This version is for the case where the dst image has even width. #define SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_EVEN(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11) \ do { \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out01 = sc0a[srcx]; \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out11 = sc0b[srcx]; \ sc1a[srcx] = sc0a[srcx]; \ sc1b[srcx] = sc0b[srcx]; \ sc0a[srcx] = sr1 + IMUL6(sr0) + SKIPSMImagePixelType(sa(sy)); \ sc0b[srcx] = (sr0 + SKIPSMImagePixelType(sa(sy))) * 4; \ out00 += sc0a[srcx]; \ out01 += sc0a[srcx]; \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ da.set(cf(da(dx), out00), dx); \ da.set(cf(da(dxx), out01), dxx); \ ++dx.x; \ ++dxx.x; \ out10 += sc0b[srcx]; \ out11 += sc0b[srcx]; \ out10 /= SKIPSMImagePixelType(SCALE_OUT10); \ out11 /= SKIPSMImagePixelType(SCALE_OUT11); \ da.set(cf(da(dx), out10), dx); \ da.set(cf(da(dxx), out11), dxx); \ } while (false) // SKIPSM update routine used for the extra column to the right // of the main image body, with wraparound boundary conditions. // This version is for the case where the dst image has odd width. #define SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_ODD(SCALE_OUT00, SCALE_OUT01) \ do { \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out01 = sc0a[srcx]; \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out11 = sc0b[srcx]; \ sc1a[srcx] = sc0a[srcx]; \ sc1b[srcx] = sc0b[srcx]; \ sc0a[srcx] = sr1 + IMUL6(sr0) + IMUL4(SKIPSMImagePixelType(sa(sy))); \ sc0b[srcx] = (sr0 + SKIPSMImagePixelType(sa(sy))) * 4; \ out00 += sc0a[srcx]; \ out01 += sc0a[srcx]; \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ da.set(cf(da(dx), out00), dx); \ da.set(cf(da(dxx), out01), dxx); \ } while (false) // SKIPSM update routine for the extra column to the right // of the extra row under the main image body. #define SKIPSM_EXPAND_ROW_COLUMN_END(SCALE_OUT00, SCALE_OUT10, SCALE_OUT01, SCALE_OUT11) \ do { \ out00 = sc1a[srcx] + IMUL6(sc0a[srcx]); \ out00 /= SKIPSMImagePixelType(SCALE_OUT00); \ da.set(cf(da(dx), out00), dx); \ if (dst_w_even) { \ out10 = sc1b[srcx] + IMUL6(sc0b[srcx]); \ out10 /= SKIPSMImagePixelType(SCALE_OUT10); \ ++dx.x; \ da.set(cf(da(dx), out10), dx); \ } \ if (dst_h_even) { \ out01 = sc0a[srcx]; \ out01 /= SKIPSMImagePixelType(SCALE_OUT01); \ da.set(cf(da(dxx), out01), dxx); \ if (dst_w_even) { \ out11 = sc0b[srcx]; \ out11 /= SKIPSMImagePixelType(SCALE_OUT11); \ ++dxx.x; \ da.set(cf(da(dxx), out11), dxx); \ } \ } \ } while (false) /** The Burt & Adelson Expand operation. * * Upsampling with Gaussian interpolation in one pass over the input image using SKIPSM-based algorithm. * Uses only integer math, visits each pixel only once. * * Explanation of algorithm: * * src image pixels: a b c dst image pixels: A B C D E * F G H I J * d e f K L M N O * P Q R S T * g h i U V W X Y * * Algorithm visits all src image pixels from left to right and top to bottom. * At each src pixel, four dst pixels are calculated. * When visiting src pixel i, dst pixels M, N, R and S are written. * * State variables before visiting i: * sr0 = h * sr1 = g * sc0a[2] = d + 6e + f * sc0b[2] = 4e + 4f * sc1a[2] = a + 6b + c * sc1b[2] = 4b + 4c * * State variables after visiting i: * sr0 = i * sr1 = h * sc0a[2] = g + 6h + i * sc0b[2] = 4h + 4i * sc1a[2] = d + 6e + f * sc1b[2] = 4e + 4f * * M = 1 * (a + 6b + c) * + 6 * (d + 6e + f) * + 1 * (g + 6h + i) * * N = 1 * (4b + 4c) * + 6 * (4e + 4f) * + 1 * (4h + 4i) * * R = 4 * (d + 6e + f) * + 4 * (g + 6h + i) * * S = 4 * (4e + 4f) * + 4 * (4h + 4i) * * Updates when visiting each src image pixel: * (all assignments occur in parallel) * sr0 <= current * sr1 <= sr0 * sc0a[x] <= sr1 + 6*sr0 + current * sc0b[x] <= 4*sr0 + 4*current * sc1a[x] <= sc0a[x] * sc1b[x] <= sc0b[x] * out(-2, -2) <= sc1a[x] + 6*sc0a[x] + (new sc0a[x]) * out(-1, -2) <= sc1b[x] + 6*sc0b[x] + (new sc0b[x]) * out(-2, -1) <= 4*sc0a[x] + 4*(new sc0a[x]) * out(-1, -1) <= 4*sc0b[x] + 4*(new sc0b[x]) * */ template void expand(bool add, bool wraparound, SrcImageIterator src_upperleft, SrcImageIterator src_lowerright, SrcAccessor sa, DestImageIterator dest_upperleft, DestImageIterator dest_lowerright, DestAccessor da, CombineFunctor cf) { int src_w = src_lowerright.x - src_upperleft.x; int src_h = src_lowerright.y - src_upperleft.y; int dst_w = dest_lowerright.x - dest_upperleft.x; int dst_h = dest_lowerright.y - dest_upperleft.y; const bool dst_w_even = (dst_w & 1) == 0; const bool dst_h_even = (dst_h & 1) == 0; // SKIPSM state variables SKIPSMImagePixelType current; SKIPSMImagePixelType out00, out10, out01, out11; SKIPSMImagePixelType sr0, sr1; SKIPSMImagePixelType* sc0a = new SKIPSMImagePixelType[src_w + 1]; SKIPSMImagePixelType* sc0b = new SKIPSMImagePixelType[src_w + 1]; SKIPSMImagePixelType* sc1a = new SKIPSMImagePixelType[src_w + 1]; SKIPSMImagePixelType* sc1b = new SKIPSMImagePixelType[src_w + 1]; // Convenient constants const SKIPSMImagePixelType SKIPSMImageZero(vigra::NumericTraits::zero()); DestImageIterator dy = dest_upperleft; DestImageIterator dyy = dest_upperleft; DestImageIterator dx = dy; DestImageIterator dxx = dyy; SrcImageIterator sy = src_upperleft; SrcImageIterator sx = sy; int srcy = 0; int srcx = 0; //int dsty = 0; //int dstx = 0; // First row { // First column srcx = 0; sx = sy; sr0 = SKIPSMImagePixelType(sa(sx)); if (wraparound) { sr1 = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1, 0))); if (!dst_w_even) { sr1 = IMUL4(sr1); } } else { sr1 = SKIPSMImageZero; } // sc*[0] are irrelevant srcx = 1; ++sx.x; for (; srcx < src_w; ++srcx, ++sx.x) { current = SKIPSMImagePixelType(sa(sx)); sc0a[srcx] = sr1 + IMUL6(sr0) + current; sc0b[srcx] = (sr0 + current) * 4; sc1a[srcx] = SKIPSMImageZero; sc1b[srcx] = SKIPSMImageZero; sr1 = sr0; sr0 = current; } // extra column at end of first row if (wraparound) { current = SKIPSMImagePixelType(sa(sy)); if (dst_w_even) { sc0a[srcx] = sr1 + IMUL6(sr0) + current; sc0b[srcx] = (sr0 + current) * 4; } else { sc0a[srcx] = sr1 + IMUL6(sr0) + IMUL4(current); // sc*b[srcx] are irrelevant for odd-sized dst images in wraparound mode. } } else { sc0a[srcx] = sr1 + IMUL6(sr0); sc0b[srcx] = sr0 * 4; } sc1a[srcx] = SKIPSMImageZero; sc1b[srcx] = SKIPSMImageZero; } // dy = row 0 // dyy = row 1 ++dyy.y; // sy = row 1 srcy = 1; ++sy.y; // Second row if (src_h > 1) { // First column srcx = 0; sx = sy; sr0 = SKIPSMImagePixelType(sa(sx)); if (wraparound) { sr1 = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w - 1, 0))); if (!dst_w_even) { sr1 = IMUL4(sr1); } } else { sr1 = SKIPSMImageZero; } // sc*[0] are irrelevant srcx = 1; ++sx.x; dx = dy; dxx = dyy; // Second column if (src_w > 1) { if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND(56, 56, 16, 16); } else { SKIPSM_EXPAND(77, 56, 22, 16); } } else { SKIPSM_EXPAND(49, 56, 14, 16); } // Main columns for (srcx = 2, ++sx.x; srcx < src_w; ++srcx, ++sx.x) { SKIPSM_EXPAND(56, 56, 16, 16); } // extra column at end of second row if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_EVEN(56, 56, 16, 16); } else { SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_ODD(77, 22); } } else { SKIPSM_EXPAND_COLUMN_END(49, 28, 14, 8); } } else { // Math works out exactly the same for wraparound and no wraparound when src_w ==1 SKIPSM_EXPAND_COLUMN_END(42, 28, 12, 8); } } else { // No Second Row // First Column srcx = 0; sr0 = SKIPSMImageZero; sr1 = SKIPSMImageZero; dx = dy; dxx = dyy; if (src_w > 1) { // Second Column srcx = 1; if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_ROW_END(48, 48, 8, 8); } else { SKIPSM_EXPAND_ROW_END(66, 48, 11, 8); } } else { SKIPSM_EXPAND_ROW_END(42, 48, 7, 8); } // Main columns for (srcx = 2; srcx < src_w; ++srcx) { SKIPSM_EXPAND_ROW_END(48, 48, 8, 8); } // extra column at end of row if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_ROW_COLUMN_END(48, 48, 8, 8); } else { SKIPSM_EXPAND_ROW_COLUMN_END(66, 48, 11, 8); } } else { SKIPSM_EXPAND_ROW_COLUMN_END(42, 24, 7, 4); } } else { // No Second Column // dst_w, dst_h must be at least 2 SKIPSM_EXPAND_ROW_COLUMN_END(36, 24, 6, 4); } delete [] sc0a; delete [] sc0b; delete [] sc1a; delete [] sc1b; return; } // dy = row 2 // dyy = row 3 dy.y += 2; dyy.y += 2; // sy = row 2 srcy = 2; ++sy.y; // Main Rows for (srcy = 2, sx = sy; srcy < src_h; ++srcy, ++sy.y, dy.y += 2, dyy.y += 2) { // First column srcx = 0; sx = sy; sr0 = SKIPSMImagePixelType(sa(sx)); if (wraparound) { sr1 = SKIPSMImagePixelType(sa(sy, vigra::Diff2D(src_w-1,0))); if (!dst_w_even) { sr1 = IMUL4(sr1); } } else { sr1 = SKIPSMImageZero; } // sc*[0] are irrelevant srcx = 1; ++sx.x; dx = dy; dxx = dyy; // Second column if (src_w > 1) { if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND(64, 64, 16, 16); } else { SKIPSM_EXPAND(88, 64, 22, 16); } } else { SKIPSM_EXPAND(56, 64, 14, 16); } // Main columns for (srcx = 2, ++sx.x; srcx < src_w; ++srcx, ++sx.x) { SKIPSM_EXPAND(64, 64, 16, 16); } // extra column at end of row if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_EVEN(64, 64, 16, 16); } else { SKIPSM_EXPAND_COLUMN_END_WRAPAROUND_ODD(88, 22); } } else { SKIPSM_EXPAND_COLUMN_END(56, 32, 14, 8); } } else { // No second column // dst_w must be at least 2 // Math works out exactly the same for wraparound and no wraparound when src_w == 1 SKIPSM_EXPAND_COLUMN_END(48, 32, 12, 8); } } // Extra row at end { srcx = 0; sr0 = SKIPSMImageZero; sr1 = SKIPSMImageZero; dx = dy; dxx = dyy; if (src_w > 1) { // Second Column srcx = 1; if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_ROW_END(56, 56, 8, 8); } else { SKIPSM_EXPAND_ROW_END(77, 56, 11, 8); } } else { SKIPSM_EXPAND_ROW_END(49, 56, 7, 8); } // Main columns for (srcx = 2; srcx < src_w; ++srcx) { SKIPSM_EXPAND_ROW_END(56, 56, 8, 8); } // extra column at end of row if (wraparound) { if (dst_w_even) { SKIPSM_EXPAND_ROW_COLUMN_END(56, 56, 8, 8); } else { SKIPSM_EXPAND_ROW_COLUMN_END(77, 56, 11, 8); } } else { SKIPSM_EXPAND_ROW_COLUMN_END(49, 28, 7, 4); } } else { // No Second Column // dst_w, dst_h must be at least 2 SKIPSM_EXPAND_ROW_COLUMN_END(42, 28, 6, 4); } } delete [] sc0a; delete [] sc0b; delete [] sc1a; delete [] sc1b; } // Functor that adds two values and de-promotes the result. // Used when collapsing a laplacian pyramid. // Explict fromPromote necessary to avoid overflow/underflow problems. template struct FromPromotePlusFunctorWrapper : public std::binary_function { inline T3 operator()(const T1& a, const T2& b) const { return vigra::NumericTraits::fromPromote(a + b); } }; // Version using argument object factories. template inline void expand(bool add, bool wraparound, vigra::triple src, vigra::triple dest) { typedef typename DestAccessor::value_type DestPixelType; if (add) { expand(add, wraparound, src.first, src.second, src.third, dest.first, dest.second, dest.third, FromPromotePlusFunctorWrapper()); } else { expand(add, wraparound, src.first, src.second, src.third, dest.first, dest.second, dest.third, std::minus()); } } /** Calculate the Gaussian pyramid for the given SrcImage/AlphaImage pair. */ template std::vector* gaussianPyramid(unsigned int numLevels, bool wraparound, typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa, typename AlphaImageType::const_traverser alpha_upperleft, typename AlphaImageType::ConstAccessor aa) { std::vector* gp = new std::vector(); // Size of pyramid level 0 int w = src_lowerright.x - src_upperleft.x; int h = src_lowerright.y - src_upperleft.y; // Pyramid level 0 PyramidImageType* gp0 = new PyramidImageType(w, h); // Copy src image into gp0, using fixed-point conversions. copyToPyramidImage (src_upperleft, src_lowerright, sa, gp0->upperLeft(), gp0->accessor()); gp->push_back(gp0); if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << command << ": info: generating Gaussian pyramid: g0"; } // Make remaining levels. PyramidImageType* lastGP = gp0; AlphaImageType* lastA = NULL; for (unsigned int l = 1; l < numLevels; l++) { if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << " g" << l; std::cerr.flush(); } // Size of next level w = (w + 1) >> 1; h = (h + 1) >> 1; // Next pyramid level PyramidImageType* gpn = new PyramidImageType(w, h); AlphaImageType* nextA = new AlphaImageType(w, h); if (lastA == NULL) { reduce (wraparound, srcImageRange(*lastGP), maskIter(alpha_upperleft, aa), destImageRange(*gpn), destImageRange(*nextA)); } else { reduce (wraparound, srcImageRange(*lastGP), maskImage(*lastA), destImageRange(*gpn), destImageRange(*nextA)); } gp->push_back(gpn); lastGP = gpn; delete lastA; lastA = nextA; } delete lastA; if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << std::endl; } return gp; } // Version using argument object factories. template inline std::vector* gaussianPyramid(unsigned int numLevels, bool wraparound, vigra::triple src, vigra::pair alpha) { return gaussianPyramid (numLevels, wraparound, src.first, src.second, src.third, alpha.first, alpha.second); } /** Calculate the Gaussian pyramid for the given image (without an alpha channel). */ template std::vector* gaussianPyramid(unsigned int numLevels, bool wraparound, typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa) { std::vector* gp = new std::vector(); // Size of pyramid level 0 int w = src_lowerright.x - src_upperleft.x; int h = src_lowerright.y - src_upperleft.y; // Pyramid level 0 PyramidImageType *gp0 = new PyramidImageType(w, h); // Copy src image into gp0, using fixed-point conversions. copyToPyramidImage (src_upperleft, src_lowerright, sa, gp0->upperLeft(), gp0->accessor()); gp->push_back(gp0); if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << command << ": info: generating Gaussian pyramid: g0"; } // Make remaining levels. PyramidImageType* lastGP = gp0; for (unsigned int l = 1; l < numLevels; l++) { if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << " g" << l; std::cerr.flush(); } // Size of next level w = (w + 1) >> 1; h = (h + 1) >> 1; // Next pyramid level PyramidImageType *gpn = new PyramidImageType(w, h); reduce(wraparound, srcImageRange(*lastGP), destImageRange(*gpn)); gp->push_back(gpn); lastGP = gpn; } if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << std::endl; } return gp; } // Version using argument object factories. template inline std::vector* gaussianPyramid(unsigned int numLevels, bool wraparound, vigra::triple src) { return gaussianPyramid (numLevels, wraparound, src.first, src.second, src.third); } /** Calculate the Laplacian pyramid of the given SrcImage/AlphaImage pair. */ template std::vector* laplacianPyramid(const char* exportName, unsigned int numLevels, bool wraparound, typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa, typename AlphaImageType::const_traverser alpha_upperleft, typename AlphaImageType::ConstAccessor aa) { // First create a Gaussian pyramid. std::vector * gp = gaussianPyramid (numLevels, wraparound, src_upperleft, src_lowerright, sa, alpha_upperleft, aa); //exportPyramid(gp, exportName); if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << command << ": info: generating Laplacian pyramid:"; std::cerr.flush(); } // For each level, subtract the expansion of the next level. // Stop if there is no next level. for (unsigned int l = 0; l < (numLevels-1); l++) { if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << " l" << l; std::cerr.flush(); } //if (l == 4) { // int dst_w = (*((*gp)[l])).width(); // cout << "dst_w=" << dst_w << std::endl; // cout << std::endl << "pre-expand l4 gp:" << std::endl; // for (int y = 30; y < 35; y++) { // cout << "y=" << y << std::endl; // for (int x = -4; x < 4; ++x) { // int modX = (x < 0) ? x+dst_w : x; // cout << (*((*gp)[l]))(modX,y) << std::endl; // } // } // int src_w = (*((*gp)[l+1])).width(); // cout << "src_w=" << src_w << std::endl; // cout << std::endl << "l5 gp:" << std::endl; // for (int y = 15; y < 18; y++) { // cout << "y=" << y << std::endl; // for (int x = -2; x < 2; ++x) { // int modX = (x < 0) ? x+src_w : x; // cout << (*((*gp)[l+1]))(modX,y) << std::endl; // } // } //} expand(false, wraparound, srcImageRange(*((*gp)[l+1])), destImageRange(*((*gp)[l]))); //if (l == 4) { // int dst_w = (*((*gp)[l])).width(); // cout << std::endl << "post-expand l4 gp:" << std::endl; // for (int y = 30; y < 35; y++) { // cout << "y=" << y << std::endl; // for (int x = -4; x < 4; ++x) { // int modX = (x < 0) ? x+dst_w : x; // cout << (*((*gp)[l]))(modX,y) << std::endl; // } // } //} } if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << " l" << (numLevels-1) << std::endl; } //exportPyramid(gp, exportName); return gp; } // Version using argument object factories. template inline std::vector* laplacianPyramid(const char* exportName, unsigned int numLevels, bool wraparound, vigra::triple src, vigra::pair alpha) { return laplacianPyramid (exportName, numLevels, wraparound, src.first, src.second, src.third, alpha.first, alpha.second); } /** Collapse the given Laplacian pyramid. */ template void collapsePyramid(bool wraparound, std::vector* p) { if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << command << ": info: collapsing Laplacian pyramid: " << "l" << p->size() - 1; std::cerr.flush(); } // For each level, add the expansion of the next level. // Work backwards from the smallest level to the largest. for (int l = (p->size()-2); l >= 0; l--) { if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << " l" << l; std::cerr.flush(); } expand(true, wraparound, srcImageRange(*((*p)[l + 1])), destImageRange(*((*p)[l]))); } if (Verbose >= VERBOSE_PYRAMID_MESSAGES) { std::cerr << std::endl; } } // Export a scalar pyramid as a set of UINT16 tiff files. template void exportPyramid(std::vector* v, const char* prefix, vigra::VigraTrueType) { typedef typename PyramidImageType::value_type PyramidValueType; //for (unsigned int i = 0; i < (v->size() - 1); i++) { // // Clear all levels except last. // initImage(destImageRange(*((*v)[i])), vigra::NumericTraits::zero()); //} //collapsePyramid(false, v); for (unsigned int i = 0; i < v->size(); i++) { char filenameBuf[512]; snprintf(filenameBuf, 512, "%s%04u.tif", prefix, i); // Rescale the pyramid values to fit in UINT16. vigra::UInt16Image usPyramid((*v)[i]->width(), (*v)[i]->height()); transformImageMP(srcImageRange(*((*v)[i])), destImage(usPyramid), vigra::linearRangeMapping(vigra::NumericTraits::min(), vigra::NumericTraits::max(), vigra::NumericTraits::min(), vigra::NumericTraits::max())); vigra::ImageExportInfo info(filenameBuf); vigra::exportImage(srcImageRange(usPyramid), info); } } // Export a vector pyramid as a set of UINT16 tiff files. template void exportPyramid(std::vector *v, const char *prefix, vigra::VigraFalseType) { typedef typename PyramidImageType::value_type PyramidVectorType; typedef typename PyramidVectorType::value_type PyramidValueType; //for (unsigned int i = 0; i < (v->size() - 1); i++) { // // Clear all levels except last. // initImage(destImageRange(*((*v)[i])), vigra::NumericTraits::zero()); //} //collapsePyramid(false, v); for (unsigned int i = 0; i < v->size(); i++) { char filenameBuf[512]; snprintf(filenameBuf, 512, "%s%04u.tif", prefix, i); // Rescale the pyramid values to fit in UINT16. vigra::UInt16RGBImage usPyramid((*v)[i]->width(), (*v)[i]->height()); transformImageMP(srcImageRange(*((*v)[i])), destImage(usPyramid), vigra::linearRangeMapping(PyramidVectorType(vigra::NumericTraits::min()), PyramidVectorType(vigra::NumericTraits::max()), typename vigra::UInt16RGBImage::value_type(vigra::NumericTraits::min()), typename vigra::UInt16RGBImage::value_type(vigra::NumericTraits::max()))); vigra::ImageExportInfo info(filenameBuf); vigra::exportImage(srcImageRange(usPyramid), info); } } // Export a pyramid as a set of UINT16 tiff files. template void exportPyramid(std::vector* v, const char* prefix) { typedef typename vigra::NumericTraits::isScalar pyramid_is_scalar; exportPyramid(v, prefix, pyramid_is_scalar()); } } // namespace enblend #endif /* __PYRAMID_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/self_test.cc0000644000175100017510000001557512070530113020654 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ // No test, no bug. -- Chris Spiel #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "self_test.h" #define lengthof(m_array) (sizeof(m_array) / sizeof(m_array[0])) extern const std::string command; //////////////////////////////////////////////////////////////////////// // Number of arguments we pass to getopt_long in each of our tests. #define ARG_COUNT 4 enum {a_short, b_short, c_short, a_long, b_long, c_long, FLAG_COUNT}; struct test_case { const char* arguments[ARG_COUNT]; int flags[FLAG_COUNT]; }; inline static int int_of_string(const char* s) { return static_cast(strtol(s, NULL, 10)); } static void reset_getopt_globals() { opterr = 0; // silence getopt_long(3) optopt = -1; // reset "unknown option" character optind = 1; // reset parsing index optarg = NULL; // reset pointer to value of option argument } static int try_out_getopt_long(int arg_count, const char* arguments[], int* flags) { const char* short_options = "ab:c::"; const struct option long_options[] = { {"long-a", no_argument, NULL, 1}, {"long-b", required_argument, NULL, 2}, {"long-c", optional_argument, NULL, 3}, {NULL, 0, NULL, 0} }; reset_getopt_globals(); while (true) { int option_index = 0; int code = getopt_long(arg_count, const_cast(arguments), short_options, long_options, &option_index); if (code == -1) { break; } switch (code) { case 1: flags[a_long] = 1; break; case 2: flags[b_long] = int_of_string(optarg); break; case 3: flags[c_long] = optarg == NULL ? 1 : int_of_string(optarg); break; case 'a': flags[a_short] = 1; break; case 'b': flags[b_short] = int_of_string(optarg); break; case 'c': flags[c_short] = optarg == NULL ? 1 : int_of_string(optarg); break; default: return -1; } } return optind; } // Write a list of elements separated by spaces to stream out. template static void write_list(std::ostream& out, unsigned size, const T list) { for (unsigned i = 0U; i != size; ++i) { out << list[i]; if (i != size - 1U) { out << ' '; } } } // Name of the first argument, i.e. the first non-option in the list // of arguments. We need to know its name so that we can check // whether getopt_long(3) really parsed all options. #define ARG1 "1" // Test whether the library function getopt_long(3) works as required. bool getopt_long_works_ok() { bool has_passed_test = true; struct test_case tests[] = { {{"p", ARG1, "2", "3"}, {0, 0, 0, 0, 0, 0}}, {{"p", "-a", ARG1, "2"}, {1, 0, 0, 0, 0, 0}}, {{"p", "-b2", ARG1, "2"}, {0, 2, 0, 0, 0, 0}}, {{"p", "-c", ARG1, "2"}, {0, 0, 1, 0, 0, 0}}, {{"p", "-c2", ARG1, "2"}, {0, 0, 2, 0, 0, 0}}, {{"p", "--long-a", ARG1, "2"}, {0, 0, 0, 1, 0, 0}}, {{"p", "--long-b=2", ARG1, "2"}, {0, 0, 0, 0, 2, 0}}, {{"p", "--long-c", ARG1, "2"}, {0, 0, 0, 0, 0, 1}}, {{"p", "--long-c=2", ARG1, "2"}, {0, 0, 0, 0, 0, 2}}, {{"p", "-a", "-b2", ARG1}, {1, 2, 0, 0, 0, 0}}, {{"p", "-a", "-b2", ARG1}, {1, 2, 0, 0, 0, 0}}, {{"p", "-ab2", "-c", ARG1}, {1, 2, 1, 0, 0, 0}}, {{"p", "-ab2", "-c3", ARG1}, {1, 2, 3, 0, 0, 0}}, {{"p", "--long-a", "--long-b=2", ARG1}, {0, 0, 0, 1, 2, 0}}, {{"p", "--long-a", "--long-b=2", ARG1}, {0, 0, 0, 1, 2, 0}}, {{"p", "--long-b=2", "--long-c", ARG1}, {0, 0, 0, 0, 2, 1}}, {{"p", "--long-b=2", "--long-c=3", ARG1}, {0, 0, 0, 0, 2, 3}}, {{"p", "-a", "--long-a", ARG1}, {1, 0, 0, 1, 0, 0}}, {{"p", "-b2", "--long-a", ARG1}, {0, 2, 0, 1, 0, 0}}, {{"p", "-a", "--long-b=2", ARG1}, {1, 0, 0, 0, 2, 0}}, {{"p", "-b2", "--long-b=2", ARG1}, {0, 2, 0, 0, 2, 0}}, {{NULL, NULL, NULL}, {0, 0, 0, 0, 0, 0}} }; const unsigned arg_count = lengthof(tests->arguments); const unsigned flag_count = lengthof(tests->flags); for (struct test_case* t = tests; t->arguments[0] != NULL; ++t) { int flags[] = {0, 0, 0, 0, 0, 0}; assert(lengthof(tests->flags) == lengthof(flags)); const int index = try_out_getopt_long(arg_count, t->arguments, flags); if (index < 0 || index >= static_cast(arg_count) || strcmp(t->arguments[index], ARG1) != 0) { std::cerr << command << ": failed self test: getopt_long(3) did not parse argument list \""; write_list(std::cerr, arg_count, t->arguments); std::cerr << "\"\n"; has_passed_test = false; } for (unsigned i = 0U; i != flag_count; ++i) { if (flags[i] != t->flags[i]) { std::cerr << command << ": failed self test: getopt_long(3) incorrectly parses argument list \""; write_list(std::cerr, arg_count, t->arguments); std::cerr << "\";\n"; std::cerr << command << ": failed self test: expected {"; write_list(std::cerr, flag_count, t->flags); std::cerr << "}, but got {"; write_list(std::cerr, flag_count, flags); std::cerr << "}\n"; has_passed_test = false; } } } reset_getopt_globals(); return has_passed_test; } enblend-enfuse-4.1.2+dfsg/src/gpu.cc0000644000175100017510000003445412076002414017460 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include "global.h" #include "gpu.h" #ifdef HAVE_LIBGLEW static const std::string command("enblend"); static GLuint GlutWindowHandle; static GLint MaxTextureSize; static GLuint PiTexture; static GLuint ETexture; static GLuint OutTexture; static GLuint FB; static GLhandleARB ProgramObject; static GLhandleARB ShaderObject; static GLint PiTextureParam; static GLint ETextureParam; static GLint TempParam; static GLint KMaxParam; static const char* GDAKernelSource = { "#extension GL_ARB_texture_rectangle : enable\n" "\n" "uniform sampler2DRect PiTexture;\n" "uniform sampler2DRect ETexture;\n" "uniform float Temperature;\n" "uniform float KMax;\n" "\n" "void main(void)\n" "{\n" " vec4 pix = texture2DRect(PiTexture, gl_TexCoord[0].st);\n" " vec4 ex = texture2DRect(ETexture, gl_TexCoord[0].st);\n" " vec4 An;\n" " vec4 pi_plus;\n" " vec4 sum = vec4(0.0, 0.0, 0.0, 0.0);\n" " float i = 0.0;\n" "\n" " for (i = 0.0; i < KMax; i++) {\n" " vec2 coord = vec2(i, gl_TexCoord[0].t);\n" " An = exp((ex - texture2DRect(ETexture, coord)) / Temperature) + 1.0;\n" " pi_plus = pix + texture2DRect(PiTexture, coord);\n" " sum += (pi_plus / An);\n" " }\n" "\n" " gl_FragColor = sum / KMax;\n" "}\n" }; void checkGLErrors(const char* file, unsigned line) { const GLenum errCode = glGetError(); if (errCode != GL_NO_ERROR) { std::cerr << command << ": OpenGL error in " << file << ":" << line << ": " << gluErrorString(errCode) << std::endl; exit(1); } } void printInfoLog(GLhandleARB obj) { GLint infologLength = 0; GLint charsWritten = 0; char *infoLog; glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength); if (infologLength > 1) { infoLog = new char[infologLength]; glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog); std::cerr << command << ": info: GL info log\n" << infoLog << std::endl; delete [] infoLog; } } bool checkFramebufferStatus() { const GLenum status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); switch (status) { case GL_FRAMEBUFFER_COMPLETE_EXT: return true; case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT: std::cerr << command << ": GL error: Framebuffer incomplete, incomplete attachment" << std::endl; return false; case GL_FRAMEBUFFER_UNSUPPORTED_EXT: std::cerr << command << ": unsupported framebuffer format" << std::endl; return false; case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT: std::cerr << command << ": framebuffer incomplete, missing attachment" << std::endl; return false; case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT: std::cerr << command << ": framebuffer incomplete, attached images must have same dimensions" << std::endl; return false; case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT: std::cerr << command << ": framebuffer incomplete, attached images must have same format" << std::endl; return false; case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT: std::cerr << command << ": framebuffer incomplete, missing draw buffer" << std::endl; return false; case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT: std::cerr << command << ": framebuffer incomplete, missing read buffer" << std::endl; return false; } return false; } #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLContextObj cgl_init() { CGLPixelFormatAttribute attribs[] = { kCGLPFAPBuffer, kCGLPFAColorSize, (CGLPixelFormatAttribute) 32, (CGLPixelFormatAttribute) 0 }; CGLPixelFormatObj pixel_format = NULL; CGLContextObj cgl_context = NULL; long int pixel_formats = 0L; CGLError cgl_error; cgl_error = CGLChoosePixelFormat(attribs, &pixel_format, &pixel_formats); if (pixel_format == NULL) { std::cerr << command << ": error " << cgl_error << " occured when choosing pixel format" << std::endl; } else { cgl_error = CGLCreateContext(pixel_format, NULL, &cgl_context); if (!cgl_context) { std::cerr << command << ": error " << cgl_error << " occured while creating a CGL context" << std::endl; } else { CGLSetCurrentContext(cgl_context); } } return cgl_context; } #endif bool initGPU(int* argcp, char** argv) { #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLContextObj cgl_context = cgl_init(); #else glutInit(argcp, argv); glutInitDisplayMode(GLUT_RGBA | GLUT_ALPHA); GlutWindowHandle = glutCreateWindow("Enblend"); #endif const int err = glewInit(); if (err != GLEW_OK) { std::cerr << command << ": an error occured while setting up the GPU\n" << command << ": " << glewGetErrorString(err) << "\n" << command << ": \"--gpu\" flag is not going to work on this machine" << std::endl; #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLDestroyContext(cgl_context); #else glutDestroyWindow(GlutWindowHandle); #endif exit(1); } if (Verbose >= VERBOSE_GPU_MESSAGES) { std::cerr << command << ": info: using graphics card: " << GLGETSTRING(GL_VENDOR) << "\n" << command << ": info: renderer: " << GLGETSTRING(GL_RENDERER) << "\n" << command << ": info: version: " << GLGETSTRING(GL_VERSION) << "\n"; } const GLboolean has_arb_fragment_shader = glewGetExtension("GL_ARB_fragment_shader"); const GLboolean has_arb_vertex_shader = glewGetExtension("GL_ARB_vertex_shader"); const GLboolean has_arb_shader_objects = glewGetExtension("GL_ARB_shader_objects"); const GLboolean has_arb_shading_language = glewGetExtension("GL_ARB_shading_language_100"); const GLboolean has_arb_texture_float = glewGetExtension("GL_ARB_texture_float"); const GLboolean has_arb_texture_rectangle = glewGetExtension("GL_ARB_texture_rectangle"); if (!(has_arb_fragment_shader && has_arb_vertex_shader && has_arb_shader_objects && has_arb_shading_language && has_arb_texture_float && has_arb_texture_rectangle)) { const char* msg[] = {"false", "true"}; std::cerr << command << ": extension GL_ARB_fragment_shader = " << msg[has_arb_fragment_shader] << "\n" << command << ": extension GL_ARB_vertex_shader = " << msg[has_arb_vertex_shader] << "\n" << command << ": extension GL_ARB_shader_objects = " << msg[has_arb_shader_objects] << "\n" << command << ": extension GL_ARB_shading_language_100 = " << msg[has_arb_shading_language] << "\n" << command << ": extension GL_ARB_texture_float = " << msg[has_arb_texture_float] << "\n" << command << ": extension GL_ARB_texture_rectangle = " << msg[has_arb_texture_rectangle] << "\n" << command << ": graphics card lacks the necessary extensions for \"--gpu\";" << "\n" << command << ": \"--gpu\" flag is not going to work on this machine" << std::endl; #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLDestroyContext(cgl_context); #else glutDestroyWindow(GlutWindowHandle); #endif exit(1); } glGetIntegerv(GL_MAX_TEXTURE_SIZE, &MaxTextureSize); ProgramObject = glCreateProgramObjectARB(); ShaderObject = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB); glAttachObjectARB(ProgramObject, ShaderObject); glShaderSourceARB(ShaderObject, 1, &GDAKernelSource, NULL); glCompileShaderARB(ShaderObject); printInfoLog(ShaderObject); glLinkProgramARB(ProgramObject); GLint success; glGetObjectParameterivARB(ProgramObject, GL_OBJECT_LINK_STATUS_ARB, &success); if (!success) { std::cerr << command << ": GPU ARB shader program could not be linked\n"; exit(1); } PiTextureParam = glGetUniformLocationARB(ProgramObject, "PiTexture"); ETextureParam = glGetUniformLocationARB(ProgramObject, "ETexture"); TempParam = glGetUniformLocationARB(ProgramObject, "Temperature"); KMaxParam = glGetUniformLocationARB(ProgramObject, "KMax"); glUseProgramObjectARB(ProgramObject); CHECK_GL(); return true; } bool configureGPUTextures(unsigned int k, unsigned int vars) { // state variables packed into vec4s const int width = k; const int height = (vars + 3) / 4; // http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/gl/teximage2d.html if (width > 2 + GL_MAX_TEXTURE_SIZE || height > 2 + GL_MAX_TEXTURE_SIZE) { std::cerr << command << ": texture size exceeds GPU's maximum\n"; exit(1); } if (width % 2 != 0 || height % 2 != 0) { std::cerr << command << ": warning: odd texture size may be invalid for OpenGL\n"; } glGenTextures(1, &PiTexture); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, PiTexture); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA32F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, NULL); CHECK_GL(); glGenTextures(1, &ETexture); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, ETexture); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA32F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, NULL); CHECK_GL(); glGenTextures(1, &OutTexture); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, OutTexture); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_RECTANGLE_ARB, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA32F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, NULL); CHECK_GL(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glGenFramebuffersEXT(1, &FB); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FB); glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(0.0, width, 0.0, height); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glViewport(0, 0, width, height); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_RECTANGLE_ARB, OutTexture, 0); if (!checkFramebufferStatus()) { exit(1); } return true; } bool gpuGDAKernel(unsigned int k, unsigned int vars, double t, float* packedEData, float* packedPiData, float* packedOutData) { const unsigned localWidth = k; const unsigned localHeight = (vars + 3) / 4; glBindTexture(GL_TEXTURE_RECTANGLE_ARB, PiTexture); glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, localWidth, localHeight, GL_RGBA, GL_FLOAT, packedPiData); CHECK_GL(); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, ETexture); glTexSubImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, 0, 0, localWidth, localHeight, GL_RGBA, GL_FLOAT, packedEData); CHECK_GL(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, PiTexture); glUniform1iARB(PiTextureParam, 0); CHECK_GL(); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, ETexture); glUniform1iARB(ETextureParam, 1); CHECK_GL(); glUniform1fARB(TempParam, t); CHECK_GL(); glUniform1fARB(KMaxParam, k); CHECK_GL(); glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT); glPolygonMode(GL_FRONT, GL_FILL); glBegin(GL_QUADS); glTexCoord2f(0.0, 0.0); glVertex2f(0.0, 0.0); glTexCoord2f(localWidth, 0.0); glVertex2f(localWidth, 0.0); glTexCoord2f(localWidth, localHeight); glVertex2f(localWidth, localHeight); glTexCoord2f(0.0, localHeight); glVertex2f(0.0, localHeight); glEnd(); CHECK_GL(); glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); CHECK_GL(); glReadPixels(0, 0, localWidth, localHeight, GL_RGBA, GL_FLOAT, packedOutData); CHECK_GL(); return true; } bool clearGPUTextures() { glDeleteFramebuffersEXT(1, &FB); glDeleteTextures(1, &PiTexture); glDeleteTextures(1, &ETexture); glDeleteTextures(1, &OutTexture); return true; } bool wrapupGPU() { if (FB != 0) { glDeleteFramebuffersEXT(1, &FB); } if (PiTexture != 0) { glDeleteTextures(1, &PiTexture); } if (ETexture != 0) { glDeleteTextures(1, &ETexture); } if (OutTexture != 0) { glDeleteTextures(1, &OutTexture); } #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLContextObj cgl_context = CGLGetCurrentContext(); if (cgl_context != NULL) { CGLDestroyContext(cgl_context); } #else glutDestroyWindow(GlutWindowHandle); #endif return true; } #endif // HAVE_LIBGLEW enblend-enfuse-4.1.2+dfsg/src/error_message.h0000644000175100017510000000274612070530113021357 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ERROR_MESSAGE_H__ #define __ERROR_MESSAGE_H__ #include #if !defined(HAVE_DECL_STRERROR_R) #if defined(STRERROR_R_CHAR_P) // GNU // http://www.gnu.org/software/hello/manual/libc/Error-Messages.html extern char* strerror_r(int errnum, char* buf, size_t buflen); #else // POSIX // http://www.opengroup.org/onlinepubs/9699919799/functions/strerror_r.html extern int strerror_r(int errnum, char* buf, size_t buflen); #endif // STRERROR_R_CHAR_P #endif // !HAVE_DECL_STRERROR_R namespace enblend { /** Answer the error message associated with anErrorNumber. */ std::string errorMessage(int anErrorNumber); } #endif /* __ERROR_MESSAGE_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/maskcommon.h0000644000175100017510000002747612070530113020675 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal, Mikolaj Leszczynski * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MASKCOMMON_H #define MASKCOMMON_H #include namespace enblend { template class DifferenceFunctor { public: typedef typename EnblendNumericTraits::ImagePixelComponentType PixelComponentType; typedef typename EnblendNumericTraits::ImagePixelComponentType ResultPixelComponentType; typedef vigra::LinearIntensityTransform RangeMapper; DifferenceFunctor() : scale_(vigra::linearRangeMapping(vigra::NumericTraits::min(), vigra::NumericTraits::max(), ResultType(vigra::NumericTraits::min()), ResultType(vigra::NumericTraits::max()))) {} virtual ~DifferenceFunctor() {} ResultType operator()(const PixelType& a, const PixelType& b) const { typedef typename vigra::NumericTraits::isScalar src_is_scalar; return difference(a, b, src_is_scalar()); } protected: virtual ResultType difference(const vigra::RGBValue& a, const vigra::RGBValue& b, vigra::VigraFalseType) const = 0; ResultType difference(PixelType a, PixelType b, vigra::VigraTrueType) const { typedef typename vigra::NumericTraits::isSigned src_is_signed; return scalar_difference(a, b, src_is_signed()); } ResultType scalar_difference(PixelType a, PixelType b, vigra::VigraTrueType) const { return scale_(std::abs(a - b)); } // This appears necessary because NumericTraits::Promote // is an unsigned int instead of an int. ResultType scalar_difference(PixelType a, PixelType b, vigra::VigraFalseType) const { return scale_(std::abs(static_cast(a) - static_cast(b))); } RangeMapper scale_; }; template value_type hue(const vigra::RGBValue& pixel) { typedef typename vigra::NumericTraits::RealPromote real_value_type; const value_type red = pixel.red(); const value_type green = pixel.green(); const value_type blue = pixel.blue(); const value_type max = std::max(red, std::max(green, blue)); const value_type min = std::min(red, std::min(green, blue)); if (min == max) { return vigra::NumericTraits::max(); } else { const real_value_type delta = vigra::NumericTraits::toRealPromote(6 * (max - min)); real_value_type h = 0.0; if (red == max) { h = (green - blue) / delta; } else if (green == max) { h = (1.0 / 3.0) + (blue - red) / delta; } else { h = (2.0 / 3.0) + (red - green) / delta; } if (h < 0.0) { h += 1.0; } return vigra::NumericTraits::fromRealPromote(h * vigra::NumericTraits::max()); } } template class MaxHueLuminanceDifferenceFunctor : public DifferenceFunctor { typedef DifferenceFunctor super; public: typedef typename super::PixelComponentType PixelComponentType; MaxHueLuminanceDifferenceFunctor(double aLuminanceWeight, double aChrominanceWeight) { const double total = aLuminanceWeight + aChrominanceWeight; assert(total != 0.0); luma_ = aLuminanceWeight / total; chroma_ = aChrominanceWeight / total; } protected: ResultType difference(const vigra::RGBValue& a, const vigra::RGBValue& b, vigra::VigraFalseType) const { const PixelComponentType aLum = a.luminance(); const PixelComponentType bLum = b.luminance(); const PixelComponentType aHue = hue(a); const PixelComponentType bHue = hue(b); const PixelComponentType lumDiff = aLum > bLum ? aLum - bLum : bLum - aLum; PixelComponentType hueDiff = aHue > bHue ? aHue - bHue : bHue - aHue; if (hueDiff > (vigra::NumericTraits::max() / 2)) { hueDiff = vigra::NumericTraits::max() - hueDiff; } return super::scale_(std::max(luma_ * lumDiff, chroma_ * hueDiff)); } private: MaxHueLuminanceDifferenceFunctor(); // NOT IMPLEMENTED double luma_; double chroma_; }; template class DeltaEPixelDifferenceFunctor : public DifferenceFunctor { typedef DifferenceFunctor super; public: typedef typename super::PixelComponentType PixelComponentType; DeltaEPixelDifferenceFunctor(double aLuminanceWeight, double aChrominanceWeight) : rgb_to_lab_(vigra::RGB2LabFunctor(vigra::NumericTraits::max())) { const double total = aLuminanceWeight + 2.0 * aChrominanceWeight; assert(total != 0.0); luma_ = aLuminanceWeight / total; chroma_ = aChrominanceWeight / total; } protected: ResultType difference(const vigra::RGBValue& a, const vigra::RGBValue& b, vigra::VigraFalseType) const { typedef typename vigra::RGB2LabFunctor::result_type LABResultType; const LABResultType lab_a = rgb_to_lab_(a); const LABResultType lab_b = rgb_to_lab_(b); // See, e.g. http://en.wikipedia.org/wiki/Color_difference // or http://www.colorwiki.com/wiki/Delta_E:_The_Color_Difference const double delta_e = sqrt(luma_ * square(lab_a[0] - lab_b[0]) + chroma_ * square(lab_a[1] - lab_b[1]) + chroma_ * square(lab_a[2] - lab_b[2])); // Vigra documentation: 0 <= L* <= 100.0, -86.1813 <= a* <= 98.2352, -107.862 <= b* <= 94.4758 // => Maximum delta_e = 291.4619. Real differences are much smaller and fromRealPromote() // clips out-of-destination-range values anyhow. We use 128.0, which yields values comparable // to MaxHueLuminanceDifferenceFunctor. return super::scale_(vigra::NumericTraits:: fromRealPromote(delta_e * vigra::NumericTraits::max() / 128.0)); } private: DeltaEPixelDifferenceFunctor(); // NOT IMPLEMENTED double luma_; double chroma_; vigra::RGB2LabFunctor rgb_to_lab_; }; template class PixelSumFunctor { typedef typename EnblendNumericTraits::ImagePixelComponentType PixelComponentType; typedef typename EnblendNumericTraits::ImagePixelComponentType ResultPixelComponentType; typedef vigra::LinearIntensityTransform RangeMapper; public: PixelSumFunctor() : rm(linearRangeMapping(vigra::NumericTraits::min(), vigra::NumericTraits::max(), ResultType(vigra::NumericTraits::min()), ResultType(vigra::NumericTraits::max()))) {} ResultType operator()(const PixelType& a, const PixelType& b) const { typedef typename vigra::NumericTraits::isScalar src_is_scalar; return sum(a, b, src_is_scalar()); } protected: ResultType sum(const PixelType& a, const PixelType& b, vigra::VigraFalseType) const { PixelComponentType aLum = a.luminance(); PixelComponentType bLum = b.luminance(); PixelComponentType lumDiff = (aLum + bLum) / 2; return rm(lumDiff); } ResultType sum(const PixelType& a, const PixelType& b, vigra::VigraTrueType) const { typedef typename vigra::NumericTraits::isSigned src_is_signed; return scalar_sum(a, b, src_is_signed()); } ResultType scalar_sum(const PixelType& a, const PixelType& b, vigra::VigraTrueType) const { return rm(a + b); } // This appears necessary because NumericTraits::Promote // is an unsigned int instead of an int. ResultType scalar_sum(const PixelType& a, const PixelType& b, vigra::VigraFalseType) const { return rm(std::abs(static_cast(a) + static_cast(b))); } RangeMapper rm; }; template class MapFunctor { typedef typename EnblendNumericTraits::ImagePixelComponentType PixelComponentType; typedef typename EnblendNumericTraits::ImagePixelComponentType ResultPixelComponentType; typedef vigra::LinearIntensityTransform RangeMapper; public: MapFunctor() : rm(vigra::linearRangeMapping(vigra::NumericTraits::min(), vigra::NumericTraits::max(), ResultType(vigra::NumericTraits::min()), ResultType(vigra::NumericTraits::max()))) {} ResultType operator()(const PixelType& a) const { typedef typename vigra::NumericTraits::isScalar src_is_scalar; return map(a, src_is_scalar()); } protected: ResultType map(const PixelType& a, vigra::VigraFalseType) const { PixelComponentType aLum = a.luminance(); return rm(aLum); } ResultType map(const PixelType& a, vigra::VigraTrueType) const { typedef typename vigra::NumericTraits::isSigned src_is_signed; return scalar_map(a, src_is_signed()); } ResultType scalar_map(const PixelType& a, vigra::VigraTrueType) const { return rm(a); } // This appears necessary because NumericTraits::Promote // is an unsigned int instead of an int. ResultType scalar_map(const PixelType& a, vigra::VigraFalseType) const { return rm(std::abs(static_cast(a))); } RangeMapper rm; }; } // namespace enblend #endif /* MASKCOMMON_H */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/fixmath.h0000644000175100017510000012413112224466155020172 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __FIXMATH_H__ #define __FIXMATH_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #ifdef _WIN32 #include using namespace boost::math; #endif #include #include #include #include #include #include "vigra_ext/cachedfileimage.hxx" #include "minimizer.h" #include "muopt.h" #define MAXIMUM_LIGHTNESS 100.0 // J #define MAXIMUM_CHROMA 120.0 // C #define MAXIMUM_HUE 360.0 // h #define XYZ_SCALE 100.0 namespace enblend { static inline double radian_of_degree(double x) { return x * (M_PI / 180.0); } static inline double degree_of_radian(double x) { return x * (180.0 / M_PI); } static inline double wrap_cyclically(double x, double modulus) { assert(modulus > 0.0); while (x < 0.0) { x += modulus; } return fmod(x, modulus); } static inline double limit(double x, double lower_limit, double upper_limit) { assert(lower_limit <= upper_limit); if (x != x) { throw std::range_error("limit: not a number"); } return std::min(std::max(lower_limit, x), upper_limit); } static inline void rgb_to_jch(const double* rgb, cmsJCh* jch) { double xyz[3]; cmsDoTransform(InputToXYZTransform, rgb, xyz, 1U); const cmsCIEXYZ scaled_xyz = {XYZ_SCALE * xyz[0], XYZ_SCALE * xyz[1], XYZ_SCALE * xyz[2]}; cmsJCh jch_unlimited; cmsCIECAM02Forward(CIECAMTransform, &scaled_xyz, &jch_unlimited); jch->J = jch_unlimited.J != jch_unlimited.J ? 0.0 : limit(jch_unlimited.J, 0.0, MAXIMUM_LIGHTNESS); jch->C = jch_unlimited.C != jch_unlimited.C ? 0.0 : limit(jch_unlimited.C, 0.0, MAXIMUM_CHROMA); jch->h = wrap_cyclically(jch_unlimited.h, MAXIMUM_HUE); // J in range [0, 100], C in range [0, 120], h in range [0, 360] } static inline void jch_to_rgb(const cmsJCh* jch, double* rgb) { cmsCIEXYZ scaled_xyz; cmsCIECAM02Reverse(CIECAMTransform, jch, &scaled_xyz); // xyz values in range [0, 100] // scale xyz values to range [0, 1] const double xyz[] = { scaled_xyz.X / XYZ_SCALE, scaled_xyz.Y / XYZ_SCALE, scaled_xyz.Z / XYZ_SCALE }; cmsDoTransform(XYZToInputTransform, xyz, rgb, 1U); // rgb values in range [0, 1] } static inline void jch_to_lab(const cmsJCh* jch, cmsCIELab* lab) { double rgb[3]; jch_to_rgb(jch, rgb); cmsDoTransform(InputToLabTransform, rgb, lab, 1); } struct extra_minimizer_parameter { extra_minimizer_parameter(const cmsJCh& out_of_box_jch) : jch(out_of_box_jch) {jch_to_lab(&jch, &bad_lab);} cmsJCh jch; cmsCIELab bad_lab; }; inline double delta_e_of_lab_and_rgb(const cmsCIELab* lab, const double* rgb) { cmsCIELab lab_of_rgb; cmsDoTransform(InputToLabTransform, rgb, &lab_of_rgb, 1); return cmsCMCdeltaE(lab, &lab_of_rgb, 2.0, 1.0); } inline double out_of_box_penalty(const double* rgb) { const double infinite_badness = 10000.0; double result = 0.0; for (const double* x = rgb; x != rgb + 3U; ++x) { if (*x > 1.0) { result += *x * infinite_badness; } else if (*x < 0.0) { result += (1.0 - *x) * infinite_badness; } } return result; } inline double delta_e_cost(const cmsJCh* jch, const extra_minimizer_parameter* parameter) { double rgb[3]; jch_to_rgb(jch, rgb); return delta_e_of_lab_and_rgb(¶meter->bad_lab, rgb) + out_of_box_penalty(rgb); } double delta_e_min_cost(double luminance, void* data) { const extra_minimizer_parameter* parameter = static_cast(data); const cmsJCh jch = {luminance, parameter->jch.C, parameter->jch.h}; return delta_e_cost(&jch, parameter); } double delta_e_multimin_cost(const gsl_vector* x, void* data) { const extra_minimizer_parameter* parameter = static_cast(data); const cmsJCh jch = {gsl_vector_get(x, 0), gsl_vector_get(x, 1), parameter->jch.h}; return delta_e_cost(&jch, parameter); } /** A functor for converting scalar pixel values to the number representation used * for pyramids. These are either fixed-point integers or floating-point numbers. */ template class ConvertScalarToPyramidFunctor { public: ConvertScalarToPyramidFunctor() {} inline PyramidPixelType operator()(const SrcPixelType& v) const { return doConvert(v, SrcIsIntegral(), PyramidIsIntegral()); } protected: typedef typename vigra::NumericTraits::isIntegral SrcIsIntegral; typedef typename vigra::NumericTraits::isIntegral PyramidIsIntegral; // Convert an integral pixel type to an integral pyramid value type. inline PyramidPixelType doConvert(const SrcPixelType& v, vigra::VigraTrueType, vigra::VigraTrueType) const { return convertIntegerToFixedPoint(v); } // Convert an integral pixel type to a real pyramid value type. inline PyramidPixelType doConvert(const SrcPixelType& v, vigra::VigraTrueType, vigra::VigraFalseType) const { return vigra::NumericTraits::toRealPromote(v); } // Convert a real pixel type to an integral pyramid value type. inline PyramidPixelType doConvert(const SrcPixelType& v, vigra::VigraFalseType, vigra::VigraTrueType) const { return convertDoubleToFixedPoint(v); } // Convert a real pixel type to a real pyramid value type. inline PyramidPixelType doConvert(const SrcPixelType& v, vigra::VigraFalseType, vigra::VigraFalseType) const { // Convert real data using a log transform. These achieves // two purposes: // 1. During blending, even completely non-negative images // can result in negative pixels. A log transform // followed by the exp inverse guarantees all-positive // output. // 2. For HDR data, the log transform put the samples closer // to a perceptual space making the blending a little more // pleasing. Ideally, all blending should be done in a // strictly perceptually-linear space, such as Luv or Lab. // // See ConvertPyramidToScalarFunctor::doConvert for the // inverse transform. // // Check for non-positive values -- they should not be in the // input, but if they are we need to handle them or log will // return a NaN. // // v >= 0.0 ? 1.0 + log(v + 1.0) : 1.0 / (1.0 - v) return v >= 0.0 ? 1.0 + log1p(v) : 1.0 / (1.0 - v); } inline PyramidPixelType convertDoubleToFixedPoint(const double& v) const { // Shift v to get the appropriate number of fraction bits into the integer part, // then fromRealPromote this value into the fixed-point type. return vigra::NumericTraits::fromRealPromote(v * static_cast(1U << PyramidFractionBits)); } inline PyramidPixelType convertIntegerToFixedPoint(const SrcPixelType& v) const { // Shift v left to move the decimal point and set the fraction bits to zero. return static_cast(v) << PyramidFractionBits; } }; class MersenneTwister { public: typedef unsigned long result_type; MersenneTwister() : generator_(gsl_rng_alloc(gsl_rng_mt19937)) {assert(generator_);} MersenneTwister(const MersenneTwister& a_generator) : generator_(gsl_rng_clone(a_generator.generator_)) {assert(generator_);} ~MersenneTwister() {gsl_rng_free(generator_);} MersenneTwister& operator=(const MersenneTwister& a_generator) { if (this != &a_generator) { gsl_rng_free(generator_); generator_ = gsl_rng_clone(a_generator.generator_); assert(generator_); } return *this; } result_type min() const {return gsl_rng_min(generator_);} result_type max() const {return gsl_rng_max(generator_);} void seed() {gsl_rng_set(generator_, gsl_rng_default_seed);} void seed(result_type a_seed) {gsl_rng_set(generator_, a_seed);} result_type operator()() {return gsl_rng_get(generator_);} private: gsl_rng* generator_; }; inline static unsigned non_deterministic_seed() { unsigned seed = static_cast(1 + omp_get_thread_num()); const clock_t now = clock(); if (now != static_cast(-1)) { seed ^= static_cast(now); } return seed; } /** A functor for converting numbers stored in the pyramid number representation back * into normal pixel values. */ template class ConvertPyramidToScalarFunctor { public: ConvertPyramidToScalarFunctor() { #ifdef DEBUG random_number_generator_.seed(); // apply default seed in all threads for reproducibility #else random_number_generator_.seed(non_deterministic_seed()); #endif } inline DestPixelType operator()(const PyramidPixelType& v) const { return doConvert(v, DestIsIntegral(), PyramidIsIntegral()); } protected: typedef typename vigra::NumericTraits::isIntegral DestIsIntegral; typedef typename vigra::NumericTraits::isIntegral PyramidIsIntegral; // test time with floating-point dithering: 100.01 sec // test time with integer dithering: 94.89 sec // Convert an integral pyramid pixel to an integral image pixel. inline DestPixelType doConvert(const PyramidPixelType& v, vigra::VigraTrueType, vigra::VigraTrueType) const { // Integer Dithering PyramidPixelType half = 1U << (PyramidFractionBits - 1); PyramidPixelType quarter = 1U << (PyramidFractionBits - 2); PyramidPixelType threeQuarter = 3U << (PyramidFractionBits - 2); PyramidPixelType vFraction = v & ((1U << PyramidFractionBits) - 1); if ((vFraction >= quarter) && (vFraction < threeQuarter)) { PyramidPixelType random = (PyramidPixelType(random_number_generator_()) & (half - 1)) + quarter; if (random <= vFraction) { return DestPixelType(vigra::NumericTraits::fromPromote((v >> PyramidFractionBits) + 1)); } else { return DestPixelType(vigra::NumericTraits::fromPromote(v >> PyramidFractionBits)); } } else if (vFraction >= quarter) { return DestPixelType(vigra::NumericTraits::fromPromote((v >> PyramidFractionBits) + 1)); } else { return DestPixelType(vigra::NumericTraits::fromPromote(v >> PyramidFractionBits)); } } // Convert a real pyramid pixel to an integral image pixel. inline DestPixelType doConvert(const PyramidPixelType& v, vigra::VigraTrueType, vigra::VigraFalseType) const { const double d = dither(v); return vigra::NumericTraits::fromRealPromote(d); } // Convert an integral pyramid pixel to a real image pixel. inline DestPixelType doConvert(const PyramidPixelType& v, vigra::VigraFalseType, vigra::VigraTrueType) const { return convertFixedPointToDouble(v); } // Convert a real pyramid pixel to a real image pixel. inline DestPixelType doConvert(const PyramidPixelType& v, vigra::VigraFalseType, vigra::VigraFalseType) const { // Undo logarithmic/rational mapping that was done in building // the pyramid. See ConvertScalarToPyramidFunctor::doConvert // for the forward transformation. return v >= 1.0 ? expm1(v - 1.0) : 1.0 - 1.0 / v; } // Dithering is used to fool the eye into seeing gradients that are finer // than the precision of the pixel type. // This prevents the occurence of cleanly-bordered regions in the output where // the pixel values suddenly change from N to N+1. // Such regions are especially objectionable in the green channel of 8-bit images. inline double dither(const double& v) const { const double vFraction = v - floor(v); // Only dither values within a certain range of the rounding cutoff point. if (vFraction > 0.25 && vFraction <= 0.75) { if (vFraction - 0.25 >= 0.5 * random()) { return ceil(v); } else { return floor(v); } } return v; } inline double convertFixedPointToDouble(const PyramidPixelType& v) const { return vigra::NumericTraits::toRealPromote(v) / static_cast(1U << PyramidFractionBits); } private: double random() const { return static_cast(random_number_generator_()) / static_cast(random_number_generator_.max()); } mutable MersenneTwister random_number_generator_; }; /** Wrapper for vector pixel types. */ template class ConvertVectorToPyramidFunctor { typedef typename SrcVectorType::value_type SrcComponentType; typedef typename PyramidVectorType::value_type PyramidComponentType; typedef ConvertScalarToPyramidFunctor ConvertFunctorType; public: ConvertVectorToPyramidFunctor() : cf() {} inline PyramidVectorType operator()(const SrcVectorType& v) const { return PyramidVectorType(cf(v.red()), cf(v.green()), cf(v.blue())); } protected: ConvertFunctorType cf; }; /** Wrapper for vector pixel types. */ template class ConvertPyramidToVectorFunctor { typedef typename DestVectorType::value_type DestComponentType; typedef typename PyramidVectorType::value_type PyramidComponentType; typedef ConvertPyramidToScalarFunctor ConvertFunctorType; public: ConvertPyramidToVectorFunctor() : cf() {} inline DestVectorType operator()(const PyramidVectorType& v) const { return DestVectorType(cf(v.red()), cf(v.green()), cf(v.blue())); } protected: ConvertFunctorType cf; }; /** Fixed point converter that uses ICC profile transformation */ template class ConvertVectorToJCHPyramidFunctor { typedef typename SrcVectorType::value_type SrcComponentType; typedef typename PyramidVectorType::value_type PyramidComponentType; typedef ConvertScalarToPyramidFunctor ConvertFunctorType; public: ConvertVectorToJCHPyramidFunctor() : cf(), scale(1.0 / vigra::NumericTraits::toRealPromote(vigra::NumericTraits::max())), shift(double(1U << (PyramidIntegerBits - 1 - 7))) {} inline PyramidVectorType operator()(const SrcVectorType& v) const { // rgb values must be in range [0, 1] const double rgb[] = { scale * vigra::NumericTraits::toRealPromote(v.red()), scale * vigra::NumericTraits::toRealPromote(v.green()), scale * vigra::NumericTraits::toRealPromote(v.blue()) }; cmsJCh jch; rgb_to_jch(rgb, &jch); // convert cylindrical 'JCh' to cartesian, but reuse (yikes!) the cylindrical structure const double theta = radian_of_degree(jch.h); jch.h = jch.C * cos(theta); jch.C = jch.C * sin(theta); // scale to maximize usage of fixed-point type jch.J *= shift; jch.C *= shift; jch.h *= shift; return PyramidVectorType(cf(jch.J), cf(jch.C), cf(jch.h)); } protected: ConvertFunctorType cf; const double scale; const double shift; }; template static inline void limit_sequence(forward_iterator first, forward_iterator last, double lower_limit, double upper_limit) { while (first != last) { *first = limit(*first, lower_limit, upper_limit); ++first; } } static inline double uniform_random(unsigned* seed) { return static_cast(enblend::rand_r(seed)) / static_cast(RAND_MAX); } static inline bool bracket_minimum(const gsl_function& cost, double& x_initial, double x_lower, double x_upper, unsigned maximum_tries) { const double y_minimum_bound = std::min(cost.function(x_lower, cost.params), cost.function(x_upper, cost.params)); double y_initial = cost.function(x_initial, cost.params); if (y_initial < y_minimum_bound) { return true; } unsigned i = 0U; const double lower = std::max(0.001, 1.001 * x_lower); const double upper = 0.999 * x_upper; unsigned seed = 1000003U; // fixed seed for reproducibility while (y_initial >= y_minimum_bound && i < maximum_tries) { x_initial = uniform_random(&seed) * (upper - lower) + lower; y_initial = cost.function(x_initial, cost.params); ++i; #ifdef DEBUG_SHADOW_HIGHLIGHT_STATISTICS #ifdef OPENMP #pragma omp critical #endif std::cout << "+ highlight recovery -- bracket minimum: x = " << x_initial << ", y = " << y_initial << std::endl; #endif } return i < maximum_tries; } /** Fixed point converter that uses ICC profile transformation */ template class ConvertJCHPyramidToVectorFunctor { typedef typename DestVectorType::value_type DestComponentType; typedef typename PyramidVectorType::value_type PyramidComponentType; typedef ConvertPyramidToScalarFunctor ConvertFunctorType; public: ConvertJCHPyramidToVectorFunctor() : cf(), scale(vigra::NumericTraits::toRealPromote(vigra::NumericTraits::max())), shift(double(1U << (PyramidIntegerBits - 1 - 7))), // Parameters for highlight optimizer only highlight_lightness_guess_1d_factor(limit(enblend::parameter::as_double("highlight-recovery-lightness-guess-factor", 0.975), 0.25, 4.0)), highlight_lightness_guess_1d_offset(enblend::parameter::as_double("highlight-recovery-lightness-guess-offset", 0.0)), maximum_highlight_iterations(limit(enblend::parameter::as_unsigned("highlight-recovery-maximum-iterations", 100U), 10U, 1000U)), maximum_highlight_bracket_tries(limit(enblend::parameter::as_unsigned("highlight-recovery-bracket-maximum-tries", 1000U), 10U, 1000000U)), highlight_simplex_lightness_step_length(limit(enblend::parameter::as_double("highlight-recovery-lightness-step-length", 12.5), 1.0 / 65536.0, 100.0)), highlight_simplex_chroma_step_length(limit(enblend::parameter::as_double("highlight-recovery-chroma-step-length", 6.25), 1.0 / 65536.0, 120.0)), highlight_iterations_per_leg(limit(enblend::parameter::as_unsigned("highlight-recovery-iterations-per-leg", 50U), 5U, 500U)), maximum_highlight_leg(limit(enblend::parameter::as_unsigned("highlight-recovery-maximum-legs", 10U), 1U, 100U)), highlight_disguised_shadow_j(limit(enblend::parameter::as_double("highlight-disguised-as-shadow-lightness", 0.07), 0.0, 10.0)), // Parameters for shadow optimizer only shadow_lightness_lightness_guess_factor(enblend::parameter::as_double("shadow-recovery-lightness-lightness-guess-factor", 1.24)), shadow_lightness_chroma_guess_factor(enblend::parameter::as_double("shadow-recovery-lightness-chroma-guess-factor", -0.136)), shadow_lightness_guess_offset(enblend::parameter::as_double("shadow-recovery-lightness-guess-offset", 0.0)), shadow_chroma_lightness_guess_factor(enblend::parameter::as_double("shadow-recovery-chroma-lightness-guess-factor", -0.604)), shadow_chroma_chroma_guess_factor(enblend::parameter::as_double("shadow-recovery-chroma-chroma-guess-factor", 1.33)), shadow_chroma_guess_offset(enblend::parameter::as_double("shadow-recovery-chroma-guess-offset", 0.0)), shadow_simplex_lightness_step_length(limit(enblend::parameter::as_double("shadow-recovery-lightness-step-length", 0.625), 1.0 / 65536.0, 100.0)), shadow_simplex_chroma_step_length(limit(enblend::parameter::as_double("shadow-recovery-chroma-step-length", 1.25), 1.0 / 65536.0, 120.0)), shadow_iterations_per_leg(limit(enblend::parameter::as_unsigned("shadow-recovery-iterations-per-leg", 40U), 4U, 400U)), maximum_shadow_leg(limit(enblend::parameter::as_unsigned("shadow-recovery-maximum-legs", 5U), 1U, 50U)), // Parameters for both optimizers // Desired error limits: LoFi: 0.5/2^8, HiFi: 0.5/2^16, Super-HiFi: 0.5/2^24 optimizer_error(limit(enblend::parameter::as_double("ciecam-optimizer-error", 0.5 / 65536.0), 0.5 / 16777216.0, 1.0)), // Delta-E goals: LoFi: 1.0, HiFi: 0.5, Super-HiFi: 0.0 optimizer_goal(limit(enblend::parameter::as_double("ciecam-optimizer-deltae-goal", 0.5), 0.0, 10.0)) {} inline double highlight_lightness_guess_1d(const cmsJCh& jch) const { return std::min( // heuristic function with fitted parameter highlight_lightness_guess_1d_factor * jch.J + highlight_lightness_guess_1d_offset, 0.995 * MAXIMUM_LIGHTNESS); // backstop such that our guess is less than the maximum } inline double highlight_lightness_guess_2d(const cmsJCh& jch) const { return std::min(0.99609375 * MAXIMUM_LIGHTNESS, jch.J); } inline double highlight_chroma_guess_2d(const cmsJCh& jch) const { return std::min(0.99609375 * MAXIMUM_CHROMA, jch.C); } inline double shadow_lightness_guess_2d(const cmsJCh& jch) const { return std::max(shadow_lightness_lightness_guess_factor * jch.J + shadow_lightness_chroma_guess_factor * jch.C + shadow_lightness_guess_offset, 0.0); } inline double shadow_chroma_guess_2d(const cmsJCh& jch) const { return std::max(shadow_chroma_lightness_guess_factor * jch.J + shadow_chroma_chroma_guess_factor * jch.C + shadow_chroma_guess_offset, 0.0); } inline double optimize_1d(cmsJCh initial_jch, double initial_lightness, unsigned maximum_iterations, cmsJCh& final_jch) const { extra_minimizer_parameter extra(initial_jch); gsl_function cost = {delta_e_min_cost, &extra}; GoldenSectionMinimizer1D optimizer(cost, initial_lightness, 0.0, std::max(MAXIMUM_LIGHTNESS, initial_jch.J)); optimizer.set_absolute_error(optimizer_error)-> set_goal(optimizer_goal)-> set_maximum_number_of_iterations(maximum_iterations); optimizer.run(); final_jch.J = optimizer.x_minimum(); #ifdef DEBUG_SHADOW_HIGHLIGHT_STATISTICS double initial_rgb[3]; jch_to_rgb(&initial_jch, initial_rgb); double final_rgb[3]; jch_to_rgb(&final_jch, final_rgb); #ifdef OPENMP #pragma omp critical #endif std::cout << "+ highlight recovery: ini J = " << initial_jch.J << ", {C = " << initial_jch.C << ", h = " << initial_jch.h << "}, ini RGB = (" << initial_rgb[0] << ", " << initial_rgb[1] << ", " << initial_rgb[2] << ")\n" << "+ highlight recovery: opt J = " << optimizer.x_minimum() << " after " << optimizer.number_of_iterations() << " iterations\n" << "+ highlight recovery: delta-E = " << optimizer.f_minimum() << "\n" << "+ highlight recovery: opt RGB = (" << final_rgb[0] << ", " << final_rgb[1] << ", " << final_rgb[2] << ")\n" << std::endl; #endif return optimizer.f_minimum(); } inline double optimize_2d(cmsJCh initial_jch, double initial_lightness, double initial_chroma, double initial_lightness_step_length, double initial_chroma_step_length, unsigned maximum_leg, unsigned iterations_per_leg, cmsJCh& final_jch) const { extra_minimizer_parameter extra(initial_jch); gsl_multimin_function cost = {delta_e_multimin_cost, 2U, &extra}; const MinimizerMultiDimensionSimplex::array_type initial = boost::assign::list_of(initial_lightness)(initial_chroma); MinimizerMultiDimensionSimplex::array_type step = boost::assign::list_of(initial_lightness_step_length)(initial_chroma_step_length); MinimizerMultiDimensionSimplex2Randomized optimizer(cost, initial, step); optimizer.set_absolute_error(optimizer_error)->set_goal(optimizer_goal); for (unsigned leg = 1U; leg <= maximum_leg; ++leg) { optimizer.set_maximum_number_of_iterations(leg * iterations_per_leg); optimizer.run(); if (optimizer.has_reached_goal()) { break; } step[0] = optimizer.characteristic_size(); step[1] = optimizer.characteristic_size(); optimizer.set_step_sizes(step); } MinimizerMultiDimensionSimplex::array_type minimum_parameter(2U); optimizer.x_minimum(minimum_parameter.begin()); final_jch.J = minimum_parameter[0]; final_jch.C = minimum_parameter[1]; #ifdef DEBUG_SHADOW_HIGHLIGHT_STATISTICS double initial_rgb[3]; jch_to_rgb(&initial_jch, initial_rgb); double final_rgb[3]; jch_to_rgb(&final_jch, final_rgb); #ifdef OPENMP #pragma omp critical #endif std::cout << "+ shadow/highlight recovery: ini J = " << initial_jch.J << ", C = " << initial_jch.C << ", {h = " << initial_jch.h << "}, ini RGB = (" << initial_rgb[0] << ", " << initial_rgb[1] << ", " << initial_rgb[2] << ")\n" << "+ shadow/highlight recovery: opt J = " << final_jch.J << ", C = " << final_jch.C << " after " << optimizer.number_of_iterations() << " iterations\n" << "+ shadow/highlight recovery: delta-E = " << optimizer.f_minimum() << ", simplex size = " << optimizer.characteristic_size() << "\n" << "+ shadow/highlight recovery: opt RGB = (" << final_rgb[0] << ", " << final_rgb[1] << ", " << final_rgb[2] << ")\n" << std::endl; #endif return optimizer.f_minimum(); } inline DestVectorType operator()(const PyramidVectorType& v) const { cmsJCh jch = {cf(v.red()), cf(v.green()), cf(v.blue())}; if (jch.J <= 0.0) { #ifdef DEBUG_DARK_SHADOW_STATISTICS #ifdef OPENMP #pragma omp critical #endif std::cout << "+ unrecoverable dark shadow: J = " << jch.J << "\n" << std::endl; #endif // Lasciate ogne speranza, voi ch'intrate. return DestVectorType(0, 0, 0); } // scale back to range J: [0, 100], C: [0, 120], h: [0, 360] jch.J /= shift; jch.C /= shift; jch.h /= shift; // convert cartesian to cylindrical const double chroma = hypot(jch.C, jch.h); jch.h = wrap_cyclically(degree_of_radian(atan2(jch.C, jch.h)), MAXIMUM_HUE); jch.C = chroma; double rgb[3]; jch_to_rgb(&jch, rgb); if (rgb[0] < 0.0 || rgb[1] < 0.0 || rgb[2] < 0.0) { optimize_2d(jch, shadow_lightness_guess_2d(jch), shadow_chroma_guess_2d(jch), shadow_simplex_lightness_step_length, shadow_simplex_chroma_step_length, maximum_shadow_leg, shadow_iterations_per_leg, jch); jch_to_rgb(&jch, rgb); } else if (rgb[0] > 1.0 || rgb[1] > 1.0 || rgb[2] > 1.0) { double guessed_j = highlight_lightness_guess_1d(jch); extra_minimizer_parameter extra(jch); gsl_function cost = {delta_e_min_cost, &extra}; if (EXPECT_RESULT(jch.J <= highlight_disguised_shadow_j, false)) { // ANTICIPATED CHANGE: Linearize transformations for J // \approx 0 and compute rgb-array from linearization. #ifdef DEBUG_SHADOW_HIGHLIGHT_STATISTICS #ifdef OPENMP #pragma omp critical #endif std::cout << "+ highlight recovery: disguised shadow: J = " << jch.J << " (<= " << highlight_disguised_shadow_j << "), C = " << jch.C << ", h = " << jch.h << "\n" << std::endl; #endif rgb[0] = 0.0; rgb[1] = 0.0; rgb[2] = 0.0; } else if (EXPECT_RESULT(bracket_minimum(cost, guessed_j, 0.0, std::max(MAXIMUM_LIGHTNESS, jch.J), maximum_highlight_bracket_tries), true)) { cmsJCh initial_jch = jch; const double delta_e_1d = optimize_1d(initial_jch, guessed_j, maximum_highlight_iterations, jch); if (delta_e_1d > optimizer_goal) { #ifdef DEBUG_SHADOW_HIGHLIGHT_STATISTICS #ifdef OPENMP #pragma omp critical #endif std::cout << "+ highlight recovery: falling back from J-optimizer to (J, C)-optimizer for ini J = " << initial_jch.J << ", {C = " << initial_jch.C << ", h = " << initial_jch.h << "}\n" << "+ highlight recovery: 1d opt J = " << jch.J << " and 1d delta-E = " << delta_e_1d << "\n" << std::endl; #endif optimize_2d(initial_jch, highlight_lightness_guess_2d(jch), highlight_chroma_guess_2d(jch), highlight_simplex_lightness_step_length, highlight_simplex_chroma_step_length, maximum_highlight_leg, highlight_iterations_per_leg, jch); } jch_to_rgb(&jch, rgb); } else { optimize_2d(jch, highlight_lightness_guess_2d(jch), highlight_chroma_guess_2d(jch), highlight_simplex_lightness_step_length, highlight_simplex_chroma_step_length, maximum_highlight_leg, highlight_iterations_per_leg, jch); jch_to_rgb(&jch, rgb); } } limit_sequence(rgb, rgb + 3U, 0.0, 1.0); return DestVectorType(vigra::NumericTraits::fromRealPromote(scale * rgb[0]), vigra::NumericTraits::fromRealPromote(scale * rgb[1]), vigra::NumericTraits::fromRealPromote(scale * rgb[2])); } protected: ConvertFunctorType cf; const double scale; const double shift; const double highlight_lightness_guess_1d_factor; const double highlight_lightness_guess_1d_offset; const unsigned maximum_highlight_iterations; const unsigned maximum_highlight_bracket_tries; const double highlight_simplex_lightness_step_length; const double highlight_simplex_chroma_step_length; const unsigned highlight_iterations_per_leg; const unsigned maximum_highlight_leg; const double highlight_disguised_shadow_j; const double shadow_lightness_lightness_guess_factor; const double shadow_lightness_chroma_guess_factor; const double shadow_lightness_guess_offset; const double shadow_chroma_lightness_guess_factor; const double shadow_chroma_chroma_guess_factor; const double shadow_chroma_guess_offset; const double shadow_simplex_lightness_step_length; const double shadow_simplex_chroma_step_length; const unsigned shadow_iterations_per_leg; const unsigned maximum_shadow_leg; const double optimizer_error; const double optimizer_goal; }; /** Copy a scalar image into a scalar pyramid image. */ template void copyToPyramidImage(typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa, typename PyramidImageType::traverser dest_upperleft, typename PyramidImageType::Accessor da, vigra::VigraTrueType) { typedef typename SrcImageType::value_type SrcPixelType; typedef typename PyramidImageType::value_type PyramidPixelType; transformImageMP(src_upperleft, src_lowerright, sa, dest_upperleft, da, ConvertScalarToPyramidFunctor()); } /** Copy a vector image into a vector pyramid image. * Uses an optional color space conversion. */ template void copyToPyramidImage(typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa, typename PyramidImageType::traverser dest_upperleft, typename PyramidImageType::Accessor da, vigra::VigraFalseType) { typedef typename SrcImageType::value_type SrcVectorType; typedef typename PyramidImageType::value_type PyramidVectorType; if (UseCIECAM) { if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { cerr << command << ": info: CIECAM02 color conversion"; if (!enblend::profileName(InputProfile).empty()) { cerr << " from/to \"" << enblend::profileName(InputProfile) << "\" profile"; } cerr << "\n"; } transformImageMP(src_upperleft, src_lowerright, sa, dest_upperleft, da, ConvertVectorToJCHPyramidFunctor()); } else { transformImageMP(src_upperleft, src_lowerright, sa, dest_upperleft, da, ConvertVectorToPyramidFunctor()); } } // Compile-time switch based on scalar or vector image type. template inline void copyToPyramidImage(typename SrcImageType::const_traverser src_upperleft, typename SrcImageType::const_traverser src_lowerright, typename SrcImageType::ConstAccessor sa, typename PyramidImageType::traverser dest_upperleft, typename PyramidImageType::Accessor da) { typedef typename vigra::NumericTraits::isScalar src_is_scalar; copyToPyramidImage (src_upperleft, src_lowerright, sa, dest_upperleft, da, src_is_scalar()); } // Version using argument object factories. template inline void copyToPyramidImage(vigra::triple src, vigra::pair dest) { copyToPyramidImage (src.first, src.second, src.third, dest.first, dest.second); } /** Copy a scalar pyramid image into a scalar image. */ template inline void copyFromPyramidImageIf(typename PyramidImageType::const_traverser src_upperleft, typename PyramidImageType::const_traverser src_lowerright, typename PyramidImageType::ConstAccessor sa, typename MaskImageType::const_traverser mask_upperleft, typename MaskImageType::ConstAccessor ma, typename DestImageType::traverser dest_upperleft, typename DestImageType::Accessor da, vigra::VigraTrueType) { typedef typename DestImageType::value_type DestPixelType; typedef typename PyramidImageType::value_type PyramidPixelType; transformImageIfMP(src_upperleft, src_lowerright, sa, mask_upperleft, ma, dest_upperleft, da, ConvertPyramidToScalarFunctor()); } /** Copy a vector pyramid image into a vector image. * Uses an optional color space conversion. */ template inline void copyFromPyramidImageIf(typename PyramidImageType::const_traverser src_upperleft, typename PyramidImageType::const_traverser src_lowerright, typename PyramidImageType::ConstAccessor sa, typename MaskImageType::const_traverser mask_upperleft, typename MaskImageType::ConstAccessor ma, typename DestImageType::traverser dest_upperleft, typename DestImageType::Accessor da, vigra::VigraFalseType) { typedef typename DestImageType::value_type DestVectorType; typedef typename PyramidImageType::value_type PyramidVectorType; if (UseCIECAM) { if (Verbose >= VERBOSE_COLOR_CONVERSION_MESSAGES) { cerr << command << ": info: CIECAM02 color conversion" << endl; } transformImageIfMP(src_upperleft, src_lowerright, sa, mask_upperleft, ma, dest_upperleft, da, ConvertJCHPyramidToVectorFunctor()); } else { // OpenMP changes the result here! The maximum absolute // difference is 1 of 255 for 8-bit images. -- cls transformImageIfMP(src_upperleft, src_lowerright, sa, mask_upperleft, ma, dest_upperleft, da, ConvertPyramidToVectorFunctor()); } } // Compile-time switch based on scalar or vector image type. template inline void copyFromPyramidImageIf(typename PyramidImageType::const_traverser src_upperleft, typename PyramidImageType::const_traverser src_lowerright, typename PyramidImageType::ConstAccessor sa, typename MaskImageType::const_traverser mask_upperleft, typename MaskImageType::ConstAccessor ma, typename DestImageType::traverser dest_upperleft, typename DestImageType::Accessor da) { typedef typename vigra::NumericTraits::isScalar src_is_scalar; copyFromPyramidImageIf (src_upperleft, src_lowerright, sa, mask_upperleft, ma, dest_upperleft, da, src_is_scalar()); } // Version using argument object factories. template inline void copyFromPyramidImageIf(vigra::triple src, vigra::pair mask, vigra::pair dest) { copyFromPyramidImageIf (src.first, src.second, src.third, mask.first, mask.second, dest.first, dest.second); } } // namespace enblend #endif /* __FIXMATH_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/minimizer.h0000644000175100017510000005057412224465735020551 0ustar ametzlerametzler/* * Copyright (C) 2012, 2013 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef MINIMIZER_H_INCLUDED #define MINIMIZER_H_INCLUDED #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include class Minimizer { enum {ITERATIONS_PER_DIMENSION = 100U}; public: Minimizer(size_t dimension) : dimension_(dimension), maximum_iteration_(ITERATIONS_PER_DIMENSION * dimension), iteration_(0U), f_goal_(boost::none), absolute_error_(sqrt(std::numeric_limits::epsilon())) {} Minimizer(const Minimizer& minimizer) : dimension_(minimizer.dimension_), maximum_iteration_(minimizer.maximum_iteration_), iteration_(minimizer.iteration_), f_goal_(minimizer.f_goal_), absolute_error_(minimizer.absolute_error_) {} Minimizer& operator=(const Minimizer& minimizer) { if (this != &minimizer) { dimension_ = minimizer.dimension_; maximum_iteration_ = minimizer.maximum_iteration_; iteration_ = minimizer.iteration_; f_goal_ = minimizer.f_goal_; absolute_error_ = minimizer.absolute_error_; } return *this; } virtual ~Minimizer() {} virtual std::string proper_name() const = 0; size_t dimension() const {return dimension_;} void set_dimension(size_t dimension) {dimension_ = dimension;} Minimizer* set_maximum_number_of_iterations(unsigned n) { maximum_iteration_ = n; return this; } Minimizer* unset_maximum_number_of_iterations() { maximum_iteration_ = boost::none; return this; } unsigned number_of_iterations() const {return iteration_;} void next_iteration() {++iteration_;} Minimizer* set_goal(double goal) { f_goal_ = goal; return this; } Minimizer* unset_goal() { f_goal_ = boost::none; return this; } Minimizer* set_absolute_error(double absolute_error) { if (absolute_error > 0.0) { absolute_error_ = std::max(absolute_error, sqrt(std::numeric_limits::epsilon())); return this; } else { throw std::domain_error("Minimizer1D::set_absolute_error"); } } Minimizer* unset_absolute_error() { absolute_error_ = boost::none; return this; } virtual double f_minimum() const = 0; virtual bool has_reached_goal() const {return f_goal_ && f_minimum() <= *f_goal_;} virtual bool has_reached_maximum_iteration() const { return maximum_iteration_ && iteration_ >= *maximum_iteration_; } struct minimum_not_bracketed : public std::runtime_error { minimum_not_bracketed(const std::string& a_message) : std::runtime_error(a_message) {} }; protected: virtual double absolute_error() const { return absolute_error_ ? *absolute_error_ : sqrt(std::numeric_limits::epsilon()); } private: Minimizer(); // not implemented size_t dimension_; boost::optional maximum_iteration_; unsigned iteration_; boost::optional f_goal_; boost::optional absolute_error_; }; class Minimizer1D : public Minimizer { public: Minimizer1D(const gsl_function& function, double x_minimum, double x_lower, double x_upper) : Minimizer(1U), minimizer_(NULL), function_(function), x_minimum_(x_minimum), x_lower_(x_lower), x_upper_(x_upper), relative_error_(0.0) {require_ordered_x();} Minimizer1D(const Minimizer1D& minimizer) : Minimizer(minimizer), minimizer_(NULL), function_(minimizer.function_), x_minimum_(minimizer.x_minimum_), x_lower_(minimizer.x_lower_), x_upper_(minimizer.x_upper_), relative_error_(minimizer.relative_error_) {} Minimizer1D& operator=(const Minimizer1D& minimizer) { if (this != &minimizer) { Minimizer::operator=(minimizer); function_ = minimizer.function_; x_minimum_ = minimizer.x_minimum_; x_lower_ = minimizer.x_lower_; x_upper_ = minimizer.x_upper_; relative_error_ = minimizer.relative_error_; gsl_min_fminimizer_free(minimizer_); minimizer_ = NULL; initialize(); } return *this; } virtual ~Minimizer1D() {gsl_min_fminimizer_free(minimizer_);} virtual std::string proper_name() const {return std::string(gsl_min_fminimizer_name(minimizer_));} void set_bracket(const gsl_function& function, double x_minimum, double x_lower, double x_upper) { require_ordered_x(); function_ = function; x_minimum_ = x_minimum; x_lower_ = x_lower; x_upper_ = x_upper; const int status = gsl_min_fminimizer_set(minimizer_, &function_, x_minimum_, x_lower_, x_upper_); if (status == GSL_EINVAL) { throw minimum_not_bracketed("Minimizer1D::set_bracket: minimum not bracketed"); } else if (status != GSL_SUCCESS) { throw std::runtime_error("Minimizer1D::set_bracket"); } } Minimizer1D* set_relative_error(double relative_error) { if (relative_error >= 0.0) { relative_error_ = relative_error; return this; } else { throw std::domain_error("Minimizer1D::set_relative_error"); } } Minimizer1D* unset_relative_error() { relative_error_ = boost::none; return this; } void run() { int test_status = GSL_CONTINUE; while (test_status == GSL_CONTINUE) { next_iteration(); const int minimizer_status = gsl_min_fminimizer_iterate(minimizer_); if (minimizer_status == GSL_EBADFUNC || // singular point or minimizer_status == GSL_FAILURE) // could not improve minimum { break; } x_lower_ = gsl_min_fminimizer_x_lower(minimizer_); x_upper_ = gsl_min_fminimizer_x_upper(minimizer_); x_minimum_ = gsl_min_fminimizer_x_minimum(minimizer_); if (has_reached_goal() || has_reached_maximum_iteration()) { break; } test_status = gsl_min_test_interval(x_lower_, x_upper_, absolute_error(), relative_error()); } } virtual double x_minimum() const {return x_minimum_;} virtual double f_minimum() const {return gsl_min_fminimizer_f_minimum(minimizer_);} protected: virtual const gsl_min_fminimizer_type* type() const = 0; void require_ordered_x() const { if (!(x_lower_ <= x_minimum_ && x_minimum_ <= x_upper_)) { throw std::runtime_error("Minimizer1D::require_ordered_x: x-values not ascending"); } } void initialize() { assert(minimizer_ == NULL); minimizer_ = gsl_min_fminimizer_alloc(type()); if (minimizer_ == NULL) { throw std::runtime_error("Minimizer1D::initialize: no memory"); } set_bracket(function_, x_minimum_, x_lower_, x_upper_); } virtual double relative_error() const {return relative_error_ ? *relative_error_ : 0.0;} virtual bool has_reached_tolerance() const { return gsl_min_test_interval(x_lower_, x_upper_, absolute_error(), relative_error()) == GSL_SUCCESS; } private: Minimizer1D(); // not implemented gsl_min_fminimizer* minimizer_; gsl_function function_; double x_minimum_; double x_lower_; double x_upper_; boost::optional relative_error_; }; class GoldenSectionMinimizer1D : public Minimizer1D { public: GoldenSectionMinimizer1D(const gsl_function& function, double x_minimum, double x_lower, double x_upper) : Minimizer1D(function, x_minimum, x_lower, x_upper) {initialize();} GoldenSectionMinimizer1D(const GoldenSectionMinimizer1D& minimizer) : Minimizer1D(minimizer) {initialize();} protected: virtual const gsl_min_fminimizer_type* type() const {return gsl_min_fminimizer_goldensection;} private: GoldenSectionMinimizer1D(); // not implemented }; class BrentMinimizer1D : public Minimizer1D { public: BrentMinimizer1D(const gsl_function& function, double x_minimum, double x_lower, double x_upper) : Minimizer1D(function, x_minimum, x_lower, x_upper) {initialize();} BrentMinimizer1D(const BrentMinimizer1D& minimizer) : Minimizer1D(minimizer) {initialize();} protected: virtual const gsl_min_fminimizer_type* type() const {return gsl_min_fminimizer_brent;} private: BrentMinimizer1D(); // not implemented }; class GillMurrayMinimizer1D : public Minimizer1D { public: GillMurrayMinimizer1D(const gsl_function& function, double x_minimum, double x_lower, double x_upper) : Minimizer1D(function, x_minimum, x_lower, x_upper) {initialize();} GillMurrayMinimizer1D(const GillMurrayMinimizer1D& minimizer) : Minimizer1D(minimizer) {initialize();} protected: virtual const gsl_min_fminimizer_type* type() const {return gsl_min_fminimizer_quad_golden;} private: GillMurrayMinimizer1D(); // not implemented }; template inline void copy_to_gsl_vector(input_iterator first, input_iterator last, gsl_vector* vector) { unsigned i = 0U; while (first != last) { gsl_vector_set(vector, i, *first); ++i; ++first; } } template inline output_iterator copy_from_gsl_vector(gsl_vector* vector, output_iterator result) { for (unsigned i = 0U; i != vector->size; ++i) { *result = gsl_vector_get(vector, i); ++result; } return result; } class MinimizerMultiDimensionNoDerivative : public Minimizer { public: typedef std::vector array_type; MinimizerMultiDimensionNoDerivative(const gsl_multimin_function& function, const array_type& start, const array_type& step_sizes) : Minimizer(start.size()), minimizer_(NULL), function_(function), xs_(gsl_vector_alloc(start.size())), step_sizes_(gsl_vector_alloc(step_sizes.size())), characteristic_size_(std::numeric_limits::max()) { if (xs_ == NULL || step_sizes_ == NULL) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::constructor: no memory"); } if (start.size() != step_sizes.size()) { throw std::invalid_argument("MinimizerMultiDimensionNoDerivative::constructor: dimension mismatch"); } copy_to_gsl_vector(start.begin(), start.end(), xs_); initialize_step_sizes(step_sizes); } MinimizerMultiDimensionNoDerivative(const gsl_multimin_function& function, const array_type& start) : Minimizer(start.size()), minimizer_(NULL), function_(function), xs_(gsl_vector_alloc(start.size())), step_sizes_(gsl_vector_alloc(start.size())), characteristic_size_(std::numeric_limits::max()) { if (xs_ == NULL || step_sizes_ == NULL) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::constructor: no memory"); } copy_to_gsl_vector(start.begin(), start.end(), xs_); gsl_vector_set_all(step_sizes_, 1.0); } MinimizerMultiDimensionNoDerivative(const MinimizerMultiDimensionNoDerivative& minimizer) : Minimizer(minimizer), minimizer_(NULL), function_(minimizer.function_), xs_(gsl_vector_alloc(dimension())), step_sizes_(gsl_vector_alloc(dimension())), characteristic_size_(minimizer.characteristic_size_) { if (xs_ == NULL || step_sizes_ == NULL) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::constructor: no memory"); } gsl_vector_memcpy(xs_, minimizer.xs_); gsl_vector_memcpy(step_sizes_, minimizer.step_sizes_); } MinimizerMultiDimensionNoDerivative& operator=(const MinimizerMultiDimensionNoDerivative& minimizer) { if (this != &minimizer) { Minimizer::operator=(minimizer); // or equivalently: this->Minimizer::operator=(minimizer) function_ = minimizer.function_; characteristic_size_ = minimizer.characteristic_size_; if (dimension() != minimizer.dimension()) { set_dimension(minimizer.dimension()); gsl_vector_free(xs_); gsl_vector_free(step_sizes_); xs_ = gsl_vector_alloc(dimension()); step_sizes_ = gsl_vector_alloc(dimension()); if (xs_ == NULL || step_sizes_ == NULL) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::operator=: no memory"); } } gsl_vector_memcpy(xs_, minimizer.xs_); gsl_vector_memcpy(step_sizes_, minimizer.step_sizes_); gsl_multimin_fminimizer_free(minimizer_); minimizer_ = NULL; initialize(); } return *this; } virtual ~MinimizerMultiDimensionNoDerivative() { gsl_vector_free(step_sizes_); gsl_vector_free(xs_); gsl_multimin_fminimizer_free(minimizer_); } void set_start(const array_type& start) { if (start.size() == dimension()) { copy_to_gsl_vector(start.begin(), start.end(), xs_); } else { throw std::invalid_argument("MinimizerMultiDimensionNoDerivative::set_start: dimension mismatch"); } set(); } void set_step_sizes(const array_type& step_sizes) { initialize_step_sizes(step_sizes); set(); } template output_iterator get_step_sizes(output_iterator result) const { return copy_from_gsl_vector(step_sizes_, result); } virtual std::string proper_name() const {return std::string(gsl_multimin_fminimizer_name(minimizer_));} void run() { int test_status = GSL_CONTINUE; while (test_status == GSL_CONTINUE) { next_iteration(); const int minimizer_status = gsl_multimin_fminimizer_iterate(minimizer_); if (minimizer_status == GSL_ENOPROG || // could not improve minimum has_reached_goal() || has_reached_maximum_iteration()) { break; } characteristic_size_ = gsl_multimin_fminimizer_size(minimizer_); test_status = gsl_multimin_test_size(characteristic_size_, absolute_error()); } characteristic_size_ = gsl_multimin_fminimizer_size(minimizer_); gsl_vector_memcpy(xs_, gsl_multimin_fminimizer_x(minimizer_)); } template output_iterator x_minimum(output_iterator result) const { return copy_from_gsl_vector(gsl_multimin_fminimizer_x(minimizer_), result); } virtual double f_minimum() const {return gsl_multimin_fminimizer_minimum(minimizer_);} double characteristic_size() const {return characteristic_size_;} protected: virtual const gsl_multimin_fminimizer_type* type() const = 0; void initialize_step_sizes(const array_type& step_sizes) { if (step_sizes.size() == dimension()) { array_type::const_iterator x = step_sizes.begin(); unsigned i = 0U; while (x != step_sizes.end()) { if (*x > 0.0) { gsl_vector_set(step_sizes_, i, *x); } else { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::initialize_step_sizes: " "non-positive step size"); } ++x; ++i; } } else { throw std::invalid_argument("MinimizerMultiDimensionNoDerivative::initialize_step_sizes: " "dimension mismatch"); } } void set() { assert(minimizer_ != NULL); const int status = gsl_multimin_fminimizer_set(minimizer_, &function_, xs_, step_sizes_); if (status != GSL_SUCCESS) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::set"); } } void initialize() { assert(minimizer_ == NULL); minimizer_ = gsl_multimin_fminimizer_alloc(type(), dimension()); if (minimizer_ == NULL) { throw std::runtime_error("MinimizerMultiDimensionNoDerivative::initialize: no memory"); } set(); } private: MinimizerMultiDimensionNoDerivative(); // not implemented gsl_multimin_fminimizer* minimizer_; gsl_multimin_function function_; gsl_vector* xs_; gsl_vector* step_sizes_; double characteristic_size_; }; class MinimizerMultiDimensionSimplex : public MinimizerMultiDimensionNoDerivative { public: MinimizerMultiDimensionSimplex(const gsl_multimin_function& function, const array_type& start, const array_type& step_sizes) : MinimizerMultiDimensionNoDerivative(function, start, step_sizes) {initialize();} MinimizerMultiDimensionSimplex(const gsl_multimin_function& function, const array_type& start) : MinimizerMultiDimensionNoDerivative(function, start) {initialize();} MinimizerMultiDimensionSimplex(const MinimizerMultiDimensionSimplex& minimizer) : MinimizerMultiDimensionNoDerivative(minimizer) {initialize();} protected: virtual const gsl_multimin_fminimizer_type* type() const {return gsl_multimin_fminimizer_nmsimplex;} private: MinimizerMultiDimensionSimplex(); // not implemented }; class MinimizerMultiDimensionSimplex2 : public MinimizerMultiDimensionNoDerivative { public: MinimizerMultiDimensionSimplex2(const gsl_multimin_function& function, const array_type& start, const array_type& step_sizes) : MinimizerMultiDimensionNoDerivative(function, start, step_sizes) {initialize();} MinimizerMultiDimensionSimplex2(const gsl_multimin_function& function, const array_type& start) : MinimizerMultiDimensionNoDerivative(function, start) {initialize();} MinimizerMultiDimensionSimplex2(const MinimizerMultiDimensionSimplex2& minimizer) : MinimizerMultiDimensionNoDerivative(minimizer) {initialize();} protected: virtual const gsl_multimin_fminimizer_type* type() const {return gsl_multimin_fminimizer_nmsimplex2;} private: MinimizerMultiDimensionSimplex2(); // not implemented }; class MinimizerMultiDimensionSimplex2Randomized : public MinimizerMultiDimensionNoDerivative { public: MinimizerMultiDimensionSimplex2Randomized(const gsl_multimin_function& function, const array_type& start, const array_type& step_sizes) : MinimizerMultiDimensionNoDerivative(function, start, step_sizes) {initialize();} MinimizerMultiDimensionSimplex2Randomized(const gsl_multimin_function& function, const array_type& start) : MinimizerMultiDimensionNoDerivative(function, start) {initialize();} MinimizerMultiDimensionSimplex2Randomized(const MinimizerMultiDimensionSimplex2Randomized& minimizer) : MinimizerMultiDimensionNoDerivative(minimizer) {initialize();} protected: virtual const gsl_multimin_fminimizer_type* type() const {return gsl_multimin_fminimizer_nmsimplex2rand;} private: MinimizerMultiDimensionSimplex2Randomized(); // not implemented }; #endif // MINIMIZER_H_INCLUDED // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/mask.h0000644000175100017510000015570112224464371017472 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MASK_H__ #define __MASK_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "vigra_ext/fillpolygon.hxx" #include "vigra_ext/impexalpha.hxx" #include "vigra_ext/rect2d.hxx" #include "vigra_ext/stdcachedfileimage.hxx" #include "common.h" #include "anneal.h" #include "muopt.h" #include "nearest.h" #include "path.h" #include "postoptimizer.h" #include "graphcut.h" #include "maskcommon.h" #include "masktypedefs.h" using boost::lambda::_1; using boost::lambda::_2; using boost::lambda::if_then_else_return; using boost::lambda::call_begin; using boost::lambda::call_end; using boost::lambda::constant; using boost::lambda::protect; using boost::lambda::ret; using vigra::functor::Arg1; using vigra::functor::Arg2; using vigra::functor::Arg3; using vigra::functor::ifThenElse; using vigra::functor::Param; using vigra::functor::UnaryFunctor; std::string stringOfPixelDifferenceFunctor(difference_functor_t aFunctor) { switch (aFunctor) { case HueLuminanceMaxDifference: return "maximum-hue-luminance"; case DeltaEDifference: return "delta-e"; default: throw never_reached("switch control expression \"aFunctor\" out of range"); } return "unknown"; } namespace enblend { void dump_segment(const Segment& segment, const std::string& prefix = std::string(), std::ostream& out = std::cout) { const unsigned points_per_line = 5U; unsigned n = 1U; const size_t size = segment.size(); out << prefix << "{segment with " << size << " point(s): // suffix 'f' means frozen point\n" << prefix; for (Segment::const_iterator i = segment.begin(); i != segment.end(); ++i, ++n) { // Append an 'f' to non-movable ("frozen") segment points. out << ' ' << i->second << (i->first ? ' ' : 'f'); if (n % points_per_line == 0U && n != size) { out << '\n' << prefix; } } out << "\n" << prefix << "}\n"; } void dump_contour(const Contour& contour, const std::string& prefix = std::string(), std::ostream& out = std::cout) { out << prefix << "{contour with " << contour.size() << " segment(s):\n"; for (Contour::const_iterator i = contour.begin(); i != contour.end(); ++i) { dump_segment(**i, prefix + " ", out); } out << prefix << "}\n"; } void dump_contourvector(const ContourVector& contourvector, const std::string& prefix = std::string(), std::ostream& out = std::cout) { out << prefix << "{contourvector with " << contourvector.size() << " contour(s):\n"; for (ContourVector::const_iterator i = contourvector.begin(); i != contourvector.end(); ++i) { dump_contour(**i, prefix + " ", out); } out << prefix << "}\n"; } template void visualizePoint(ImageType& image, const vigra::Point2D& location, typename ImageType::PixelType value) { typedef typename ImageType::Iterator Iterator; Iterator point(image.upperLeft() + location); if (point.x >= image.upperLeft().x && point.x < image.lowerRight().x && point.y >= image.upperLeft().y && point.y < image.lowerRight().y) { image.accessor().set(value, point); } } template inline T round_to(double x) { return static_cast(x >= 0.0 ? x + 0.5 : x - 0.5); } template void visualizePoint(ImageType& image, const vigra::Point2D& location, typename ImageType::PixelType value, marker_t marker, int radius) { if (radius <= 0) { return; } const int r_sqrt2 = round_to(static_cast(radius) / 1.414213562373095); switch (marker) { case NO_MARKER: return; case DOT_MARKER: visualizePoint(image, location, value); break; case PLUS_MARKER: for (int i = -radius; i <= radius; ++i) { visualizePoint(image, location + vigra::Point2D(i, 0), value); visualizePoint(image, location + vigra::Point2D(0, i), value); } break; case CROSS_MARKER: for (int i = -r_sqrt2; i <= r_sqrt2; ++i) { visualizePoint(image, location + vigra::Point2D(i, i), value); visualizePoint(image, location + vigra::Point2D(-i, i), value); } break; case HOLLOW_SQUARE_MARKER: for (int i = -r_sqrt2; i <= r_sqrt2; ++i) { visualizePoint(image, location + vigra::Point2D(-r_sqrt2, i), value); visualizePoint(image, location + vigra::Point2D(r_sqrt2, i), value); visualizePoint(image, location + vigra::Point2D(i, -r_sqrt2), value); visualizePoint(image, location + vigra::Point2D(i, r_sqrt2), value); } break; case HOLLOW_DIAMOND_MARKER: for (int i = 0; i <= radius; ++i) { visualizePoint(image, location + vigra::Point2D(i - radius, i), value); visualizePoint(image, location + vigra::Point2D(i, i - radius), value); visualizePoint(image, location + vigra::Point2D(-i + radius, i), value); visualizePoint(image, location + vigra::Point2D(-i, i - radius), value); } break; default: visualizePoint(image, location, value); } } // Draw a line from begin to end in image. Use value as pixel color. // // The algorithm is not implemented efficiently. However, the // function is only called to visualize the initial seam line, which // we do not consider a performance-critical job. template void visualizeLine(ImageType& image, const vigra::Point2D& begin, const vigra::Point2D& end, typename ImageType::PixelType value) { typedef typename ImageType::Iterator Iterator; const vigra::Diff2D difference(end - begin); const int stepX = sign(difference.x); const int stepY = sign(difference.y); Iterator point(image.upperLeft() + begin); const Iterator stop(image.upperLeft() + end); double error = 0.0; //std::cout << "+ [" << begin << " .. " << end << "]\n"; const vigra::Size2D size(image.size()); // Exit immediately if both start point and end point are outside of the image. if (!(begin.x >= 0 && begin.x < size.x && begin.y >= 0 && begin.y < size.y && end.x >= 0 && end.x < size.x && end.y >= 0 && end.y < size.y)) { return; } if (abs(difference.x) >= abs(difference.y)) { const double delta_error = difference.x == 0 ? 0.0 : fabs(static_cast(difference.y) / static_cast(difference.x)); while (true) { if (point.x >= image.upperLeft().x && point.x < image.lowerRight().x && point.y >= image.upperLeft().y && point.y < image.lowerRight().y) { image.accessor().set(value, point); } if (point.x == stop.x) { break; } error += delta_error; if (fabs(error) >= 0.5) { point.y += stepY; error -= 1.0; } point.x += stepX; } } else { const double delta_error = difference.y == 0 ? 0.0 : fabs(static_cast(difference.x) / static_cast(difference.y)); while (true) { if (point.x >= image.upperLeft().x && point.x < image.lowerRight().x && point.y >= image.upperLeft().y && point.y < image.lowerRight().y) { image.accessor().set(value, point); } if (point.y == stop.y) { break; } error += delta_error; if (fabs(error) >= 0.5) { point.x += stepX; error -= 1.0; } point.y += stepY; } } } template class FindAverageAndVarianceIf { public: typedef value argument_type; typedef value first_argument_type; typedef double second_argument_type; typedef typename vigra::NumericTraits::RealPromote result_type; typedef typename vigra::NumericTraits::RealPromote value_type; FindAverageAndVarianceIf(predicate aPredicate) : sum_(0.0), sum_of_squares_(0.0), count_(0.0), pred_(aPredicate) {} void reset() { count_ = 0.0; sum_of_squares_ = 0.0; count_ = 0.0; } void operator()(const argument_type& v) { if (pred_(v)) { count_ += 1.0; sum_ += static_cast(v); sum_of_squares_ += square(static_cast(v)); } } unsigned count() const {return static_cast(count_);} result_type average() const { assert(count_ != 0.0); return static_cast(sum_ / count_); } result_type variance() const { assert(count_ != 0.0); return static_cast((sum_of_squares_ - square(sum_) / count_) / count_); } private: double sum_; double sum_of_squares_; double count_; predicate pred_; }; template class XorAccessor { public: typedef ValueType value_type; typedef AccessorType accessor_type; XorAccessor(AccessorType a) : acc(a) {} template ValueType operator()(const Iterator& i) const {return acc(i);} ValueType operator()(const ValueType* i) const {return acc(i);} template ValueType operator()(const Iterator& i, Difference d) const {return acc(i, d);} template void set(const Value& v, const Iterator& i) const {acc.set(v ^ acc(i), i);} template void set(const Value& v, Iterator& i) const {acc.set(v ^ acc(i), i);} template void set(const Value& v, const Iterator& i, const Difference& d) const {acc.set(v ^ acc(i, d), i, d);} private: AccessorType acc; }; template void closedPolygonsOfContourSegments(const vigra::Size2D& mask_size, const Contour& contour, BackInsertionIterator result) { #ifdef DEBUG_POLYGON_FILL const vigra::Diff2D border(10, 10); vigra::BRGBImage polygon_image(mask_size + border + border); visualizeLine(polygon_image, vigra::Point2D(0, 0) + border, vigra::Point2D(mask_size.x, 0) + border, VISUALIZE_RGB_COLOR_GREEN3); visualizeLine(polygon_image, vigra::Point2D(mask_size.x, 0) + border, vigra::Point2D(mask_size.x, mask_size.y) + border, VISUALIZE_RGB_COLOR_GREEN3); visualizeLine(polygon_image, vigra::Point2D(mask_size.x, mask_size.y) + border, vigra::Point2D(0, mask_size.y) + border, VISUALIZE_RGB_COLOR_GREEN3); visualizeLine(polygon_image, vigra::Point2D(0, mask_size.y) + border, vigra::Point2D(0, 0) + border, VISUALIZE_RGB_COLOR_GREEN3); std::cout << "+ closedPolygonsOfContourSegments: #segments = " << contour.size() << "\n"; #endif vigra::Point2D last_point; for (Contour::const_iterator segment = contour.begin(); segment != contour.end(); ++segment) { const Segment::iterator vertex_begin((*segment)->begin()); const Segment::iterator vertex_end((*segment)->end()); for (Segment::iterator vertex = vertex_begin; vertex != vertex_end; ++vertex) { last_point = vigra::Point2D(vertex->second.x, vertex->second.y); *result++ = last_point; } #ifdef DEBUG_POLYGON_FILL std::cout << "+ closedPolygonsOfContourSegments: #vertices = " << (*segment)->size() << "\n"; Segment::iterator previous_vertex; for (Segment::iterator vertex = vertex_begin; vertex != vertex_end; ++vertex) { const vigra::Point2D p(vertex->second.x, vertex->second.y); if (vertex != vertex_begin) { const vigra::Point2D q(previous_vertex->second.x, previous_vertex->second.y); visualizeLine(polygon_image, q + border, p + border, VISUALIZE_RGB_COLOR_MAGENTA2); } previous_vertex = vertex; visualizePoint(polygon_image, p + border, VISUALIZE_RGB_COLOR_RED1); } #endif } const Segment::iterator firstVertex((*(contour.begin()))->begin()); const vigra::Point2D first_point(firstVertex->second.x, firstVertex->second.y); if (first_point != last_point) { *result++ = first_point; } *result++ = END_OF_SEGMENT_MARKER; #ifdef DEBUG_POLYGON_FILL vigra::exportImage(srcImageRange(polygon_image), vigra::ImageExportInfo(",polygon.tif")); #endif } template void fillContourScanLine(MaskType* mask, const Contour& contour, const vigra::Diff2D& offset) { typedef typename MaskType::PixelType MaskPixelType; typedef typename MaskType::Accessor MaskAccessor; const vigra::Size2D mask_size(mask->lowerRight() - mask->upperLeft()); std::vector polygon; closedPolygonsOfContourSegments(mask_size, contour, std::back_inserter(polygon)); vigra_ext::fill_polygon(mask->upperLeft() + offset, mask->lowerRight() + offset, XorAccessor(mask->accessor()), polygon.begin(), polygon.end(), ~MaskPixelType()); } template void fillContourScanLineActive(MaskType* mask, const Contour& contour, const vigra::Diff2D& offset) { typedef typename MaskType::PixelType MaskPixelType; typedef typename MaskType::Accessor MaskAccessor; const vigra::Size2D mask_size(mask->lowerRight() - mask->upperLeft()); std::vector polygon; closedPolygonsOfContourSegments(mask_size, contour, std::back_inserter(polygon)); vigra_ext::fill_polygon_active(mask->upperLeft() + offset, mask->lowerRight() + offset, XorAccessor(mask->accessor()), polygon.begin(), polygon.end(), ~MaskPixelType()); } template void fillContour(MaskType* mask, const Contour& contour, const vigra::Diff2D& offset) { const std::string routine_name(enblend::parameter::as_string("polygon-filler", "new-active")); #ifdef DEBUG_POLYGON_FILL std::cout << "+ fillContour: mask offset = " << offset << "\n"; #endif if (routine_name == "new") { #ifdef DEBUG_POLYGON_FILL std::cout << "+ fillContour: use fillContourScanLine polygon filler\n"; #endif fillContourScanLine(mask, contour, offset); } else { #ifdef DEBUG_POLYGON_FILL std::cout << "+ fillContour: use fillContourScanLineActive polygon filler\n"; #endif fillContourScanLineActive(mask, contour, offset); } } template void maskBounds(MaskType* mask, const vigra::Rect2D& uBB, vigra::Rect2D& mBB) { typedef typename MaskType::PixelType MaskPixelType; typedef typename MaskType::traverser MaskIteratorType; typedef typename MaskType::Accessor MaskAccessor; // Find the bounding box of the mask transition line and put it in mBB. // mBB starts out as empty rectangle. mBB = vigra::Rect2D(vigra::Point2D(mask->size()), vigra::Point2D(0, 0)); MaskIteratorType myPrev = mask->upperLeft(); MaskIteratorType my = mask->upperLeft() + vigra::Diff2D(0, 1); MaskIteratorType mend = mask->lowerRight(); MaskIteratorType mxLeft = myPrev; MaskIteratorType mx = myPrev + vigra::Diff2D(1, 0); for (int x = 1; mx.x < mend.x; ++x, ++mx.x, ++mxLeft.x) { if (*mxLeft != *mx) { mBB |= vigra::Rect2D(x - 1, 0, x + 1, 1); } } for (int y = 1; my.y < mend.y; ++y, ++my.y, ++myPrev.y) { mxLeft = my; mx = my + vigra::Diff2D(1, 0); MaskIteratorType mxUpLeft = myPrev; MaskIteratorType mxUp = myPrev + vigra::Diff2D(1, 0); if (*mxUpLeft != *mxLeft) { // Transition line is between mxUpLeft and mxLeft. mBB |= vigra::Rect2D(0, y - 1, 1, y + 1); } for (int x = 1; mx.x < mend.x; ++x, ++mx.x, ++mxLeft.x, ++mxUp.x) { if (*mxLeft != *mx) { mBB |= vigra::Rect2D(x - 1, y, x + 1, y + 1); } if (*mxUp != *mx) { mBB |= vigra::Rect2D(x, y - 1, x + 1, y + 1); } } } // Check that mBB is well-defined. if (mBB.isEmpty()) { // No transition pixels were found in the mask at all. This // means that one image has no contribution. if (*(mask->upperLeft()) == vigra::NumericTraits::zero()) { // If the mask is entirely black, then inspectOverlap // should have caught this. It should have said that the // white image is redundant. cerr << command << ": mask is entirely black, but white image was not identified as redundant" << endl; exit(1); } else { // If the mask is entirely white, then the black image // would have been identified as redundant if black and // white were swapped. Set mBB to the full size of the // mask. mBB = uBB; // Explain why the black image disappears completely. cerr << command << ": warning: previous images are completely overlapped by the current images" << endl; } } else { // mBB is defined relative to inputUnion origin //cerr << command << ": info: mBB relative to mask: " << mBB << endl; mBB.moveBy(uBB.upperLeft()); } if (Verbose >= VERBOSE_ROIBB_SIZE_MESSAGES) { cerr << command << ": info: mask transition line bounding box: " << mBB << endl; } } /** Vectorize the seam line defined in nftOutputImage into the contour * rawSegments. */ template void vectorizeSeamLine(Contour& rawSegments, const AlphaType* const whiteAlpha, const AlphaType* const blackAlpha, const vigra::Rect2D& uBB, int nftStride, MaskType* nftOutputImage, int vectorizeDistance = 0) { typedef typename MaskType::PixelType MaskPixelType; typedef typename MaskType::traverser MaskIteratorType; const double diagonalLength = hypot(static_cast(nftOutputImage->width()), static_cast(nftOutputImage->height())); if(vectorizeDistance == 0) vectorizeDistance = MaskVectorizeDistance.is_percentage() ? static_cast(ceil(MaskVectorizeDistance.value() / 100.0 * diagonalLength)) : MaskVectorizeDistance.value(); if (vectorizeDistance < minimumVectorizeDistance) { cerr << command << ": warning: mask vectorization distance " << vectorizeDistance << " (" << 100.0 * vectorizeDistance / diagonalLength << "% of diagonal) is smaller\n" << command << ": warning: than minimum of " << minimumVectorizeDistance << "; will use " << minimumVectorizeDistance << " (" << 100.0 * minimumVectorizeDistance / diagonalLength << "% of diagonal)" << endl; vectorizeDistance = minimumVectorizeDistance; } const vigra::Rect2D border(1, 1, nftOutputImage->width() - 1, nftOutputImage->height() - 1); MaskIteratorType my = nftOutputImage->upperLeft() + vigra::Diff2D(1, 1); MaskIteratorType mend = nftOutputImage->lowerRight() + vigra::Diff2D(-1, -1); for (int y = 1; my.y < mend.y; ++y, ++my.y) { MaskIteratorType mx = my; MaskPixelType lastColor = vigra::NumericTraits::zero(); for (int x = 1; mx.x < mend.x; ++x, ++mx.x) { if (*mx == vigra::NumericTraits::max() && lastColor == vigra::NumericTraits::zero()) { // Found the corner of a previously unvisited white region. // Create a Segment to hold the border of this region. std::vector excessPoints; Segment* snake = new Segment(); rawSegments.push_back(snake); // Walk around border of white region. vigra::CrackContourCirculator crack(mx); vigra::CrackContourCirculator crackEnd(crack); bool lastPointFrozen = false; int distanceLastPoint = 0; do { vigra::Point2D currentPoint = *crack + vigra::Diff2D(x, y); crack++; vigra::Point2D nextPoint = *crack + vigra::Diff2D(x, y); // See if currentPoint lies on border. if (currentPoint.x == border.left() || currentPoint.x == border.right() || currentPoint.y == border.top() || currentPoint.y == border.bottom()) { // See if currentPoint is in a corner. if ((currentPoint.x == border.left() && currentPoint.y == border.top()) || (currentPoint.x == border.left() && currentPoint.y == border.bottom()) || (currentPoint.x == border.right() && currentPoint.y == border.top()) || (currentPoint.x == border.right() && currentPoint.y == border.bottom())) { snake->push_front(std::make_pair(false, currentPoint)); distanceLastPoint = 0; } else if (!lastPointFrozen || (nextPoint.x != border.left() && nextPoint.x != border.right() && nextPoint.y != border.top() && nextPoint.y != border.bottom())) { snake->push_front(std::make_pair(false, currentPoint)); distanceLastPoint = 0; } else { excessPoints.push_back(currentPoint); } lastPointFrozen = true; } else { // Current point is not frozen. if (distanceLastPoint % vectorizeDistance == 0) { snake->push_front(std::make_pair(true, currentPoint)); distanceLastPoint = 0; } else { excessPoints.push_back(currentPoint); } lastPointFrozen = false; } distanceLastPoint++; } while (crack != crackEnd); // Paint the border so this region will not be found again for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end(); ++vertexIterator) { (*nftOutputImage)[vertexIterator->second] = vigra::NumericTraits::one(); // While we're at it, convert vertices to uBB-relative coordinates. vertexIterator->second = nftStride * (vertexIterator->second + vigra::Diff2D(-1, -1)); // While we're at it, mark vertices outside the union region as not moveable. if (vertexIterator->first && (*whiteAlpha)[vertexIterator->second + uBB.upperLeft()] == vigra::NumericTraits::zero() && (*blackAlpha)[vertexIterator->second + uBB.upperLeft()] == vigra::NumericTraits::zero()) { vertexIterator->first = false; } } for (std::vector::iterator vertexIterator = excessPoints.begin(); vertexIterator != excessPoints.end(); ++vertexIterator) { // These are points on the border of the white // region that are not in the snake. Recolor them // so that this white region will not be found // again. (*nftOutputImage)[*vertexIterator] = vigra::NumericTraits::one(); } } lastColor = *mx; } } } /** Convert rawContours snakes into segments with unbroken runs of * moveable vertices. */ void reorderSnakesToMovableRuns(ContourVector& contours, const Contour& rawSegments) { for (Contour::const_iterator segments = rawSegments.begin(); segments != rawSegments.end(); ++segments) { Segment* snake = *segments; // Snake becomes multiple separate segments in one contour Contour* currentContour = new Contour(); contours.push_back(currentContour); // Check if snake is a closed contour bool closedContour = true; for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end(); ++vertexIterator) { if (!vertexIterator->first) { closedContour = false; break; } } // Closed contours consist of only moveable vertices. if (closedContour) { currentContour->push_back(snake); continue; } if (snake->front().first) { // First vertex is moveable. Rotate list so that first // vertex is nonmoveable. Segment::iterator firstNonmoveableVertex = snake->begin(); while (firstNonmoveableVertex->first) { ++firstNonmoveableVertex; } // Copy initial run on moveable vertices and first // non-moveable vertex to end of list. Segment::iterator firstNonmoveableSuccessor = firstNonmoveableVertex; ++firstNonmoveableSuccessor; if (EXPECT_RESULT(firstNonmoveableSuccessor == snake->end(), false)) { snake->insert(enblend::next(firstNonmoveableVertex), snake->begin(), firstNonmoveableVertex); } else { snake->insert(snake->end(), // append at the end snake->begin(), firstNonmoveableSuccessor); } // Erase initial run of moveable vertices. snake->erase(snake->begin(), firstNonmoveableVertex); } // Find last moveable vertex. Segment::iterator lastMoveableVertex = snake->begin(); for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end(); ++vertexIterator) { if (vertexIterator->first) { lastMoveableVertex = vertexIterator; } } Segment* currentSegment = NULL; bool insideMoveableSegment = false; bool passedLastMoveableVertex = false; Segment::iterator lastNonmoveableVertex = snake->begin(); for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end(); ++vertexIterator) { // Create a new segment if necessary. if (currentSegment == NULL) { currentSegment = new Segment(); currentContour->push_back(currentSegment); } // Keep track of when we visit the last moveable vertex. // Don't create new segments after this point. // Add all remaining nonmoveable vertices to current segment. if (vertexIterator == lastMoveableVertex) { passedLastMoveableVertex = true; } // Keep track of last nonmoveable vertex. if (!vertexIterator->first) { lastNonmoveableVertex = vertexIterator; } // All segments must begin with a nonmoveable vertex. // If only one nonmoveable vertex separates two runs of moveable vertices, // that vertex is copied into the beginning of the current segment. // It was previously added at the end of the last segment. if (vertexIterator->first && currentSegment->empty()) { currentSegment->push_front(*lastNonmoveableVertex); } // Add the current vertex to the current segment. currentSegment->push_front(*vertexIterator); if (!insideMoveableSegment && vertexIterator->first) { // Beginning a new moveable segment. insideMoveableSegment = true; } else if (insideMoveableSegment && !vertexIterator->first && !passedLastMoveableVertex) { // End of currentSegment. insideMoveableSegment = false; // Correct for the push_fronts we've been doing currentSegment->reverse(); // Cause a new segment to be generated on next vertex. currentSegment = NULL; } } // Reverse the final segment. if (currentSegment != NULL) { currentSegment->reverse(); } delete snake; } } /** Find extent of moveable snake vertices, and vertices bordering * moveable vertices vertex bounding box. */ vigra::Rect2D vertexBoundingBox(ContourVector& contours) { vigra::Rect2D box; bool initializedVBB = false; for (ContourVector::iterator currentContour = contours.begin(); currentContour != contours.end(); ++currentContour) { for (Contour::iterator currentSegment = (*currentContour)->begin(); currentSegment != (*currentContour)->end(); ++currentSegment) { Segment::iterator lastVertex = (*currentSegment)->begin(); bool foundFirstMoveableVertex = false; for (Segment::iterator vertexIterator = (*currentSegment)->begin(); vertexIterator != (*currentSegment)->end(); ++vertexIterator) { if (vertexIterator->first) { if (!initializedVBB) { box = vigra::Rect2D(vertexIterator->second, vigra::Size2D(1, 1)); initializedVBB = true; } else { box |= vertexIterator->second; } if (!foundFirstMoveableVertex) { box |= lastVertex->second; } foundFirstMoveableVertex = true; } else if (foundFirstMoveableVertex) { // First nonmoveable vertex at end of run. box |= vertexIterator->second; break; } lastVertex = vertexIterator; } } } return box; } /** Calculate a blending mask between whiteImage and blackImage. */ template MaskType* createMask(const ImageType* const white, const ImageType* const black, const AlphaType* const whiteAlpha, const AlphaType* const blackAlpha, const vigra::Rect2D& uBB, const vigra::Rect2D& iBB, bool wraparound, unsigned numberOfImages, FileNameList::const_iterator inputFileNameIterator, unsigned m) { typedef typename ImageType::PixelType ImagePixelType; typedef typename MaskType::PixelType MaskPixelType; typedef typename MaskType::traverser MaskIteratorType; typedef typename MaskType::Accessor MaskAccessor; if (LoadMasks) { // Read mask from a file instead of calculating it. MaskType* mask = new MaskType(uBB.size()); const std::string maskFilename = enblend::expandFilenameTemplate(LoadMaskTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (can_open_file(maskFilename)) { vigra::ImageImportInfo maskInfo(maskFilename.c_str()); if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: loading mask \"" << maskFilename << "\"" << std::endl; } if (!maskInfo.isGrayscale()) { std::cerr << command << ": error: mask image \"" << maskFilename << "\" is not grayscale" << std::endl; exit(1); } if (maskInfo.numExtraBands() != 0) { std::cerr << command << ": error: mask image \"" << maskFilename << "\" must not have an alpha channel" << std::endl; exit(1); } if (std::string(maskInfo.getPixelType()) != vigra::TypeAsString::result()) { std::cerr << command << ": error: mask image \"" << maskFilename << "\" has pixel type " << maskInfo.getPixelType() << ";\n" << command << ": error: expecting pixel type " << vigra::TypeAsString::result() << std::endl; exit(1); } if (maskInfo.width() != uBB.width() || maskInfo.height() != uBB.height()) { const bool too_small = maskInfo.width() < uBB.width() || maskInfo.height() < uBB.height(); std::string category; if (too_small) { category = "warning: "; } std::cerr << command << ": " << category << "mask in \"" << maskFilename << "\" has size " << "(" << maskInfo.width() << "x" << maskInfo.height() << "),\n" << command << ": " << category << " but image union has size " << uBB.size() << ";\n" << command << ": " << category << " make sure this is the right mask for the given images" << std::endl; if (!too_small) { // Mask is too large, loading it would cause a segmentation fault. exit(1); } } importImage(maskInfo, destImage(*mask)); } else { // Cannot read mask file. We already issued an error // message through can_open_file(). exit(1); } return mask; } // Start by using the nearest feature transform to generate a mask. vigra::Size2D mainInputSize, mainInputBBSize; vigra::Rect2D mainInputBB; int mainStride; if (CoarseMask) { // Do MainAlgorithm at 1/CoarsenessFactor scale. // uBB rounded up to multiple of CoarsenessFactor pixels in each direction mainInputSize = vigra::Size2D((uBB.width() + CoarsenessFactor - 1) / CoarsenessFactor, (uBB.height() + CoarsenessFactor - 1) / CoarsenessFactor); mainInputBBSize = vigra::Size2D((iBB.width() + CoarsenessFactor - 1) / CoarsenessFactor, (iBB.height() + CoarsenessFactor - 1) / CoarsenessFactor); mainInputBB = vigra::Rect2D(vigra::Point2D(std::floor(double(iBB.upperLeft().x - uBB.upperLeft().x) / CoarsenessFactor), std::floor(double(iBB.upperLeft().y - uBB.upperLeft().y) / CoarsenessFactor)), mainInputBBSize); mainStride = CoarsenessFactor; } else { // Do MainAlgorithm at 1/1 scale. mainInputSize = uBB.size(); mainInputBB = vigra::Rect2D(iBB); if(mainInputBB.upperLeft().x >= uBB.upperLeft().x) mainInputBB.moveBy(-uBB.upperLeft()); else mainInputBB.moveBy(uBB.upperLeft()); mainStride = 1; } vigra::Size2D mainOutputSize; vigra::Diff2D mainOutputOffset; // GraphCut supports seam visualization without optimizers if (!CoarseMask && !OptimizeMask && !VisualizeSeam) { // We are not going to vectorize the mask. mainOutputSize = mainInputSize; mainOutputOffset = vigra::Diff2D(0, 0); } else { // Add 1-pixel border all around the image for the vectorization algorithm. mainOutputSize = mainInputSize + vigra::Diff2D(2, 2); mainOutputOffset = vigra::Diff2D(1, 1); } // mem usage before: 0 // mem usage after: CoarseMask: 1/8 * uBB * MaskType // !CoarseMask: uBB * MaskType MaskType* mainOutputImage = new MaskType(mainOutputSize);; if (MainAlgorithm == GraphCut) graphCut(vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(iBB, srcImageRange(*white))), vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(iBB, srcImage(*black))), vigra::destIter(mainOutputImage->upperLeft() + mainOutputOffset), vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(uBB, srcImageRange(*whiteAlpha))), vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(uBB, srcImage(*blackAlpha))), ManhattanDistance, wraparound ? HorizontalStrip : OpenBoundaries, mainInputBB); else if (MainAlgorithm == NFT) nearestFeatureTransform(vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(uBB, srcImageRange(*whiteAlpha))), vigra_ext::stride(mainStride, mainStride, vigra_ext::apply(uBB, srcImage(*blackAlpha))), vigra::destIter(mainOutputImage->upperLeft() + mainOutputOffset), ManhattanDistance, wraparound ? HorizontalStrip : OpenBoundaries); #ifdef DEBUG_NEAREST_FEATURE_TRANSFORM { typedef std::pair ImagePair; const ImagePair nft[] = { std::make_pair("blackmask", blackAlpha), std::make_pair("whitemask", whiteAlpha), //std::make_pair("nft-input", nftInputImage), std::make_pair("nft-output", mainOutputImage) }; for (size_t i = 0; i < sizeof(nft) / sizeof(ImagePair); ++i) { const std::string nftMaskTemplate(command + "-" + nft[i].first + "-%n.tif"); const std::string nftMaskFilename = enblend::expandFilenameTemplate(nftMaskTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (Verbose >= VERBOSE_NFT_MESSAGES) { cerr << command << ": info: saving nearest-feature-transform image \"" << nftMaskFilename << "\"" << endl; } vigra::ImageExportInfo nftMaskInfo(nftMaskFilename.c_str()); nftMaskInfo.setCompression(MASK_COMPRESSION); vigra::exportImage(srcImageRange(*nft[i].second), nftMaskInfo); } } #endif // mem usage before: CoarseMask: 2/8 * uBB * MaskType // !CoarseMask: 2 * uBB * MaskType // mem usage after: CoarseMask: 1/8 * uBB * MaskType // !CoarseMask: uBB * MaskType if (!VisualizeSeam && !CoarseMask && !OptimizeMask) { // nftOutputImage is the final mask in this case. return mainOutputImage; } // Vectorize the seam lines found in nftOutputImage. Contour rawSegments; if (MainAlgorithm == GraphCut) vectorizeSeamLine(rawSegments, whiteAlpha, blackAlpha, uBB, mainStride, mainOutputImage, 4); else vectorizeSeamLine(rawSegments, whiteAlpha, blackAlpha, uBB, mainStride, mainOutputImage); delete mainOutputImage; #ifdef DEBUG_SEAM_LINE std::cout << "+ createMask: rawSegments\n"; dump_contour(rawSegments, "+ createMask: "); #endif // mem usage after: 0 if (!OptimizeMask && !VisualizeSeam) { // Simply fill contours to get final unoptimized mask. MaskType* mask = new MaskType(uBB.size()); fillContour(mask, rawSegments, vigra::Diff2D(0, 0)); // delete all segments in rawSegments std::for_each(rawSegments.begin(), rawSegments.end(), bind(delete_ptr(), _1)); return mask; } ContourVector contours; reorderSnakesToMovableRuns(contours, rawSegments); rawSegments.clear(); #ifdef DEBUG_SEAM_LINE std::cout << "+ createMask: contours\n"; dump_contourvector(contours, "+ createMask: "); #endif { const size_t totalSegments = std::accumulate(contours.begin(), contours.end(), 0U, ret(_1 + boost::lambda::bind(&Contour::size, _2))); if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << command << ": info: optimizing "; if (totalSegments == 1U) { cerr << "1 distinct seam"; } else { cerr << totalSegments << " distinct seams"; } cerr << endl; } if (totalSegments == 0U) { cerr << command << ": warning: failed to detect any seam" << endl; } } vigra::Rect2D vBB = vertexBoundingBox(contours); vBB.moveBy(uBB.upperLeft()); // move vBB to be root-relative // Make sure that vBB is bigger than iBB by one pixel in each // direction. This will create a max-cost border to keep the seam // line from leaving the intersection region. vigra::Rect2D iBBPlus = iBB; iBBPlus.addBorder(1); vBB |= iBBPlus; // Vertex-Union bounding box: portion of uBB inside vBB const vigra::Rect2D uvBB = vBB & uBB; // Offset between vBB and uvBB const vigra::Diff2D uvBBOffset = uvBB.upperLeft() - vBB.upperLeft(); vigra::Size2D mismatchImageSize; int mismatchImageStride; vigra::Diff2D uvBBStrideOffset; if (CoarseMask) { // Prepare to stride by two over uvBB to create cost image. // Push ul corner of vBB so that there is an even number of // pixels between vBB and uvBB. if (uvBBOffset.x % 2) { vBB.setUpperLeft(vBB.upperLeft() + vigra::Diff2D(-1, 0)); } if (uvBBOffset.y % 2) { vBB.setUpperLeft(vBB.upperLeft() + vigra::Diff2D(0, -1)); } uvBBStrideOffset = (uvBB.upperLeft() - vBB.upperLeft()) / 2; mismatchImageStride = 2; mismatchImageSize = (vBB.size() + vigra::Diff2D(1, 1)) / 2; } else { uvBBStrideOffset = uvBBOffset; mismatchImageStride = 1; mismatchImageSize = vBB.size(); } typedef vigra::UInt8 MismatchImagePixelType; typedef vigra::BasicImage MismatchImageType; typedef vigra::BasicImage > VisualizeImageType; MismatchImageType mismatchImage(mismatchImageSize, vigra::NumericTraits::max()); // Visualization of optimization output VisualizeImageType* visualizeImage = NULL; if (VisualizeSeam) { visualizeImage = new VisualizeImageType(mismatchImageSize); } // mem usage after: Visualize && CoarseMask: iBB * UInt8 // Visualize && !CoarseMask: 2 * iBB * UInt8 // !Visualize && CoarseMask: 1/2 * iBB * UInt8 // !Visualize && !CoarseMask: iBB * UInt8 // Calculate mismatch image switch (PixelDifferenceFunctor) { case HueLuminanceMaxDifference: combineTwoImagesMP(vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImageRange(*white))), vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImage(*black))), vigra::destIter(mismatchImage.upperLeft() + uvBBStrideOffset), MaxHueLuminanceDifferenceFunctor (LuminanceDifferenceWeight, ChrominanceDifferenceWeight)); break; case DeltaEDifference: combineTwoImagesMP(vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImageRange(*white))), vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImage(*black))), vigra::destIter(mismatchImage.upperLeft() + uvBBStrideOffset), DeltaEPixelDifferenceFunctor (LuminanceDifferenceWeight, ChrominanceDifferenceWeight)); break; default: throw never_reached("switch control expression \"PixelDifferenceFunctor\" out of range"); } if (Verbose >= VERBOSE_DIFFERENCE_STATISTICS) { typedef std::binder2nd > predicate; predicate non_maximum(std::bind2nd(std::not_equal_to(), vigra::NumericTraits::max())); enblend::FindAverageAndVarianceIf statistics(non_maximum); const double range = static_cast(vigra::NumericTraits::max() - vigra::NumericTraits::min()); vigra::inspectImage(srcImageRange(mismatchImage), statistics); cerr << command << ": info: difference statistics: overlap size = " << std::count_if(mismatchImage.begin(), mismatchImage.end(), non_maximum) << " pixels\n" << command << ": info: difference statistics: mismatch average = " << statistics.average() / range << " [" << stringOfPixelDifferenceFunctor(PixelDifferenceFunctor) << "]\n" << command << ": info: difference statistics: standard deviation = " << sqrt(statistics.variance()) / range << " [" << stringOfPixelDifferenceFunctor(PixelDifferenceFunctor) << "]" << endl; } if (DifferenceBlurRadius > 0.0) { gaussianSmoothing(srcImageRange(mismatchImage), destImage(mismatchImage), DifferenceBlurRadius); } if (visualizeImage) { // Dump cost image into visualize image. copyImage(srcImageRange(mismatchImage), destImage(*visualizeImage)); // Color the parts of the visualize image where the two images // to be blended do not overlap. combineThreeImagesMP(vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImageRange(*whiteAlpha))), vigra_ext::stride(mismatchImageStride, mismatchImageStride, vigra_ext::apply(uvBB, srcImage(*blackAlpha))), vigra::srcIter(visualizeImage->upperLeft() + uvBBStrideOffset), vigra::destIter(visualizeImage->upperLeft() + uvBBStrideOffset), ifThenElse(Arg1() & Arg2(), Arg3(), Param(VISUALIZE_NO_OVERLAP_VALUE))); const vigra::Diff2D offset = vigra::Diff2D(vBB.upperLeft()) - vigra::Diff2D(uBB.upperLeft()); // Draw the initial seam line as a reference. for (ContourVector::const_iterator v = contours.begin(); v != contours.end(); ++v) { for (Contour::const_iterator c = (*v)->begin(); c != (*v)->end(); ++c) { for (Segment::const_iterator s = (*c)->begin(); s != (*c)->end(); ++s) { Segment::const_iterator next = s; ++next; if (next != (*c)->end()) { visualizeLine(*visualizeImage, (s->second - offset) / mismatchImageStride, (next->second - offset) / mismatchImageStride, VISUALIZE_INITIAL_PATH); } if (OptimizeMask) visualizePoint(*visualizeImage, (s->second - offset) / mismatchImageStride, s->first ? VISUALIZE_MOVABLE_POINT : VISUALIZE_FROZEN_POINT, s->first ? MARK_MOVABLE_POINT : MARK_FROZEN_POINT, 2); } } } } #ifndef SKIP_OPTIMIZER if (OptimizeMask) { int segmentNumber; // Move snake points to mismatchImage-relative coordinates for (ContourVector::iterator currentContour = contours.begin(); currentContour != contours.end(); ++currentContour) { segmentNumber = 0; for (Contour::iterator currentSegment = (*currentContour)->begin(); currentSegment != (*currentContour)->end(); ++currentSegment, ++segmentNumber) { Segment* snake = *currentSegment; for (Segment::iterator vertexIterator = snake->begin(); vertexIterator != snake->end(); ++vertexIterator) { vertexIterator->second = (vertexIterator->second + uBB.upperLeft() - vBB.upperLeft()) / mismatchImageStride; } } } std::vector *params = new(std::vector); OptimizerChain *defaultOptimizerChain = new OptimizerChain (&mismatchImage, visualizeImage, &mismatchImageSize, &mismatchImageStride, &uvBBStrideOffset, &contours, &uBB, &vBB, params, whiteAlpha, blackAlpha, &uvBB); // Add Strategy 1: Use GDA to optimize placement of snake vertices defaultOptimizerChain->addOptimizer("anneal"); // Add Strategy 2: Use Dijkstra shortest path algorithm between snake vertices defaultOptimizerChain->addOptimizer("dijkstra"); // Fire optimizer chain (runs every optimizer on the list in sequence) defaultOptimizerChain->runOptimizerChain(); // Move snake vertices from mismatchImage-relative // coordinates to uBB-relative coordinates. for (ContourVector::iterator currentContour = contours.begin(); currentContour != contours.end(); ++currentContour) { segmentNumber = 0; for (Contour::iterator currentSegment = (*currentContour)->begin(); currentSegment != (*currentContour)->end(); ++currentSegment, ++segmentNumber) { Segment* snake = *currentSegment; for (Segment::iterator currentVertex = snake->begin(); currentVertex != snake->end(); ++currentVertex) { currentVertex->second = currentVertex->second * mismatchImageStride + vBB.upperLeft() - uBB.upperLeft(); } } } delete params; delete defaultOptimizerChain; } #endif // !SKIP_OPTIMIZER if (visualizeImage) { const std::string visualizeFilename = enblend::expandFilenameTemplate(VisualizeTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (visualizeFilename == *inputFileNameIterator) { cerr << command << ": will not overwrite input image \"" << *inputFileNameIterator << "\" with seam-visualization image" << endl; exit(1); } else if (visualizeFilename == OutputFileName) { cerr << command << ": will not overwrite output image \"" << OutputFileName << "\" with seam-visualization image" << endl; exit(1); } else { if (Verbose >= VERBOSE_MASK_MESSAGES) { cerr << command << ": info: saving seam visualization \"" << visualizeFilename << "\"" << endl; } vigra::ImageExportInfo visualizeInfo(visualizeFilename.c_str()); visualizeInfo.setCompression(MASK_COMPRESSION); vigra::exportImage(srcImageRange(*visualizeImage), visualizeInfo); } delete visualizeImage; } #ifdef DEBUG_SEAM_LINE std::cout << "+ createMask: contours of final optimized mask\n"; dump_contourvector(contours, "+ createMask: "); #endif // Fill contours to get final optimized mask. MaskType* mask = new MaskType(uBB.size()); std::for_each(contours.begin(), contours.end(), boost::lambda::bind(fillContour, mask, *_1, vigra::Diff2D(0, 0))); // Clean up contours std::for_each(contours.begin(), contours.end(), bind(boost::lambda::ll::for_each(), bind(call_begin(), (*_1)), bind(call_end(), (*_1)), protect(bind(delete_ptr(), _1)))); std::for_each(contours.begin(), contours.end(), bind(delete_ptr(), _1)); return mask; } } // namespace enblend #endif /* __MASK_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/enfuse.h0000644000175100017510000017570212107440552020022 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ENFUSE_H__ #define __ENFUSE_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "common.h" #include "filespec.h" #include "openmp.h" #include "numerictraits.h" #include "fixmath.h" #include "assemble.h" #include "blend.h" #include "bounds.h" #include "pyramid.h" #include "mga.h" using boost::lambda::_1; using boost::lambda::_2; using boost::lambda::bind; using boost::lambda::const_parameters; using vigra::functor::Arg1; using vigra::functor::Arg2; using vigra::functor::Param; namespace enblend { static inline double gaussDistribution(double x, double mu, double sigma) { return exp(-0.5 * square((x - mu) / sigma)); } // Keep sum and sum-of-squares together for improved CPU-cache locality. template struct ScratchPad { ScratchPad() : sum(T()), sumSqr(T()), n(size_t()) {} T sum; T sumSqr; size_t n; }; template void localStdDevIf(SrcIterator src_ul, SrcIterator src_lr, SrcAccessor src_acc, MaskIterator mask_ul, MaskAccessor mask_acc, DestIterator dest_ul, DestAccessor dest_acc, vigra::Size2D size) { typedef typename vigra::NumericTraits::RealPromote SrcSumType; typedef vigra::NumericTraits DestTraits; typedef typename SrcIterator::PixelType SrcPixelType; typedef typename SrcIterator::row_iterator SrcRowIterator; typedef typename MaskIterator::row_iterator MaskRowIterator; typedef typename DestIterator::PixelType DestPixelType; typedef ScratchPad ScratchPadType; typedef std::vector ScratchPadArray; typedef typename ScratchPadArray::iterator ScratchPadArrayIterator; vigra_precondition(size.x > 1 && size.y > 1, "localStdDevIf(): window for local variance must be at least 2x2"); vigra_precondition(src_lr.x - src_ul.x >= size.x && src_lr.y - src_ul.y >= size.y, "localStdDevIf(): window larger than image"); const typename SrcIterator::difference_type imageSize = src_lr - src_ul; ScratchPadArray scratchPad(imageSize.x + 1); const vigra::Diff2D border(size.x / 2, size.y / 2); const vigra::Diff2D nextUpperRight(size.x / 2 + 1, -size.y / 2); SrcIterator const srcEnd(src_lr - border); SrcIterator const srcEndXm1(srcEnd - vigra::Diff2D(1, 0)); // For each row in the source image... #ifdef OPENMP #pragma omp parallel for firstprivate (scratchPad) #endif for (int row = 0; row < imageSize.y - 2 * border.y; ++row) { SrcIterator srcRow(src_ul + border + vigra::Diff2D(0, row)); MaskIterator maskRow(mask_ul + border + vigra::Diff2D(0, row)); DestIterator destRow(dest_ul + border + vigra::Diff2D(0, row)); // Row's running values SrcSumType sum = vigra::NumericTraits::zero(); SrcSumType sumSqr = vigra::NumericTraits::zero(); size_t n = 0; SrcIterator const windowSrcUpperLeft(srcRow - border); SrcIterator const windowSrcLowerRight(srcRow + border); SrcIterator windowSrc; MaskIterator const windowMaskUpperLeft(maskRow - border); MaskIterator windowMask; ScratchPadArrayIterator spCol; // Initialize running-sums of this row for (windowSrc = windowSrcUpperLeft, windowMask = windowMaskUpperLeft, spCol = scratchPad.begin(); windowSrc.x <= windowSrcLowerRight.x; ++windowSrc.x, ++windowMask.x, ++spCol) { SrcSumType sumInit = vigra::NumericTraits::zero(); SrcSumType sumSqrInit = vigra::NumericTraits::zero(); size_t nInit = 0; for (windowSrc.y = windowSrcUpperLeft.y, windowMask.y = windowMaskUpperLeft.y; windowSrc.y <= windowSrcLowerRight.y; ++windowSrc.y, ++windowMask.y) { if (mask_acc(windowMask)) { const SrcSumType value = src_acc(windowSrc); sumInit += value; sumSqrInit += square(value); ++nInit; } } // Set scratch pad's column-wise values spCol->sum = sumInit; spCol->sumSqr = sumSqrInit; spCol->n = nInit; // Update totals sum += sumInit; sumSqr += sumSqrInit; n += nInit; } // Write one row of results SrcIterator srcCol(srcRow); MaskIterator maskCol(maskRow); DestIterator destCol(destRow); ScratchPadArrayIterator old(scratchPad.begin()); ScratchPadArrayIterator next(scratchPad.begin() + size.x); while (true) { // Compute standard deviation if (mask_acc(maskCol)) { const SrcSumType result = n <= 1 ? vigra::NumericTraits::zero() : sqrt((sumSqr - square(sum) / n) / (n - 1)); dest_acc.set(DestTraits::fromRealPromote(result), destCol); } if (srcCol.x == srcEndXm1.x) { break; } // Compute auxilliary values of next column SrcSumType sumInit = vigra::NumericTraits::zero(); SrcSumType sumSqrInit = vigra::NumericTraits::zero(); size_t nInit = 0; for (windowSrc = srcCol + nextUpperRight, windowMask = maskCol + nextUpperRight; windowSrc.y <= windowSrcLowerRight.y; ++windowSrc.y, ++windowMask.y) { if (mask_acc(windowMask)) { const SrcSumType value = src_acc(windowSrc); sumInit += value; sumSqrInit += square(value); ++nInit; } } // Set sums of next column next->sum = sumInit; next->sumSqr = sumSqrInit; next->n = nInit; // Update totals sum += sumInit - old->sum; sumSqr += sumSqrInit - old->sumSqr; n += nInit - old->n; // Advance to next column ++srcCol.x; ++maskCol.x; ++destCol.x; ++old; ++next; } } } template class Histogram { enum {GRAY = 0, CHANNELS = 3}; public: typedef vigra::NumericTraits InputPixelTraits; typedef typename InputPixelTraits::ValueType KeyType; // scalar values are our keys typedef typename InputPixelTraits::isScalar pixelIsScalar; typedef unsigned DataType; // pixel counts are our data typedef vigra::NumericTraits ResultPixelTraits; typedef typename ResultPixelTraits::ValueType ResultType; typedef map MapType; typedef std::pair PairType; typedef typename MapType::const_iterator MapConstIterator; typedef typename MapType::iterator MapIterator; typedef typename MapType::size_type MapSizeType; Histogram() {clear();} void clear() { for (int channel = 0; channel < CHANNELS; ++channel) { totalCount[channel] = DataType(); histogram[channel].clear(); } } static void setPrecomputedEntropySize(size_t size) { // PERFORMANCE: setPrecomputedEntropySize is a pure // performance enhancer otherwise the function is completely // redundant. It derives its existence from the facts that // computing the entropy "p * log(p)" given the probability // "p" is an expensive operation _and_ most of the time the // moving window is filled completely, i.e., no pixel is // masked. precomputedSize = size; delete [] precomputedLog; delete [] precomputedEntropy; if (size == 0) { precomputedLog = NULL; precomputedEntropy = NULL; } else { precomputedLog = new double[size + 1]; vigra_precondition(precomputedLog != NULL, "Histogram::setPrecomputedSize: failed to allocate log-preevaluate memory"); precomputedEntropy = new double[size + 1]; vigra_precondition(precomputedEntropy != NULL, "Histogram::setPrecomputedSize: failed to allocate entropy-preevaluate memory"); precomputedLog[0] = 0.0; // just to have a reliable value precomputedEntropy[0] = 0.0; for (size_t i = 1; i <= size; ++i) { const double p = static_cast(i) / static_cast(size); precomputedLog[i] = log(static_cast(i)); precomputedEntropy[i] = p * log(p); } } } Histogram& operator=(const Histogram& other) { if (this != &other) { for (int channel = 0; channel < CHANNELS; ++channel) { totalCount[channel] = other.totalCount[channel]; histogram[channel] = other.histogram[channel]; } } return *this; } void insert(const InputPixelType& x) {insertFun(x, pixelIsScalar());} void insert(const Histogram* other) {insertFun(other, pixelIsScalar());} void erase(const InputPixelType& x) {eraseFun(x, pixelIsScalar());} void erase(const Histogram* other) {eraseFun(other, pixelIsScalar());} ResultPixelType entropy() const {return entropyFun(pixelIsScalar());} protected: void insertInChannel(int channel, const PairType& keyval) { // PERFORMANCE: The actual insertion code below code is a much // faster version of // MapIterator const i = histogram[channel].find(keyval.first); // if (i == histogram[channel].end()) // histogram[channel].insert(keyval); // else i->second += keyval.second; MapIterator const lowerBound = histogram[channel].lower_bound(keyval.first); const DataType count = keyval.second; if (lowerBound != histogram[channel].end() && !(histogram[channel].key_comp()(keyval.first, lowerBound->first))) { lowerBound->second += count; } else { histogram[channel].insert(lowerBound, keyval); } totalCount[channel] += count; } void eraseInChannel(int channel, const PairType& keyval) { MapIterator const i = histogram[channel].find(keyval.first); assert(i != histogram[channel].end()); DataType& c = i->second; const DataType count = keyval.second; if (c > count) { c -= count; } else { // PERFORMANCE: It is _much_ faster to erase unneeded bins // right away than it is e.g. to periodically (think of // every column) cleaning up the whole map while wasting // time in lots of comparisons until then. histogram[channel].erase(i); } totalCount[channel] -= count; } double entropyOfChannel(int channel) const { const DataType total = totalCount[channel]; const MapSizeType actualBins = histogram[channel].size(); if (total == 0 || actualBins <= 1) { return 0.0; } else { double e = 0.0; MapConstIterator const end = histogram[channel].end(); if (total == precomputedSize) { for (MapConstIterator i = histogram[channel].begin(); i != end; ++i) { e += precomputedEntropy[i->second]; } return -e / precomputedLog[actualBins]; } else { for (MapConstIterator i = histogram[channel].begin(); i != end; ++i) { const double p = i->second / static_cast(total); e += p * log(p); } return -e / log(static_cast(actualBins)); } } } // Grayscale void insertFun(const InputPixelType& x, vigra::VigraTrueType) { insertInChannel(GRAY, PairType(x, 1U)); } void insertFun(const Histogram* other, vigra::VigraTrueType) { MapConstIterator const end = other->histogram[GRAY].end(); for (MapConstIterator i = other->histogram[GRAY].begin(); i != end; ++i) { insertInChannel(GRAY, *i); } } void eraseFun(const InputPixelType& x, vigra::VigraTrueType) { eraseInChannel(GRAY, PairType(x, 1U)); } void eraseFun(const Histogram* other, vigra::VigraTrueType) { MapConstIterator const end = other->histogram[GRAY].end(); for (MapConstIterator i = other->histogram[GRAY].begin(); i != end; ++i) { eraseInChannel(GRAY, *i); } } ResultPixelType entropyFun(vigra::VigraTrueType) const { const double max = static_cast(vigra::NumericTraits::max()); return ResultPixelType(ResultPixelTraits::fromRealPromote(entropyOfChannel(GRAY) * max)); } // RGB void insertFun(const InputPixelType& x, vigra::VigraFalseType) { for (int channel = 0; channel < CHANNELS; ++channel) { insertInChannel(channel, PairType(x[channel], 1U)); } } void insertFun(const Histogram* other, vigra::VigraFalseType) { for (int channel = 0; channel < CHANNELS; ++channel) { MapConstIterator const end = other->histogram[channel].end(); for (MapConstIterator i = other->histogram[channel].begin(); i != end; ++i) { insertInChannel(channel, *i); } } } void eraseFun(const InputPixelType& x, vigra::VigraFalseType) { for (int channel = 0; channel < CHANNELS; ++channel) { eraseInChannel(channel, PairType(x[channel], 1U)); } } void eraseFun(const Histogram* other, vigra::VigraFalseType) { for (int channel = 0; channel < CHANNELS; ++channel) { MapConstIterator const end = other->histogram[channel].end(); for (MapConstIterator i = other->histogram[channel].begin(); i != end; ++i) { eraseInChannel(channel, *i); } } } ResultPixelType entropyFun(vigra::VigraFalseType) const { const double max = static_cast(vigra::NumericTraits::max()); return ResultPixelType(vigra::NumericTraits::fromRealPromote(entropyOfChannel(0) * max), vigra::NumericTraits::fromRealPromote(entropyOfChannel(1) * max), vigra::NumericTraits::fromRealPromote(entropyOfChannel(2) * max)); } private: static size_t precomputedSize; static double* precomputedLog; static double* precomputedEntropy; MapType histogram[CHANNELS]; DataType totalCount[CHANNELS]; }; template void localEntropyIf(SrcIterator src_ul, SrcIterator src_lr, SrcAccessor src_acc, MaskIterator mask_ul, MaskAccessor mask_acc, DestIterator dest_ul, DestAccessor dest_acc, vigra::Size2D size) { typedef vigra::NumericTraits DestTraits; typedef typename SrcIterator::PixelType SrcPixelType; typedef typename SrcIterator::row_iterator SrcRowIterator; typedef typename MaskIterator::row_iterator MaskRowIterator; typedef typename DestIterator::PixelType DestPixelType; typedef Histogram ScratchPadType; vigra_precondition(src_lr.x - src_ul.x >= size.x && src_lr.y - src_ul.y >= size.y, "localEntropyIf(): window larger than image"); const typename SrcIterator::difference_type imageSize = src_lr - src_ul; ScratchPadType* const scratchPad = new ScratchPadType[imageSize.y + 1]; ScratchPadType::setPrecomputedEntropySize(size.x * size.y); const vigra::Diff2D border(size.x / 2, size.y / 2); const vigra::Diff2D deltaX(size.x / 2, 0); const vigra::Diff2D deltaXp1(size.x / 2 + 1, 0); const vigra::Diff2D deltaY(0, size.y / 2); // Fill scratch pad for the first time. { SrcIterator srcRow(src_ul + deltaX); SrcIterator const srcEnd(src_lr - deltaX); MaskIterator maskRow(mask_ul + deltaX); ScratchPadType* spRow(scratchPad); for (; srcRow.y < srcEnd.y; ++srcRow.y, ++maskRow.y, ++spRow) { SrcIterator srcCol(srcRow - deltaX); SrcIterator srcColEnd(srcRow + deltaX); MaskIterator maskCol(maskRow - deltaX); for (; srcCol.x <= srcColEnd.x; ++srcCol.x, ++maskCol.x) { if (mask_acc(maskCol)) { spRow->insert(src_acc(srcCol)); } } } } // Iterate through the image { SrcIterator srcCol(src_ul + border); SrcIterator const srcEnd(src_lr - border); MaskIterator maskCol(mask_ul + border); DestIterator destCol(dest_ul + border); ScratchPadType hist; // For each column in the source image... for (; srcCol.x < srcEnd.x; ++srcCol.x, ++maskCol.x, ++destCol.x) { SrcIterator srcRow(srcCol); MaskIterator maskRow(maskCol); DestIterator destRow(destCol); ScratchPadType* spRow(scratchPad + border.y); // Initialize running histogram of this column hist.clear(); for (ScratchPadType* s = spRow - border.y; s <= spRow + border.y; ++s) { hist.insert(s); } // Write one column of results for (; srcRow.y < srcEnd.y; ++srcRow.y, ++maskRow.y, ++destRow.y, ++spRow) { // Compute entropy if (mask_acc(maskRow)) { dest_acc.set(hist.entropy(), destRow); } // Update running histogram to next row hist.erase(spRow - border.y); // remove oldest row hist.insert(spRow + border.y + 1); // add next row } // Update scratch pad to next column for (srcRow = srcCol - deltaY, maskRow = maskCol - deltaY, spRow = scratchPad; srcRow.y < src_lr.y; ++srcRow.y, ++maskRow.y, ++spRow) { if (mask_acc(maskRow - deltaX)) { // remove oldest column spRow->erase(src_acc(srcRow - deltaX)); } if (mask_acc(maskRow + deltaXp1)) { // add next column spRow->insert(src_acc(srcRow + deltaXp1)); } } } } ScratchPadType::setPrecomputedEntropySize(0); delete [] scratchPad; } template inline void localEntropyIf(vigra::triple src, vigra::pair mask, vigra::pair dest, vigra::Size2D size) { localEntropyIf(src.first, src.second, src.third, mask.first, mask.second, dest.first, dest.second, size); } template inline void localStdDevIf(vigra::triple src, vigra::pair mask, vigra::pair dest, vigra::Size2D size) { localStdDevIf(src.first, src.second, src.third, mask.first, mask.second, dest.first, dest.second, size); } template class ImageMaskMultiplyFunctor { public: ImageMaskMultiplyFunctor(MaskPixelType d) : divisor(vigra::NumericTraits::toRealPromote(d)) {} template ImagePixelType operator()(const ImagePixelType& iP, const MaskPixelType& maskP) const { typedef typename vigra::NumericTraits::RealPromote RealImagePixelType; // Convert mask pixel to blend coefficient in range [0.0, 1.0]. const double maskCoeff = vigra::NumericTraits::toRealPromote(maskP) / divisor; const RealImagePixelType riP = vigra::NumericTraits::toRealPromote(iP); const RealImagePixelType blendP = riP * maskCoeff; return vigra::NumericTraits::fromRealPromote(blendP); } protected: const double divisor; }; template class ExposureFunctor { public: typedef ResultType result_type; ExposureFunctor(double w, double m, double s, InputAccessor a) : weight(w), mu(m), sigma(s), acc(a) {} inline ResultType operator()(const InputType& a) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(a, srcIsScalar()); } protected: // grayscale template inline ResultType f(const T& a, vigra::VigraTrueType) const { typedef typename vigra::NumericTraits::RealPromote RealType; const RealType ra = vigra::NumericTraits::toRealPromote(a); const double b = vigra::NumericTraits::max() * mu; const double c = vigra::NumericTraits::max() * sigma; return vigra::NumericTraits::fromRealPromote(weight * gaussDistribution(ra, b, c)); } // RGB template inline ResultType f(const T& a, vigra::VigraFalseType) const { return f(acc.operator()(a), vigra::VigraTrueType()); } const double weight; const double mu; const double sigma; InputAccessor acc; }; template class CutoffExposureFunctor { public: typedef ResultType result_type; CutoffExposureFunctor(double w, double m, double s, InputAccessor a, const AlternativePercentage& lc, const AlternativePercentage& uc, InputAccessor lca, InputAccessor uca) : weight(w), mu(m), sigma(s), acc(a), lower_cutoff(lc.instantiate()), upper_cutoff(uc.instantiate()), lower_acc(lca), upper_acc(uca) { typedef typename InputAccessor::value_type value_type; const value_type max = vigra::NumericTraits::max(); if (lower_cutoff > upper_cutoff) { std::cerr << command << ": lower exposure cutoff (" << lower_cutoff << "/" << max << " = " << 100.0 * lower_cutoff / max << "%) exceeds upper cutoff (" << upper_cutoff << "/" << max << " = " << 100.0 * upper_cutoff / max << "%)" << endl; exit(1); } } inline ResultType operator()(const InputType& a) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(a, srcIsScalar()); } protected: // grayscale template inline ResultType f(const T& a, vigra::VigraTrueType) const { typedef typename vigra::NumericTraits::RealPromote RealType; const RealType ra = vigra::NumericTraits::toRealPromote(a); if (ra >= lower_cutoff && ra <= upper_cutoff) { const double b = vigra::NumericTraits::max() * mu; const double c = vigra::NumericTraits::max() * sigma; return vigra::NumericTraits::fromRealPromote(weight * gaussDistribution(ra, b, c)); } else { return ResultType(); } } // RGB template inline ResultType f(const T& a, vigra::VigraFalseType) const { typedef typename T::value_type ValueType; typedef typename vigra::NumericTraits::RealPromote RealType; const RealType ra = vigra::NumericTraits::toRealPromote(acc.operator()(a)); const RealType lower_ra = vigra::NumericTraits::toRealPromote(lower_acc.operator()(a)); const RealType upper_ra = vigra::NumericTraits::toRealPromote(upper_acc.operator()(a)); if (lower_ra >= lower_cutoff && upper_ra <= upper_cutoff) { const double b = vigra::NumericTraits::max() * mu; const double c = vigra::NumericTraits::max() * sigma; return vigra::NumericTraits::fromRealPromote(weight * gaussDistribution(ra, b, c)); } else { return ResultType(); } } const double weight; const double mu; const double sigma; InputAccessor acc; const double lower_cutoff; const double upper_cutoff; InputAccessor lower_acc; InputAccessor upper_acc; }; template class SaturationFunctor { public: typedef ResultType result_type; SaturationFunctor(double w) : weight(w) {} inline ResultType operator()(const InputType& a) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; return f(a, srcIsScalar()); } protected: // grayscale template inline ResultType f(const T& a, vigra::VigraTrueType) const { return vigra::NumericTraits::zero(); } // RGB template inline ResultType f(const T& a, vigra::VigraFalseType) const { typedef typename T::value_type value_type; typedef vigra::NumericTraits value_traits; typedef vigra::NumericTraits result_traits; const value_type max = std::max(a.red(), std::max(a.green(), a.blue())); const value_type min = std::min(a.red(), std::min(a.green(), a.blue())); if (max == min) { return result_traits::zero(); } else { const double max_value = value_traits::isIntegral::asBool ? static_cast(value_traits::max()) : 1.0; const double sum = static_cast(max) + static_cast(min); const double difference = static_cast(max) - static_cast(min); const double saturation = sum <= max_value ? difference / sum : difference / (2.0 * max_value - sum); return result_traits::fromRealPromote(weight * saturation); } } const double weight; }; template class ContrastFunctor { public: typedef ResultType result_type; ContrastFunctor(double w) : weight(w) {} inline ResultType operator()(const InputType& a) const { typedef typename vigra::NumericTraits::isScalar srcIsScalar; typedef typename vigra::NumericTraits::isIntegral scaleIsIntegral; return f(a, srcIsScalar(), scaleIsIntegral()); } protected: // grayscale, integral template inline ResultType f(const T& a, vigra::VigraTrueType, vigra::VigraTrueType) const { const typename vigra::NumericTraits::RealPromote ra = vigra::NumericTraits::toRealPromote(a); return vigra::NumericTraits::fromRealPromote(weight * ra / vigra::NumericTraits::max()); } // grayscale, floating-point template inline ResultType f(const T& a, vigra::VigraTrueType, vigra::VigraFalseType) const { const typename vigra::NumericTraits::RealPromote ra = vigra::NumericTraits::toRealPromote(a); return vigra::NumericTraits::fromRealPromote(weight * ra); } // RGB, integral template inline ResultType f(const T& a, vigra::VigraFalseType, vigra::VigraTrueType) const { typedef typename T::value_type TComponentType; typedef typename vigra::NumericTraits::RealPromote RealTComponentType; typedef typename ScaleType::value_type ScaleComponentType; const RealTComponentType ra = static_cast(a.lightness()); return vigra::NumericTraits::fromRealPromote(weight * ra / vigra::NumericTraits::max()); } // RGB, floating-point template inline ResultType f(const T& a, vigra::VigraFalseType, vigra::VigraFalseType) const { typedef typename T::value_type TComponentType; typedef typename vigra::NumericTraits::RealPromote RealTComponentType; const RealTComponentType ra = static_cast(a.lightness()); return vigra::NumericTraits::fromRealPromote(weight * ra); } const double weight; }; template class EntropyFunctor { public: typedef vigra::NumericTraits InputTraits; typedef vigra::NumericTraits ResultTraits; typedef ResultType result_type; EntropyFunctor(double w) : weight(w) {} ResultType operator()(const InputType& x) const { typedef typename InputTraits::isScalar srcIsScalar; return entropy(x, srcIsScalar()); } protected: // Grayscale ResultType entropy(const InputType& x, vigra::VigraTrueType) const { return ResultTraits::fromRealPromote(weight * ResultTraits::toRealPromote(x)); } // RGB ResultType entropy(const InputType& x, vigra::VigraFalseType) const { const typename ResultTraits::RealPromote minimum = ResultTraits::toRealPromote(std::min(std::min(x.red(), x.green()), x.blue())); return ResultTraits::fromRealPromote(weight * minimum); } private: const double weight; }; template struct MagnitudeAccessor { typedef ValueType value_type; template ValueType operator()(const Iterator& i) const {return std::abs(*i);} ValueType operator()(const ValueType* i) const {return std::abs(*i);} template ValueType operator()(const Iterator& i, Difference d) const {return std::abs(i[d]);} template void set(const Value& v, const Iterator& i) const { *i = vigra::detail::RequiresExplicitCast::cast(std::abs(v)); } template void set(const Value& v, Iterator& i) const { *i = vigra::detail::RequiresExplicitCast::cast(std::abs(v)); } template void set(const Value& v, const Iterator& i, const Difference& d) const { i[d] = vigra::detail::RequiresExplicitCast::cast(std::abs(v)); } }; template class ClampingFunctor { public: typedef vigra::NumericTraits InputTraits; ClampingFunctor(InputType lower, ResultType lowerValue, InputType upper, ResultType upperValue) : lo(lower), up(upper), loval(lowerValue), upval(upperValue) {} ResultType operator()(const InputType& x) const { typedef typename InputTraits::isScalar srcIsScalar; return clamp(x, srcIsScalar()); } protected: ResultType clamp(const InputType& x, vigra::VigraTrueType) const { return x <= lo ? loval : (x >= up ? upval : x); } // RGB ResultType clamp(const InputType& x, vigra::VigraFalseType) const { return ResultType(x.red() <= lo.red() ? loval.red() : (x.red() >= up.red() ? upval.red() : x.red()), x.green() <= lo.green() ? loval.green() : (x.green() >= up.green() ? upval.green() : x.green()), x.red() <= lo.red() ? loval.blue() : (x.blue() >= up.blue() ? upval.blue() : x.blue())); } private: const InputType lo, up; const ResultType loval, upval; }; // If the first argument is lower than THRESHOLD return the second // argument, i.e. the "fill-in" value multiplied with SCALE2, // otherwise return the first argument multiplied with SCALE1. template class FillInFunctor { public: FillInFunctor(InputType thr, double s1, double s2) : threshold(thr), scale1(s1), scale2(s2) {} ResultType operator()(const InputType& x, const InputType& y) const { if (x >= threshold) { return vigra::NumericTraits::fromRealPromote(scale1 * x); } else { return vigra::NumericTraits::fromRealPromote(scale2 * y); } } private: const InputType threshold; const double scale1, scale2; }; template void enfuseMask(vigra::triple src, vigra::pair mask, vigra::pair result) { typedef typename ImageType::value_type ImageValueType; typedef typename ImageType::PixelType PixelType; typedef typename vigra::NumericTraits::ValueType ScalarType; typedef typename MaskType::value_type MaskValueType; const typename ImageType::difference_type imageSize = src.second - src.first; // Exposure if (WExposure > 0.0) { typedef MultiGrayscaleAccessor MultiGrayAcc; MultiGrayAcc ga(GrayscaleProjector); if (ExposureLowerCutoff.is_effective() || ExposureUpperCutoff.is_effective()) { MultiGrayAcc lca(ExposureLowerCutoffGrayscaleProjector.empty() ? GrayscaleProjector : ExposureLowerCutoffGrayscaleProjector); MultiGrayAcc uca(ExposureUpperCutoffGrayscaleProjector.empty() ? ExposureLowerCutoffGrayscaleProjector : ExposureUpperCutoffGrayscaleProjector); CutoffExposureFunctor cef(WExposure, WMu, WSigma, ga, ExposureLowerCutoff, ExposureUpperCutoff, lca, uca); #ifdef DEBUG_EXPOSURE std::cout << "+ enfuseMask: cutoff - GrayscaleProjector = <" << GrayscaleProjector << ">\n" << "+ enfuseMask: ExposureLowerCutoffGrayscaleProjector = <" << ExposureLowerCutoffGrayscaleProjector << ">\n" << "+ enfuseMask: ExposureUpperCutoffGrayscaleProjector = <" << ExposureUpperCutoffGrayscaleProjector << ">\n"; #endif transformImageIfMP(src, mask, result, cef); } else { ExposureFunctor ef(WExposure, WMu, WSigma, ga); #ifdef DEBUG_EXPOSURE std::cout << "+ enfuseMask: plain - GrayscaleProjector = <" << GrayscaleProjector << ">\n"; #endif transformImageIfMP(src, mask, result, ef); } } // Contrast if (WContrast > 0.0) { typedef typename vigra::NumericTraits::Promote LongScalarType; typedef IMAGETYPE GradImage; typedef typename GradImage::iterator GradIterator; GradImage grad(imageSize); MultiGrayscaleAccessor ga(GrayscaleProjector); if (FilterConfig.edgeScale > 0.0) { #ifdef DEBUG_LOG std::cout << "+ Laplacian Edge Detection, scale = " << FilterConfig.edgeScale << " pixels" << endl; #endif GradImage laplacian(imageSize); if (FilterConfig.lceScale > 0.0) { #ifdef DEBUG_LOG std::cout << "+ Local Contrast Enhancement, (scale, amount) = " << FilterConfig.lceScale << " pixels, " << (100.0 * FilterConfig.lceFactor) << "%" << endl; #endif GradImage lce(imageSize); vigra::gaussianSharpening(src.first, src.second, ga, lce.upperLeft(), lce.accessor(), FilterConfig.lceFactor, FilterConfig.lceScale); vigra::laplacianOfGaussian(lce.upperLeft(), lce.lowerRight(), lce.accessor(), laplacian.upperLeft(), MagnitudeAccessor(), FilterConfig.edgeScale); } else { vigra::laplacianOfGaussian(src.first, src.second, ga, laplacian.upperLeft(), MagnitudeAccessor(), FilterConfig.edgeScale); } #ifdef DEBUG_LOG { vigra::FindMinMax minmax; vigra::inspectImage(srcImageRange(laplacian), minmax); std::cout << "+ after Laplacian and Magnitude: min = " << minmax.min << ", max = " << minmax.max << endl; } #endif const double minCurve = static_cast(MinCurvature.instantiate()); if (minCurve <= 0.0) { #ifdef DEBUG_LOG std::cout << "+ truncate values below " << -minCurve << endl;; #endif transformImageIfMP(laplacian.upperLeft(), laplacian.lowerRight(), laplacian.accessor(), mask.first, mask.second, grad.upperLeft(), grad.accessor(), ClampingFunctor (static_cast(-minCurve), LongScalarType(), vigra::NumericTraits::max(), vigra::NumericTraits::max())); } else { #ifdef DEBUG_LOG std::cout << "+ merge local contrast and edges - switch at " << minCurve << endl; #endif GradImage localContrast(imageSize); // TODO: use localStdDev localStdDevIf(src.first, src.second, ga, mask.first, mask.second, localContrast.upperLeft(), localContrast.accessor(), vigra::Size2D(ContrastWindowSize, ContrastWindowSize)); combineTwoImagesIfMP(laplacian.upperLeft(), laplacian.lowerRight(), laplacian.accessor(), localContrast.upperLeft(), localContrast.accessor(), mask.first, mask.second, grad.upperLeft(), grad.accessor(), FillInFunctor (static_cast(minCurve), // threshold 1.0, // scale factor for "laplacian" minCurve / vigra::NumericTraits::max())); // scale factor for "localContrast" } } else { #ifdef DEBUG_LOG std::cout << "+ Variance of Local Contrast" << endl; #endif localStdDevIf(src.first, src.second, ga, mask.first, mask.second, grad.upperLeft(), grad.accessor(), vigra::Size2D(ContrastWindowSize, ContrastWindowSize)); } #ifdef DEBUG_LOG { vigra::FindMinMax minmax; vigra::inspectImage(srcImageRange(grad), minmax); std::cout << "+ final grad: min = " << minmax.min << ", max = " << minmax.max << endl; } #endif ContrastFunctor cf(WContrast); combineTwoImagesIfMP(srcImageRange(grad), result, mask, result, const_parameters(bind(cf, _1) + _2)); } // Saturation if (WSaturation > 0.0) { SaturationFunctor sf(WSaturation); combineTwoImagesIfMP(src, result, mask, result, const_parameters(bind(sf, _1) + _2)); } // Entropy if (WEntropy > 0.0) { typedef typename ImageType::PixelType PixelType; typedef typename vigra::NumericTraits::ValueType ScalarType; typedef IMAGETYPE Image; Image entropy(imageSize); if (EntropyLowerCutoff.is_effective()) { const ScalarType lowerCutoff = EntropyLowerCutoff.instantiate(); const ScalarType upperCutoff = EntropyUpperCutoff.instantiate(); #ifdef DEBUG_ENTROPY std::cout << "+ EntropyLowerCutoff.value = " << EntropyLowerCutoff.value() << ", " << "lowerCutoff = " << static_cast(lowerCutoff) << "\n" << "+ EntropyUpperCutoff.value = " << EntropyUpperCutoff.value() << ", " << "upperCutoff = " << static_cast(upperCutoff) << endl; #endif if (lowerCutoff > upperCutoff) { const double max = static_cast(vigra::NumericTraits::max()); std::cerr << command << ": lower entropy cutoff (" << static_cast(lowerCutoff) << "/" << max << " = " << 100.0 * lowerCutoff / max << "%) exceeds upper cutoff (" << static_cast(upperCutoff) << "/" << max << " = " << 100.0 * upperCutoff / max << "%)" << endl; exit(1); } Image trunc(imageSize); ClampingFunctor cf((PixelType(lowerCutoff)), // IMPLEMENTATION NOTE: (PixelType(ScalarType())), // The extra parenthesis avoid a bug in the VC9 compiler. (PixelType(upperCutoff)), (PixelType(vigra::NumericTraits::max()))); transformImageMP(src.first, src.second, src.third, trunc.upperLeft(), trunc.accessor(), cf); localEntropyIf(trunc.upperLeft(), trunc.lowerRight(), trunc.accessor(), mask.first, mask.second, entropy.upperLeft(), entropy.accessor(), vigra::Size2D(EntropyWindowSize, EntropyWindowSize)); } else { localEntropyIf(src.first, src.second, src.third, mask.first, mask.second, entropy.upperLeft(), entropy.accessor(), vigra::Size2D(EntropyWindowSize, EntropyWindowSize)); } EntropyFunctor ef(WEntropy); combineTwoImagesIfMP(srcImageRange(entropy), result, mask, result, const_parameters(bind(ef, _1) + _2)); } }; /** Enfuse's main blending loop. Templatized to handle different image types. */ template void enfuseMain(const FileNameList& anInputFileNameList, const std::list& anImageInfoList, vigra::ImageExportInfo& anOutputImageInfo, vigra::Rect2D& anInputUnion) { typedef typename EnblendNumericTraits::ImagePixelComponentType ImagePixelComponentType; typedef typename EnblendNumericTraits::ImageType ImageType; typedef typename EnblendNumericTraits::AlphaPixelType AlphaPixelType; typedef typename EnblendNumericTraits::AlphaType AlphaType; typedef IMAGETYPE MaskType; typedef typename MaskType::value_type MaskPixelType; typedef typename EnblendNumericTraits::ImagePyramidPixelType ImagePyramidPixelType; typedef typename EnblendNumericTraits::ImagePyramidType ImagePyramidType; typedef typename EnblendNumericTraits::MaskPyramidPixelType MaskPyramidPixelType; typedef typename EnblendNumericTraits::MaskPyramidType MaskPyramidType; enum {ImagePyramidIntegerBits = EnblendNumericTraits::ImagePyramidIntegerBits}; enum {ImagePyramidFractionBits = EnblendNumericTraits::ImagePyramidFractionBits}; enum {MaskPyramidIntegerBits = EnblendNumericTraits::MaskPyramidIntegerBits}; enum {MaskPyramidFractionBits = EnblendNumericTraits::MaskPyramidFractionBits}; typedef typename EnblendNumericTraits::SKIPSMImagePixelType SKIPSMImagePixelType; typedef typename EnblendNumericTraits::SKIPSMAlphaPixelType SKIPSMAlphaPixelType; typedef typename EnblendNumericTraits::SKIPSMMaskPixelType SKIPSMMaskPixelType; // List of input image / input alpha / mask triples typedef std::list< vigra::triple > imageListType; typedef typename imageListType::iterator imageListIteratorType; imageListType imageList; // Sum of all masks MaskType *normImage = new MaskType(anInputUnion.size()); // Result image. Alpha will be union of all input alphas. std::pair outputPair(static_cast(NULL), new AlphaType(anInputUnion.size())); std::list imageInfoList(anImageInfoList); const unsigned numberOfImages = imageInfoList.size(); unsigned m = 0; FileNameList::const_iterator inputFileNameIterator(anInputFileNameList.begin()); while (!imageInfoList.empty()) { vigra::Rect2D imageBB; std::pair imagePair = assemble(imageInfoList, anInputUnion, imageBB); MaskType* mask = new MaskType(anInputUnion.size()); if (LoadMasks) { // IMPLEMENTATION NOTE: For simplicity of the code, here // we also load in hard masks. Computing the set of hard // masks from a set of soft masks is done by maximum // selection, which is an idempotent function. const std::string maskFilename = enblend::expandFilenameTemplate(UseHardMask ? HardMaskTemplate : SoftMaskTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (can_open_file(maskFilename)) { vigra::ImageImportInfo maskInfo(maskFilename.c_str()); if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: loading " << (UseHardMask ? "hard" : "soft") << "mask \"" << maskFilename << "\"" << endl; } if (!maskInfo.isGrayscale()) { std::cerr << command << ": error: mask image \"" << maskFilename << "\" is not grayscale" << std::endl; exit(1); } if (maskInfo.numExtraBands() != 0) { std::cerr << command << ": error: mask image \"" << maskFilename << "\" must not have an alpha channel" << std::endl; exit(1); } if (maskInfo.width() != anInputUnion.width() || maskInfo.height() != anInputUnion.height()) { std::cerr << command << ": warning: mask in \"" << maskFilename << "\" has size " << "(" << maskInfo.width() << "x" << maskInfo.height() << "),\n" << command << ": warning: but image union has size " << anInputUnion.size() << ";\n" << command << ": warning: make sure this is the right mask for the given images" << endl; } importImage(maskInfo, destImage(*mask)); } else { // Cannot read mask file. We already issued an error // message through can_open_file(). exit(1); } } else { enfuseMask(srcImageRange(*(imagePair.first)), srcImage(*(imagePair.second)), destImage(*mask)); } if (SaveMasks) { const std::string maskFilename = enblend::expandFilenameTemplate(SoftMaskTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (maskFilename == *inputFileNameIterator) { std::cerr << command << ": will not overwrite input image \"" << *inputFileNameIterator << "\" with soft mask file" << endl; exit(1); } else if (maskFilename == OutputFileName) { std::cerr << command << ": will not overwrite output image \"" << OutputFileName << "\" with soft mask file" << endl; exit(1); } else { if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: saving soft mask \"" << maskFilename << "\"" << endl; } vigra::ImageExportInfo maskInfo(maskFilename.c_str()); maskInfo.setXResolution(ImageResolution.x); maskInfo.setYResolution(ImageResolution.y); maskInfo.setCompression(MASK_COMPRESSION); exportImage(srcImageRange(*mask), maskInfo); } } // Make output alpha the union of all input alphas. copyImageIf(srcImageRange(*(imagePair.second)), maskImage(*(imagePair.second)), destImage(*(outputPair.second))); // Add the mask to the norm image. combineTwoImagesMP(srcImageRange(*mask), srcImage(*normImage), destImage(*normImage), Arg1() + Arg2()); imageList.push_back(vigra::make_triple(imagePair.first, imagePair.second, mask)); #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after loading image " << m << "\n"; v.printStats(std::cerr, command + ": info: image", imagePair.first); v.printStats(std::cerr, command + ": info: alpha", imagePair.second); v.printStats(std::cerr, command + ": info: weight", mask); v.printStats(std::cerr, command + ": info: normImage", normImage); v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif ++m; ++inputFileNameIterator; } if (StopAfterMaskGeneration && !UseHardMask) { exit(0); } const int totalImages = imageList.size(); typename EnblendNumericTraits::MaskPixelType maxMaskPixelType = vigra::NumericTraits::MaskPixelType>::max(); if (UseHardMask) { if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: creating hard blend mask" << endl; } const vigra::Size2D sz = normImage->size(); imageListIteratorType imageIter; #ifdef OPENMP #pragma omp parallel for private (imageIter) #endif for (int y = 0; y < sz.y; ++y) { for (int x = 0; x < sz.x; ++x) { float max = 0.0f; int maxi = 0; int i = 0; for (imageIter = imageList.begin(); imageIter != imageList.end(); ++imageIter) { const float w = static_cast((*imageIter->third)(x, y)); if (w > max) { max = w; maxi = i; } i++; } i = 0; for (imageIter = imageList.begin(); imageIter != imageList.end(); ++imageIter) { if (max == 0.0f) { (*imageIter->third)(x, y) = static_cast(maxMaskPixelType) / totalImages; } else if (i == maxi) { (*imageIter->third)(x, y) = maxMaskPixelType; } else { (*imageIter->third)(x, y) = 0.0f; } i++; } } } unsigned i = 0; if (SaveMasks) { for (imageIter = imageList.begin(), inputFileNameIterator = anInputFileNameList.begin(); imageIter != imageList.end(); ++imageIter, ++inputFileNameIterator) { const std::string maskFilename = enblend::expandFilenameTemplate(HardMaskTemplate, imageList.size(), *inputFileNameIterator, OutputFileName, i); if (maskFilename == *inputFileNameIterator) { std::cerr << command << ": will not overwrite input image \"" << *inputFileNameIterator << "\" with hard mask" << endl; exit(1); } else if (maskFilename == OutputFileName) { std::cerr << command << ": will not overwrite output image \"" << OutputFileName << "\" with hard mask" << endl; exit(1); } else { if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: saving hard mask \"" << maskFilename << "\"" << endl; } vigra::ImageExportInfo maskInfo(maskFilename.c_str()); maskInfo.setXResolution(ImageResolution.x); maskInfo.setYResolution(ImageResolution.y); maskInfo.setCompression(MASK_COMPRESSION); exportImage(srcImageRange(*(imageIter->third)), maskInfo); } i++; } } #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after creating hard mask\n"; v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif } if (StopAfterMaskGeneration) { exit(0); } vigra::Rect2D junkBB; const unsigned int numLevels = roiBounds(anInputUnion, anInputUnion, anInputUnion, anInputUnion, junkBB, WrapAround != OpenBoundaries); std::vector *resultLP = NULL; m = 0; while (!imageList.empty()) { vigra::triple imageTriple = imageList.front(); imageList.erase(imageList.begin()); std::ostringstream oss0; oss0 << "imageGP" << m << "_"; // imageLP is constructed using the image's own alpha channel // as the boundary for extrapolation. std::vector *imageLP = laplacianPyramid( oss0.str().c_str(), numLevels, WrapAround != OpenBoundaries, srcImageRange(*(imageTriple.first)), maskImage(*(imageTriple.second))); delete imageTriple.first; delete imageTriple.second; //std::ostringstream oss1; //oss1 << "imageLP" << m << "_"; //exportPyramid(imageLP, oss1.str().c_str()); if (!UseHardMask) { // Normalize the mask coefficients. // Scale to the range expected by the MaskPyramidPixelType. combineTwoImagesMP(srcImageRange(*(imageTriple.third)), srcImage(*normImage), destImage(*(imageTriple.third)), ifThenElse(Arg2() > Param(0.0), Param(maxMaskPixelType) * Arg1() / Arg2(), Param(maxMaskPixelType / totalImages))); } // maskGP is constructed using the union of the input alpha channels // as the boundary for extrapolation. std::vector *maskGP = gaussianPyramid (numLevels, WrapAround != OpenBoundaries, srcImageRange(*(imageTriple.third)), maskImage(*(outputPair.second))); delete imageTriple.third; //std::ostringstream oss2; //oss2 << "maskGP" << m << "_"; //exportPyramid(maskGP, oss2.str().c_str()); ConvertScalarToPyramidFunctor::MaskPixelType, MaskPyramidPixelType, MaskPyramidIntegerBits, MaskPyramidFractionBits> maskConvertFunctor; MaskPyramidPixelType maxMaskPyramidPixelValue = maskConvertFunctor(maxMaskPixelType); for (unsigned int i = 0; i < maskGP->size(); ++i) { // Multiply image lp with the mask gp. combineTwoImagesMP(srcImageRange(*((*imageLP)[i])), srcImage(*((*maskGP)[i])), destImage(*((*imageLP)[i])), ImageMaskMultiplyFunctor(maxMaskPyramidPixelValue)); // Done with maskGP. delete (*maskGP)[i]; } delete maskGP; //std::ostringstream oss3; //oss3 << "multLP" << m << "_"; //exportPyramid(imageLP, oss3.str().c_str()); if (resultLP != NULL) { // Add imageLP to resultLP. for (unsigned int i = 0; i < imageLP->size(); ++i) { combineTwoImagesMP(srcImageRange(*((*imageLP)[i])), srcImage(*((*resultLP)[i])), destImage(*((*resultLP)[i])), Arg1() + Arg2()); delete (*imageLP)[i]; } delete imageLP; } else { resultLP = imageLP; } //std::ostringstream oss4; //oss4 << "resultLP" << m << "_"; //exportPyramid(resultLP, oss4.str().c_str()); ++m; } delete normImage; //exportPyramid(resultLP, "resultLP"); collapsePyramid(WrapAround != OpenBoundaries, resultLP); outputPair.first = new ImageType(anInputUnion.size()); copyFromPyramidImageIf (srcImageRange(*((*resultLP)[0])), maskImage(*(outputPair.second)), destImage(*(outputPair.first))); // Delete result pyramid. for (unsigned int i = 0; i < resultLP->size(); ++i) { delete (*resultLP)[i]; } delete resultLP; checkpoint(outputPair, anOutputImageInfo); delete outputPair.first; delete outputPair.second; } } // namespace enblend #endif /* __ENFUSE_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/error_message.cc0000644000175100017510000000456412070530113021515 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include "error_message.h" namespace enblend { namespace detail { std::string noErrorMessageAvailable(int anErrorNumber) { std::ostringstream oss; oss << "No detailed error message available; decimal error #" << anErrorNumber; return oss.str(); } } std::string errorMessage(int anErrorNumber) { #if defined(HAVE_STRERROR) || defined(HAVE_STRERROR_R) char* message; int return_code; #if defined(HAVE_STRERROR_R) const size_t buffer_size = 65536; boost::scoped_ptr message_buffer(new char[buffer_size]); #if defined(STRERROR_R_CHAR_P) message = strerror_r(anErrorNumber, message_buffer.get(), buffer_size); return_code = 0; #else message = message_buffer.get(); return_code = strerror_r(anErrorNumber, message, buffer_size); #endif // STRERROR_R_CHAR_P #elif defined(HAVE_STRERROR) message = strerror(anErrorNumber); return_code = 0; #endif // HAVE_STRERROR_R, HAVE_STRERROR if (return_code != 0) { std::ostringstream oss; oss << "Conversion of decimal error #" << anErrorNumber << " to an error message failed with decimal return code " << return_code; return oss.str(); } else if (strlen(message) == 0) { return detail::noErrorMessageAvailable(anErrorNumber); } else { return std::string(message); } #else return detail::noErrorMessageAvailable(anErrorNumber); #endif // HAVE_STRERROR || HAVE_STRERROR_R } } enblend-enfuse-4.1.2+dfsg/src/self_test.h0000644000175100017510000000166712070530113020513 0ustar ametzlerametzler/* * Copyright (C) 2009-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __SELF_TEST_H__ #define __SELF_TEST_H__ extern bool getopt_long_works_ok(); #endif /* __SELF_TEST_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/Makefile.am0000644000175100017510000000463012232763260020412 0ustar ametzlerametzlerAM_CPPFLAGS = $(EXTRACPPFLAGS) AM_CFLAGS = $(EXTRACFLAGS) AM_CXXFLAGS = $(EXTRACXXFLAGS) AM_LDFLAGS = $(EXTRALDFLAGS) SUBDIRS = layer_selection bin_PROGRAMS = enblend enfuse enblend_SOURCES = anneal.h assemble.h blend.h bounds.h \ common.h enblend.h enblend.cc fixmath.h \ global.h gpu.cc gpu.h graphcut.h \ maskcommon.h masktypedefs.h mask.h postoptimizer.h \ nearest.h numerictraits.h openmp.h path.h pyramid.h \ error_message.h error_message.cc \ filenameparse.h filenameparse.cc \ filespec.h filespec.cc \ self_test.h self_test.cc \ tiff_message.h tiff_message.cc \ minimizer.h muopt.h enblend_LDFLAGS = $(AM_LDFLAGS) $(OPENGL_CFLAGS) enblend_LDADD = layer_selection/liblayersel.a \ $(GSL_LIBS) $(OPENGL_LIBS) @EXTRA_LIBS@ enblend_CXXFLAGS = $(AM_CXXFLAGS) $(GSL_CFLAGS) $(OPENGL_CFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src/layer_selection enfuse_SOURCES = assemble.h blend.h bounds.h common.h \ enfuse.h enfuse.cc fixmath.h \ global.h mga.h numerictraits.h openmp.h pyramid.h \ error_message.h error_message.cc \ filenameparse.h filenameparse.cc \ filespec.h filespec.cc \ self_test.h self_test.cc \ tiff_message.h tiff_message.cc \ minimizer.h muopt.h enfuse_LDFLAGS = $(AM_LDFLAGS) enfuse_LDADD = layer_selection/liblayersel.a \ $(GSL_LIBS) @EXTRA_LIBS@ enfuse_CXXFLAGS = $(AM_CXXFLAGS) $(GSL_CFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src/layer_selection EXTRA_DIST = enblend.1 enfuse.1 \ gen_sig DefaultSig.pm Sig.pm \ CMakeLists.txt DISTCLEANFILES = enblend.1 enfuse.1 # Generated sources BUILT_SOURCES = signature.h CLEANFILES = signature.h signature.h: $(srcdir)/gen_sig $(srcdir)/DefaultSig.pm $(srcdir)/Sig.pm @ $(PERL) -I$(srcdir) $< --extra=$(VERSION) > $@ # Documentation man_MANS = enblend.1 enfuse.1 #dist_man_MANS = enblend.1 enfuse.1 .PHONY: man man: enblend.1 enfuse.1 enblend.1: enblend $(HELP2MAN) --output=$@ ./enblend enfuse.1: enfuse $(HELP2MAN) --output=$@ ./enfuse enblend-enfuse-4.1.2+dfsg/src/layer_selection/0000755000175100017510000000000012232763264021540 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/src/layer_selection/info.h0000644000175100017510000000555112070530113022633 0ustar ametzlerametzler/* * Copyright (C) 2010-2011 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __INFO_H__ #define __INFO_H__ #include #include "vigra/imageinfo.hxx" struct LayerInfo { LayerInfo(int a_width, int a_height, bool is_color_image, vigra::ImageImportInfo::PixelType a_pixel_type, vigra::Diff2D a_position, float an_x_resolution, float a_y_resolution) : width(a_width), height(a_height), is_color(is_color_image), pixel_type(a_pixel_type), position(a_position), x_resolution(an_x_resolution), y_resolution(a_y_resolution) {} int width; int height; bool is_color; vigra::ImageImportInfo::PixelType pixel_type; vigra::Diff2D position; float x_resolution; float y_resolution; vigra::Size2D size() const; bool is_float() const; bool is_signed() const; std::pair resolution() const; }; class ImageInfo { typedef std::vector layer_list; public: ImageInfo(const std::string& a_filename) : filename_(a_filename) {}; const std::string& filename() const {return filename_;} const LayerInfo* layer(unsigned a_layer_index) const {return &layers_[a_layer_index];} void append(const LayerInfo& an_info) {layers_.push_back(an_info);} unsigned number_of_layers() const {return layers_.size();} private: /* const */ std::string filename_; // const time_t filetime_; layer_list layers_; }; class ImageListInformation { typedef std::vector image_list; public: ImageListInformation() {} ImageListInformation(const ImageListInformation* an_image_list); virtual ~ImageListInformation() {} void append(const ImageInfo& an_info) {images_.push_back(an_info);} unsigned number_of_images() const {return images_.size();} const ImageInfo* image_info_on(const std::string& a_filename) const; const LayerInfo* layer_info_on(const std::string& a_filename, unsigned a_layer_index) const; private: image_list::const_iterator find_image_by_name(const std::string& a_filename) const; image_list images_; }; #endif // __INFO_H__ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/layer_selection/selector.cc0000644000175100017510000001012512070530113023647 0ustar ametzlerametzler/* * Copyright (C) 2010-2011 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #ifdef HAVE_CONFIG_H #include #endif #include "selector.h" namespace selector { std::string AllLayers::name() const { return "all-layers"; } std::string AllLayers::description() const { return "select all layers in all images;"; } std::string FirstLayer::name() const { return "first-layer"; } std::string FirstLayer::description() const { return "select only first layer in each multi-layer image;"; } std::string LargestLayer::name() const { return "largest-layer"; } std::string LargestLayer::description() const { return "select largest layer in each multi-layer image;"; } static unsigned find_largest_layer(const ImageListInformation* an_image_info, const std::string& a_filename) { const ImageInfo* image_info = an_image_info->image_info_on(a_filename); const unsigned n = image_info->number_of_layers(); unsigned max_index = 0; int max_area = -1; for (unsigned i = 0; i != n; ++i) { const LayerInfo* layer_info = an_image_info->layer_info_on(a_filename, i); const int area = layer_info->width * layer_info->height; if (area > max_area) { max_area = area; max_index = i; } } return max_index; } bool LargestLayer::select(const ImageListInformation* an_image_info, const std::string& a_filename, unsigned a_layer_index) { cache_t::const_iterator index = cache_.find(a_filename); unsigned max_index; if (index == cache_.end()) { max_index = 1 + find_largest_layer(an_image_info, a_filename); cache_.insert(cache_t::value_type(a_filename, max_index)); } else { max_index = index->second; } return a_layer_index == max_index; } std::string NoLayer::name() const { return "no-layer"; } std::string NoLayer::description() const { return "do not select any layer from any image;"; } algorithm_list algorithms = boost::assign::list_of (static_cast(new AllLayers)) (static_cast(new FirstLayer)) (static_cast(new LargestLayer)) (static_cast(new NoLayer)) ; algorithm_list::const_iterator find_by_id(id_t an_id) { algorithm_list::const_iterator algorithm = std::find_if(algorithms.begin(), algorithms.end(), boost::lambda::bind(&Abstract::id, boost::lambda::_1) == boost::lambda::constant(an_id)); assert(algorithm != algorithms.end()); return algorithm; } algorithm_list::const_iterator find_by_name(const std::string& a_name) { algorithm_list::const_iterator algorithm = std::find_if(algorithms.begin(), algorithms.end(), boost::lambda::bind(&Abstract::name, boost::lambda::_1) == boost::lambda::constant(a_name)); return algorithm; } } // end namespace selector enblend-enfuse-4.1.2+dfsg/src/layer_selection/Makefile.in0000664000175100017510000005762512232763264023626 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src/layer_selection DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = liblayersel_a_AR = $(AR) $(ARFLAGS) liblayersel_a_LIBADD = am_liblayersel_a_OBJECTS = liblayersel_a-info.$(OBJEXT) \ liblayersel_a-layer_selection.$(OBJEXT) \ liblayersel_a-selector.$(OBJEXT) liblayersel_a_OBJECTS = $(am_liblayersel_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) \ -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(liblayersel_a_SOURCES) DIST_SOURCES = $(liblayersel_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = $(EXTRACPPFLAGS) AM_CFLAGS = $(EXTRACFLAGS) AM_CXXFLAGS = $(EXTRACXXFLAGS) AM_LDFLAGS = $(EXTRALDFLAGS) noinst_LIBRARIES = liblayersel.a liblayersel_a_SOURCES = info.h info.cc \ layer_selection.h layer_selection.cc \ selector.h selector.cc liblayersel_a_CXXFLAGS = $(AM_CXXFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src -I${top_srcdir}/src/layer_selection all: all-am .SUFFIXES: .SUFFIXES: .cc .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/layer_selection/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/layer_selection/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) liblayersel.a: $(liblayersel_a_OBJECTS) $(liblayersel_a_DEPENDENCIES) $(EXTRA_liblayersel_a_DEPENDENCIES) $(AM_V_at)-rm -f liblayersel.a $(AM_V_AR)$(liblayersel_a_AR) liblayersel.a $(liblayersel_a_OBJECTS) $(liblayersel_a_LIBADD) $(AM_V_at)$(RANLIB) liblayersel.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblayersel_a-info.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblayersel_a-layer_selection.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/liblayersel_a-selector.Po@am__quote@ .cc.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cc.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` liblayersel_a-info.o: info.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-info.o -MD -MP -MF $(DEPDIR)/liblayersel_a-info.Tpo -c -o liblayersel_a-info.o `test -f 'info.cc' || echo '$(srcdir)/'`info.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-info.Tpo $(DEPDIR)/liblayersel_a-info.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='info.cc' object='liblayersel_a-info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-info.o `test -f 'info.cc' || echo '$(srcdir)/'`info.cc liblayersel_a-info.obj: info.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-info.obj -MD -MP -MF $(DEPDIR)/liblayersel_a-info.Tpo -c -o liblayersel_a-info.obj `if test -f 'info.cc'; then $(CYGPATH_W) 'info.cc'; else $(CYGPATH_W) '$(srcdir)/info.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-info.Tpo $(DEPDIR)/liblayersel_a-info.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='info.cc' object='liblayersel_a-info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-info.obj `if test -f 'info.cc'; then $(CYGPATH_W) 'info.cc'; else $(CYGPATH_W) '$(srcdir)/info.cc'; fi` liblayersel_a-layer_selection.o: layer_selection.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-layer_selection.o -MD -MP -MF $(DEPDIR)/liblayersel_a-layer_selection.Tpo -c -o liblayersel_a-layer_selection.o `test -f 'layer_selection.cc' || echo '$(srcdir)/'`layer_selection.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-layer_selection.Tpo $(DEPDIR)/liblayersel_a-layer_selection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='layer_selection.cc' object='liblayersel_a-layer_selection.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-layer_selection.o `test -f 'layer_selection.cc' || echo '$(srcdir)/'`layer_selection.cc liblayersel_a-layer_selection.obj: layer_selection.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-layer_selection.obj -MD -MP -MF $(DEPDIR)/liblayersel_a-layer_selection.Tpo -c -o liblayersel_a-layer_selection.obj `if test -f 'layer_selection.cc'; then $(CYGPATH_W) 'layer_selection.cc'; else $(CYGPATH_W) '$(srcdir)/layer_selection.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-layer_selection.Tpo $(DEPDIR)/liblayersel_a-layer_selection.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='layer_selection.cc' object='liblayersel_a-layer_selection.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-layer_selection.obj `if test -f 'layer_selection.cc'; then $(CYGPATH_W) 'layer_selection.cc'; else $(CYGPATH_W) '$(srcdir)/layer_selection.cc'; fi` liblayersel_a-selector.o: selector.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-selector.o -MD -MP -MF $(DEPDIR)/liblayersel_a-selector.Tpo -c -o liblayersel_a-selector.o `test -f 'selector.cc' || echo '$(srcdir)/'`selector.cc @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-selector.Tpo $(DEPDIR)/liblayersel_a-selector.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='selector.cc' object='liblayersel_a-selector.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-selector.o `test -f 'selector.cc' || echo '$(srcdir)/'`selector.cc liblayersel_a-selector.obj: selector.cc @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -MT liblayersel_a-selector.obj -MD -MP -MF $(DEPDIR)/liblayersel_a-selector.Tpo -c -o liblayersel_a-selector.obj `if test -f 'selector.cc'; then $(CYGPATH_W) 'selector.cc'; else $(CYGPATH_W) '$(srcdir)/selector.cc'; fi` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/liblayersel_a-selector.Tpo $(DEPDIR)/liblayersel_a-selector.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='selector.cc' object='liblayersel_a-selector.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(liblayersel_a_CXXFLAGS) $(CXXFLAGS) -c -o liblayersel_a-selector.obj `if test -f 'selector.cc'; then $(CYGPATH_W) 'selector.cc'; else $(CYGPATH_W) '$(srcdir)/selector.cc'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/src/layer_selection/layer_selection.cc0000644000175100017510000000452212070530113025214 0ustar ametzlerametzler/* * Copyright (C) 2010-2011 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include #endif #include #include "layer_selection.h" #include "selector.h" LayerSelectionHost::LayerSelectionHost() : selector_(NULL), info_(NULL), tally_(NULL) {} LayerSelectionHost::LayerSelectionHost(const LayerSelectionHost& a_selection) : selector_(a_selection.selector_), info_(new ImageListInformation(a_selection.info_)), tally_(new file_tally_t) {} LayerSelectionHost& LayerSelectionHost::operator=(const LayerSelectionHost& a_selection) { if (this != &a_selection) { selector_ = a_selection.selector_; delete info_; info_ = new ImageListInformation(a_selection.info_); delete tally_; tally_ = new file_tally_t; } return *this; } LayerSelectionHost::~LayerSelectionHost() { delete info_; delete tally_; } std::string LayerSelectionHost::name() const { return selector_->name(); } std::string LayerSelectionHost::description() const { return selector_->description(); } selector::Abstract* LayerSelectionHost::get_selector() const { return selector_; } void LayerSelectionHost::set_selector(selector::Abstract* a_selector) { selector_ = a_selector; } bool LayerSelectionHost::accept(const std::string& a_filename, unsigned a_layer_index) { const bool result = selector_->select(const_cast(info_), a_filename, a_layer_index); if (result) { ++(tally_->operator[](a_filename)[a_layer_index]); } return result; } enblend-enfuse-4.1.2+dfsg/src/layer_selection/selector.h0000644000175100017510000000615312070530113023517 0ustar ametzlerametzler/* * Copyright (C) 2010-2011 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __SELECTOR_H__ #define __SELECTOR_H__ #include #include #include #include "info.h" #include "layer_selection.h" namespace selector { typedef enum { AllLayersId, FirstLayerId, LargestLayerId, NoLayerId } id_t; struct Abstract { Abstract() {} virtual ~Abstract() {} virtual id_t id() const = 0; virtual std::string name() const = 0; virtual std::string description() const = 0; virtual bool select(const ImageListInformation* an_image_info, const std::string& a_filename, unsigned a_layer_index) = 0; }; class AllLayers : public Abstract { public: id_t id() const {return AllLayersId;} std::string name() const; std::string description() const; bool select(const ImageListInformation*, const std::string&, unsigned) { return true; } }; class FirstLayer : public Abstract { public: id_t id() const {return FirstLayerId;} std::string name() const; std::string description() const; bool select(const ImageListInformation*, const std::string&, unsigned a_layer_index) { return a_layer_index == 1; } }; class LargestLayer : public Abstract { public: id_t id() const {return LargestLayerId;} std::string name() const; std::string description() const; bool select(const ImageListInformation* an_image_info, const std::string& a_filename, unsigned a_layer_index); private: typedef std::map cache_t; cache_t cache_; }; class NoLayer : public Abstract { public: id_t id() const {return NoLayerId;} std::string name() const; std::string description() const; bool select(const ImageListInformation*, const std::string&, unsigned) { return false; } }; typedef std::list algorithm_list; extern algorithm_list algorithms; algorithm_list::const_iterator find_by_id(id_t an_id); algorithm_list::const_iterator find_by_name(const std::string& a_name); } // end namespace selector #endif /* __SELECTOR_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/layer_selection/Makefile.am0000644000175100017510000000100412070530113023550 0ustar ametzlerametzlerAM_CPPFLAGS = $(EXTRACPPFLAGS) AM_CFLAGS = $(EXTRACFLAGS) AM_CXXFLAGS = $(EXTRACXXFLAGS) AM_LDFLAGS = $(EXTRALDFLAGS) noinst_LIBRARIES = liblayersel.a liblayersel_a_SOURCES = info.h info.cc \ layer_selection.h layer_selection.cc \ selector.h selector.cc liblayersel_a_CXXFLAGS = $(AM_CXXFLAGS) \ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \ -I${top_srcdir}/include -I${top_srcdir}/src -I${top_srcdir}/src/layer_selection enblend-enfuse-4.1.2+dfsg/src/layer_selection/layer_selection.h0000644000175100017510000000623712070530113025063 0ustar ametzlerametzler/* * Copyright (C) 2010-2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __LAYER_SELECTION_H__ #define __LAYER_SELECTION_H__ #include #include #include #include #include "info.h" namespace selector { struct Abstract; // forward declaration for class in "selector.h" } class LayerSelectionHost { public: LayerSelectionHost(); LayerSelectionHost(const LayerSelectionHost& a_selection); LayerSelectionHost& operator=(const LayerSelectionHost& a_selection); virtual ~LayerSelectionHost(); std::string name() const; std::string description() const; selector::Abstract* get_selector() const; void set_selector(selector::Abstract* a_selector); template void retrieve_image_information(const_iterator begin, const_iterator end) { delete info_; info_ = new ImageListInformation; delete tally_; tally_ = new file_tally_t; for (const_iterator image = begin; image != end; ++image) { ImageInfo image_info(image->filename()); vigra::ImageImportInfo file_info(image->filename().c_str()); for (int layer = 0; layer < file_info.numImages(); ++layer) { vigra::ImageImportInfo* layer_info(new vigra::ImageImportInfo(file_info)); layer_info->setImageIndex(layer); image_info.append(LayerInfo(layer_info->width(), layer_info->height(), layer_info->isColor(), layer_info->pixelType(), layer_info->getPosition(), layer_info->getXResolution(), layer_info->getYResolution())); delete layer_info; } info_->append(image_info); tally_->insert(file_tally_t::value_type(image->filename(), layer_tally_t(file_info.numImages()))); } } virtual bool accept(const std::string& a_filename, unsigned a_layer_index); // query tally // std::vector unused_files() const; // std::pair multiply_used_layers() const; private: selector::Abstract* selector_; ImageListInformation* info_; typedef std::vector layer_tally_t; typedef std::map file_tally_t; file_tally_t* tally_; }; #endif /* __LAYER_SELECTION_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/layer_selection/info.cc0000644000175100017510000000536512070530113022774 0ustar ametzlerametzler/* * Copyright (C) 2010-2011 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include // make_pair #include #include #include "info.h" vigra::Size2D LayerInfo::size() const { return vigra::Size2D(width, height); } bool LayerInfo::is_float() const { return pixel_type == vigra::ImageImportInfo::FLOAT || pixel_type == vigra::ImageImportInfo::DOUBLE; } bool LayerInfo::is_signed() const { return pixel_type == vigra::ImageImportInfo::INT16 || pixel_type == vigra::ImageImportInfo::INT32; } std::pair LayerInfo::resolution() const { return std::make_pair(x_resolution, y_resolution); } //////////////////////////////////////////////////////////////////////// ImageListInformation::ImageListInformation(const ImageListInformation* an_image_list) { if (an_image_list != NULL) { copy(an_image_list->images_.begin(), an_image_list->images_.end(), back_inserter(images_)); } } ImageListInformation::image_list::const_iterator ImageListInformation::find_image_by_name(const std::string& a_filename) const { return find_if(images_.begin(), images_.end(), boost::lambda::bind(&ImageInfo::filename, boost::lambda::_1) == boost::lambda::constant(a_filename)); } const ImageInfo* ImageListInformation::image_info_on(const std::string& a_filename) const { image_list::const_iterator image_info = find_image_by_name(a_filename); if (image_info == images_.end()) { return NULL; } else { return &(*image_info); } } const LayerInfo* ImageListInformation::layer_info_on(const std::string& a_filename, unsigned a_layer_index) const { image_list::const_iterator image_info = find_image_by_name(a_filename); if (image_info == images_.end()) { return NULL; } else { if (a_layer_index >= image_info->number_of_layers()) { return NULL; } else { return image_info->layer(a_layer_index); } } } enblend-enfuse-4.1.2+dfsg/src/muopt.h0000644000175100017510000000373412224464371017701 0ustar ametzlerametzler/* * Copyright (C) 2012 Dr. Christoph L. Spiel * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __MUOPT_H__ #define __MUOPT_H__ #ifdef HAVE_CONFIG_H #include #endif #ifdef __GNUC__ #define PREFETCH(m_addr, m_rw_hint, m_temporal_locality_hint) \ __builtin_prefetch((m_addr), (m_rw_hint), (m_temporal_locality_hint)) #define EXPECT_RESULT(m_condition, m_expected_result) \ __builtin_expect((m_condition), static_cast(m_expected_result)) #else #define PREFETCH(m_addr, m_rw_hint, m_temporal_locality_hint) #define EXPECT_RESULT(m_condition, m_expected_result) (m_condition) #endif typedef enum { PREPARE_FOR_READ, PREPARE_FOR_WRITE } rw_hint; // If data is only touched once, or if the dataset is smaller than the // cache, prefer the non-temporal version; otherwise use one of the // temporal versions. typedef enum { // Fetch data into the first way of the L1/L2 cache, minimizing cache pollution. NO_TEMPORAL_LOCALITY, // Fetch data into the least-recently-used way of the ... LOW_TEMPORAL_LOCALITY, // ... L3 cache? MEDIUM_TEMPORAL_LOCALITY, // ... L2/L3 cache? HIGH_TEMPORAL_LOCALITY // ... L1/L2/L3 cache just as a normal load would do. } temporal_locality_hint; #endif /* __MUOPT_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/enfuse.10000644000175100017510000001513612224473525017733 0ustar ametzlerametzler.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.10. .TH ENFUSE "1" "October 2013" "enfuse 4.1.2" "User Commands" .SH NAME enfuse \- manual page for enfuse 4.1.2 .SH SYNOPSIS .B enfuse [\fIoptions\fR] [\fI--output=IMAGE\fR] \fIINPUT\fR... .SH DESCRIPTION Fuse INPUT images into a single IMAGE. .PP INPUT... are image filenames or response filenames. Response filenames start with an "@" character. .SS "Common options:" .TP \fB\-V\fR, \fB\-\-version\fR output version information and exit .TP \fB\-h\fR, \fB\-\-help\fR print this help message and exit .TP \fB\-l\fR, \fB\-\-levels\fR=\fILEVELS\fR limit number of blending LEVELS to use (1 to 29); negative number of LEVELS decreases maximum; "auto" restores the default automatic maximization .TP \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR write output to FILE; default: "a.tif" .TP \fB\-v\fR, \fB\-\-verbose\fR[=\fILEVEL\fR] verbosely report progress; repeat to increase verbosity or directly set to LEVEL .TP \fB\-w\fR, \fB\-\-wrap\fR[=\fIMODE\fR] wrap around image boundary, where MODE is "none", "horizontal", "vertical", or "both"; default: none; without argument the option selects horizontal wrapping .TP \fB\-\-compression\fR=\fICOMPRESSION\fR set compression of output image to COMPRESSION, where COMPRESSION is: "deflate", "jpeg", "lzw", "none", "packbits", for TIFF files and 0 to 100, or "jpeg", "jpeg\-arith" for JPEG files, where "jpeg" and "jpeg\-arith" accept a compression level .TP \fB\-\-layer\-selector\fR=\fIALGORITHM\fR set the layer selector ALGORITHM; default: "all\-layers"; available algorithms are: "all\-layers": select all layers in all images; "first\-layer": select only first layer in each multi\-layer image; "largest\-layer": select largest layer in each multi\-layer image; "no\-layer": do not select any layer from any image; .TP \fB\-\-parameter\fR=\fIKEY1[=VALUE1][\fR:KEY2[=VALUE2][:...]] set one or more KEY\-VALUE pairs .SS "Extended options:" .TP \fB\-b\fR BLOCKSIZE image cache BLOCKSIZE in kilobytes; default: 2048KB .TP \fB\-c\fR, \fB\-\-ciecam\fR use CIECAM02 to blend colors; disable with "\-\-no\-ciecam" .TP \fB\-\-fallback\-profile\fR=\fIPROFILE\-FILE\fR use the ICC profile from PROFILE\-FILE instead of sRGB .TP \fB\-d\fR, \fB\-\-depth\fR=\fIDEPTH\fR set the number of bits per channel of the output image, where DEPTH is "8", "16", "32", "r32", or "r64" .TP \fB\-g\fR associated\-alpha hack for Gimp (before version 2) and Cinepaint .TP \fB\-f\fR WIDTHxHEIGHT[+xXOFFSET+yYOFFSET] manually set the size and position of the output image; useful for cropped and shifted input TIFF images, such as those produced by Nona .TP \fB\-m\fR CACHESIZE set image CACHESIZE in megabytes; default: 1024MB .SS "Fusion options:" .TP \fB\-\-exposure\-weight\fR=\fIWEIGHT\fR weight given to well\-exposed pixels (0 <= WEIGHT <= 1); default: 1 .TP \fB\-\-saturation\-weight\fR=\fIWEIGHT\fR weight given to highly\-saturated pixels (0 <= WEIGHT <= 1); default: 0.2 .TP \fB\-\-contrast\-weight\fR=\fIWEIGHT\fR weight given to pixels in high\-contrast neighborhoods (0 <= WEIGHT <= 1); default: 0 .TP \fB\-\-entropy\-weight\fR=\fIWEIGHT\fR weight given to pixels in high entropy neighborhoods (0 <= WEIGHT <= 1); default: 0 .TP \fB\-\-exposure\-mu\fR=\fIMEAN\fR center also known as MEAN of Gaussian weighting function (0 <= MEAN <= 1); default: 0.5 .TP \fB\-\-exposure\-sigma\fR=\fISIGMA\fR standard deviation of Gaussian weighting function (SIGMA > 0); default: 0.2 .TP \fB\-\-soft\-mask\fR average over all masks; this is the default .TP \fB\-\-hard\-mask\fR force hard blend masks and no averaging on finest scale; this is especially useful for focus stacks with thin and high contrast features, but leads to increased noise .SS "Expert options:" .TP \fB\-\-exposure\-cutoff\fR=\fILOWERCUTOFF[\fR:UPPERCUTOFF[:LOWERPROJECTOR[:UPPERPROJECTOR]]] LOWERCUTOFF and UPPERCUTOFF are the values below or above of which pixels are weighted with zero weight in exposure weighting; append "%" signs for relative values; default: 0%:100%:anti\-value:value .TP \fB\-\-contrast\-window\-size\fR=\fISIZE\fR set window SIZE for local\-contrast analysis (SIZE >= 3); default: 5 .TP \fB\-\-gray\-projector\fR=\fIPROJECTOR\fR apply gray\-scale PROJECTOR in exposure or contrast weighing, where PROJECTOR is one of "anti\-value", "average", "l\-star", "lightness", "luminance", "pl\-star", "value", or "channel\-mixer:RED\-WEIGHT:GREEN\-WEIGHT:BLUE\-WEIGHT"; default: "average" .TP \fB\-\-contrast\-edge\-scale\fR=\fIEDGESCALE[\fR:LCESCALE[:LCEFACTOR]] set scale on which to look for edges; positive LCESCALE switches on local contrast enhancement by LCEFACTOR (EDGESCALE, LCESCALE, LCEFACTOR >= 0); append "%" to LCESCALE for values relative to EDGESCALE; append "%" to LCEFACTOR for relative value; default: 0:0:0 .TP \fB\-\-contrast\-min\-curvature\fR=\fICURVATURE\fR minimum CURVATURE for an edge to qualify; append "%" for relative values; default: 0 .TP \fB\-\-entropy\-window\-size\fR=\fISIZE\fR set window SIZE for local entropy analysis (SIZE >= 3); default: 3 .TP \fB\-\-entropy\-cutoff\fR=\fILOWERCUTOFF[\fR:UPPERCUTOFF] LOWERCUTOFF is the value below of which pixels are treated as black and UPPERCUTOFF is the value above of which pixels are treated as white in the entropy weighting; append "%" signs for relative values; default: 0%:100% .TP \fB\-\-save\-masks[\fR=\fISOFT\-TEMPLATE[\fR:HARD\-TEMPLATE]] save weight masks in SOFT\-TEMPLATE and HARD\-TEMPLATE; conversion chars: "%i": mask index, "%n": mask number, "%p": full path, "%d": dirname, "%b": basename, "%f": filename, "%e": extension; lowercase characters refer to input images uppercase to the output image default: "softmask\-%n.tif":"hardmask\-%n.tif" .TP \fB\-\-load\-masks[\fR=\fISOFT\-TEMPLATE[\fR:HARD\-TEMPLATE]] skip calculation of weight maps and use the ones in the files matching the templates instead. These can be either hard or soft masks. For template syntax see "\-\-save\-masks"; default: "softmask\-%n.tif":"hardmask\-%n.tif" .PP Enfuse accepts arguments to any option in uppercase as well as in lowercase letters. .SH AUTHOR Written by Andrew Mihal and others. + cleanup_output .SH "REPORTING BUGS" Report bugs at . + cleanup_output .SH COPYRIGHT Copyright \(co 2004\-2012 Andrew Mihal. License GPLv2+: GNU GPL version 2 or later .br This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for .B enfuse is maintained as a Texinfo manual. If the .B info and .B enfuse programs are properly installed at your site, the command .IP .B info enfuse .PP should give you access to the complete manual. enblend-enfuse-4.1.2+dfsg/src/enblend.10000644000175100017510000001341612224473525020054 0ustar ametzlerametzler.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.10. .TH ENBLEND "1" "October 2013" "enblend 4.1.2" "User Commands" .SH NAME enblend \- manual page for enblend 4.1.2 .SH SYNOPSIS .B enblend [\fIoptions\fR] [\fI--output=IMAGE\fR] \fIINPUT\fR... .SH DESCRIPTION Blend INPUT images into a single IMAGE. .PP INPUT... are image filenames or response filenames. Response filenames start with an "@" character. .SS "Common options:" .TP \fB\-V\fR, \fB\-\-version\fR output version information and exit .TP \fB\-a\fR pre\-assemble non\-overlapping images .TP \fB\-h\fR, \fB\-\-help\fR print this help message and exit .TP \fB\-l\fR, \fB\-\-levels\fR=\fILEVELS\fR limit number of blending LEVELS to use (1 to 29); negative number of LEVELS decreases maximum; "auto" restores the default automatic maximization .TP \fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR write output to FILE; default: "a.tif" .TP \fB\-v\fR, \fB\-\-verbose\fR[=\fILEVEL\fR] verbosely report progress; repeat to increase verbosity or directly set to LEVEL .TP \fB\-w\fR, \fB\-\-wrap\fR[=\fIMODE\fR] wrap around image boundary, where MODE is "none", "horizontal", "vertical", or "both"; default: none; without argument the option selects horizontal wrapping .TP \fB\-x\fR checkpoint partial results .TP \fB\-\-compression\fR=\fICOMPRESSION\fR set compression of output image to COMPRESSION, where COMPRESSION is: "deflate", "jpeg", "lzw", "none", "packbits", for TIFF files and 0 to 100, or "jpeg", "jpeg\-arith" for JPEG files, where "jpeg" and "jpeg\-arith" accept a compression level .TP \fB\-\-layer\-selector\fR=\fIALGORITHM\fR set the layer selector ALGORITHM; default: "all\-layers"; available algorithms are: "all\-layers": select all layers in all images; "first\-layer": select only first layer in each multi\-layer image; "largest\-layer": select largest layer in each multi\-layer image; "no\-layer": do not select any layer from any image; .TP \fB\-\-parameter\fR=\fIKEY1[=VALUE1][\fR:KEY2[=VALUE2][:...]] set one or more KEY\-VALUE pairs .SS "Extended options:" .TP \fB\-b\fR BLOCKSIZE image cache BLOCKSIZE in kilobytes; default: 2048KB .TP \fB\-c\fR, \fB\-\-ciecam\fR use CIECAM02 to blend colors; disable with "\-\-no\-ciecam" .TP \fB\-\-fallback\-profile\fR=\fIPROFILE\-FILE\fR use the ICC profile from PROFILE\-FILE instead of sRGB .TP \fB\-d\fR, \fB\-\-depth\fR=\fIDEPTH\fR set the number of bits per channel of the output image, where DEPTH is "8", "16", "32", "r32", or "r64" .TP \fB\-g\fR associated\-alpha hack for Gimp (before version 2) and Cinepaint .TP \fB\-\-gpu\fR use graphics card to accelerate seam\-line optimization .TP \fB\-f\fR WIDTHxHEIGHT[+xXOFFSET+yYOFFSET] manually set the size and position of the output image; useful for cropped and shifted input TIFF images, such as those produced by Nona .TP \fB\-m\fR CACHESIZE set image CACHESIZE in megabytes; default: 1024MB .SS "Mask generation options:" .TP \fB\-\-primary\-seam\-generator\fR=\fIALGORITHM\fR use main seam finder ALGORITHM, where ALGORITHM is "nearest\-feature\-transform" or "graph\-cut"; default: "nearest\-feature\-transform" .TP \fB\-\-image\-difference\fR=\fIALGORITHM[\fR:LUMINANCE\-WEIGHT[:CHROMINANCE\-WEIGHT]] use ALGORITHM for calculation of the difference image, where ALGORITHM is "max\-hue\-luminance" or "delta\-e"; LUMINANCE\-WEIGHT and CHROMINANCE\-WEIGHT define the weights of lightness and color; default: delta\-e:1: 1 .TP \fB\-\-coarse\-mask\fR[=\fIFACTOR\fR] shrink overlap regions by FACTOR to speedup mask generation; this is the default; if omitted FACTOR defaults to 8 .TP \fB\-\-fine\-mask\fR generate mask at full image resolution; use e.g. if overlap regions are very narrow .TP \fB\-\-smooth\-difference\fR=\fIRADIUS\fR (deprecated) smooth the difference image prior to seam\-line optimization with a Gaussian blur of RADIUS; default: 0 pixels .TP \fB\-\-optimize\fR turn on mask optimization; this is the default .TP \fB\-\-no\-optimize\fR turn off mask optimization .TP \fB\-\-optimizer\-weights\fR=\fIDISTANCE\-WEIGHT[\fR:MISMATCH\-WEIGHT] set the optimizer's weigths for distance and mismatch; default: 8:1 .TP \fB\-\-mask\-vectorize\fR=\fILENGTH\fR set LENGTH of single seam segment; append "%" for relative value; defaults: 4 for coarse masks and 20 for fine masks .TP \fB\-\-anneal\fR=\fITAU[\fR:DELTAE\-MAX[:DELTAE\-MIN[:K\-MAX]]] set annealing parameters of optimizer strategy 1; defaults: 0.75:7000:5:32 .TP \fB\-\-dijkstra\fR=\fIRADIUS\fR set search RADIUS of optimizer strategy 2; default: 25 pixels .TP \fB\-\-save\-masks\fR[=\fITEMPLATE\fR] save generated masks in TEMPLATE; default: "mask\-%n.tif"; conversion chars: "%i": mask index, "%n": mask number, "%p": full path, "%d": dirname, "%b": basename, "%f": filename, "%e": extension; lowercase characters refer to input images uppercase to the output image .TP \fB\-\-load\-masks\fR[=\fITEMPLATE\fR] use existing masks in TEMPLATE instead of generating them; same template characters as "\-\-save\-masks"; default: "mask\-%n.tif" .TP \fB\-\-visualize\fR[=\fITEMPLATE\fR] save results of optimizer in TEMPLATE; same template characters as "\-\-save\-masks"; default: "vis\-%n.tif" .PP Enblend accepts arguments to any option in uppercase as well as in lowercase letters. .SH AUTHOR Written by Andrew Mihal and others. + cleanup_output .SH "REPORTING BUGS" Report bugs at . + cleanup_output .SH COPYRIGHT Copyright \(co 2004\-2012 Andrew Mihal. License GPLv2+: GNU GPL version 2 or later .br This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH "SEE ALSO" The full documentation for .B enblend is maintained as a Texinfo manual. If the .B info and .B enblend programs are properly installed at your site, the command .IP .B info enblend .PP should give you access to the complete manual. enblend-enfuse-4.1.2+dfsg/src/gpu.h0000644000175100017510000000321012070530113017300 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __GPU_H__ #define __GPU_H__ #ifdef HAVE_CONFIG_H #include #endif #ifdef HAVE_LIBGLEW #define GLEW_STATIC 1 #include #ifdef HAVE_APPLE_OPENGL_FRAMEWORK #include #else #include #endif extern int Verbose; void checkGLErrors(const char* file, unsigned line); #define CHECK_GL() checkGLErrors(__FILE__, __LINE__) void printInfoLog(GLhandleARB obj); bool checkFramebufferStatus(); #ifdef HAVE_APPLE_OPENGL_FRAMEWORK CGLContextObj cgl_init(); #endif bool initGPU(int*, char**); bool configureGPUTextures(unsigned int k, unsigned int vars); bool gpuGDAKernel(unsigned int k, unsigned int vars, double t, float* packedEData, float* packedPiData, float* packedOutData); bool clearGPUTextures(); bool wrapupGPU(void); #endif /* HAVE_LIBGLEW */ #endif /* __GPU_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/Sig.pm0000644000175100017510000000074512070530113017426 0ustar ametzlerametzler# name: Sig.pm # synopsis: signature generation # author: Dr. Christoph L. Spiel # perl version: 5.10.0 # This file is part of Enblend. # Licence details can be found in the file COPYING. package Sig; use strict; use warnings; use DefaultSig; our @ISA = qw(DefaultSig); # See the base class, DefaultSig, for available methods and the # default definition of signature(). # sub signature { # my $self = shift; # # return "My signature ..."; # } 1; enblend-enfuse-4.1.2+dfsg/src/enblend.h0000644000175100017510000007342112070530113020127 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __ENBLEND_H__ #define __ENBLEND_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "vigra_ext/rect2d.hxx" #include "common.h" #include "openmp.h" #include "numerictraits.h" #include "fixmath.h" #include "assemble.h" #include "blend.h" #include "bounds.h" #include "mask.h" #include "pyramid.h" namespace enblend { /** Enblend's main blending loop. Templatized to handle different image types. */ template void enblendMain(const FileNameList& anInputFileNameList, const std::list& anImageInfoList, vigra::ImageExportInfo& anOutputImageInfo, vigra::Rect2D& anInputUnion) { typedef typename EnblendNumericTraits::ImagePixelComponentType ImagePixelComponentType; typedef typename EnblendNumericTraits::ImageType ImageType; typedef typename EnblendNumericTraits::AlphaPixelType AlphaPixelType; typedef typename EnblendNumericTraits::AlphaType AlphaType; typedef typename EnblendNumericTraits::MaskPixelType MaskPixelType; typedef typename EnblendNumericTraits::MaskType MaskType; typedef typename EnblendNumericTraits::ImagePyramidPixelType ImagePyramidPixelType; typedef typename EnblendNumericTraits::ImagePyramidType ImagePyramidType; typedef typename EnblendNumericTraits::MaskPyramidPixelType MaskPyramidPixelType; typedef typename EnblendNumericTraits::MaskPyramidType MaskPyramidType; enum {ImagePyramidIntegerBits = EnblendNumericTraits::ImagePyramidIntegerBits}; enum {ImagePyramidFractionBits = EnblendNumericTraits::ImagePyramidFractionBits}; enum {MaskPyramidIntegerBits = EnblendNumericTraits::MaskPyramidIntegerBits}; enum {MaskPyramidFractionBits = EnblendNumericTraits::MaskPyramidFractionBits}; typedef typename EnblendNumericTraits::SKIPSMImagePixelType SKIPSMImagePixelType; typedef typename EnblendNumericTraits::SKIPSMAlphaPixelType SKIPSMAlphaPixelType; typedef typename EnblendNumericTraits::SKIPSMMaskPixelType SKIPSMMaskPixelType; std::list imageInfoList(anImageInfoList); // Create the initial black image. vigra::Rect2D blackBB; std::pair blackPair = assemble(imageInfoList, anInputUnion, blackBB); if (Checkpoint) { checkpoint(blackPair, anOutputImageInfo); } // mem usage before = 0 // mem xsection = OneAtATime: anInputUnion*imageValueType + anInputUnion*AlphaValueType // !OneAtATime: 2*anInputUnion*imageValueType + 2*anInputUnion*AlphaValueType // mem usage after = anInputUnion*ImageValueType + anInputUnion*AlphaValueType #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after loading black image\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif const unsigned numberOfImages = imageInfoList.size(); // Main blending loop. unsigned m = 0; FileNameList::const_iterator inputFileNameIterator(anInputFileNameList.begin()); while (!imageInfoList.empty()) { // Create the white image. vigra::Rect2D whiteBB; std::pair whitePair = assemble(imageInfoList, anInputUnion, whiteBB); // mem usage before = anInputUnion*ImageValueType + anInputUnion*AlphaValueType // mem xsection = OneAtATime: anInputUnion*imageValueType + anInputUnion*AlphaValueType // !OneAtATime: 2*anInputUnion*imageValueType + 2*anInputUnion*AlphaValueType // mem usage after = 2*anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command <<": info: image cache statistics after loading white image\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: whiteImage", whitePair.first); v.printStats(std::cerr, command + ": info: whiteAlpha", whitePair.second); v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // Union bounding box of whiteImage and blackImage. vigra::Rect2D uBB = blackBB | whiteBB; if (Verbose >= VERBOSE_UBB_MESSAGES) { std::cerr << command << ": info: image union bounding box: " << uBB << std::endl; } // Intersection bounding box of whiteImage and blackImage. vigra::Rect2D iBB = blackBB & whiteBB; bool iBBValid = !iBB.isEmpty(); if (Verbose >= VERBOSE_IBB_MESSAGES) { std::cerr << command << ": info: image intersection bounding box: "; if (iBBValid) { std::cerr << iBB; } else { std::cerr << "(no intersection)"; } std::cerr << std::endl; } // Determine what kind of overlap we have. const Overlap overlap = inspectOverlap(vigra_ext::apply(uBB, srcImageRange(*(blackPair.second))), vigra_ext::apply(uBB, srcImage(*(whitePair.second)))); // If white image is redundant, skip it and go to next images. if (overlap == CompleteOverlap) { // White image is redundant. delete whitePair.first; delete whitePair.second; std::cerr << command << ": warning: some images are redundant and will not be blended" << std::endl; continue; } else if (overlap == NoOverlap && ExactLevels == 0) { // Images do not actually overlap. std::cerr << command << ": images do not overlap - they will be combined without blending\n" << command << ": use the \"-l\" flag to force blending with a certain number of levels" << std::endl; // Copy white image into black image verbatim. vigra::copyImageIf(srcImageRange(*(whitePair.first)), maskImage(*(whitePair.second)), destImage(*(blackPair.first))); vigra::copyImageIf(srcImageRange(*(whitePair.second)), maskImage(*(whitePair.second)), destImage(*(blackPair.second))); delete whitePair.first; delete whitePair.second; // Checkpoint results. if (Checkpoint) { if (Verbose >= VERBOSE_CHECKPOINTING_MESSAGES) { std::cerr << command << ": info: "; if (imageInfoList.empty()) { std::cerr << "writing final output" << std::endl; } else { std::cerr << "checkpointing" << std::endl; } } checkpoint(blackPair, anOutputImageInfo); } blackBB = uBB; continue; } // Estimate memory requirements. if (Verbose >= VERBOSE_MEMORY_ESTIMATION_MESSAGES) { long long bytes = 0; // Input images bytes += 2 * uBB.area() * sizeof(ImagePixelType); // Input alpha channels bytes += 2 * uBB.area() * sizeof(AlphaPixelType); // Mem used during mask generation: long long nftBytes = 0; if (LoadMasks) { nftBytes = 0; } else if (CoarseMask) { nftBytes = 2 * 1/8 * uBB.area() * sizeof(MaskPixelType) + 2 * 1/8 * uBB.area() * sizeof(vigra::UInt32); } else { nftBytes = 2 * uBB.area() * sizeof(MaskPixelType) + 2 * uBB.area() * sizeof(vigra::UInt32); } long long optBytes = 0; if (LoadMasks) { optBytes = 0; } else if (!OptimizeMask) { optBytes = 0; } else if (CoarseMask) { optBytes = 1/2 * iBB.area() * sizeof(vigra::UInt8); } else { optBytes = iBB.area() * sizeof(vigra::UInt8); } if (VisualizeSeam) { optBytes *= 2; } const long long bytesDuringMask = bytes + std::max(nftBytes, optBytes); const long long bytesAfterMask = bytes + uBB.area() * sizeof(MaskPixelType); bytes = std::max(bytesDuringMask, bytesAfterMask); std::cerr << command << ": info: estimated space required for mask generation: " << static_cast(ceil(bytes / 1000000.0)) << "MB" << std::endl; } // Create the blend mask. const bool wraparoundForMask = WrapAround != OpenBoundaries && uBB.width() == anInputUnion.width(); MaskType* mask = createMask(whitePair.first, blackPair.first, whitePair.second, blackPair.second, uBB, iBB, wraparoundForMask, numberOfImages, inputFileNameIterator, m); // Calculate bounding box of seam line. vigra::Rect2D mBB; maskBounds(mask, uBB, mBB); if (SaveMasks) { const std::string maskFilename = enblend::expandFilenameTemplate(SaveMaskTemplate, numberOfImages, *inputFileNameIterator, OutputFileName, m); if (maskFilename == *inputFileNameIterator) { std::cerr << command << ": will not overwrite input image \"" << *inputFileNameIterator << "\" with mask file" << std::endl; exit(1); } else if (maskFilename == OutputFileName) { std::cerr << command << ": will not overwrite output image \"" << OutputFileName << "\" with mask file" << std::endl; exit(1); } else { if (Verbose >= VERBOSE_MASK_MESSAGES) { std::cerr << command << ": info: saving mask \"" << maskFilename << "\"" << std::endl; } vigra::ImageExportInfo maskInfo(maskFilename.c_str()); maskInfo.setXResolution(ImageResolution.x); maskInfo.setYResolution(ImageResolution.y); maskInfo.setPosition(uBB.upperLeft()); maskInfo.setCompression(MASK_COMPRESSION); exportImage(srcImageRange(*mask), maskInfo); } } // mem usage here = MaskType*ubb + // 2*anInputUnion*ImageValueType + // 2*anInputUnion*AlphaValueType #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after mask generation\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: whiteImage", whitePair.first); v.printStats(std::cerr, command + ": info: whiteAlpha", whitePair.second); v.printStats(std::cerr, command + ": info: mask", mask); v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // Calculate ROI bounds and number of levels from mBB. // ROI bounds must be at least mBB but not to extend uBB. vigra::Rect2D roiBB; const unsigned int numLevels = roiBounds(anInputUnion, iBB, mBB, uBB, roiBB, wraparoundForMask); const bool wraparoundForBlend = WrapAround != OpenBoundaries && roiBB.width() == anInputUnion.width(); if (StopAfterMaskGeneration) { vigra::copyImageIf(vigra_ext::apply(uBB, srcImageRange(*(whitePair.first))), maskImage(*mask), vigra_ext::apply(uBB, destImage(*(blackPair.first)))); vigra::initImageIf(vigra_ext::apply(whiteBB, destImageRange(*(blackPair.second))), vigra_ext::apply(whiteBB, maskImage(*(whitePair.second))), vigra::NumericTraits::max()); delete whitePair.first; delete whitePair.second; blackBB = uBB; ++m; ++inputFileNameIterator; continue; } // Estimate memory requirements for this blend iteration if (Verbose >= VERBOSE_MEMORY_ESTIMATION_MESSAGES) { // Maximum utilization is when all three pyramids have been built // mem xsection = 4 * roiBB.width() * SKIPSMImagePixelType // + 4 * roiBB.width() * SKIPSMAlphaPixelType // mem usage after = anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType // + 2*(4/3)*roiBB*ImagePyramidType long long bytes = anInputUnion.area() * (sizeof(ImagePixelType) + 2 * sizeof(AlphaPixelType)) + (4/3) * roiBB.area() * (sizeof(MaskPyramidPixelType) + 2 * sizeof(ImagePyramidPixelType)) + (4 * roiBB.width()) * (sizeof(SKIPSMImagePixelType) + sizeof(SKIPSMAlphaPixelType)); std::cerr << command << ": info: estimated space required for this blend step: " << static_cast(ceil(bytes / 1000000.0)) << "MB" << std::endl; } // Create a version of roiBB relative to uBB upperleft corner. // This is to access roi within images of size uBB. // For example, the mask. vigra::Rect2D roiBB_uBB = roiBB; roiBB_uBB.moveBy(-uBB.upperLeft()); // Build Gaussian pyramid from mask. std::vector *maskGP = gaussianPyramid(numLevels, wraparoundForBlend, vigra_ext::apply(roiBB_uBB, srcImageRange(*mask))); #ifdef DEBUG_EXPORT_PYRAMID exportPyramid(maskGP, "mask"); #endif // mem usage before = MaskType*ubb + 2*anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // mem usage xsection = 3 * roiBB.width * MaskPyramidType // mem usage after = MaskType*ubb + 2*anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after calculating mask pyramid\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: whiteImage", whitePair.first); v.printStats(std::cerr, command + ": info: whiteAlpha", whitePair.second); v.printStats(std::cerr, command + ": info: mask", mask); for (unsigned int i = 0; i < maskGP->size(); i++) { v.printStats(std::cerr, command + ": info: maskGP", i, (*maskGP)[i]); } v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // Now it is safe to make changes to mask image. // Black out the ROI in the mask. // Make an roiBounds relative to uBB origin. vigra::initImage(vigra_ext::apply(roiBB_uBB, destImageRange(*mask)), vigra::NumericTraits::zero()); // Copy pixels inside whiteBB and inside white part of mask into black image. // These are pixels where the white image contributes outside of the ROI. // We cannot modify black image inside the ROI yet because we haven't built the // black pyramid. vigra::copyImageIf(vigra_ext::apply(uBB, srcImageRange(*(whitePair.first))), maskImage(*mask), vigra_ext::apply(uBB, destImage(*(blackPair.first)))); // We no longer need the mask. delete mask; // mem usage after = 2*anInputUnion*ImageValueType + // 2*anInputUnion*AlphaValueType + // (4/3)*roiBB*MaskPyramidType // Build Laplacian pyramid from white image. std::vector* whiteLP = laplacianPyramid("whiteGP", numLevels, wraparoundForBlend, vigra_ext::apply(roiBB, srcImageRange(*(whitePair.first))), vigra_ext::apply(roiBB, maskImage(*(whitePair.second)))); #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after calculating white pyramid\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: whiteImage", whitePair.first); v.printStats(std::cerr, command + ": info: whiteAlpha", whitePair.second); for (unsigned int i = 0; i < maskGP->size(); i++) { v.printStats(std::cerr, command + ": info: maskGP", i, (*maskGP)[i]); } for (unsigned int i = 0; i < whiteLP->size(); i++) { v.printStats(std::cerr, command + ": info: whiteLP", i, (*whiteLP)[i]); } v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // mem usage after = 2*anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType + (4/3)*roiBB*ImagePyramidType // mem xsection = 4 * roiBB.width() * SKIPSMImagePixelType // + 4 * roiBB.width() * SKIPSMAlphaPixelType // We no longer need the white rgb data. delete whitePair.first; // mem usage after = anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType + (4/3)*roiBB*ImagePyramidType // Build Laplacian pyramid from black image. std::vector* blackLP = laplacianPyramid("blackGP", numLevels, wraparoundForBlend, vigra_ext::apply(roiBB, srcImageRange(*(blackPair.first))), vigra_ext::apply(roiBB, maskImage(*(blackPair.second)))); #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after calculating black pyramid\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: whiteAlpha", whitePair.second); for (unsigned int i = 0; i < maskGP->size(); i++) { v.printStats(std::cerr, command + ": info: maskGP", i, (*maskGP)[i]); } for (unsigned int i = 0; i < whiteLP->size(); i++) { v.printStats(std::cerr, command + ": info: whiteLP", i, (*whiteLP)[i]); } for (unsigned int i = 0; i < blackLP->size(); i++) { v.printStats(std::cerr, command + ": info: blackLP", i, (*blackLP)[i]); } v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif #ifdef DEBUG_EXPORT_PYRAMID exportPyramid(blackLP, "enblend_black_lp"); #endif // Peak memory xsection is here! // mem xsection = 4 * roiBB.width() * SKIPSMImagePixelType // + 4 * roiBB.width() * SKIPSMAlphaPixelType // mem usage after = anInputUnion*ImageValueType + 2*anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType // + 2*(4/3)*roiBB*ImagePyramidType // Make the black image alpha equal to the union of the // white and black alpha channels. vigra::initImageIf(vigra_ext::apply(whiteBB, destImageRange(*(blackPair.second))), vigra_ext::apply(whiteBB, maskImage(*(whitePair.second))), vigra::NumericTraits::max()); // We no longer need the white alpha data. delete whitePair.second; // mem usage after = anInputUnion*ImageValueType + anInputUnion*AlphaValueType // + (4/3)*roiBB*MaskPyramidType + 2*(4/3)*roiBB*ImagePyramidType // Blend pyramids ConvertScalarToPyramidFunctor whiteMask; blend(maskGP, whiteLP, blackLP, whiteMask(vigra::NumericTraits::max())); #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after blending pyramids\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); for (unsigned int i = 0; i < maskGP->size(); i++) { v.printStats(std::cerr, command + ": info: maskGP", i, (*maskGP)[i]); } for (unsigned int i = 0; i < whiteLP->size(); i++) { v.printStats(std::cerr, command + ": info: whiteLP", i, (*whiteLP)[i]); } for (unsigned int i = 0; i < blackLP->size(); i++) { v.printStats(std::cerr, command + ": info: blackLP", i, (*blackLP)[i]); } v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // delete mask pyramid #ifdef DEBUG_EXPORT_PYRAMID exportPyramid(maskGP, "enblend_mask_gp"); #endif for (unsigned int i = 0; i < maskGP->size(); i++) { delete (*maskGP)[i]; } delete maskGP; // mem usage after = anInputUnion*ImageValueType + anInputUnion*AlphaValueType + 2*(4/3)*roiBB*ImagePyramidType // delete white pyramid #ifdef DEBUG_EXPORT_PYRAMID exportPyramid(whiteLP, "enblend_white_lp"); #endif for (unsigned int i = 0; i < whiteLP->size(); i++) { delete (*whiteLP)[i]; } delete whiteLP; // mem usage after = anInputUnion*ImageValueType + anInputUnion*AlphaValueType + (4/3)*roiBB*ImagePyramidType #ifdef DEBUG_EXPORT_PYRAMID exportPyramid(blackLP, "enblend_blend_lp"); #endif // collapse black pyramid collapsePyramid(wraparoundForBlend, blackLP); #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after collapsing black pyramid\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); for (unsigned int i = 0; i < blackLP->size(); i++) { v.printStats(std::cerr, command + ": info: blackLP", i, (*blackLP)[i]); } v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // copy collapsed black pyramid into black image ROI, using black alpha mask. copyFromPyramidImageIf(srcImageRange(*((*blackLP)[0])), vigra_ext::apply(roiBB, maskImage(*(blackPair.second))), vigra_ext::apply(roiBB, destImage(*(blackPair.first)))); // delete black pyramid for (unsigned int i = 0; i < blackLP->size(); i++) { delete (*blackLP)[i]; } delete blackLP; // mem usage after = anInputUnion*ImageValueType + anInputUnion*AlphaValueType // Checkpoint results. if (Checkpoint) { if (Verbose >= VERBOSE_CHECKPOINTING_MESSAGES) { std::cerr << command << ": info: "; if (imageInfoList.empty()) { std::cerr << "writing final output" << std::endl; } else { std::cerr << "checkpointing" << std::endl; } } checkpoint(blackPair, anOutputImageInfo); } #ifdef CACHE_IMAGES if (Verbose >= VERBOSE_CFI_MESSAGES) { vigra_ext::CachedFileImageDirector& v = vigra_ext::CachedFileImageDirector::v(); std::cerr << command << ": info: image cache statistics after checkpointing\n"; v.printStats(std::cerr, command + ": info: blackImage", blackPair.first); v.printStats(std::cerr, command + ": info: blackAlpha", blackPair.second); v.printStats(std::cerr, command + ": info: "); v.resetCacheMisses(); } #endif // Now set blackBB to uBB. blackBB = uBB; ++m; ++inputFileNameIterator; } // end main blending loop if (!StopAfterMaskGeneration && !Checkpoint) { if (Verbose >= VERBOSE_CHECKPOINTING_MESSAGES) { std::cerr << command << ": info: writing final output" << std::endl; } checkpoint(blackPair, anOutputImageInfo); } delete blackPair.first; delete blackPair.second; } } // namespace enblend #endif /* __ENBLEND_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/path.h0000644000175100017510000001705112070530113017451 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __PATH_H__ #define __PATH_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include namespace enblend { template class PathCompareFunctor { public: PathCompareFunctor(const Image* i) : image(i) {} bool operator()(const Point& a, const Point& b) const { #ifdef DEBUG_PATH_COMPARE cout << "+ PathCompareFunctor::operator(): comparing " << "a = (" << a.x << ", " << a.y << ") = " << (*image)[a] << ", b = (" << b.x << ", " << b.y << ") = " << (*image)[b] << endl; #endif // want the priority queue sorted in ascending order return (*image)[a] > (*image)[b]; } protected: const Image* image; }; template std::vector* minCostPath(CostImageIterator cost_upperleft, CostImageIterator cost_lowerright, CostAccessor ca, vigra::Point2D startingPoint, vigra::Point2D endingPoint) { typedef typename CostAccessor::value_type CostPixelType; typedef typename vigra::NumericTraits::Promote WorkingPixelType; typedef vigra::BasicImage WorkingImageType; typedef typename WorkingImageType::traverser WorkingImageIterator; typedef std::priority_queue, PathCompareFunctor > PQ; const int w = cost_lowerright.x - cost_upperleft.x; const int h = cost_lowerright.y - cost_upperleft.y; // 4-bit direction encoding {up, down, left, right} // A 8 9 // 2 0 1 // 6 4 5 //const unsigned char neighborArray[] = {0xA, 8, 9, 1, 5, 4, 6, 2}; const vigra::UInt8 neighborArray[] = {0xA, 1, 6, 8, 5, 2, 9, 4}; //const unsigned char neighborArrayInverse[] = {5, 4, 6, 2, 0xA, 8, 9, 1}; const vigra::UInt8 neighborArrayInverse[] = {5, 2, 9, 4, 0xA, 1, 6, 8}; vigra::UInt8Image* pathNextHop = new vigra::UInt8Image(w, h, vigra::UInt8(0)); WorkingImageType* costSoFar = new WorkingImageType(w, h, vigra::NumericTraits::max()); PQ* pq = new PQ(PathCompareFunctor(costSoFar)); std::vector* result = new std::vector; #ifdef DEBUG_PATH cout << "+ minCostPath: w = " << w << ", h = " << h << "\n" << "+ minCostPath: startingPoint = " << startingPoint << ", endingPoint = " << endingPoint << endl; #endif (*costSoFar)[endingPoint] = std::max(vigra::NumericTraits::one(), vigra::NumericTraits::toPromote(ca(cost_upperleft + endingPoint))); pq->push(endingPoint); while (!pq->empty()) { vigra::Point2D top = pq->top(); pq->pop(); #ifdef DEBUG_PATH cout << "+ minCostPath: visiting point = " << top << endl; #endif if (top != startingPoint) { WorkingPixelType costToTop = (*costSoFar)[top]; #ifdef DEBUG_PATH cout << "+ minCostPath: costToTop = " << costToTop << endl; #endif // For each 8-neighbor of top with costSoFar == 0 do relax for (int i = 0; i < 8; i++) { // get the negihbor; vigra::UInt8 neighborDirection = neighborArray[i]; vigra::Point2D neighborPoint = top; if (neighborDirection & 0x8) {--neighborPoint.y;} if (neighborDirection & 0x4) {++neighborPoint.y;} if (neighborDirection & 0x2) {--neighborPoint.x;} if (neighborDirection & 0x1) {++neighborPoint.x;} // Make sure neighbor is in valid region if (neighborPoint.y < 0 || neighborPoint.y >= h || neighborPoint.x < 0 || neighborPoint.x >= w) { continue; } #ifdef DEBUG_PATH cout << "+ minCostPath: neighbor = " << neighborPoint << endl; #endif // See if the neighbor has already been visited. // If neighbor has maximal cost, it has not been visited. // If so skip it. WorkingPixelType neighborPreviousCost = (*costSoFar)[neighborPoint]; #ifdef DEBUG_PATH cout << "+ minCostPath: neighborPreviousCost = " << neighborPreviousCost << endl; #endif if (neighborPreviousCost != vigra::NumericTraits::max()) { continue; } WorkingPixelType neighborCost = std::max(vigra::NumericTraits::one(), vigra::NumericTraits::toPromote(ca(cost_upperleft + neighborPoint))); #ifdef DEBUG_PATH cout << "+ minCostPath: neighborCost = " << neighborCost << endl; #endif if (neighborCost == vigra::NumericTraits::max()) { neighborCost *= 65536; // Can't use << since neighborCost may be floating-point } if ((i & 1) == 0) { // neighbor is diagonal neighborCost = WorkingPixelType(static_cast(neighborCost) * 1.4); } const WorkingPixelType newNeighborCost = neighborCost + costToTop; if (newNeighborCost < neighborPreviousCost) { // We have found the shortest path to neighbor. (*costSoFar)[neighborPoint] = newNeighborCost; (*pathNextHop)[neighborPoint] = neighborArrayInverse[i]; pq->push(neighborPoint); } } } else { // If yes then follow back to beginning using pathNextHop // include neither start nor end point in result vigra::UInt8 nextHop = (*pathNextHop)[top]; while (nextHop != 0) { if (nextHop & 0x8) {--top.y;} if (nextHop & 0x4) {++top.y;} if (nextHop & 0x2) {--top.x;} if (nextHop & 0x1) {++top.x;} nextHop = (*pathNextHop)[top]; if (nextHop != 0) { result->push_back(top); } } break; } } delete pathNextHop; delete costSoFar; delete pq; return result; } template inline std::vector* minCostPath(vigra::triple cost, vigra::Point2D startingPoint, vigra::Point2D endingPoint) { return minCostPath(cost.first, cost.second, cost.third, startingPoint, endingPoint); } } // namespace enblend #endif /* __PATH_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/graphcut.h0000644000175100017510000016437412070530501020346 0ustar ametzlerametzler/* * Copyright (C) 2011-2012 Mikolaj Leszczynski * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef GRAPHCUT_H #define GRAPHCUT_H #include #ifdef _WIN32 #include #else #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "vigra_ext/rect2d.hxx" #include "vigra_ext/stdcachedfileimage.hxx" #include "common.h" #include "maskcommon.h" #include "masktypedefs.h" #include "nearest.h" using namespace vigra::functor; #define BIT_MASK_DIR 0x03 #define BIT_MASK_OPDIR 0x02 #define BIT_MASK_OPEN 0x04 #define BIT_MASK_DIVIDE 0x0F namespace enblend { struct pointHash { std::size_t operator()(const vigra::Point2D& p) const { std::size_t seed = 0; boost::hash_combine(seed, p.x); boost::hash_combine(seed, p.y); return seed; } }; class CheckpointPixels { public: CheckpointPixels() {} boost::unordered_set top, bottom; ~CheckpointPixels() { this->clear(); } void clear() { top.clear(); bottom.clear(); } }; int distab(const vigra::Point2D& a, const vigra::Point2D& b) { return std::abs((a.x - b.x)) + std::abs((a.y - b.y)); } template std::vector* findIntermediatePoints(MaskImageIterator mask1_upperleft, MaskImageIterator mask1_lowerright, MaskAccessor ma1, MaskImageIterator mask2_upperleft, MaskAccessor ma2, DestImageIterator dest_upperleft, DestAccessor da, nearest_neighbor_metric_t& norm, boundary_t& boundary, const vigra::Rect2D& iBB) { typedef vigra::NumericTraits MaskPixelTraits; typedef typename IMAGETYPE::traverser IteratorType; typedef vigra::CrackContourCirculator Circulator; typedef vigra::triple EntryPointContainer; IMAGETYPE nftTempImg(mask1_lowerright - mask1_upperleft + vigra::Diff2D(2, 2), MaskPixelTraits::max() / 2); IMAGETYPE nft(iBB.lowerRight() - iBB.upperLeft() + vigra::Diff2D(2, 2), MaskPixelTraits::max() / 2); IMAGETYPE overlap(iBB.lowerRight() - iBB.upperLeft() + vigra::Diff2D(2, 2)); IteratorType nftIter = nft.upperLeft(); IteratorType previous; Circulator* circ; Circulator* end; bool offTheBorder = false; bool inOverlap = false; bool ready = false; std::vector* interPointList = new std::vector(); std::vector entryPointList; EntryPointContainer* max = NULL; std::pair entryPoint; vigra::Point2D intermediatePoint; unsigned int counter = 0; nearestFeatureTransform(vigra::srcIterRange(mask1_upperleft, mask1_lowerright, ma1), vigra::srcIter(mask2_upperleft, ma2), vigra::destIter(nftTempImg.upperLeft() + vigra::Diff2D(1, 1)), norm, boundary); copyImage(vigra::srcIterRange(nftTempImg.upperLeft() + vigra::Diff2D(1, 1), nftTempImg.lowerRight() - vigra::Diff2D(1, 1)), vigra::destIter(dest_upperleft, da)); copyImage(vigra_ext::apply(iBB, vigra::srcIterRange(nftTempImg.upperLeft() + vigra::Diff2D(1, 1), nftTempImg.lowerRight() - vigra::Diff2D(1, 1))), vigra::destIter(nft.upperLeft() + vigra::Diff2D(1, 1))); combineTwoImagesMP(vigra_ext::apply(iBB, vigra::srcIterRange(mask1_upperleft, mask1_lowerright, ma1)), vigra_ext::apply(iBB, vigra::srcIter(mask2_upperleft, ma2)), vigra::destIter(overlap.upperLeft() + vigra::Diff2D(1, 1)), ifThenElse(Arg1() && Arg2(), Param(MaskPixelTraits::max()), Param(MaskPixelTraits::zero()))); #ifdef DEBUG_GRAPHCUT exportImage(srcImageRange(nftTempImg), ImageExportInfo("./debug/nft-orig.tif").setPixelType("UINT8")); exportImage(srcImageRange(nft), ImageExportInfo("./debug/nfttotal.tif").setPixelType("UINT8")); exportImage(srcImageRange(overlap), ImageExportInfo("./debug/overlap.tif").setPixelType("UINT8")); #endif circ = new Circulator(nftIter + vigra::Diff2D(1, 0), vigra::FourNeighborCode::South); end = new Circulator(nftIter + vigra::Diff2D(1, 0), vigra::FourNeighborCode::South); previous = circ->outerPixel(); do { (*circ)++; if (nft.accessor()(previous) != nft.accessor()(circ->outerPixel())) { if (ready) { entryPointList.push_back(EntryPointContainer(entryPoint.first, entryPoint.second, counter)); entryPoint.first = previous; entryPoint.second = circ->outerPixel(); } else { ready = true; entryPoint = std::pair(previous, circ->outerPixel()); } counter = 0; } ++counter; previous = circ->outerPixel(); } while (*circ != *end); if (entryPointList.empty()) { return interPointList; } for (typename std::vector::iterator i = entryPointList.begin(); i != entryPointList.end(); ++i) { if (max == NULL) { max = &(*i); continue; } if (i->third > max->third) { max = &(*i); } } if (max != NULL) { delete circ; delete end; vigra::Diff2D dir = max->second - max->first; if (dir.x != 0) { if (max->second.x < max->first.x) { max->second = max->first; } circ = new Circulator(max->second, vigra::FourNeighborCode::West); end = new Circulator(max->second, vigra::FourNeighborCode::West); } else if (dir.y != 0) { if (max->second.y < max->first.y) { max->second = max->first; } circ = new Circulator(max->second, vigra::FourNeighborCode::North); end = new Circulator(max->second, vigra::FourNeighborCode::North); } } else { return interPointList; } while (circ != end) { (*circ)++; intermediatePoint = circ->outerPixel() - nft.upperLeft(); if (!offTheBorder && !(nft.accessor()(circ->outerPixel()) == MaskPixelTraits::max() / 2)) { offTheBorder = true; const vigra::Point2D dualGraphPoint = vigra::Point2D(intermediatePoint * 2 - vigra::Diff2D(1, 1)); if (intermediatePoint.x >= 0 && intermediatePoint.y >= 0 && intermediatePoint.x < iBB.lowerRight().x && intermediatePoint.y < iBB.lowerRight().y) { interPointList->push_back(dualGraphPoint); } #ifdef DEBUG_GRAPHCUT std::cout << "Start point: " << dualGraphPoint << std::endl; #endif } if (offTheBorder) { if (!inOverlap && overlap[intermediatePoint] == MaskPixelTraits::max()) { inOverlap = true; const vigra::Point2D dualGraphPoint = vigra::Point2D(intermediatePoint * 2 - vigra::Diff2D(1, 1)); if (!interPointList->empty() && *(interPointList->begin()) != dualGraphPoint && intermediatePoint.x >= 0 && intermediatePoint.y >= 0) { interPointList->push_back(dualGraphPoint); } #ifdef DEBUG_GRAPHCUT std::cout << "Entering overlap: " << dualGraphPoint << std::endl; #endif } if (inOverlap && overlap[intermediatePoint] == MaskPixelTraits::zero() && nft.accessor()(circ->outerPixel()) != MaskPixelTraits::max() / 2) { inOverlap = false; const vigra::Point2D dualGraphPoint = vigra::Point2D(intermediatePoint * 2 - vigra::Diff2D(1, 1)); if (intermediatePoint.x >= 0 && intermediatePoint.y >= 0) { interPointList->push_back(dualGraphPoint); } #ifdef DEBUG_GRAPHCUT std::cout << "Leaving overlap: " << dualGraphPoint << std::endl; #endif } if (nft.accessor()(circ->outerPixel()) == MaskPixelTraits::max() / 2) { const vigra::Point2D dualGraphPoint = vigra::Point2D((previous - nft.upperLeft()) * 2 - vigra::Diff2D(1, 1)); if (!interPointList->empty() && *(interPointList->rbegin()) != dualGraphPoint && intermediatePoint.x >= 0 && intermediatePoint.y >= 0) { interPointList->push_back(dualGraphPoint); } #ifdef DEBUG_GRAPHCUT std::cout << "Endpoint reached: " << dualGraphPoint << std::endl; #endif break; } } previous = circ->outerPixel(); } delete circ; delete end; return interPointList; } template class CostComparer { public: CostComparer(const ImageType* image) : img(image) {} bool operator()(const vigra::Point2D& a, const vigra::Point2D& b) const { if (a == vigra::Point2D(-20, -20)) { return totalScore > (*img)[b]; } else if (b == vigra::Point2D(-20, -20)) { return (*img)[a] > totalScore; } return (*img)[a] > (*img)[b]; } void setTotalScore(long s) { totalScore = s; } protected: const ImageType* img; long totalScore; }; struct OutputLabelingFunctor { public: OutputLabelingFunctor(boost::unordered_set* a_, boost::unordered_set* b_, vigra::Point2D offset_) : left(a_), right(b_), offset(offset_) {} bool operator()(vigra::Diff2D a2, vigra::Diff2D b2) { vigra::Point2D a(a2); vigra::Point2D b(b2); //add border to detect seams close to border a -= vigra::Point2D(1,1); b -= vigra::Point2D(1,1); //a-= offset; b-= offset; return !((left->find(a) != left->end() && right->find(b) != right->end()) || (right->find(a) != right->end() && left->find(b) != left->end())); } protected: boost::unordered_set* left; boost::unordered_set* right; vigra::Point2D offset; }; template struct CutPixelsFunctor { public: CutPixelsFunctor(boost::unordered_set* a_, boost::unordered_set* b_) : left(a_), right(b_){} MaskPixelType operator()(const vigra::Diff2D& pos2, const MaskPixelType& a2) const { vigra::Point2D pos(pos2); if(left->find(pos) != left->end() && right->find(pos) != right->end()) return 164; else if (left->find(*pos) != left->end()) return 64; else if (right->find(*pos) != right->end()) return 255; else return 0; } protected: boost::unordered_set* left; boost::unordered_set* right; }; template struct CountFunctor { public: CountFunctor(int* c, int* c2) : color(c), count(c2) {} MaskPixelType operator()(const MaskPixelType& arg1, const MaskPixelType& arg2) const { if (arg1 > 0 && arg1 == arg2) { (*color)++; } if (arg1 == 255) { (*count)++; } return arg1; } int* color; int* count; }; template inline void graphCut(vigra::triple src1, vigra::pair src2, vigra::pair dest, vigra::triple mask1, vigra::pair mask2, nearest_neighbor_metric_t norm, boundary_t boundary, const vigra::Rect2D& iBB) { graphCut(src1.first, src1.second, src1.third, src2.first, src2.second, dest.first, dest.second, mask1.first, mask1.second, mask1.third, mask2.first, mask2.second, norm, boundary, iBB); } void getNeighbourList(vigra::Point2D src, vigra::Point2D* list, vigra::Diff2D bounds, CheckpointPixels* srcDestPoints) { // return neighbour points from top to left in clockwise order bool check = false; if (src.y == 1) { list[0] = vigra::Point2D(-1, -1); check = true; } else { list[0] = src(0, -2); } if (src.x == bounds.x - 1) { list[1] = vigra::Point2D(-1, -1); check = true; } else { list[1] = src(2, 0); } if (src.y == bounds.y - 1) { list[2] = vigra::Point2D(-1, -1); check = true; } else { list[2] = src(0, 2); } if (src.x == 1) { list[3] = vigra::Point2D(-1, -1); check = true; } else { list[3] = src(-2, 0); } if (srcDestPoints->bottom.find(src) != srcDestPoints->bottom.end()) { list[0] = vigra::Point2D(-20, -20); list[1] = vigra::Point2D(-20, -20); list[2] = vigra::Point2D(-20, -20); list[3] = vigra::Point2D(-20, -20); } if (check) { if (srcDestPoints->bottom.find(src) != srcDestPoints->bottom.end() || srcDestPoints->bottom.find(src(1, 0)) != srcDestPoints->bottom.end() || srcDestPoints->bottom.find(src(1, 1)) != srcDestPoints->bottom.end() || srcDestPoints->bottom.find(src(0, 1)) != srcDestPoints->bottom.end()) { if (list[1] == vigra::Point2D(-1, -1)) { list[1] = vigra::Point2D(-20, -20); } else if (list[2] == vigra::Point2D(-1, -1)) { list[2] = vigra::Point2D(-20, -20); } else if (list[3] == vigra::Point2D(-1, -1)) { list[3] = vigra::Point2D(-20, -20); } } } } void getNeighbourList(CheckpointPixels* srcDestPoints, boost::unordered_set::iterator* auxList1, boost::unordered_set::iterator* auxList2) { *auxList1 = srcDestPoints->top.begin(); *auxList2 = srcDestPoints->top.end(); } template std::vector* tracePath(vigra::Point2D pt, ImageType* img, CheckpointPixels* srcDestPoints) { std::vector* vec = new std::vector; vigra::Point2D current = pt; vec->push_back(pt); do { switch ((*img)[current(1, 1)] & BIT_MASK_DIR) { case 0: vec->push_back(current(0, -2)); break; case 1: vec->push_back(current(2, 0)); break; case 2: vec->push_back(current(0, 2)); break; case 3: vec->push_back(current(-2, 0)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path tracing error" << std::endl; #endif break; } current = vec->back(); } while (srcDestPoints->top.find(current) == srcDestPoints->top.end()); return vec; } template unsigned int getEdgeWeight(int dir, vigra::Point2D pt, ImageType* img, bool endpt, vigra::Diff2D bounds) { if (!endpt) { switch (dir) { case 0: return (*img)[pt(1, 0)]; break; case 1: return (*img)[pt(2, 1)]; break; case 2: return (*img)[pt(1, 2)]; break; case 3: return (*img)[pt(0, 1)]; break; } } else { if (pt.y == 1) { return (*img)[pt(1, 0)]; } else if (pt.x == bounds.x - 2) { return (*img)[pt(2, 1)]; } else if (pt.y == bounds.y - 2) { return (*img)[pt(1, 2)]; } else if (pt.x == 1) { return (*img)[pt(0, 1)]; } } return 0; } template std::vector* A_star(vigra::Point2D srcpt, vigra::Point2D destpt, ImageType* img, GradientImageType* gradientX, GradientImageType* gradientY, vigra::Diff2D bounds, CheckpointPixels* srcDestPoints, boost::unordered_set* visited) { MaskPixelType zeroVal = vigra::NumericTraits::zero(); typedef std::priority_queue, CostComparer > Queue; CostComparer costcomp(img); Queue* openset = new Queue(costcomp); long score = 0; long totalScore = 0; long iterCount = 0; int gradientA; int gradientB; bool scoreIsBetter; bool pushToList; bool destOpen = false; vigra::Point2D list[4]; vigra::Point2D current; vigra::Point2D neighbour; vigra::Point2D destNeighbour; boost::unordered_set::iterator auxListBegin; boost::unordered_set::iterator auxListEnd; openset->push(srcpt); while (!openset->empty()) { current = openset->top(); openset->pop(); iterCount++; if (current == destpt) { #ifdef DEBUG_GRAPHCUT std::cout << "Graphcut completed after visiting " << iterCount << " nodes" << std::endl; #endif delete openset; return tracePath(destNeighbour, img, srcDestPoints); } if (current == vigra::Point2D(-10, -10)) { getNeighbourList(srcDestPoints, &auxListBegin, &auxListEnd); } else { getNeighbourList(current, list, bounds, srcDestPoints); } if (current != vigra::Point2D(-10, -10)) { for (int i = 0; i < 4; i++) { score = 0; scoreIsBetter = false; pushToList = false; neighbour = list[i]; //visited during an earlier sub-cut, ignore if(visited->find(neighbour) != visited->end()) { continue; } if (neighbour == vigra::Point2D(-20, -20) || (neighbour != vigra::Point2D(-1, -1) && neighbour != vigra::Point2D(-10, -10) && (*img)[neighbour(1, 1)] == zeroVal)) { if (neighbour == vigra::Point2D(-20, -20)) { score = (*img)[current] + getEdgeWeight(i, current, img, true, bounds); } else { if (i % 2 == 0) { gradientA = std::abs((*gradientY)[(current) / 2]); gradientB = std::abs((*gradientY)[(neighbour) / 2]); } else { gradientA = std::abs((*gradientX)[(current) / 2]); gradientB = std::abs((*gradientX)[(neighbour) / 2]); } if (gradientA + gradientB > 0) { score = (*img)[current] + getEdgeWeight(i, current, img, false, bounds) * (gradientA + gradientB); } else { score = (*img)[current] + getEdgeWeight(i, current, img, false, bounds); } } if (neighbour == vigra::Point2D(-20, -20) && !destOpen) { pushToList = true; destOpen = true; scoreIsBetter = true; } else if (neighbour != vigra::Point2D(-20, -20) && ((*img)[neighbour(1, 1)] & BIT_MASK_OPEN) == 0) { pushToList = true; (*img)[neighbour(1, 1)] += BIT_MASK_OPEN; scoreIsBetter = true; } else if ((neighbour == vigra::Point2D(-20, -20) && score < totalScore) || (neighbour != vigra::Point2D(-20, -20) && score < (*img)[neighbour])) { scoreIsBetter = true; } if (scoreIsBetter) { if (neighbour == vigra::Point2D(-20, -20)) { totalScore = score; destNeighbour = current; costcomp.setTotalScore(totalScore); } else { (*img)[neighbour(1, 1)] &= BIT_MASK_OPEN; (*img)[neighbour(1, 1)] += i; (*img)[neighbour(1, 1)] ^= BIT_MASK_OPDIR; (*img)[neighbour] = score; } if (pushToList) { openset->push(neighbour); } } } } } else { for (boost::unordered_set::iterator x = auxListBegin; x != auxListEnd; ++x) { score = 0; scoreIsBetter = false; pushToList = false; neighbour = *x; if (neighbour != vigra::Point2D(-1, -1) && (*img)[neighbour(1, 1)] == zeroVal) { score = 0; if (((*img)[neighbour(1, 1)] & BIT_MASK_OPEN) == 0) { pushToList = true; (*img)[neighbour(1, 1)] += BIT_MASK_OPEN; scoreIsBetter = true; } else if (score < (*img)[neighbour]) { scoreIsBetter = true; } if (scoreIsBetter) { (*img)[neighbour(1, 1)] &= BIT_MASK_OPEN; (*img)[neighbour] = score; if (pushToList) { openset->push(neighbour); } } } } } } #ifdef DEBUG_GRAPHCUT std::cout << "Graphcut failed after visiting " << iterCount << " nodes" << std::endl; #endif delete openset; return new std::vector(); } vigra::Point2D convertFromDual(const vigra::Point2D& dualPixel) { const int stride = 2; return (vigra::Point2D((dualPixel->x - 1) / stride, (dualPixel->y - 1) / stride)); } void dividePath(std::vector* cut, boost::unordered_set* left, boost::unordered_set* right, const vigra::Rect2D& iBB) { vigra::Point2D previous; vigra::Point2D current; vigra::Point2D next; vigra::Point2D endIterPoint; unsigned short closest = 0; vigra::Diff2D dim(iBB.lowerRight() - iBB.upperLeft()); std::vector::iterator previousDual; std::vector::iterator nextDual; for (std::vector::iterator currentDual = cut->begin(), nextDual = cut->begin(); currentDual != cut->end(); ++currentDual) { current = convertFromDual(*currentDual); next = convertFromDual(*nextDual); if (currentDual == cut->begin()) { ++nextDual; next = convertFromDual(*nextDual); // find closest edge int dist; const vigra::Diff2D toLowerRight = dim - current; closest = 0; dist = current.y; if (toLowerRight.x < dist) { closest = 1; dist = toLowerRight.x; } if (toLowerRight.y < dist) { closest = 2; dist = toLowerRight.y; } if (current.x < dist) { closest = 3; } switch (closest) { case 0: right->insert(current(0, 0)); left->insert(current(1, 0)); break; case 1: left->insert(current(1, 1)); right->insert(current(1, 0)); break; case 2: left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 3: right->insert(current(0, 1)); left->insert(current(0, 0)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } int previousDir; if (next.x == current.x) { if (next.y < current.y) { previousDir = 0; } else { previousDir = 2; } } else { if (next.x > current.x) { previousDir = 1; } else { previousDir = 3; } } switch (closest) { case 0: switch (previousDir) { case 2: right->insert(current(0, 1)); left->insert(current(1, 1)); break; case 1: right->insert(current(0, 1)); right->insert(current(1, 1)); break; case 3: left->insert(current(0, 1)); left->insert(current(1, 1)); break; case 0: left->insert(current(0, 0)); right->insert(current(1, 0)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } break; case 1: switch (previousDir) { case 0: left->insert(current(0, 0)); left->insert(current(0, 1)); break; case 2: right->insert(current(0, 0)); right->insert(current(0, 1)); break; case 3: right->insert(current(0, 0)); left->insert(current(0, 1)); break; case 1: right->insert(current(1, 1)); left->insert(current(1, 0)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } break; case 2: switch (previousDir) { case 0: left->insert(current); right->insert(current(1, 0)); break; case 1: left->insert(current); left->insert(current(1, 0)); break; case 3: right->insert(current); right->insert(current(1, 0)); break; case 2: left->insert(current(1, 1)); right->insert(current(0, 1)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } break; case 3: switch (previousDir) { case 2: left->insert(current(1, 0)); left->insert(current(1, 1)); break; case 0: right->insert(current(1, 0)); right->insert(current(1, 1)); break; case 1: right->insert(current(1, 1)); left->insert(current(1, 0)); break; case 3: right->insert(current(0, 0)); left->insert(current(0, 1)); break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } break; } switch (closest) { case 0: endIterPoint = current; while (endIterPoint.y + iBB.upperLeft().y > -2) { endIterPoint.y--; left->insert(endIterPoint(1, 0)); right->insert(endIterPoint); } break; case 1: endIterPoint = current; while (endIterPoint.x < iBB.lowerRight().x + 2) { endIterPoint.x++; left->insert(endIterPoint(0, 1)); right->insert(endIterPoint); } break; case 2: endIterPoint = current; while (endIterPoint.y < iBB.lowerRight().y + 2) { endIterPoint.y++; left->insert(endIterPoint); right->insert(endIterPoint(1, 0)); } break; case 3: endIterPoint = current; while (endIterPoint.x > -2) { endIterPoint.x--; left->insert(endIterPoint); right->insert(endIterPoint(0, 1)); } break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } } else { int previousDir; int currentDir; if (previous.x == current.x) { if (previous.y > current.y) { previousDir = 0; } else { previousDir = 2; } } else { if (previous.x < current.x) { previousDir = 1; } else { previousDir = 3; } } previousDir = previousDir << 2; if (nextDual == cut->end()) { int dist; const vigra::Diff2D toLowerRight = dim - current; closest = 0; dist = current.y; if (toLowerRight.x < dist) { closest = 1; dist = toLowerRight.x; } if (toLowerRight.y < dist) { closest = 2; dist = toLowerRight.y; } if (current.x < dist) { closest = 3; } currentDir = closest; } else if (next.x == current.x) { if (next.y < current.y) { currentDir = 0; } else { currentDir = 2; } } else { if (next.x > current.x) { currentDir = 1; } else { currentDir = 3; } } switch (previousDir + currentDir) { case 0: // top -> top left->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 1: // top -> right left->insert(current); left->insert(current(1, 0)); left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 3: // top -> left right->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 4: // right->top left->insert(current); right->insert(current(1, 0)); right->insert(current(0, 1)); right->insert(current(1, 1)); break; case 5: // right->right left->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); right->insert(current(1, 1)); break; case 6: // right->bottom left->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); left->insert(current(1, 1)); break; case 9: // bottom->right right->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); right->insert(current(1, 1)); break; case 10: // bottom->bottom right->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); left->insert(current(1, 1)); break; case 11: // bottom->left right->insert(current); left->insert(current(1, 0)); left->insert(current(0, 1)); left->insert(current(1, 1)); break; case 12: // left->top left->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); left->insert(current(1, 1)); break; case 14: // left->bottom right->insert(current); right->insert(current(1, 0)); right->insert(current(0, 1)); left->insert(current(1, 1)); break; case 15: // left->left right->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); left->insert(current(1, 1)); break; case 2: // top -> bottom case 7: // right->left case 8: // bottom->top case 13: // left->right default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error: two-point loop" << std::endl; std::cout << current << std::endl; #endif break; } if (*currentDual == cut->back()) { switch (closest) { case 2: endIterPoint = current; switch (currentDir) { case 1: left->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); left->insert(current(1, 1)); break; case 3: right->insert(current); right->insert(current(1, 0)); right->insert(current(0, 1)); left->insert(current(1, 1)); break; } while (endIterPoint.y < iBB.lowerRight().y + 2) { endIterPoint.y++; left->insert(endIterPoint(1, 0)); right->insert(endIterPoint); } break; case 3: endIterPoint = current; switch (currentDir) { case 0: right->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 2: right->insert(current); left->insert(current(1, 0)); left->insert(current(0, 1)); left->insert(current(1, 1)); break; } while (endIterPoint.x > -2) { endIterPoint.x--; left->insert(endIterPoint(0, 1)); right->insert(endIterPoint); } break; case 0: endIterPoint = current; switch (currentDir) { case 1: left->insert(current); right->insert(current(1, 0)); right->insert(current(0, 1)); right->insert(current(1, 1)); break; case 3: left->insert(current); right->insert(current(1, 0)); left->insert(current(0, 1)); left->insert(current(1, 1)); break; } while (endIterPoint.y + iBB.upperLeft().y > -2) { endIterPoint.y--; left->insert(endIterPoint); right->insert(endIterPoint(1, 0)); } break; case 1: endIterPoint = current; switch (currentDir) { case 0: left->insert(current); left->insert(current(1, 0)); left->insert(current(0, 1)); right->insert(current(1, 1)); break; case 2: right->insert(current); left->insert(current(1, 0)); right->insert(current(0, 1)); right->insert(current(1, 1)); break; } while (endIterPoint.x < iBB.lowerRight().x + 2) { endIterPoint.x++; left->insert(endIterPoint); right->insert(endIterPoint(0, 1)); } break; default: #ifdef DEBUG_GRAPHCUT std::cout << "path dividing error" << std::endl; #endif break; } } } if (nextDual != cut->end()) { ++nextDual; } previous = current; previousDual = currentDual; } } template void processCutResults(MaskImageIterator mask1_upperleft, MaskImageIterator mask1_lowerright, MaskAccessor ma1, MaskImageIterator mask2_upperleft, MaskAccessor ma2, DestImageIterator dest_upperleft, DestAccessor da, std::vector& totalDualPath, const vigra::Rect2D& iBB) { const vigra::Diff2D size(iBB.lowerRight().x - iBB.upperLeft().x, iBB.lowerRight().y - iBB.upperLeft().y); IMAGETYPE finalmask(size + vigra::Diff2D(2, 2)); IMAGETYPE tempImg(size); typedef vigra::UInt8 BasePixelType; typedef vigra::NumericTraits BasePixelTraits; typedef vigra::NumericTraits MaskPixelTraits; boost::unordered_set pixelsLeftOfCut; boost::unordered_set pixelsRightOfCut; dividePath(&totalDualPath, &pixelsLeftOfCut, &pixelsRightOfCut, iBB); #ifdef DEBUG_GRAPHCUT combineTwoImagesMP(srcIterRange(Diff2D(), size), vigra::srcIter(finalmask.upperLeft() + Diff2D(1, 1)), vigra::destIter(tempImg.upperLeft()), CutPixelsFunctor(&pixelsLeftOfCut, &pixelsRightOfCut)); exportImage(srcImageRange(tempImg), ImageExportInfo("./debug/cut_pixels.tif").setPixelType("UINT8")); #endif // labels areas that belong to left/right images // adds a 1-pixel border to catch any area that is cut off by the seam vigra::labelImage(vigra::srcIterRange(vigra::Diff2D(), vigra::Diff2D() + size + vigra::Diff2D(2, 2)), destImage(finalmask), false, OutputLabelingFunctor(&pixelsLeftOfCut, &pixelsRightOfCut, iBB.upperLeft())); #ifdef DEBUG_GRAPHCUT exportImage(srcImageRange(finalmask), ImageExportInfo("./debug/labels.tif").setPixelType("UINT8")); #endif int colorSum = 0; int count = 0; CountFunctor c(&colorSum, &count); transformImage(vigra::srcIterRange(finalmask.upperLeft() + vigra::Diff2D(1, 1), finalmask.lowerRight() - vigra::Diff2D(1, 1)), vigra::destIter(finalmask.upperLeft() + vigra::Diff2D(1, 1)), ifThenElse(Arg1() == Param(1), Param(BasePixelTraits::max()), Param(BasePixelTraits::zero()))); inspectTwoImages(vigra::srcIterRange(finalmask.upperLeft() + vigra::Diff2D(1, 1), finalmask.lowerRight() - vigra::Diff2D(1, 1)), vigra::srcIter(dest_upperleft + iBB.upperLeft(), da), c); #ifdef DEBUG_GRAPHCUT exportImage(srcImageRange(finalmask), ImageExportInfo("./debug/labels1.tif").setPixelType("UINT8")); #endif // if colorSum < half the pixels labeled as "1" in finalmask should be black if (colorSum < count / 2) { transformImage(vigra::srcIterRange(finalmask.upperLeft() + vigra::Diff2D(1, 1), finalmask.lowerRight() - vigra::Diff2D(1, 1)), vigra::destIter(finalmask.upperLeft() + vigra::Diff2D(1, 1)), ifThenElse(Arg1() == Param(0), Param(BasePixelTraits::max()), Param(BasePixelTraits::zero()))); } else { transformImage(vigra::srcIterRange(finalmask.upperLeft() + vigra::Diff2D(1, 1), finalmask.lowerRight() - vigra::Diff2D(1, 1)), vigra::destIter(finalmask.upperLeft() + vigra::Diff2D(1, 1)), ifThenElse(Arg1() == Param(0), Param(BasePixelTraits::zero()), Param(BasePixelTraits::max()))); } #ifdef DEBUG_GRAPHCUT exportImage(srcImageRange(finalmask), ImageExportInfo("./debug/labels2.tif").setPixelType("UINT8")); #endif combineTwoImagesMP(vigra_ext::apply(iBB, vigra::srcIterRange(mask1_upperleft, mask1_lowerright, ma1)), vigra_ext::apply(iBB, vigra::srcIter(mask2_upperleft, ma2)), destImage(tempImg), ifThenElse(Arg1() && Arg2(), Param(MaskPixelTraits::max()), Param(MaskPixelTraits::zero()))); copyImageIf(vigra::srcIterRange(finalmask.upperLeft() + vigra::Diff2D(1, 1), finalmask.lowerRight() - vigra::Diff2D(1, 1)), srcImage(tempImg), vigra::destIter(dest_upperleft + iBB.upperLeft(), da)); } /* Graph-cut * implementation of an algorithm based on an article by: * V.Kwatra, A.Schoedl, I.Essa, G.Turk, A.Bobick * "Graphcut Textures: Image and Video Synthesis Using Graph Cuts" * * The algorithm finds the best seam between two images using a graph-based approach. * * Min-cost pathfinding is based on using the initial image graph's dual graph */ template void graphCut(SrcImageIterator src1_upperleft, SrcImageIterator src1_lowerright, SrcAccessor sa1, SrcImageIterator src2_upperleft, SrcAccessor sa2, DestImageIterator dest_upperleft, DestAccessor da, MaskImageIterator mask1_upperleft, MaskImageIterator mask1_lowerright, MaskAccessor ma1, MaskImageIterator mask2_upperleft, MaskAccessor ma2, nearest_neighbor_metric_t norm, boundary_t boundary, const vigra::Rect2D& iBB) { typedef typename SrcAccessor::value_type SrcPixelType; typedef typename MaskAccessor::value_type MaskPixelType; typedef vigra::UInt8 BasePixelType; typedef float GradientPixelType; typedef vigra::NumericTraits BasePixelTraits; typedef vigra::NumericTraits GradientPixelTraits; typedef typename BasePixelTraits::Promote BasePromotePixelType; typedef vigra::NumericTraits BasePromotePixelTraits; typedef typename BasePromotePixelTraits::Promote GraphPixelType; const vigra::Diff2D size(src1_lowerright.x - src1_upperleft.x, src1_lowerright.y - src1_upperleft.y); #ifdef DEBUG_GRAPHCUT const vigra::Diff2D masksize(mask1_lowerright.x - mask1_upperleft.x, mask1_lowerright.y - mask1_upperleft.y); #endif IMAGETYPE intermediateImg(size); IMAGETYPE intermediateGraphImg(size + size + vigra::Diff2D(1, 1)); IMAGETYPE gradientPreConvolve(size); IMAGETYPE gradientX(size); IMAGETYPE gradientY(size); IMAGETYPE graphImg(size + size + vigra::Diff2D(1, 1)); std::vector* dualPath = NULL; std::vector totalDualPath; vigra::Point2D intermediatePoint; boost::scoped_ptr srcDestPoints(new CheckpointPixels()); const vigra::Diff2D graphsize(graphImg.lowerRight().x - graphImg.upperLeft().x, graphImg.lowerRight().y - graphImg.upperLeft().y); const vigra::Rect2D gBB(vigra::Point2D(1, 1), vigra::Size2D(graphsize)); vigra::Kernel2D edgeWeightKernel; edgeWeightKernel.initExplicitly(vigra::Diff2D(-1, -1), vigra::Diff2D(1, 1)) = // upper left and lower right 0, 1, 0, 1, 1, 1, 0, 1, 0; edgeWeightKernel.setBorderTreatment(vigra::BORDER_TREATMENT_CLIP); vigra::Kernel1D gradientKernel; gradientKernel.initSymmetricGradient(); // gradient images calculation transformImage(src1_upperleft, src1_lowerright, sa1, gradientPreConvolve.upperLeft(), gradientPreConvolve.accessor(), MapFunctor()); transformImage(src2_upperleft, src2_upperleft + size, sa2, intermediateImg.upperLeft(), intermediateImg.accessor(), MapFunctor()); combineTwoImagesMP(srcImageRange(gradientPreConvolve), srcImage(intermediateImg), destImage(gradientPreConvolve), Arg1() + Arg2()); // computing image gradient for a better cost function vigra::separableConvolveX(srcImageRange(gradientPreConvolve), destImage(gradientX), vigra::kernel1d(gradientKernel)); vigra::separableConvolveY(srcImageRange(gradientPreConvolve), destImage(gradientY), vigra::kernel1d(gradientKernel)); // difference image calculation switch (PixelDifferenceFunctor) { case HueLuminanceMaxDifference: combineTwoImagesMP(src1_upperleft, src1_lowerright, sa1, src2_upperleft, sa2, intermediateImg.upperLeft(), intermediateImg.accessor(), MaxHueLuminanceDifferenceFunctor (LuminanceDifferenceWeight, ChrominanceDifferenceWeight)); break; case DeltaEDifference: combineTwoImagesMP(src1_upperleft, src1_lowerright, sa1, src2_upperleft, sa2, intermediateImg.upperLeft(), intermediateImg.accessor(), DeltaEPixelDifferenceFunctor (LuminanceDifferenceWeight, ChrominanceDifferenceWeight)); break; default: throw never_reached("switch control expression \"PixelDifferenceFunctor\" out of range"); } // masking overlap region borders combineThreeImagesMP(vigra_ext::apply(iBB, vigra::srcIterRange(mask1_upperleft, mask1_lowerright, ma1)), vigra_ext::apply(iBB, vigra::srcIter(mask2_upperleft, ma2)), vigra::srcIter(intermediateImg.upperLeft(), intermediateImg.accessor()), vigra::destIter(intermediateImg.upperLeft(), intermediateImg.accessor()), ifThenElse(!(Arg1() & Arg2()), Param(BasePixelTraits::max()), Arg3())); // look for possible start and end points std::vector* intermediatePointList = findIntermediatePoints (mask1_upperleft, mask1_lowerright, ma1, mask2_upperleft, ma2, dest_upperleft, da, norm, boundary, iBB); // in case something goes wrong with start/end point finding, returns regular nft image if (intermediatePointList->empty()) { delete intermediatePointList; return; } // copying to a grid copyImage(srcImageRange(intermediateImg), vigra_ext::stride(2, 2, vigra_ext::apply(gBB, destImage(intermediateGraphImg)))); // calculating differences between pixels that are adjacent in the original image convolveImage(srcImageRange(intermediateGraphImg), destImage(graphImg), vigra::kernel2d(edgeWeightKernel)); copyImage(srcImageRange(graphImg), destImage(intermediateGraphImg)); #ifdef DEBUG_GRAPHCUT exportImage(srcImageRange(intermediateImg), ImageExportInfo("./debug/diff.tif").setPixelType("UINT8")); exportImage(srcImageRange(intermediateGraphImg), ImageExportInfo("./debug/diff2.tif").setPixelType("UINT8")); exportImage(mask1_upperleft, mask1_lowerright, ma1, ImageExportInfo("./debug/mask1.tif").setPixelType("UINT8")); exportImage(mask2_upperleft, mask2_upperleft + masksize, ma2, ImageExportInfo("./debug/mask2.tif").setPixelType("UINT8")); exportImage(src1_upperleft, src1_lowerright, sa1, ImageExportInfo("./debug/src1.tif").setPixelType("UINT8")); exportImage(src2_upperleft, src2_upperleft + size, sa2, ImageExportInfo("./debug/src2.tif").setPixelType("UINT8")); exportImage(srcImageRange(gradientX), ImageExportInfo("./debug/gradx.tif").setPixelType("UINT8")); exportImage(srcImageRange(gradientY), ImageExportInfo("./debug/grady.tif").setPixelType("UINT8")); exportImage(srcImageRange(graphImg), ImageExportInfo("./debug/graph.tif").setPixelType("UINT8")); #endif // a set of points to keep visited points for subsequent graph-cut runs boost::unordered_set visited; // find optimal cuts in dual graph for (std::vector::iterator i = intermediatePointList->begin(); i != intermediatePointList->end(); ++i) { if (i == intermediatePointList->begin()) { intermediatePoint = *i; continue; } srcDestPoints->clear(); srcDestPoints->top.insert(intermediatePoint); srcDestPoints->bottom.insert(*i); #ifdef DEBUG_GRAPHCUT std::cout << "Running graph-cut: " << intermediatePoint << ":" << *i << std::endl; #endif dualPath = A_star, IMAGETYPE, BasePixelType> (vigra::Point2D(-10, -10), vigra::Point2D(-20, -20), &intermediateGraphImg, &gradientX, &gradientY, graphsize - vigra::Diff2D(1, 1), srcDestPoints.get(), &visited); visited.insert(dualPath->begin(), dualPath->end()); for (std::vector::reverse_iterator j = dualPath->rbegin(); j < dualPath->rend(); j++) { if ((j == dualPath->rbegin() && totalDualPath.empty()) || j != dualPath->rbegin()) { totalDualPath.push_back(*j); } } copyImage(srcImageRange(graphImg), destImage(intermediateGraphImg)); intermediatePoint = *i; } processCutResults (mask1_upperleft, mask1_lowerright, ma1, mask2_upperleft, ma2, dest_upperleft, da, totalDualPath, iBB); delete intermediatePointList; delete dualPath; } } /* namespace enblend */ #endif /* GRAPHCUT_H */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/src/common.h0000644000175100017510000010337712224464371020031 0ustar ametzlerametzler/* * Copyright (C) 2004-2012 Andrew Mihal * * This file is part of Enblend. * * Enblend is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * Enblend is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Enblend; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef __COMMON_H__ #define __COMMON_H__ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "error_message.h" #include "filenameparse.h" #define NUMERIC_OPTION_DELIMITERS ";:/" #define PATH_OPTION_DELIMITERS ",;:" #define ASSIGNMENT_CHARACTERS "=" #define MASK_COMPRESSION "DEFLATE" // IMPLEMENTATION NOTE: For 30 or more pyramid levels, the full width // will just barely fit in a 32-bit integer. When this range is added // to a bounding box it will certainly overflow the vigra::Diff2D. #define MAX_PYRAMID_LEVELS 29 //< src::maximum-pyramid-levels 29 // Colors used in the optimizer visualization #define VISUALIZE_RGB_COLOR_BLUE1 vigra::RGBValue( 0, 0, 255) #define VISUALIZE_RGB_COLOR_BLUE2 vigra::RGBValue( 0, 0, 238) #define VISUALIZE_RGB_COLOR_BLUE3 vigra::RGBValue( 0, 0, 205) #define VISUALIZE_RGB_COLOR_BLUE4 vigra::RGBValue( 0, 0, 139) #define VISUALIZE_RGB_COLOR_CYAN1 vigra::RGBValue( 0, 255, 255) #define VISUALIZE_RGB_COLOR_CYAN2 vigra::RGBValue( 0, 238, 238) #define VISUALIZE_RGB_COLOR_CYAN3 vigra::RGBValue( 0, 205, 205) #define VISUALIZE_RGB_COLOR_CYAN4 vigra::RGBValue( 0, 139, 139) #define VISUALIZE_RGB_COLOR_GRAY0 vigra::RGBValue( 0, 0, 0) #define VISUALIZE_RGB_COLOR_GRAY63 vigra::RGBValue( 63, 63, 63) #define VISUALIZE_RGB_COLOR_GRAY127 vigra::RGBValue(127, 127, 127) #define VISUALIZE_RGB_COLOR_GRAY139 vigra::RGBValue(139, 139, 139) #define VISUALIZE_RGB_COLOR_GRAY191 vigra::RGBValue(191, 191, 191) #define VISUALIZE_RGB_COLOR_GRAY205 vigra::RGBValue(205, 205, 205) #define VISUALIZE_RGB_COLOR_GRAY238 vigra::RGBValue(238, 238, 238) #define VISUALIZE_RGB_COLOR_GRAY255 vigra::RGBValue(255, 255, 255) #define VISUALIZE_RGB_COLOR_GREEN1 vigra::RGBValue( 0, 255, 0) #define VISUALIZE_RGB_COLOR_GREEN2 vigra::RGBValue( 0, 238, 0) #define VISUALIZE_RGB_COLOR_GREEN3 vigra::RGBValue( 0, 205, 0) #define VISUALIZE_RGB_COLOR_GREEN4 vigra::RGBValue( 0, 139, 0) #define VISUALIZE_RGB_COLOR_MAGENTA1 vigra::RGBValue(255, 0, 255) #define VISUALIZE_RGB_COLOR_MAGENTA2 vigra::RGBValue(238, 0, 238) #define VISUALIZE_RGB_COLOR_MAGENTA3 vigra::RGBValue(205, 0, 205) #define VISUALIZE_RGB_COLOR_MAGENTA4 vigra::RGBValue(139, 0, 139) #define VISUALIZE_RGB_COLOR_ORANGE1 vigra::RGBValue(255, 165, 0) #define VISUALIZE_RGB_COLOR_ORANGE2 vigra::RGBValue(238, 154, 0) #define VISUALIZE_RGB_COLOR_ORANGE3 vigra::RGBValue(205, 133, 0) #define VISUALIZE_RGB_COLOR_ORANGE4 vigra::RGBValue(139, 90, 0) #define VISUALIZE_RGB_COLOR_RED1 vigra::RGBValue(255, 0, 0) #define VISUALIZE_RGB_COLOR_RED2 vigra::RGBValue(238, 0, 0) #define VISUALIZE_RGB_COLOR_RED3 vigra::RGBValue(205, 0, 0) #define VISUALIZE_RGB_COLOR_RED4 vigra::RGBValue(139, 0, 0) #define VISUALIZE_RGB_COLOR_YELLOW1 vigra::RGBValue(255, 255, 0) #define VISUALIZE_RGB_COLOR_YELLOW2 vigra::RGBValue(238, 238, 0) #define VISUALIZE_RGB_COLOR_YELLOW3 vigra::RGBValue(205, 205, 0) #define VISUALIZE_RGB_COLOR_YELLOW4 vigra::RGBValue(139, 139, 0) // Different marker types offered by visualizePoint() typedef enum { NO_MARKER, DOT_MARKER, PLUS_MARKER, CROSS_MARKER, HOLLOW_SQUARE_MARKER, HOLLOW_DIAMOND_MARKER, } marker_t; //< src::visualize-movable-point light orange #define VISUALIZE_MOVABLE_POINT VISUALIZE_RGB_COLOR_ORANGE1 //< src::mark-movable-point diamond #define MARK_MOVABLE_POINT HOLLOW_DIAMOND_MARKER //< src::visualize-frozen-point bright white #define VISUALIZE_FROZEN_POINT VISUALIZE_RGB_COLOR_GRAY255 //< src::mark-frozen-point cross #define MARK_FROZEN_POINT CROSS_MARKER //< src::visualize-initial-path-color dark yellow #define VISUALIZE_INITIAL_PATH VISUALIZE_RGB_COLOR_YELLOW4 //< src::visualize-short-path-value-color bright yellow #define VISUALIZE_SHORT_PATH_VALUE VISUALIZE_RGB_COLOR_YELLOW1 //< src::visualize-first-vertex-value-color medium green #define VISUALIZE_FIRST_VERTEX_VALUE VISUALIZE_RGB_COLOR_GREEN3 //< src::visualize-next-vertex-value-color light green #define VISUALIZE_NEXT_VERTEX_VALUE VISUALIZE_RGB_COLOR_GREEN2 //< src::visualize-no-overlap-value-color dark red #define VISUALIZE_NO_OVERLAP_VALUE VISUALIZE_RGB_COLOR_RED4 //< src::visualize-state-space-color dark blue #define VISUALIZE_STATE_SPACE VISUALIZE_RGB_COLOR_BLUE3 //< src::visualize-state-space-inside-color bright cyan #define VISUALIZE_STATE_SPACE_INSIDE VISUALIZE_RGB_COLOR_CYAN1 //< src::visualize-state-space-unconverged-color bright magenta #define VISUALIZE_STATE_SPACE_UNCONVERGED VISUALIZE_RGB_COLOR_MAGENTA1 // For CIECAM blending, Enblend and Enfuse transform the input images // from their respective RGB color spaces to XYZ space (and then on to // JCh). The following two #defines control the color transformation // from and to XYZ space. #define RENDERING_INTENT_FOR_BLENDING INTENT_PERCEPTUAL #define TRANSFORMATION_FLAGS_FOR_BLENDING cmsFLAGS_NOCACHE // Select our preferred type of image depending on what ./configure // tells us. #ifdef CACHE_IMAGES #define IMAGETYPE vigra_ext::CachedFileImage #else #define IMAGETYPE vigra::BasicImage #endif #ifdef WIN32 #define sleep(m_duration) Sleep(m_duration) #endif #define PENALIZE_DEPRECATED_OPTION(m_old_name, m_new_name) \ do { \ cerr << command << \ ": info: option \"" m_old_name "\" is deprecated; use \"" m_new_name "\" instead" << \ endl; \ sleep(1); \ } while (false) #define lengthof(m_array) (sizeof(m_array) / sizeof(m_array[0])) // Replacement for `assert(0)' and `assert(false)'. class never_reached : public std::runtime_error { public: never_reached(const std::string& a_message) : std::runtime_error(a_message) {} virtual ~never_reached() throw() {} }; namespace enblend { /** The different image overlap classifications. */ enum Overlap {NoOverlap, PartialOverlap, CompleteOverlap}; /** Symbolic expressions for the three different metrics that * vigra::distanceTransform understands. */ typedef enum { ChessboardDistance, // 0 ManhattanDistance, // 1, L1 norm EuclideanDistance // 2, L2 norm } nearest_neighbor_metric_t; /** Define our own reentrant, uniform pseudo-random number generator. */ inline int rand_r(unsigned int* seed) { *seed = *seed * 1103515245U + 12345U; return static_cast(*seed % (static_cast(RAND_MAX) + 1U)); } /** Answer the square of the argument x. */ template inline t square(t x) { return x * x; } /** Answer the previous iterator of i. */ template inline iterator prev(iterator i) { return --i; } /** Answer the following iterator of i. */ template inline iterator next(iterator i) { return ++i; } /** Test whether s starts with p. */ inline bool starts_with(const std::string& s, const std::string& p) { return s.substr(0, p.length()) == p; } /** String tokenizer similar to strtok_r(). * In contrast to strtok_r this function returns an empty string for * each pair of successive delimiters. Function strtok_r skips them. */ char* strtoken_r(char* str, const char* delim, char** save_ptr) { char *s = str ? str : *save_ptr; if (s) { char *token = s; while (*s != 0 && !strchr(delim, (int) *s)) { s++; } *save_ptr = *s == 0 ? NULL : s + 1; *s = 0; return token; } else { return NULL; } } /** Answer the string representation of the boolean b. */ std::string stringOfBool(bool b) { return b ? "true" : "false"; } /** Answer whether we can open aFilename. */ bool can_open_file(const std::string& aFilename) { errno = 0; std::ifstream file(aFilename.c_str()); if (!file) { std::cerr << command << ": failed to open \"" << aFilename << "\": " << errorMessage(errno) << "\n"; return false; } else { errno = 0; file.close(); if (file.fail()) { std::cerr << command << ": info: problems when closing \"" << aFilename << "\": " << errorMessage(errno) << "\n"; } return true; } } /** Answer the VIGRA file type as determined by the extension of * aFileName. */ std::string getFileType(const std::string& aFileName) { std::string ext = aFileName.substr(aFileName.rfind(".") + 1); boost::algorithm::to_upper(ext); if (ext == "JPG") return "JPEG"; else if (ext == "TIF") return "TIFF"; else if (ext == "VIF") return "VIFF"; else if (ext == "PBM" || ext == "PGM" || ext == "PPM") return "PNM"; else return ext; } /** Convert aWraparoundMode given as string to the internal * representation as enum. */ boundary_t wraparoundOfString(const char* aWraparoundMode) { std::string mode = std::string(aWraparoundMode); boost::algorithm::to_upper(mode); if (mode == "NONE" || mode == "OPEN") return OpenBoundaries; else if (mode == "HORIZONTAL") return HorizontalStrip; else if (mode == "VERTICAL") return VerticalStrip; else if (mode == "BOTH" || mode == "HORIZONTAL+VERTICAL" || mode == "VERTICAL+HORIZONTAL") return DoubleStrip; else return UnknownWrapAround; } /** Convert aBoundaryMode to its string representation. */ std::string stringOfWraparound(boundary_t aBoundaryMode) { switch (aBoundaryMode) { case OpenBoundaries: return "none"; case HorizontalStrip: return "horizontal"; case VerticalStrip: return "vertical"; case DoubleStrip: return "both"; default: throw never_reached("switch control expression \"aBoundaryMode\" out of range"); } } /** Convert a_string into a number. * * Perform two validating tests in the numerical result. These are, * for example, tests for lower and upper boundaries. */ template NumericType numberOfString(const char* a_string, // string we want to convert into a number Validator1 is_valid1, // 1st validator function const std::string& invalid_message1, // error message for failed 1st validation NumericType replacement_value1, // replacement return value on 1st failure Validator2 is_valid2, // 2nd validator function const std::string& invalid_message2, // error message for failed 2nd validation NumericType replacement_value2) // replacement return value on 2nd failure { typedef std::numeric_limits traits; char* tail; long int long_int_value; double double_value; NumericType value; errno = 0; if (traits::is_exact) { long_int_value = strtol(a_string, &tail, 10); } else { double_value = strtod(a_string, &tail); } if (errno != 0) { std::cerr << command << ": " << "illegal numeric format of \"" << a_string << "\": " << errorMessage(errno) << std::endl; exit(1); } if (*tail != 0) { if (strcmp(a_string, tail) == 0) { std::cerr << command << ": " << "number is garbage; maybe the option before \"" << a_string << "\" needs an argument" << std::endl; } else { std::cerr << command << ": " << "trailing garbage \"" << tail << "\" in \"" << a_string << "\"" << std::endl; } exit(1); } if (traits::is_exact) { if (traits::is_signed) { if (long_int_value < traits::min() || long_int_value > traits::max()) { std::cerr << command << ": " << "signed number " << long_int_value << " out of range [" << traits::min() << " .. " << traits::max() << "]" << std::endl; exit(1); } else { value = static_cast(long_int_value); } } else { if (long_int_value < 0L || long_int_value > traits::max()) { std::cerr << command << ": " << "unsigned number " << long_int_value << " out of range [0 .. " << traits::max() << "]" << std::endl; exit(1); } else { value = static_cast(long_int_value); } } } else { value = static_cast(double_value); } if (is_valid1(value)) { if (is_valid2(value)) { return value; } else { std::cerr << command << ": warning: " << invalid_message2 << std::endl; return replacement_value2; } } else { std::cerr << command << ": warning: " << invalid_message1 << std::endl; return replacement_value1; } } /** Convert a_string into a number. */ template NumericType numberOfString(const char* a_string, // string we want to convert into a number Validator is_valid, // validator function const std::string& invalid_message, // error message for failed validation NumericType replacement_value) // replacement return value on failure { return numberOfString(a_string, is_valid, invalid_message, replacement_value, boost::lambda::constant(true), "", NumericType()); } /** Convert an anOutputDepth to a "pixel type" string understood by * VIGRA. */ std::string outputPixelTypeOfString(const char* anOutputDepth) { typedef std::map Str2StrMapType; Str2StrMapType depthMap; boost::assign::insert(depthMap) ("INT16", "INT16") ("INT32", "INT32") ("8", "UINT8") ("16", "UINT16") ("32", "UINT32") ("UINT8", "UINT8") ("UINT16", "UINT16") ("UINT32", "UINT32") ("DOUBLE", "DOUBLE") ("FLOAT", "FLOAT") ("R32", "FLOAT") ("R64", "DOUBLE") ("REAL32", "FLOAT") ("REAL64", "DOUBLE"); std::string output_depth(anOutputDepth); boost::algorithm::to_upper(output_depth); Str2StrMapType::const_iterator p = depthMap.find(output_depth); if (p == depthMap.end()) { throw std::invalid_argument(std::string("unknown output depth \"") + anOutputDepth + "\""); } else { return p->second; } } /** Answer the best pixel type of an image given aFileType with * respect to aPixelType. This is the type with the largest range. */ std::string bestPixelType(const std::string& aFileType, const std::string& aPixelType) { if (aFileType == "BMP" || aFileType == "JPEG" || aFileType == "RAS") return "UINT8"; else if (aFileType == "PNG" && (aPixelType == "INT32" || aPixelType == "UINT32" || aPixelType == "FLOAT" || aPixelType == "DOUBLE")) return "UINT16"; else if (aFileType == "EXR") return "FLOAT"; else return aPixelType; } typedef std::pair range_t; /** Answer the maximum range of values aPixelType can represent. */ range_t rangeOfPixelType(const std::string& aPixelType) { typedef std::map Str2PairMapType; Str2PairMapType rangeMap; boost::assign::insert(rangeMap) ("INT8", std::make_pair(vigra::NumericTraits::min(), vigra::NumericTraits::max())) ("INT16", std::make_pair(vigra::NumericTraits::min(), vigra::NumericTraits::max())) ("INT32", std::make_pair(vigra::NumericTraits::min(), vigra::NumericTraits::max())) ("UINT8", std::make_pair(0.0, vigra::NumericTraits::max())) ("UINT16", std::make_pair(0.0, vigra::NumericTraits::max())) ("UINT32", std::make_pair(0.0, vigra::NumericTraits::max())) ("FLOAT", std::make_pair(0.0, 1.0)) ("DOUBLE", std::make_pair(0.0, 1.0)); assert(!aPixelType.empty()); Str2PairMapType::const_iterator r = rangeMap.find(aPixelType); if (r == rangeMap.end()) { throw std::invalid_argument(std::string("unknown pixel type \"") + aPixelType + "\""); } else { return r->second; } } /** Answer whether aPixelType defines a range that is so larges that * it includes both aRange and anotherRange. */ bool includesBothRanges(const std::string& aPixelType, const range_t& aRange, const range_t& anotherRange) { const range_t range = rangeOfPixelType(aPixelType); return (aRange.first >= range.first && aRange.second <= range.second && anotherRange.first >= range.first && anotherRange.second <= range.second); } /** Answer the smallest pixel type that is larger or equal to both * aPixelType and anotherPixelType. */ std::string maxPixelType(const std::string& aPixelType, const std::string& anotherPixelType) { const range_t range1 = rangeOfPixelType(aPixelType); const range_t range2 = rangeOfPixelType(anotherPixelType); if (aPixelType == "DOUBLE" || anotherPixelType == "DOUBLE") { return "DOUBLE"; } else if (aPixelType == "FLOAT" || anotherPixelType == "FLOAT") { return "FLOAT"; } else if (range1.first <= range2.first && range1.second >= range2.second) { return aPixelType; // first includes second } else if (range2.first <= range1.first && range2.second >= range1.second) { return anotherPixelType; // second includes first } else { // Types are different: look for the smallest containing type using namespace boost::assign; typedef std::vector string_array; typedef string_array::const_iterator string_array_ci; if (range1.first < 0 || range2.first < 0) { const string_array types = list_of("INT8")("INT16")("INT32"); for (string_array_ci i = types.begin(); i != types.end(); ++i) { if (includesBothRanges(*i, range1, range2)) { return *i; } } return "INT32"; } else { const string_array types = list_of("UINT8")("UINT16")("UINT32"); for (string_array_ci i = types.begin(); i != types.end(); ++i) { if (includesBothRanges(*i, range1, range2)) { return *i; } } return "UINT32"; } } } /** Answer the sign of x. */ template inline int sign(T x) { return x > T() ? 1 : (x < T() ? -1 : 0); } /** Compute the integral logarithm of n to the base 10. We do not * need to take special care of the case n == 0 for our purposes. */ inline unsigned ilog10(unsigned n) { return n <= 9 ? 0 : 1 + ilog10(n / 10); } /** Expand aTemplate filling the variable parts with anInputFilename, * anOutputFilename, and aNumber depending on the conversion * specifiers in aTemplate. * * Conversion Specifiers - lowercase characters refer to * anInputFilename whereas uppercase ones refer to anOutputFilename: * %% A single '%'-sign * %i aNumber unaltered * %n successor of aNumber * %p aFilename unaltered * %d directory part of aFilename * %b non-directory part (aka basename) of aFilename * %f basename of aFilename without extension * %e extension of aFilename (including the leading dot) * All other characters in aTemplate are passed through literally. * * The "%i" and "%n" conversions honor a flag which is either * '0' pad with zeros (default) or * PUNCT i.e. any punctuation character to pad with * and a width specification. If no width is requested, the * width is computed based on aNumberOfImages. * * For example * expandFilenameTemplate("mask-%04n.tif", 2, "foobar.jpg", 9) * evaluates to * mask-0009.tif */ std::string expandFilenameTemplate(const std::string& aTemplate, unsigned aNumberOfImages, const std::string& anInputFilename, const std::string& anOutputFilename, unsigned aNumber) { std::string result; for (std::string::const_iterator c = aTemplate.begin(); c != aTemplate.end(); ++c) { if (*c == '%') { ++c; if (c == aTemplate.end()) { result.push_back(*c); } else { char pad = 0; while (c != aTemplate.end() && (*c == '0' || ispunct(*c))) { pad = *c; ++c; } std::string width; while (c != aTemplate.end() && isdigit(*c)) { width.push_back(*c); ++c; } if (c != aTemplate.end()) { switch (*c) { case '%': result.push_back(*c); break; case 'n': ++aNumber; ++aNumberOfImages; // FALLTHROUGH case 'i': { std::ostringstream oss; oss << std::setw(width.empty() ? 1 + ilog10(aNumberOfImages - 1) : atoi(width.c_str())) << std::setfill(pad == 0 ? '0' : pad) << aNumber; result.append(oss.str()); break; } case 'P': result.append(anOutputFilename); break; case 'p': result.append(anInputFilename); break; case 'D': result.append(extractDirname(anOutputFilename)); break; case 'd': result.append(extractDirname(anInputFilename)); break; case 'B': result.append(extractBasename(anOutputFilename)); break; case 'b': result.append(extractBasename(anInputFilename)); break; case 'F': result.append(extractFilename(anOutputFilename)); break; case 'f': result.append(extractFilename(anInputFilename)); break; case 'E': result.append(extractExtension(anOutputFilename)); break; case 'e': result.append(extractExtension(anInputFilename)); break; default: std::cerr << command << ": warning: ignoring unknown variable character "; if (isprint(*c)) { std::cerr << "'" << *c << "'"; } else { std::cerr << "0x" << std::hex << *c; } std::cerr << " in\n" << command << ": warning: filename template \"" << aTemplate << "\"" << std::endl; } // switch (*c) } } } else { result.push_back(*c); } } return result; } /** Answer a phrase that describes a layer in an image consisting of * multiple layers. If the image has got only one layer, we avoid to * confuse the user and answer an empty string. */ inline std::string optional_layer_name(unsigned layer_number, unsigned layer_total) { if (layer_total <= 1U) { return std::string(); } else { std::ostringstream oss; oss << ", layer " << layer_number << "/" << layer_total; return oss.str(); } } inline std::string profileInfo(cmsHPROFILE profile, cmsInfoType info) { const size_t size = cmsGetProfileInfoASCII(profile, info, cmsNoLanguage, cmsNoCountry, NULL, 0); std::string information(size, '\000'); cmsGetProfileInfoASCII(profile, info, cmsNoLanguage, cmsNoCountry, &information[0], size); boost::trim_if(information, std::bind2nd(std::less_equal(), '\040')); return information; } inline std::string profileDescription(cmsHPROFILE profile) { return profileInfo(profile, cmsInfoDescription); } inline std::string profileName(cmsHPROFILE profile) { return profileInfo(profile, cmsInfoModel); } namespace parameter { // Identifier: [A-Za-z][A-Za-z0-9_-]* inline bool is_valid_identifier(const std::string& identifier) { if (identifier.size() == 0) { return false; } else if (!isalpha(identifier[0])) { return false; } else { for (std::string::const_iterator x = identifier.begin(); x != identifier.end(); ++x) { if (!(isalnum(*x) || *x == '_' || *x == '-')) { return false; } } } return true; } struct not_found : public std::runtime_error { not_found(const std::string& a_message) : std::runtime_error(a_message) {} }; // Notes: // // * The access of parameters through enblend::parameter::as_* is // reasonable fast. For time-critical parts of the code, the // parameter's value can always be copied into a local variable. // // * The map from parameter keys to values is meant to be constant // after the command line was parsed, i.e. neither the map // itself, nor one of its values should be modified. Following // this convention makes all enblend::parameter::as_* functions // thread safe. // // Some examples how to use parameters: // // (1) Check whether a parameter has been set. // if (enblend::parameter::exists("foobar")) {...} // else {...} // // (2) Use a parameter that is known to exist. // std::string s = enblend::parameter::as_string("foobar"); // int i = enblend::parameter::as_integer("foobar"); // unsigned u = enblend::parameter::as_unsigned("foobar"); // double x = enblend::parameter::as_floating_point("foobar"); // bool b = enblend::parameter::as_boolean("foobar"); // // (3) Substitute parameter value if it exists; otherwise go with // the default. // std::string s = enblend::parameter::as_string("foobar", "baz"); // int i = enblend::parameter::as_integer("foobar", 123); // unsigned u = enblend::parameter::as_unsigned("foobar", 42U); // double x = enblend::parameter::as_floating_point("foobar", 0.577215665); // bool b = enblend::parameter::as_boolean("foobar", true); // // (4) React on parameter with a non-local change of control flow // int i; // try {i = enblend::parameter::as_integer("foobar");} // catch (enblend::parameter::not_found&) {...} // // A parameter always can be retrieved as string with function // as_string(). All other as_* functions throw the exception // conversion_error, if the parameter's value cannot be // represented. See class ParameterValue in file "global.h" for // the details on conversion especially for as_boolean(). inline bool exists(const std::string& key) { return Parameter.find(key) != Parameter.end(); } inline std::string as_string(const std::string& key) { parameter_map::const_iterator x = Parameter.find(key); if (x == Parameter.end()) { throw not_found(key); } else { return x->second.as_string(); } } inline std::string as_string(const std::string& key, const std::string& default_value) { parameter_map::const_iterator x = Parameter.find(key); if (x == Parameter.end()) { return default_value; } else { return x->second.as_string(); } } inline int as_integer(const std::string& key) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { throw not_found(key); } else { return x->second.as_integer(); } } inline int as_integer(const std::string& key, int default_value) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { return default_value; } else { return x->second.as_integer(); } } inline unsigned as_unsigned(const std::string& key) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { throw not_found(key); } else { return x->second.as_unsigned(); } } inline unsigned as_unsigned(const std::string& key, unsigned default_value) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { return default_value; } else { return x->second.as_unsigned(); } } inline double as_double(const std::string& key) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { throw not_found(key); } else { return x->second.as_double(); } } inline double as_double(const std::string& key, double default_value) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { return default_value; } else { return x->second.as_double(); } } inline bool as_boolean(const std::string& key) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { throw not_found(key); } else { return x->second.as_boolean(); } } inline bool as_boolean(const std::string& key, bool default_value) { parameter_map::iterator x = Parameter.find(key); if (x == Parameter.end()) { return default_value; } else { return x->second.as_boolean(); } } } // namespace parameter } // namespace enblend #ifndef HAVE_STRTOK_R char* strtok_r(char* str, const char* delim, char** save_ptr) { char *s = str ? str : *save_ptr; if (s) { while (*s != 0 && strchr(delim, (int) *s)) { s++; } if (*s) { char *token = s; while (*s != 0 && !strchr(delim, (int) *s)) { s++; } if (*s) { *s = 0; s++; } *save_ptr = s; return token; } else { return NULL; } } else { return NULL; } } #endif #endif /* __COMMON_H__ */ // Local Variables: // mode: c++ // End: enblend-enfuse-4.1.2+dfsg/doc/0000755000175100017510000000000012232763263016334 5ustar ametzlerametzlerenblend-enfuse-4.1.2+dfsg/doc/CreateVersTexi.pl0000755000175100017510000000205512070530113021555 0ustar ametzlerametzler#! /usr/bin/env perl use File::stat; my %MapMonth = ( "01" => "January", "02" => "February", "03" => "March", "04" => "April", "05" => "May", "06" => "June", "07" => "July", "08" => "August", "09" => "September", "10" => "October", "11" => "November", "12" => "December"); my ($testfile, $version, $usea4) = @ARGV; my ($day, $month, $year) = &getDateFromFile($testfile); print "\@set UPDATED $day $month $year\n"; print "\@set UPDATED-MONTH $month $year\n"; print "\@set EDITION $version\n"; print "\@set VERSION $version\n"; #if ($usea4 =~ /(ON|TRUE)/i) { # print "\@afourpaper\n"; #} ########################################################## sub getDateFromFile($) { my ($file) = @_; my ($m, $d, $j); my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst); my $sb = stat($file); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($sb->mtime); $m = sprintf("%02d", $mon+1); $j = $year+1900; $d = sprintf("%02d", $mday); return($d, $MapMonth{$m}, $j); } enblend-enfuse-4.1.2+dfsg/doc/CMakeLists.txt0000644000175100017510000002734512070530501021072 0ustar ametzlerametzler# This file is part of enblend. # Licence details can be found in the file COPYING. # # Copyright (c) 2009-2012, Kornel Benko # include(GetPrerequisites) # get function gp_append_unique() IF(WIN32) set(DocumentsDirectory "doc") ELSE(WIN32) set(DocumentsDirectory "doc/enblend") ENDIF(WIN32) include(${TOP_SRC_DIR}/doc/macros.cmake) set(main_texi_list enblend enfuse) set(_docs) set(_enblend_Bases auxmac.texi auxmac.tex fdl.texi mask-template-characters.texi helpful-programs.texi seam-generators.texi color-profiles.texi tuning-memory-usage.texi understanding-masks.texi workflow.texi filespec.texi external-masks.texi bug-reports.texi authors.texi photographic-workflow.fig external-mask-workflow.fig seam-line-visualization.tif default.css) set(_enfuse_Bases auxmac.texi auxmac.tex fdl.texi mask-template-characters.texi helpful-programs.texi color-profiles.texi tuning-memory-usage.texi understanding-masks.texi workflow.texi filespec.texi external-masks.texi bug-reports.texi authors.texi config-edge.gp config.gp entropy-cutoff.gp.in exposure-cutoff.gp.in entropy.gp.in gaussian.gp.in laplacian-of-gaussian.gp.in sharp-edge.gp.in sharp-edge.data smooth-edge.gp.in smooth-edge.data local-analysis-window.fig photographic-workflow.fig focus-stack-decision-tree.fig external-mask-workflow.fig default.css) set(_enblend_TEXINFOS) foreach(_e ${_enblend_Bases}) list(APPEND _enblend_TEXINFOS "${TOP_SRC_DIR}/doc/${_e}") endforeach(_e) set(_enfuse_TEXINFOS) foreach(_e ${_enfuse_Bases}) list(APPEND _enfuse_TEXINFOS "${TOP_SRC_DIR}/doc/${_e}") endforeach(_e) set(_enblendenfuse_fig_images) set(_enblendenfuse_tif_images) set(_enblendenfuse_gp_images) foreach(_cmd ${main_texi_list} ) doc_create_selection(_${_cmd}_Bases "fig" _${_cmd}_fig_images) doc_create_selection(_${_cmd}_Bases "tif" _${_cmd}_tif_images) doc_create_selection(_${_cmd}_Bases "gp\\\\.in" _${_cmd}_gp_images) set(_${_cmd}_images ${_${_cmd}_fig_images} ${_${_cmd}_tif_images} ${_${_cmd}_gp_images}) foreach(_i ${_${_cmd}_fig_images}) gp_append_unique(_enblendenfuse_fig_images ${_i}) endforeach(_i) foreach(_i ${_${_cmd}_tif_images}) gp_append_unique(_enblendenfuse_tif_images ${_i}) endforeach(_i) foreach(_i ${_${_cmd}_gp_images}) gp_append_unique(_enblendenfuse_gp_images ${_i}) endforeach(_i) endforeach(_cmd) project(doc0) set(_helpfiles) #create /config.h.texi doc_create_configh_texi(_helpfiles config-h.texi) # create /vers*.texi foreach(_cmd ${main_texi_list}) #message(STATUS "doc_verscopy_file vers${_cmd}.texi") doc_verscopy_file(_helpfiles "vers${_cmd}.texi") endforeach(_cmd) # create /vars*.texi foreach(_cmd ${main_texi_list}) #message(STATUS "doc_varscreate_file ${_cmd}") doc_varscreate_file(_helpfiles ${_cmd}) endforeach(_cmd) # %.txt: %.fig foreach(_fig ${_enblendenfuse_fig_images}) #message(STATUS "doc_create_txt_from_fig ${_tif}") doc_create_txt_from_fig(_helpfiles ${_fig}) endforeach(_fig) # %.gif: %.tif # %.png: %.tif # %.eps: %.tif foreach(_tif ${_enblendenfuse_tif_images}) #message(STATUS "doc_create_tif_images ${_tif}") doc_create_tif_images(_helpfiles ${_tif}) endforeach(_tif) # /%.gp.in: /%.gp set(srcdir "${TOP_SRC_DIR}/doc") set(RASTER_DIR "${CMAKE_CURRENT_BINARY_DIR}") foreach(_gp ${_enblendenfuse_gp_images}) message(STATUS "Handling ${_gp}.gp.in") # (@srcdir@ and @RASTER_DIR@) will be substituted in *.gp.in doc_create_gp_in_files(_helpfiles ${_gp}) endforeach() #message(STATUS "_helpfiles = " ${_helpfiles}) add_custom_target(doc0 DEPENDS ${_helpfiles}) project(doc1) # search for gnuplot and # generate images (.txt, .pdf .eps and .png) find_package(Gnuplot) set(_depend_gp) if (NOT DOC OR NOT GNUPLOT_FOUND) # there is no gnuplot command, so simply copy the needed files file(GLOB _copy_files RELATIVE "${TOP_SRC_DIR}/doc" "${TOP_SRC_DIR}/doc/*.txt" "${TOP_SRC_DIR}/doc/*.eps" "${TOP_SRC_DIR}/doc/*.png" "${TOP_SRC_DIR}/doc/*.pdf") foreach(_cf ${_copy_files}) if(NOT ${_cf} MATCHES "en(blend|fuse)") # This is done below doc_copybin(_depend_gp "${_cf}") list(APPEND _docs "${_cf}") endif() endforeach(_cf) else() # foreach(_gp ${_enblendenfuse_gp_images}) doc_create_gp_images(_depend_gp ${_gp}) list(APPEND _docs ${_created}) endforeach(_gp) endif() add_custom_target(doc1 DEPENDS doc0 ${_depend_gp}) project(doc2) # Search for fig2dev and convert some images find_program(FIG2DEV_EXE fig2dev) if (${FIG2DEV_EXE} MATCHES "-NOTFOUND") # here the creation of html and pdf will be disabled, because .gif-prerequisites are not found # Automake uses here sed and the like set(DOC3:BOOL "FALSE") else() #message(STATUS "_enblendenfuse_fig_images = ${_enblendenfuse_fig_images}") foreach(_img ${_enblendenfuse_fig_images}) foreach(_ext eps gif pdf png) doc_create_fig2dev(_depend_gp ${_img} ${_ext}) list(APPEND _docs ${_img}.${_ext}) endforeach(_ext) if(NOSPLIT) install(FILES ${_img}.png DESTINATION ${DocumentsDirectory}) endif(NOSPLIT) endforeach(_img) set(DOC3:BOOL ${DOC}) endif() add_custom_target(doc2 DEPENDS doc1 ${_depend_gp}) project(doc3) # Search for makeinfo command and # generate info and pdf for enblend + enfuse find_program(MAKEINFO_EXE "makeinfo") if (DOC3:BOOL) if ( NOT ${MAKEINFO_EXE} MATCHES "-NOTFOUND") # Check for sufficient version, should be >= 4.11 EXECUTE_PROCESS(COMMAND ${MAKEINFO_EXE} "--version" OUTPUT_VARIABLE _makeinfo_version OUTPUT_STRIP_TRAILING_WHITESPACE) foreach(_v_l ${_makeinfo_version}) #message(STATUS "_v_l = ${_v_l}") if(_v_l MATCHES "\\(GNU texinfo\\) *\([0-9]+\)\\.\([0-9]+\)") set(MAKEINFO_MAJOR ${CMAKE_MATCH_1}) set(MAKEINFO_MINOR1 "00000${CMAKE_MATCH_2}") if(MAKEINFO_MINOR1 MATCHES "^[0]+\([0-9][0-9][0-9][0-9]\)\$") set(MAKEINFO_MINOR ${CMAKE_MATCH_1}) endif() set(MAKEINFO_VERSION "${MAKEINFO_MAJOR}.${MAKEINFO_MINOR}") endif() endforeach() string(COMPARE GREATER "${MAKEINFO_VERSION}" "4.0010" DOC3:BOOL) #message(STATUS "MAKEINFO_VERSION = ${MAKEINFO_VERSION}") if (NOT DOC3:BOOL) message(STATUS "Sorry, but you need makeinfo version >= 4.11") endif() endif() endif() find_program(TEXI2DVI_EXE "texi2dvi") if(${EXTRATEXI2DVIFLAGS} MATCHES "^\\@") set(TEXI2DVIFLAGS "--command=${EXTRATEXI2DVIFLAGS}") message(STATUS "EXTRATEXI2DVIFLAGS = ${EXTRATEXI2DVIFLAGS}") message(STATUS "Setting TEXI2DVIFLAGS to ${TEXI2DVIFLAGS}") else() set(TEXI2DVIFLAGS) message(STATUS "Resetting TEXI2DVIFLAGS") endif() set(_auxdepends) FILE(GLOB tmp_texi RELATIVE "${TOP_SRC_DIR}/doc" "${TOP_SRC_DIR}/doc/*.tex*") foreach(_cmd ${main_texi_list}) # These are already created with doc_varscreate_file() list(REMOVE_ITEM tmp_texi vars${_cmd}.texi) endforeach() foreach(_f ${tmp_texi}) if (NOT ${_f} MATCHES "vers.*") add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_f}" COMMAND ${CMAKE_COMMAND} -E copy "${TOP_SRC_DIR}/doc/${_f}" "${CMAKE_CURRENT_BINARY_DIR}/${_f}" DEPENDS "${TOP_SRC_DIR}/doc/${_f}" ) list(APPEND _auxdepends "${CMAKE_CURRENT_BINARY_DIR}/${_f}") endif() endforeach() foreach (_cmd ${main_texi_list}) set(_created "${CMAKE_CURRENT_BINARY_DIR}/${_cmd}") if (NOT DOC3:BOOL OR ${MAKEINFO_EXE} MATCHES "-NOTFOUND" OR ${TEXI2DVI_EXE} MATCHES "-NOTFOUND") # there is no makeinfo or no texi2dvi command, # this implies insufficient latex installation. # Therefore simply copy the data from source tree. foreach(_ext "info") doc_copybin(_depend_gp "${_cmd}.${_ext}") list(APPEND _docs "${_cmd}.${_ext}" "${_created}.${_ext}") endforeach() # # Disabled, because not part of repo. # They would have only been created with "make pdf" or "make html" in source doc directory # under automake if (EXISTS "${TOP_SRC_DIR}/doc/${_cmd}.pdf" AND NOT IS_DIRECTORY "${TOP_SRC_DIR}/doc/${_cmd}.pdf") copybin(_depend_gp "${_cmd}.pdf") list(APPEND _docs "${_cmd}.pdf" "${_created}.pdf") else() message(STATUS "Sorry, but there is no file ${TOP_SRC_DIR}/doc/${_cmd}.pdf to copy. Leave it out") endif() if (EXISTS "${TOP_SRC_DIR}/doc/${_cmd}.html" AND IS_DIRECTORY "${TOP_SRC_DIR}/doc/${_cmd}.html") doc_copybin(_depend_gp "${_cmd}.html" "DIR") list(APPEND _docs "${_cmd}.html" "${_created}.html") else() message(STATUS "Sorry, but there is no directory ${TOP_SRC_DIR}/doc/${_cmd}.html to copy. Leave it out") endif() else() # here fig2dev, makeinfo and texi2dvi exist, option DOC set to ON #message(STATUS "create ${_created}.info") add_custom_command( OUTPUT "${_created}.info" COMMAND ${MAKEINFO_EXE} "--css-include=${TOP_SRC_DIR}/doc/default.css" "-I" "${TOP_SRC_DIR}/doc" -o "${_created}.info" "${TOP_SRC_DIR}/doc/${_cmd}.texi" DEPENDS "${TOP_SRC_DIR}/doc/${_cmd}.texi" ${_${_cmd}_TEXINFOS} ${_depend_gp} "${CMAKE_CURRENT_BINARY_DIR}/config-h.texi" COMMENT "makeinfo: Creating ${_created}.info from ${TOP_SRC_DIR}/doc/${_cmd}.texi" ) install(FILES "${_created}.info" DESTINATION ${DocumentsDirectory}) add_custom_command( OUTPUT "${_created}.texi" COMMAND ${CMAKE_COMMAND} -E copy "${TOP_SRC_DIR}/doc/${_cmd}.texi" "${_created}.texi" DEPENDS "${TOP_SRC_DIR}/doc/${_cmd}.texi" ) #message(STATUS "${TEXI2DVI_EXE} ${TEXI2DVIFLAGS} --pdf --batch ${_created}.texi") file(RELATIVE_PATH _tmp_created "${CMAKE_CURRENT_BINARY_DIR}" "${_created}.texi") add_custom_command( OUTPUT "${_created}.pdf" COMMAND ${TEXI2DVI_EXE} ${TEXI2DVIFLAGS} "--dvipdf" "--batch" "--build=local" "${_tmp_created}" DEPENDS "${_created}.texi" ${_${_cmd}_TEXINFOS} ${_depend_gp} "${CMAKE_CURRENT_BINARY_DIR}/config-h.texi" ${_auxdepends} COMMENT "texi2dvi: Creating ${_created}.pdf from ${TOP_SRC_DIR}/doc/${_cmd}.texi, cmdline="${TEXI2DVIFLAGS} ) install(FILES "${_created}.pdf" DESTINATION ${DocumentsDirectory}) #message(STATUS "create ${_created}.html") if(NOSPLIT) set(_created_output "${_created}_file.html") set(_output_param "${_created}_file.html") set(_html_param "--no-split") else() set(_created_output "${_created}.html/index.html") set(_output_param "${_created}.html") set(_html_param) endif(NOSPLIT) add_custom_command( OUTPUT "${_created_output}" COMMAND ${MAKEINFO_EXE} "--html" ${_html_param} "--css-include=${TOP_SRC_DIR}/doc/default.css" "-I" "${TOP_SRC_DIR}/doc" -o "${_output_param}" "${TOP_SRC_DIR}/doc/${_cmd}.texi" DEPENDS "${TOP_SRC_DIR}/doc/${_cmd}.texi" ${_${_cmd}_TEXINFOS} ${_depend_gp} COMMENT "makeinfo: Creating ${_created}.html from ${TOP_SRC_DIR}/doc/${_cmd}.texi" ) if(NOSPLIT) install(FILES "${_created}_file.html" DESTINATION ${DocumentsDirectory} RENAME "${_cmd}.html") else(NOSPLIT) foreach(_img ${_${_cmd}_images}) set(_needed_image "${_created}.html/${_img}.png") set(_parent_image "${CMAKE_CURRENT_BINARY_DIR}/${_img}.png") #message(STATUS "_needed_image = ${_needed_image}") add_custom_command( OUTPUT "${_needed_image}" COMMAND ${CMAKE_COMMAND} -E copy "${_parent_image}" "${_needed_image}" DEPENDS "${_created}.html/index.html" "${_parent_image}" COMMENT "Copying ${_parent_image} to ${_needed_image}" ) list(APPEND _docs "${_needed_image}") endforeach(_img) install(DIRECTORY "${_created}.html" DESTINATION ${DocumentsDirectory}) endif(NOSPLIT) list(APPEND _docs "${_created}.info" "${_created}.pdf" "${_created_output}") endif() endforeach(_cmd) add_custom_target(doc3 ALL DEPENDS ${_docs}) if(DOC3:BOOL) # set make order add_dependencies(doc3 doc2 doc1 doc0 enblendenfuse) endif() enblend-enfuse-4.1.2+dfsg/doc/default.css0000644000175100017510000000303612070530113020456 0ustar ametzlerametzler/* Settings for generic elements */ body { background: white; color: black; margin-left: 6%; margin-right: 6% } h1, h2, h3, h4, h5, h6 {margin-left: -4%} dl, h1, h2, h3, h4, h5, h6, ol, p, table, ul {font-family: sans-serif} code, pre {font-family: monospace;} var { font-family: sans-serif; font-style: italic } /* Class-based and attibute-based settings */ div.contents {} div.float { /*background-color: #ffffcc;*/ /* for debugging */ border-bottom: 1px solid; border-top: 1px solid; margin-left: auto; margin-right: auto; width: 88%; } dl.compact {} dl.listoffloats {} h1.chapter {} h1.settitle {} h1.unnumbered {} h2.section {} h3.subsection {} h4.subsubsection {} hr.small { background-color: black; color: black; height: 1px; width: 113% } hr.middle { background-color: black; color: black; height: 2px; width: 113% } hr.big { background-color: black; color: black; height: 4px; width: 113% } math {display: block} math[display=inline] {display: inline} math[display=separate] { margin-left: auto; margin-right: auto; width: 88%; } pre.example {} pre.display {font-family: sans-serif} pre.menu-comment { font-family: sans-serif; font-size: 110%; font-weight: bold; margin-top: 2ex; } small.enddots {} span.option {font-size: 110%} span.samp {font-size: 110%} strong { font-family: sans-serif; font-weight: bold; } table.index-cp {} table.index-op {} table.index-pg {} table.menu {} tt {font-size: 110%} ul.toc {} enblend-enfuse-4.1.2+dfsg/doc/fdl.texi0000644000175100017510000004610112070530113017760 0ustar ametzlerametzler@c The GNU Free Documentation License. Version 1.2, November 2002 @c This file is intended to be included within another document, @c hence no sectioning command or @node. @display Copyright @copyright{} 2000, 2001, 2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @end display @enumerate 0 @item PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document @dfn{free} in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of ``copyleft'', which means that derivative works of the document must themselves be free in the same sense. It complements the @acronym{GNU} General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. @item APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The ``Document'', below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as ``you''. You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A ``Modified Version'' of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A ``Secondary Section'' is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The ``Invariant Sections'' are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The ``Cover Texts'' are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A ``Transparent'' copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not ``Transparent'' is called ``Opaque''. Examples of suitable formats for Transparent copies include plain @sc{ascii} without markup, Texinfo input format, La@TeX{} input format, @acronym{SGML} or @acronym{XML} using a publicly available @acronym{DTD}, and standard-conforming simple @acronym{HTML}, PostScript or @acronym{PDF} designed for human modification. Examples of transparent image formats include @acronym{PNG}, @acronym{XCF} and @acronym{JPG}. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, @acronym{SGML} or @acronym{XML} for which the @acronym{DTD} and/or processing tools are not generally available, and the machine-generated @acronym{HTML}, PostScript or @acronym{PDF} produced by some word processors for output purposes only. The ``Title Page'' means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, ``Title Page'' means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section ``Entitled XYZ'' means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as ``Acknowledgements'', ``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' of such a section when you modify the Document means that it remains a section ``Entitled XYZ'' according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. @item VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. @item COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. @item MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: @enumerate A @item Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. @item List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. @item State on the Title page the name of the publisher of the Modified Version, as the publisher. @item Preserve all the copyright notices of the Document. @item Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. @item Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. @item Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. @item Include an unaltered copy of this License. @item Preserve the section Entitled ``History'', Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled ``History'' in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. @item Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the ``History'' section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. @item For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. @item Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. @item Delete any section Entitled ``Endorsements''. Such a section may not be included in the Modified Version. @item Do not retitle any existing section to be Entitled ``Endorsements'' or to conflict in title with any Invariant Section. @item Preserve any Warranty Disclaimers. @end enumerate If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled ``Endorsements'', provided it contains nothing but endorsements of your Modified Version by various parties---for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. @item COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled ``History'' in the various original documents, forming one section Entitled ``History''; likewise combine any sections Entitled ``Acknowledgements'', and any sections Entitled ``Dedications''. You must delete all sections Entitled ``Endorsements.'' @item COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. @item AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an ``aggregate'' if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. @item TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled ``Acknowledgements'', ``Dedications'', or ``History'', the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. @item TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. @item FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the @acronym{GNU} Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See @uref{http://@/www.gnu.org/@/copyleft/}. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License ``or any later version'' applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. @end enumerate enblend-enfuse-4.1.2+dfsg/doc/versenblend.texi0000644000175100017510000000014212224473655021537 0ustar ametzlerametzler@set UPDATED 7 October 2013 @set UPDATED-MONTH October 2013 @set EDITION 4.1.2 @set VERSION 4.1.2 enblend-enfuse-4.1.2+dfsg/doc/seam-generators.texi0000644000175100017510000000610412070530113022306 0ustar ametzlerametzlerThis version (@value{VERSION}) of Enblend supports two main algorithms to generate seam lines. Use option@tie{}@option{--primary-seam-generator} to select one of the generators. @table @asis @item Nearest Feature Transform (@acronym{NFT}) @cindex nearest feature transform (@acronym{NFT}) The @acronym{NFT}, also known as @uref{http://en.wikipedia.org/@/wiki/@/Distance_transform, Distance Transform}, is a fast and efficient technique to produce a seam line route given the geometries of multiple overlapping images. @acronym{NFT} as implemented in this version of Enblend only takes into account the @emph{shape of the overlap area.} It completely ignore the images' contents. @item Graph-Cut (@acronym{GC}) @cindex graphcut (@acronym{GC}) @uref{http://en.wikipedia.org/@/wiki/@/Graph_@/cuts_@/in_@/computer_@/vision, @acronym{GC}} is a region-oriented way of segmenting images. The generator is based on the idea of finding a minimum cost ``cut'' of a graph created from a given image pair. A ``cut'' is where the seam line appears. @acronym{GC} determines the cost from the overlapping images' contents. @end table @cindex graphcut, details @cindex seam generation, details The most significant difference between the two algorithms is the output mask gradation. @acronym{NFT} produces a coarse approximation of the seam, running as far away from the overlap-region borders as possible. The resulting mask could then be blended as-is, however, Enblend by default runs image-content dependent optimizers to increase the mask gradation and for example omits the regions where the images differ. The result is a finer seam line, which only loosely follows the shape of @acronym{NFT}'s primary seam. Graph-Cut, on the other hand, is capable of producing the final mask in one pass without the need of further optimizers. It looks for a seam line that is @emph{globally} optimal, taking into account @itemize @item feature frequency, as well as @item image dissimilarity. @end itemize @noindent This means, the seam is less likely to cross lines like for example fences, lampposts, or road markings, where they would be visible. The optimizers which run after @acronym{NFT} can also be run after @acronym{GC}. Nevertheless, @acronym{GC} works best just with a fine mask (option@tie{}@option{--fine-mask}); optimizers are then automatically @emph{turned off} to take full advantage of the detailed seam @acronym{GC} produces. @acronym{GC} requires more memory and computation time to complete than @acronym{NFT}. Thus, it is best to prefer @acronym{NFT} where the images used are large and execution time is crucial. If quality is the priority, using @acronym{GC} and fine mask usually produces visually more pleasing results. @cindex graphcut, limitations @acronym{GC} is currently limited to seams that begin and end on the images' borders. This means that the algorithm cannot run in cases where, for example, one image is contained in another, resulting in a loop-like seam. In such cases, though, Enblend automatically falls back to a @acronym{NFT}-generated seam, making its application transparent to the user. enblend-enfuse-4.1.2+dfsg/doc/auxmac.tex0000644000175100017510000000045512070530113020322 0ustar ametzlerametzler\input thumbpdf.sty % Auxilliary Macros. % % Include this file before texinfo.tex! \def\mathit#1{\hbox{\it #1}} \def\mathrm#1{\ifmmode{\rm #1}\else #1\fi} % These definitions are required for older versions of texinfo.tex. \def\geq{\ifmmode \ge\else $\ge$\fi} \def\leq{\ifmmode \le\else $\le$\fi} enblend-enfuse-4.1.2+dfsg/doc/ReplaceValues.pl0000644000175100017510000000207712070530113021414 0ustar ametzlerametzler#! /usr/bin/env perl use strict; # Syntax: ReplaceValues.pl [= [= ...]] [ ...] # Parse Arguments for strings enclosed with "@" to substitute # e.g. option e.g. abc=3 # produces from a line # bla bla @abc@ bla # the following # bla bla 3 bla ################################### # Without the options this acts like "cat" command in unix OS ################################### my %Subst = (); for my $arg (@ARGV) { if ($arg =~ /^([^=]+)=(.*)$/) { $Subst{$1} = $2; } else { # $arg should be filename here &SubstituteDataInFile($arg); } } exit(0); ################################################################# sub SubstituteDataInFile($) { my ($InFile) = @_; open(FI, '<', $InFile) || die("Could not read \"$InFile\""); while (my $l = ) { print &SubstituteDataInLine($l); } close(FI); } sub SubstituteDataInLine($) {my ($line) = @_; my $result = $line; for my $k (keys %Subst) { while ($result =~ s/\@$k@/$Subst{$k}/) { } } return($result); } enblend-enfuse-4.1.2+dfsg/doc/varsenfuse.texi0000644000175100017510000000623612224473525021417 0ustar ametzlerametzler@c enfuse.cc:105 @set src::default-contrast-window-size 5 @c enfuse.cc:108 @set src::default-edge-scale 0.0 @c enfuse.cc:114 @set src::default-entropy-lower-cutoff 0% @c enfuse.cc:115 @set src::default-entropy-upper-cutoff 100% @c enfuse.cc:113 @set src::default-entropy-window-size 3 @c enfuse.cc:95 @set src::default-exposure-lower-cutoff 0% @c enfuse.cc:97 @set src::default-exposure-lower-cutoff-projector anti-value @c enfuse.cc:102 @set src::default-exposure-mu 0.5 @c enfuse.cc:103 @set src::default-exposure-sigma 0.2 @c enfuse.cc:96 @set src::default-exposure-upper-cutoff 100% @c enfuse.cc:98 @set src::default-exposure-upper-cutoff-projector value @c enfuse.cc:121 @set src::default-hard-mask-template hardmask-%n.tif @c enfuse.cc:110 @set src::default-lce-factor 0.0 @c enfuse.cc:109 @set src::default-lce-scale 0.0 @c enfuse.cc:112 @set src::default-minimum-curvature 0 @c global.h:77 @set src::default-output-filename a.tif @c enfuse.cc:120 @set src::default-soft-mask-template softmask-%n.tif @c global.h:152 @set src::default-tiff-resolution 300@dmn{dpi} @c enfuse.cc:81 @set src::default-verbosity-level 1 @c enfuse.cc:99 @set src::default-weight-contrast 0.0 @c enfuse.cc:101 @set src::default-weight-entropy 0.0 @c enfuse.cc:94 @set src::default-weight-exposure 1.0 @c enfuse.cc:100 @set src::default-weight-saturation 0.2 @c enfuse.cc:1689 @set src::layer-selector all-layers @c common.h:122 @set src::mark-frozen-point cross @c common.h:118 @set src::mark-movable-point diamond @c enfuse.cc:1314 @set src::maximum-exposure-mu 1 @c common.h:56 @set src::maximum-pyramid-levels 29 @c enfuse.cc:1281 @set src::maximum-weight-contrast 1 @c enfuse.cc:1343 @set src::maximum-weight-entropy 1 @c enfuse.cc:1265 @set src::maximum-weight-exposure 1 @c enfuse.cc:1297 @set src::maximum-weight-saturation 1 @c enfuse.cc:1410 @set src::minimum-cache-block-size 1@dmn{KB} @c enfuse.cc:1509 @set src::minimum-cache-size 1@dmn{MB} @c enfuse.cc:1370 @set src::minimum-contrast-window-size 3 @c enfuse.cc:1390 @set src::minimum-entropy-window-size 3 @c enfuse.cc:1311 @set src::minimum-exposure-mu 0 @c enfuse.cc:1327 @set src::minimum-exposure-sigma 0 @c bounds.h:120 @set src::minimum-pyramid-levels 1 @c enfuse.cc:1357 @set src::minimum-verbosity-level 0 @c enfuse.cc:1278 @set src::minimum-weight-contrast 0 @c enfuse.cc:1340 @set src::minimum-weight-entropy 0 @c enfuse.cc:1262 @set src::minimum-weight-exposure 0 @c enfuse.cc:1294 @set src::minimum-weight-saturation 0 @c common.h:128 @set src::visualize-first-vertex-value-color medium green @c common.h:120 @set src::visualize-frozen-point bright white @c common.h:124 @set src::visualize-initial-path-color dark yellow @c common.h:116 @set src::visualize-movable-point light orange @c common.h:130 @set src::visualize-next-vertex-value-color light green @c common.h:132 @set src::visualize-no-overlap-value-color dark red @c common.h:126 @set src::visualize-short-path-value-color bright yellow @c common.h:134 @set src::visualize-state-space-color dark blue @c common.h:136 @set src::visualize-state-space-inside-color bright cyan @c common.h:138 @set src::visualize-state-space-unconverged-color bright magenta enblend-enfuse-4.1.2+dfsg/doc/mask-template-characters.texi0000644000175100017510000000630712070530113024100 0ustar ametzlerametzler@float Table,Table:mask-template-characters @table @code @dbtitle{Mask Template Characters} @item %% @cindex mask template character, @samp{%} Produces a literal @samp{%}-sign. @item %i @cindex mask template character, @samp{i} Expands to the index of the mask file starting at zero. @samp{%i} supports setting a pad character or a width specification: @display @code{%} @var{PAD} @var{WIDTH} @code{i} @end display @var{PAD} is either @samp{0} or any punctuation character; the default pad character is @samp{0}. @var{WIDTH} is an integer specifying the minimum width of the number. The default is the smallest width given the number of input images, this is 1 for 2--9 images, 2 for 10--99 images, 3 for 100--999 images, and so on. Examples: @samp{%i}, @samp{%02i}, or @samp{%_4i}. @item %n @cindex mask template character, @samp{n} Expands to the number of the mask file starting at one. Otherwise it behaves identically to @samp{%i}, including pad character and width specification. @item %p @cindex mask template character, @samp{p} This is the full name (path, filename, and extension) of the input file associated with the mask. Example: If the input file is called @file{/home/@/luser/@/snap/@/img.jpg}, @samp{%p} expands to @file{/home/@/luser/@/snap/@/img.jpg}, or shorter: @samp{%p} @result{} @file{/home/@/luser/@/snap/@/img.jpg}. @item %P @cindex mask template character, @samp{P} This is the full name of the output file. @item %d @cindex mask template character, @samp{d} Is replaced with the directory part of the associated input file. @ifhtml See Info file @file{coreutils.info}, node ``dirname invocation''. @end ifhtml @ifnothtml @inforef{dirname invocation, Stripping a non-directory suffix from a file name, coreutils.info}. @end ifnothtml Example (cont.): @samp{%d} @result{} @file{/home/@/luser/@/snap}. @item %D @cindex mask template character, @samp{D} Is replaced with the directory part of the output file. @item %b @cindex mask template character, @samp{b} Is replaced with the non-directory part (often called ``basename'') of the associated input file. @ifhtml See Info file @file{coreutils.info}, node ``basename invocation''. @end ifhtml @ifnothtml @inforef{basename invocation, Stripping a directory and suffix from a file name, coreutils.info}. @end ifnothtml Example (cont.): @samp{%b} @result{} @file{img.jpg}. @item %B @cindex mask template character, @samp{B} Is replaced with the non-directory part of the output file. @item %f @cindex mask template character, @samp{f} Is replaced with the filename without path and extension of the associated input file. Example (cont.): @samp{%f} @result{} @file{img}. @item %F @cindex mask template character, @samp{F} Is replaced with the filename without path and extension of the output file. @item %e @cindex mask template character, @samp{e} Is replaced with the extension (including the leading dot) of the associated input file. Example (cont.): @samp{%e} @result{} @file{.jpg}. @item %E @cindex mask template character, @samp{E} Is replaced with the extension of the output file. @end table @caption{Special characters to control the generation of mask filenames.} @shortcaption{Mask template characters} @cindex mask template characters, table of @end float enblend-enfuse-4.1.2+dfsg/doc/tuning-memory-usage.texi0000644000175100017510000001332712070530113023133 0ustar ametzlerametzlerThe default configuration of Enblend and Enfuse assumes a system with 3--4@dmn{GB} of @acronym{RAM}. @cindex image cache If Enblend and Enfuse have been compiled with the ``image-cache'' feature, they do not rely on the operating system's memory management, but use their own image cache in the file system. To find out whether your version uses the image cache say @example enblend --verbose --version @end example @noindent or @example enfuse --verbose --version @end example @noindent @cindex image cache, location @cindex @env{TMPDIR} Enblend and Enfuse put the file that holds the image cache either in the directory pointed to by the environment variable@tie{}@env{TMPDIR}, or, if the variable is not set, in directory@tie{}@file{/tmp}. It is prudent to ensure write permissions and enough of free space on the volume with the cache file. @opindex -m @opindex -b The size of the image cache is user configurable with the option@tie{}@samp{-m @var{CACHE-SIZE}} (@pxref{Extended Options}). Furthermore, option@tie{}@samp{-b @var{BUFFER-SIZE}} (@pxref{Extended Options}) allows for fine-tuning the size of a single buffer inside the image cache. Note that @var{CACHE-SIZE} is given in megabytes, whereas the unit of @var{BUFFER-SIZE} is kilobytes. Usually the user lets the operating system take care of the memory management of all processes. However, users of Enblend or Enfuse might want to control the balance between the operating systems' @uref{http://@/en.wikipedia.org/@/wiki/@/Virtual_@/memory, Virtual Memory} system and the image cache for several reasons. @itemize @item Paging in or out parts of a process' image runs at kernel level and thus can make user processes appear unresponsive or ``jumpy''. The caching mechanism of Enblend and Enfuse of course runs as a user process, which is why it has less detrimental effects on the system's overall responsiveness. @item The image cache has been optimized for accesses to image data. All algorithms in Enblend and Enfuse have been carefully arranged to play nice with the image cache. An operating system's cache has no knowledge of these particular memory access patterns. @item The disk access of the operating system to the swap device has been highly optimized. Enblend and Enfuse on the other hand use the standard @acronym{IO}-layer, which is a much slower interface. @item Limiting the amount of image cache prevents Enblend and Enfuse from eating up most or all @acronym{RAM}, thereby forcing all user applications into the swap. @end itemize @noindent The @var{CACHE-SIZE} should be set in such a way as to reconcile all of the above aspects even for the biggest data sets, that is, projects with many large images. @ref{Table:cache-size-settings} suggests some cache- and buffer-sizes for different amounts of available @acronym{RAM}. @float Table,Table:cache-size-settings @ifinfo @example @acronym{RAM} | @var{CACHE-SIZE} | @var{BUFFER-SIZE} | Comment MB | MB | KB | ------+------------+-------------+--------- 4096 | 1024 | 2048 | default 2048 | 512--1024 | 1024 | 1024 | 256--512 | 256--512 | @end example @end ifinfo @html
RAM CACHE-SIZE BUFFER-SIZE Comment
MB MB KB
4096 1024 2048 default
2048 512–1024 1024
1024 256–512 256–512
@end html @tex { \vskip0.5\baselineskip \offinterlineskip \halign{ \indent\strut\hfil#\hfil& \quad\vrule#& \quad\hfil#\hfil& \quad\vrule#& \quad\hfil#\hfil& \quad\vrule#& \quad#\hfil\cr \bf RAM && \bf CACHE-SIZE && \bf BUFFER-SIZE && \bf Comment \cr \bf MB && \bf MB && \bf KB && \cr\noalign{\hrule} \omit &\vrule height.667ex width0pt& \omit && \omit && \cr 4096 && 1024 && 2048 && default \cr 2048 && 512--1024 && 1024 && \cr 1024 && 256--512 && 256--512 && \cr } } @end tex @docbook Suggested cache-size settings RAM CACHE-SIZE BUFFER-SIZE Comment MB MB KB 4096 1024 2048 default 2048 512–1024 1024 1024 256–512 256–512
@end docbook @caption{Suggested cache-size settings} @c @shortcaption{} @end float On systems with considerably more than 4@dmn{GB} of @acronym{RAM} it is recommended to run Enblend or Enfuse versions without image cache. enblend-enfuse-4.1.2+dfsg/doc/entropy-cutoff.gp.in0000644000175100017510000000234312070530113022241 0ustar ametzlerametzler# Plot example of entropy-cutoff function load "@srcdir@/config.gp" Lower = 0.05 Upper = 0.9 Offset = 5e-3 _Epsilon = 1.0 / 1024.0 Step(X) = X < 0 ? 0 : (X > _Epsilon ? 1 : 1/0) EntropyCutoffProper(Y, LowerCutoff, UpperCutoff) = \ Y <= LowerCutoff ? 0.0 : (Y >= UpperCutoff ? 1.0 : Y) EntropyCutoff(Y, LowerCutoff, UpperCutoff) = \ Step(Y - LowerCutoff) * Step(UpperCutoff - Y) * \ EntropyCutoffProper(Y, LowerCutoff, UpperCutoff) + \ Step(Y - UpperCutoff) set grid set key right bottom set samples 1023 set xlabel "Y" set xtics 0.2 set ylabel "EC" set yrange [-0.1:1.1] set ytics 0.2 set terminal unknown plot [Y = 0:1] Y + Offset, EntropyCutoff(Y, Lower, Upper) - Offset set output "entropy-cutoff.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "entropy-cutoff.eps" set terminal postscript eps enhanced replot set output "entropy-cutoff.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - entropy-cutoff.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/entropy-cutoff.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/authors.texi0000644000175100017510000000233512070530113020701 0ustar ametzlerametzler@sc{Andrew Mihal} (@email{acmihal@@users.sourceforge.net}) has written Enblend and Enfuse. @noindent @strong{Contributors} @itemize @item @sc{Pablo d'Angelo} (@email{dangelo@@users.sourceforge.net}) added the contrast criteria. @item @sc{Joe Beda}: Win32 porting up to version@tie{}3.2. @item @sc{Kornel Benko}, @email{kornelbenko@@users.sourceforge.net}: CMake support for version@tie{}4.0. @item @sc{Roger Goodman}: Proofreading of the manuals. @item @sc{Max Lyons}. @item @sc{Mark} aka mjz: Win32 porting up to version@tie{}3.2. @item @sc{Thomas Modes}, @email{tmodes@@users.sourceforge.net}: Win32 porting of version@tie{}4.0. @item @sc{Ryan Sleevi}, @email{ryansleevi@@users.sourceforge.net}: Win32 porting of version@tie{}4.0. @item @sc{Christoph Spiel} (@email{cspiel@@users.sourceforge.net}) added the gray projectors, the @acronym{LoG}-based edge detection, an O(n)-algorithm for the calculation of local contrast, entropy weighting, and various other features. @item @sc{Brent Townshend}, @email{btownshend@@users.sourceforge.net}: @acronym{HDR} support. @end itemize @noindent Thanks to @sc{Simon Andriot} and @sc{Pablo Joubert} for suggesting the @sc{Mertens}-@sc{Kautz}-@sc{Van Reeth} technique and the name ``Enfuse''. enblend-enfuse-4.1.2+dfsg/doc/helpful-programs.texi0000644000175100017510000001064012070530113022501 0ustar ametzlerametzlerSeveral programs and libraries have proven helpful when working with Enfuse and Enblend. @table @strong @item Raw Image Conversion @itemize @item @pindex dcraw @uref{http://@/www.cybercom.net/@/~dcoffin/@/dcraw/, DCRaw} is a universal raw-converter written by @sc{David Coffin}. @item @pindex ufraw @pindex ufraw-batch @uref{http://@/ufraw.sourceforge.net/, UFRaw}, a raw converter written by @sc{Udi Fuchs} and based on DCRaw, adds a @acronym{GUI} (@command{ufraw}), versatile batch processing (@command{ufraw-batch}), and some additional features such as cropping, noise reduction with wavelets, and automatic lens error correction. @end itemize @item Image Alignment and Rendering @itemize @item @pindex ale @uref{http://@/auricle.dyndns.org/ALE/, ALE}, @sc{David Hilvert's} anti-lamenessing engine for the real die-hard command-line users aligns, filters, and renders images. @item @pindex hugin @uref{http://@/hugin.sourceforge.net/, Hugin} is a @acronym{GUI} that aligns and stitches images. @pindex nona @r{(Hugin)} @pindex align_image_stack @r{(Hugin)} @pindex fulla @r{(Hugin)} It comes with several command line tools, like @command{nona} to stitch panorama images, @command{align_image_stack} to align overlapping images for @acronym{HDR} or create focus stacks, and @command{fulla} to correct lens errors. @item @pindex PTOptimizer @r{(PanoTools)} @pindex PTmender @r{(PanoTools)} @uref{http://@/panotools.sourceforge.net/, PanoTools} the successor of @sc{Helmut Dersch's} @uref{http://@/www.all-in-one.ee/@/~dersch/, original PanoTools} offers a set of command-line driven applications to create panoramas. Most notable are @command{PTOptimizer} and @command{PTmender}. @end itemize @item Image Manipulation @itemize @item @pindex cinepaint @uref{http://@/www.cinepaint.org/, CinePaint} is a branch of an early Gimp forked off at version@tie{}1.0.4. It sports much less features than the current Gimp, but offers 8@dmn{bit}, 16@dmn{bit} and 32@dmn{bit} color channels, @acronym{HDR} (for example floating-point @acronym{TIFF}, and @acronym{OpenEXR}), and a tightly integrated color management system. @item @pindex gimp The @uref{http://@/www.gimp.org/, Gimp} is a general purpose image manipulation program. At the time of this writing it is still limited to images with only 8@dmn{bits} per channel. @item @pindex convert @r{(ImageMagick)} @pindex display @r{(ImageMagick)} @pindex identify @r{(ImageMagick)} @pindex montage @r{(ImageMagick)} @pindex gm @r{(GraphicsMagick)} @uref{http://@/www.imagemagick.org/, ImageMagick} and its clone @uref{http://@/www.graphicsmagick.org/, GraphicsMagick} are general purpose command-line driven image manipulation programs, for example, @command{convert}, @command{display}, @command{identify}, and @command{montage}. @end itemize @item High Dynamic Range @itemize @item @pindex exrdisplay @r{(OpenEXR)} @uref{http://@/www.openexr.com/, OpenEXR} offers libraries and some programs to work with the @acronym{EXR} @acronym{HDR} format. @item @pindex pfsin @r{(PFSTools)} @pindex pfsout @r{(PFSTools)} @pindex pfsview @r{(PFSTools)} @pindex pfshdrcalibrate @r{(PFScalibration)} @pindex pfstmo_* @r{(PFStmo)} @uref{http://@/pfstools.sourceforge.net/, PFSTools} create, modify, and tonemap high-dynamic range images. @end itemize @item Libraries @itemize @item @cindex LibJPEG @uref{http://@/www.ijg.org/, LibJPEG} is a library for handling the @acronym{JPEG} (@acronym{JFIF}) image format. @item @cindex LibPNG @uref{http://@/www.libpng.org/@/pub/@/png/@/libpng.html, LibPNG} is a library that handles the Portable Network Graphics (@acronym{PNG}) image format. @item @cindex LibTiff @uref{http://@/www.remotesensing.org/@/libtiff/, LibTIFF} offers a library and utility programs to manipulate the ubiquitous Tagged Image File Format, @acronym{TIFF}. @pindex tiffinfo @r{(libtiff)} The nifty @command{tiffinfo} command quickly inquires the properties of @acronym{TIFF} files. @end itemize @item Meta-Data Handling @itemize @item @pindex exiftool @uref{http://@/www.sno.phy.queensu.ca/@/~phil/@/exiftool/, EXIFTool} reads and writes @acronym{EXIF} meta data. In particular it copies meta data from one image to another. @item @pindex tifficc @r{(LittleCMS)} @uref{http://@/www.littlecms.com/, LittleCMS} is the color management library used by Hugin, DCRaw, UFRaw, Enblend, and Enfuse. It supplies some binaries, too. @command{tifficc}, an @acronym{ICC} color profile applier, is of particular interest. @end itemize @end table enblend-enfuse-4.1.2+dfsg/doc/macros.cmake0000644000175100017510000001316012070530113020605 0ustar ametzlerametzler# used to copy files or directories for to - directory # copied files will also be installed macro(doc_copybin _depend_list _basename) set_source_files_properties(${_basename} GENERATED) if (${ARGV1} MATCHES "DIR") set(cp_command "copy_directory") install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_basename}" DESTINATION ${DocumentsDirectory}) else() set(cp_command "copy") install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_basename}" DESTINATION ${DocumentsDirectory}) endif() add_custom_command( OUTPUT ${_basename} COMMAND ${CMAKE_COMMAND} -E ${cp_command} "${TOP_SRC_DIR}/doc/${_basename}" ${_basename} DEPENDS "${TOP_SRC_DIR}/doc/${_basename}" COMMENT "Copy ${TOP_SRC_DIR}/doc/${_basename} ${_basename}" ) list(APPEND ${_depend_list} ${_basename}) endmacro(doc_copybin) # used to create config-h.texi macro(doc_create_configh_texi _depend_list _basename2) add_custom_command( OUTPUT "${_basename2}" COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/doc/define2set.pl" "${CMAKE_BINARY_DIR}/config.h" ">" "${_basename2}" DEPENDS "${CMAKE_BINARY_DIR}/config.h" COMMENT "Creating ${_basename2}" ) list(APPEND ${_depend_list} "${_basename2}") endmacro() # used to create "eps", "gif", "pdf" and "png" from fig macro(doc_create_fig2dev _depend_list _basename _ext) add_custom_command( OUTPUT "${_basename}.${_ext}" COMMAND ${FIG2DEV_EXE} -L ${_ext} "${TOP_SRC_DIR}/doc/${_basename}.fig" ">" "${_basename}.${_ext}" DEPENDS "${TOP_SRC_DIR}/doc/${_basename}.fig" COMMENT "fig2dev: Creating ${_basename}.${_ext} from ${TOP_SRC_DIR}/doc/${_img}.fig" ) list(APPEND ${_depend_list} ${_basename}.${_ext}) endmacro() # used to create "txt", "pdf", "eps" and "svg" from "gp" via gnuplot macro(doc_create_gp_images _depend_list _basename) set(_created) foreach(_ext "txt" "pdf" "eps" "svg") list(APPEND _created "${CMAKE_CURRENT_BINARY_DIR}/${_basename}.${_ext}") endforeach(_ext) add_custom_command( OUTPUT ${_created} COMMAND ${GNUPLOT_EXECUTABLE} ${_basename}.gp DEPENDS ${_basename}.gp COMMENT "gnuplot: Creating ${_created} from ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.gp" ) install(FILES ${_created} DESTINATION ${DocumentsDirectory}) list(APPEND ${_depend_list} ${_created}) endmacro(doc_create_gp_images) # used to create "gp" from "gp.in" macro(doc_create_gp_in_files _depend_list _basename) set(_basename1 ${_basename}.gp.in) set(_basename2 ${_basename}.gp) add_custom_command( OUTPUT "${_basename2}" COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/doc/ReplaceValues.pl" "srcdir=${srcdir}" "RASTER_DIR=${RASTER_DIR}" "${TOP_SRC_DIR}/doc/${_basename1}" ">" "${_basename2}" DEPENDS "${TOP_SRC_DIR}/doc/${basename1}" COMMENT "Creating ${_basename2}, basename1=${_basename1}" ) list(APPEND ${_depend_list} "${_basename2}") endmacro() # Select files matching the extension and add the names without the extension # to the destination list macro(doc_create_selection _list _ext _destlist) set(${_destlist}) # empty destination list first foreach(_src ${${_list}}) if(${_src} MATCHES "^(.+)\\.${_ext}$") #select from the list those with expected extension list(APPEND ${_destlist} ${CMAKE_MATCH_1}) # Add the base name without extension only endif() endforeach(_src) endmacro(doc_create_selection) # used to create "gif", "eps" and "png" from "tif" macro(doc_create_tif_images _depend_list _basename) foreach(_type "gif" "eps" "png") set(_basename2 ${_basename}.${_type}) add_custom_command( OUTPUT "${_basename}.${_type}" COMMAND ${IMAGEMAGICK_CONVERT_EXECUTABLE} "${TOP_SRC_DIR}/doc/${_basename}.tif" "${_basename2}" DEPENDS "${TOP_SRC_DIR}/doc/${_basename}.tif" COMMENT "convert: creating ${_basename2}" ) list(APPEND ${_depend_list} "${_basename2}") endforeach() endmacro() # used to create "txt" from /"fig" macro(doc_create_txt_from_fig _depend_list _basename) add_custom_command( OUTPUT "${_basename}.txt" COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/doc/fig2txt.pl" "${TOP_SRC_DIR}/doc/${_basename}.fig" ">" "${_basename}.txt" DEPENDS "${TOP_SRC_DIR}/doc/${_basename}.fig" COMMENT "perl: creating ${_basename}.txt" ) list(APPEND ${_depend_list} "${_basename}.txt") endmacro() # create vars*.texi files macro(doc_varscreate_file _depend_list _basename) set(_depends "${TOP_SRC_DIR}/src/${_basename}.cc" "${TOP_SRC_DIR}/src/bounds.h" "${TOP_SRC_DIR}/src/common.h" "${TOP_SRC_DIR}/src/global.h") set(_basename2 "vars${_basename}.texi") add_custom_command( OUTPUT "${_basename2}" COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/doc/docstrings" ${_depends} ">" "${_basename2}" DEPENDS ${_depends} COMMENT "perl: creating ${_basename2}" ) list(APPEND ${_depend_list} "${_basename2}") endmacro() # used to create vers*.texi macro(doc_verscopy_file _depend_list _basename) add_custom_command( OUTPUT "${_basename}" COMMAND COMMAND ${PERL_EXECUTABLE} "${TOP_SRC_DIR}/doc/CreateVersTexi.pl" "${TOP_SRC_DIR}/doc/${_basename}" "${_version_lines}" ${A4} > "${_basename}" DEPENDS "${TOP_SRC_DIR}/doc/${_basename}" COMMENT "perl: ${TOP_SRC_DIR}/doc/${_basename} -> ${_basename}" ) list(APPEND ${_depend_list} ${_basename}) endmacro() # copy from source-dir to build-dir macro(doc_copy_file _basename _basename2) add_custom_command( OUTPUT "${_basename2}" COMMAND ${CMAKE_COMMAND} -E copy "${TOP_SRC_DIR}/doc/${_basename}" "${_basename2}" DEPENDS "${TOP_SRC_DIR}/doc/${_basename}" COMMENT "Copy ${TOP_SRC_DIR}/doc/${_basename} ${_basename2}" ) list(APPEND copy_cmake_depends ${_basename2}) endmacro() enblend-enfuse-4.1.2+dfsg/doc/local-analysis-window.fig0000644000175100017510000000775712070530113023245 0ustar ametzlerametzler#FIG 3.2 Produced by xfig version 3.2.5 Portrait Center Metric A4 100.00 Single -2 # ---BEGIN-TEXT--- # window size = 3 window size = 5 # # | | | | | | | | | | # -+---+---+---+- -+---+---+---+---+---+- # | N | N | N | | N | N | N | N | N | # -+---+---+---+- -+---+---+---+---+---+- # | N | C | N | | N | N | N | N | N | # -+---+---+---+- -+---+---+---+---+---+- # | N | N | N | | N | N | C | N | N | # -+---+---+---+- -+---+---+---+---+---+- # | | | | | N | N | N | N | N | # -+---+---+---+---+---+- # | N | N | N | N | N | # -+---+---+---+---+---+- # | | | | | | # ---END-TEXT--- 1200 2 6 1627 1909 1844 2885 4 1 0 50 0 16 14 0.0000 4 210 195 1736 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 1736 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 1736 2473 N\001 -6 6 2387 1909 2604 2885 4 1 0 50 0 16 14 0.0000 4 210 195 2517 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 2517 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 2517 2473 N\001 -6 6 4514 1475 4840 3319 4 1 0 50 0 16 14 0.0000 4 210 195 4666 1692 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 4666 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 4666 2473 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 4666 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 4666 3254 N\001 -6 6 4948 1475 5165 3319 4 1 0 50 0 16 14 0.0000 4 210 195 5057 1692 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5057 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5057 2473 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5057 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5057 3254 N\001 -6 6 5708 1475 5925 3319 4 1 0 50 0 16 14 0.0000 4 210 195 5838 1692 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5838 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5838 2473 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5838 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5838 3254 N\001 -6 6 6142 1475 6359 3319 4 1 0 50 0 16 14 0.0000 4 210 195 6228 1692 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 6228 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 6228 2473 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 6228 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 6228 3254 N\001 -6 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1280 2213 2973 2213 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1280 2603 2973 2603 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1280 2994 2973 2994 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1280 1822 2973 1822 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2322 1562 2322 3254 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 2712 1562 2712 3254 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1931 1562 1931 3254 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 1540 1562 1540 3254 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 2213 6684 2213 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 2603 6684 2603 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 2994 6684 2994 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 1822 6684 1822 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 5252 1171 5252 3645 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 5642 1171 5642 3645 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 6033 1171 6033 3645 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 6424 1171 6424 3645 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 1431 6684 1431 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4210 3385 6684 3385 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4861 1171 4861 3645 2 1 0 1 0 7 50 0 -1 0.000 0 0 -1 0 0 2 4471 1171 4471 3645 4 1 0 50 0 16 14 0.0000 4 210 195 2126 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 2126 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 210 2126 2473 C\001 4 1 0 50 0 16 14 0.0000 4 180 3060 2191 780 window size = 3\001 4 1 0 50 0 16 14 0.0000 4 210 1980 5382 780 window size = 5\001 4 1 0 50 0 16 14 0.0000 4 210 195 5447 1692 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5447 2082 N\001 4 1 0 50 0 16 14 0.0000 4 210 210 5447 2473 C\001 4 1 0 50 0 16 14 0.0000 4 210 195 5447 2864 N\001 4 1 0 50 0 16 14 0.0000 4 210 195 5447 3254 N\001 enblend-enfuse-4.1.2+dfsg/doc/focus-stack-decision-tree.fig0000644000175100017510000001413212070530113023760 0ustar ametzlerametzler#FIG 3.2 Produced by xfig version 3.2.5 Portrait Center Metric A4 100.00 Single -2 # ---BEGIN-TEXT--- # o # | # _____________V_____________ # / \ # | Use local contrast window | # \___________________________/ # | # V [else] # +----------------------\ # [visible seams] | | # _____________V_____________ | # / \ | # | Use Laplacian-of-Gaussian | | # \___________________________/ | # | | # V [else] | # +--------------------->| # [still visible seams] | | # ______________V______________ | # / \ | # | Apply positive MinCurvature | | # \_____________________________/ | # | | # V [else] V # +--------------------->| # [loss of fine detail] | | # | | # | | # [mild loss of detail] V | # /--------------+ | # | | | # _________V__________ | | # / \ | | # | Use local contrast | | | # | enhancement | | | # \____________________/ | | # | V | # \------------->+ | # | | # _____________V_______________ | # / \ | # | Apply negative MinCurvature | | # \_____________________________/ | # | V # \--------------------->O # ---END-TEXT--- 1200 2 6 3240 2250 5670 2610 2 4 0 1 0 7 50 -1 -1 0.000 0 0 8 0 0 5 5670 2250 5670 2610 3240 2610 3240 2250 5670 2250 4 1 0 50 -1 16 11 0.0000 4 180 2280 4454 2476 Use Laplacian-of-Gaussian\001 -6 6 3240 3690 5760 4050 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5760 3690 5760 4050 3240 4050 3240 3690 5760 3690 4 1 0 50 -1 16 11 0.0000 4 180 2400 4500 3915 Apply positive MinCurvature\001 -6 6 1530 5580 4320 5940 2 4 0 1 0 7 50 -1 -1 0.000 0 0 8 0 0 5 4320 5580 4320 5940 1530 5940 1530 5580 4320 5580 4 1 0 50 -1 16 11 0.0000 4 135 2685 2924 5827 Use local contrast enhancement\001 -6 6 6480 7200 6840 7560 1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 6660 7380 180 180 6660 7380 6840 7380 1 3 0 1 0 7 50 -1 0 0.000 1 0.0000 6660 7380 90 90 6660 7380 6750 7380 -6 6 3240 6750 5760 7110 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5760 6750 5760 7110 3240 7110 3240 6750 5760 6750 4 1 0 50 -1 16 11 0.0000 4 180 2475 4499 6975 Apply negative MinCurvature\001 -6 6 3330 810 5670 1170 2 4 0 1 0 7 50 -1 -1 0.000 0 0 8 0 0 5 5670 810 5670 1170 3330 1170 3330 810 5670 810 4 1 0 50 -1 16 11 0.0000 4 135 2190 4500 1060 Use local contrast window\001 -6 1 3 0 1 0 0 50 -1 20 0.000 1 0.0000 4500 360 90 90 4500 360 4590 360 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 2970 4140 3150 4500 3330 4860 3150 4500 2970 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 4050 4500 4410 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 2970 4140 3150 4500 3330 4860 3150 4500 2970 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4860 3150 6660 3150 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 2610 4500 2970 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 6660 3150 6660 4590 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 4860 1710 6660 1710 6660 3150 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 3330 4500 3690 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 4410 4140 4590 4500 4770 4860 4590 4500 4410 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4860 4590 6660 4590 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 4770 4500 5130 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 5130 4140 5310 4500 5490 4860 5310 4500 5130 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 6660 4590 6660 7200 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 5490 4500 6030 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 6030 4140 6210 4500 6390 4860 6210 4500 6030 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 6390 4500 6750 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 4140 5310 2880 5310 2880 5580 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 2880 5940 2880 6210 4140 6210 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 4500 7110 4500 7380 6480 7380 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 1890 4500 2250 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 1530 4140 1710 4500 1890 4860 1710 4500 1530 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 1170 4500 1530 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 450 4500 810 4 0 0 50 -1 16 11 0.0000 4 180 435 4950 4500 [else]\001 4 0 0 50 -1 16 11 0.0000 4 180 435 4950 3060 [else]\001 4 2 0 50 -1 16 11 0.0000 4 180 1530 3870 5220 [mild loss of detail]\001 4 0 0 50 -1 16 11 0.0000 4 180 435 4950 1620 [else]\001 4 2 0 50 -1 16 11 0.0000 4 180 1215 4410 2070 [visible seams]\001 4 2 0 50 -1 16 11 0.0000 4 180 1545 4410 3510 [still visible seams]\001 4 0 0 50 -1 16 11 0.0000 4 180 1500 4590 4950 [loss of fine detail]\001 4 0 0 50 -1 16 11 0.0000 4 180 435 4590 5670 [else]\001 enblend-enfuse-4.1.2+dfsg/doc/enblend.info0000644000175100017510000040051012224473674020625 0ustar ametzlerametzlerThis is ../../doc/enblend.info, produced by makeinfo version 4.13 from ../../doc/enblend.texi. INFO-DIR-SECTION Individual utilities START-INFO-DIR-ENTRY * enblend: (enblend). Blend images using a multiresolution spline. END-INFO-DIR-ENTRY This manual is for Enblend (version 4.1.2, 7 October 2013), a tool for compositing images in such a way that the seam between the images is invisible, or at least very difficult to see. Copyright (C) 2004-2012 ANDREW MIHAL. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".  File: enblend.info, Node: Top, Next: Overview, Up: (dir) Enblend ******* This manual is for Enblend (version 4.1.2, 7 October 2013), a tool for compositing images in such a way that the seam between the images is invisible, or at least very difficult to see. * Menu: * Overview:: Overview of Enblend's features * Workflow:: Enblend's role in making panoramas * Invocation:: Command line options and arguments * Primary Seam Generators:: Differences between available seam generators * Color Profiles:: How Enblend handles ICC color profiles * Understanding Masks:: How to interpret masks and mask files * Tuning Memory Usage:: Balancing RAM and swap * Helpful Programs:: Useful other programs * Bug Reports:: How to write bug reports * Authors:: Major contributors * FDL:: GNU Free Documentation License * Program Index:: Names of programs referenced * Syntactic-Comment Index:: Keys of syntactic comments * Option Index:: Index of all options * General Index:: Topic index  File: enblend.info, Node: Overview, Next: Workflow, Prev: Top, Up: Top 1 Overview ********** Enblend overlays multiple images using the BURT-ADELSON multiresolution spline algorithm.(1) This technique tries to make the seams between the input images invisible. The basic idea is that image features should be blended across a transition zone proportional in size to the spatial frequency of the features. For example, objects like trees and windowpanes have rapid changes in color. By blending these features in a narrow zone, you will not be able to see the seam because the eye already expects to see color changes at the edge of these features. Clouds and sky are the opposite. These features have to be blended across a wide transition zone because any sudden change in color will be immediately noticeable. Enblend expects each input file to have an alpha channel. The alpha channel should indicate the region of the file that has valid image data. Enblend compares the alpha regions in the input files to find the areas where images overlap. Alpha channels can be used to indicate to Enblend that certain portions of an input image should not contribute to the final image. Enblend does _not_ align images. Use a tool such as `hugin' or PanoTools to do this. The TIFF files produced by these programs are exactly what Enblend is designed to work with. Sometimes these GUIs allow you to select feathering for the edges of your images. This treatment is detrimental to Enblend. Turn off feathering by deselecting it or setting the feather width to zero. Enblend blends the images in the order they are specified on the command line. You should order your images according to the way that they overlap, for example from left-to-right across the panorama. If you are making a multi-row panorama, we recommend blending each horizontal row individually, and then running Enblend a last time to blend all of the rows together vertically. Enblend reads all layers of multi-layer images, like, for example, multi-directory TIFF images(2). The input images are processed in the order they appear on the command line. Multi-layer images are processed from the first layer to the last before Enblend considers the next image on the command line. Find out more about Enblend on its SourceForge (http://sourceforge.net/) web page (http://enblend.sourceforge.net/). ---------- Footnotes ---------- (1) PETER J. BURT and EDWARD H. ADELSON, "A Multiresolution Spline With Application to Image Mosaics", ACM Transactions on Graphics, Vol. 2, No. 4, October 1983, pages 217-236. (2) Use utilities like, e.g., `tiffcopy' and `tiffsplit' of LibTIFF to manipulate multi-directory TIFF images. *Note Helpful Programs::.  File: enblend.info, Node: Workflow, Next: Invocation, Prev: Overview, Up: Top 2 Workflow ********** Enblend is a part of a chain of tools to assemble images. It combines a series of pictures taken at the same location but in different directions. * Menu: * Standard Workflow:: The usual, all-in-one thing * External Mask Manipulation:: Fiddling around with the masks yourself  File: enblend.info, Node: Standard Workflow, Next: External Mask Manipulation, Up: Workflow 2.1 Standard Workflow ===================== *note Figure:photographic-workflow:: shows where Enblend and Enfuse sit in the tool chain of the standard workflow. Figure 2.1: Photographic workflow with Enblend and Enfuse. Take Images Take _multiple_ images to form a panorama, an exposure series, a focus stack, etc. There is one exception with Enfuse when a single raw image is converted multiple times to get several - typically differently "exposed" - images. _Exemplary Benefits_ * Many pictures taken from the same vantage point but showing different viewing directions. - Panorama * Pictures of the same subject exposed with different shutter speeds. - Exposure series * Images of the same subject focussed at differing distances. - Focus stack _Remaining Problem:_ The "overlayed" images may not fit together, that is the overlay regions may not match exactly. Convert Images Convert the raw data (http://www.luminous-landscape.com/tutorials/understanding-series/u-raw-files.shtml) exploiting the full dynamic range of the camera and capitalize on a high-quality conversion. Align Images Align the images so as to make them match as well as possible. Again there is one exception and this is when images naturally align. For example, a series of images taken from a rock solid tripod with a cable release without touching the camera, or images taken with a shift lens, can align without further user intervention. This step submits the images to affine transformations. If necessary, it rectifies the lens' distortions (e.g. barrel or pincushion), too. Sometimes even luminance or color differences between pairs of overlaying images are corrected ("photometric alignment"). _Benefit:_ The overlay areas of images match as closely as possible given the quality if the input images and the lens model used in the transformation. _Remaining Problem:_ The images may still not align perfectly, for example, because of parallax (http://en.wikipedia.org/wiki/Parallax) errors, or blur produced by camera shake. Combine Images Enblend and Enfuse combine the aligned images into one. _Benefit:_ The overlay areas become imperceptible for all but the most mal-aligned images. _Remaining Problem:_ Enblend and Enfuse write images with an alpha channel. (For more information on alpha channels see *note Understanding Masks::.) Furthermore, the final image rarely is rectangular. Postprocess Postprocess the combined image with your favorite tool. Often the user will want to crop the image and simultaneously throw away the alpha channel. View Print Enjoy  File: enblend.info, Node: External Mask Manipulation, Prev: Standard Workflow, Up: Workflow 2.2 External Mask Manipulation ============================== In the usual workflow Enblend and Enfuse generate the blending and fusing masks according to the command-line options and the input images and then they immediately use these masks for blending or fusing the output image. Sometimes more control over the masks is needed or wanted. To this end, both applications provide the option pair `--load-masks' and `--save-masks'. *Note Invocation::, for detailed explanations of both options. With the help of these options the processing can be broken up into two steps: Save masks with `--save-masks'. Generate masks and save them into image files. Avoid option `--output' unless the blended or fused image at this point is necessary. Load masks with `--load-masks'. Load masks from files and then blend or fuse the final image with the help of the loaded masks. In between these two steps the user may apply whatever transformation to the mask files, as long as their geometries and offsets remain the same. Thus the "Combine Images" box of *note Figure 2.1: Figure:photographic-workflow. becomes three activities as is depicted in *note Figure:external-mask-workflow::. Figure 2.2: Workflow for externally modified masks. To further optimize this kind of workflow, both Enblend and Enfuse stop after mask generation if option `--save-masks' is given, but _no output file_ is specified with the `--output' option. This way the time for pyramid generation, blending, fusing, and writing the final image to disk is saved, as well as no output image gets generated. Note that options `--save-masks' and `--load-masks' cannot be used simultaneously.  File: enblend.info, Node: Invocation, Next: Primary Seam Generators, Prev: Workflow, Up: Top 3 Invocation ************ `enblend' [OPTIONS] [`--output='IMAGE] INPUT... Assemble the sequence of images INPUT... into a single IMAGE. Input images are either specified literally or via so-called response files (see below). The latter are an alternative to specifying image filenames on the command line. * Menu: * Image Requirements:: Input image requirements * Response Files:: Files listing the images' names * Common Options:: General options * Extended Options:: Memory and GPU control * Mask Generation Options:: Mask generation control  File: enblend.info, Node: Image Requirements, Next: Response Files, Up: Invocation 3.1 Image Requirements ====================== All input images must comply with the following requirements. * Parts of the images overlap. * Each image has an alpha channel also called "mask". * The images agree on their number of channels: - one plus alpha or - three plus alpha. This is, either all images are black-and-white (one channel and alpha channel) or all are RGB-color images (three channels and alpha channel). * The images agree on their number of bits-per-channel, this is, their "depth": - `UINT8', - `UINT16', - `FLOAT', - etc. See option `--depth' below for an explanation of different (output) depths. * Enblend understands the images' filename extensions as well as their file formats. You can check the supported extensions and formats by calling Enblend with the option pair `--version --verbose' and scan the output for `Supported image formats' or `Supported file extensions'. Moreover, there are some "good practices", which are not enforced by the application, but almost certainly deliver superior results. * Either all files lack an ICC profile, or all images are supplied with the _same_ ICC profile. * If the images' meta-data contains resolution information ("DPI"), it is the same for all pictures.  File: enblend.info, Node: Response Files, Next: Common Options, Prev: Image Requirements, Up: Invocation 3.2 Response Files ================== A response file contains names of images or other response filenames. Introduce response file names with an at-character (`@'). Enblend and Enfuse process the list INPUT strictly from left to right, expanding response files in depth-first order. (Multi-layer files are processed from first layer to the last.) The following examples only show Enblend, but Enfuse works exactly the same. Solely image filenames. Example: enblend image-1.tif image-2.tif image-3.tif The ultimate order in which the images are processed is: `image-1.tif', `image-2.tif', `image-3.tif'. Single response file. Example: enblend @list where file `list' contains img1.exr img2.exr img3.exr img4.exr Ultimate order: `img1.exr', `img2.exr', `img3.exr', `img4.exr'. Mixed literal names and response files. Example: enblend @master.list image-09.png image-10.png where file `master.list' comprises of image-01.png @first.list image-04.png @second.list image-08.png `first.list' is image-02.png image-03.png and `second.list' contains image-05.png image-06.png image-07.png Ultimate order: `image-01.png', `image-02.png', `image-03.png', `image-04.png', `image-05.png', `image-06.png', `image-07.png', `image-08.png', `image-09.png', `image-10.png', 3.2.1 Response File Format -------------------------- Response files contain one filename per line. Blank lines or lines beginning with a sharp sign (`#') are ignored; the latter can serve as comments. Filenames that begin with an at-character (`@') denote other response files. *note Table:response-file-format:: states a formal grammar of response files in EBNF (http://en.wikipedia.org/wiki/Ebnf). RESPONSE-FILE ::= LINE* LINE ::= (COMMENT | FILE-SPEC) [`\r'] `\n' COMMENT ::= SPACE* `#' TEXT FILE-SPEC ::= SPACE* `@' FILENAME SPACE* SPACE ::= ` ' | `\t' where TEXT is an arbitrary string and FILENAME is any filename. Table 3.1: EBNF definition of the grammar of response files. In a response file relative filenames are used relative the response file itself, not relative to the current-working directory of the application. The above grammar might unpleasantly surprise the user in the some ways. Whitespace trimmed at both line ends For convenience, whitespace at the beginning and at the end of each line is ignored. However, this implies that response files cannot represent filenames that start or end with whitespace, as there is no quoting syntax. Filenames with embedded whitespace cause no problems, though. Only whole-line comments Comments in response files always occupy a complete line. There are no "line-ending comments". Thus, in # exposure series img-0.33ev.tif # "middle" EV img-1.33ev.tif img+0.67ev.tif only the first line contains a comment, whereas the second line includes none. Rather, it refers to a file called `img-0.33ev.tif # "middle" EV'. Image filenames cannot start with `@' An at-sign invariably introduces a response file, even if the filename's extension hints towards an image. If Enblend or Enfuse do not recognize a response file, they will skip the file and issue a warning. To force a file being recognized as a response file add one of the following syntactic comments to the _first_ line of the file. response-file: true enblend-response-file: true enfuse-response-file: true Finally, here is an example of a valid response file. # 4\pi panorama! # These pictures were taken with the panorama head. @round-shots.list # Freehand sky shot. zenith.tif # "Legs, will you go away?" images. nadir-2.tif nadir-5.tif nadir.tif 3.2.2 Syntactic Comments ------------------------ Comments that follow the format described in *note Table:response-file-syntactic-comment:: are treated as instructions how to interpret the rest of the response file. A syntactic comment is effective immediately and its effect persists to the end of the response file, unless another syntactic comment undoes it. SYNTACTIC-COMMENT ::= SPACE* `#' SPACE* KEY SPACE* `:' SPACE* VALUE KEY ::= (`A' .. `Z' | `a' .. `z' | `-')+ where VALUE is an arbitrary string. Table 3.2: EBNF definition of the grammar of syntactic comments in response files. Unknown syntactic comments are silently ignored. 3.2.3 Globbing Algorithms ------------------------- The three equivalent syntactic keys * `glob', * `globbing', or * `filename-globbing' control the algorithm that Enblend or Enfuse use to glob filenames in response files. All versions of Enblend and Enfuse support at least two algorithms: `literal', which is the default, and `wildcard'. See *note Table:globbing-algorithms:: for a list of all possible globbing algorithms. To find out about the algorithms in your version of Enblend or Enfuse team up the options `--version' and `--verbose'. `literal' Do not glob. Interpret all filenames in response files as literals. This is the default. Please keep in mind that whitespace at both ends of a line in a response file _always_ gets discarded. `wildcard' Glob using the wildcard characters `?', `*', `[', and `]'. The W*N32 implementation only globs the filename part of a path, whereas all other implementations perform wildcard expansion in _all_ path components. Also see glob(7) (http://www.kernel.org/doc/man-pages/online/pages/man7/glob.7.html). `none' Alias for `literal'. `shell' The `shell' globbing algorithm works as `literal' does. In addition, it interprets the wildcard characters `{', `}', and `~'. This makes the expansion process behave more like common UN*X shells. `sh' Alias for `shell'. Table 3.3: Globbing algorithms for the use in response files Example: # Horizontal panorama # 15 images # filename-globbing: wildcard image_000[0-9].tif image_001[0-4].tif 3.2.4 Default Layer Selection ----------------------------- The key `layer-selector' provides the same functionality as does the command-line option `--layer-selector', but on a per response-file basis. *Note Common Options::. This syntactic comment affects the layer selection of all images listed after it including those in included response files until another `layer-selector' overrides it.  File: enblend.info, Node: Common Options, Next: Extended Options, Prev: Response Files, Up: Invocation 3.3 Common Options ================== Common options control some overall features of Enblend. Enblend accepts arguments to any option in uppercase as well as in lowercase letters. For example, `deflate', `Deflate' and `DEFLATE' as arguments to the `--compression' option described below, all instruct Enblend to use the DEFLATE compression scheme. This manual denotes all arguments in lowercase for consistency. `-a' Pre-assemble non-overlapping images before each blending iteration. This overrides the default behavior which is to blend the images sequentially in the order given on the command line. Enblend will use fewer blending iterations, but it will do more work in each iteration. `--compression=COMPRESSION' Write a compressed output file. Depending on the output file format, Enblend accepts different values for COMPRESSION. JPEG format. The compression either is a literal integer or a keyword-option combination. `LEVEL' Set JPEG quality LEVEL, where LEVEL is an integer that ranges from 0-100. `jpeg[:LEVEL]' Same as above; without the optional argument just switch on (standard) JPEG compression. `jpeg-arith[:LEVEL]' Switch on arithmetic JPEG compression. With optional argument set the arithmetic compression LEVEL, where LEVEL is an integer that ranges from 0-100. TIF format. Here, COMPRESSION is one of the keywords: `none' Do not compress. This is the default. `deflate' Use the DEFLATE compression scheme also called ZIP-in-TIFF. DEFLATE is a lossless data compression algorithm that uses a combination of the LZ77 algorithm and HUFFMAN coding. `jpeg[:LEVEL]' Use JPEG compression. With optional argument set the compression LEVEL, where LEVEL is an integer that ranges from 0-100. `lzw' Use LEMPEL-ZIV-WELCH (LZW) adaptive compression scheme. LZW compression is lossless. `packbits' Use PACKBITS compression scheme. PACKBITS is a particular variant of run-length compression; it is lossless. Any other format. Other formats do not accept a COMPRESSION setting. However, VIGRA (http://hci.iwr.uni-heidelberg.de/vigra/) automatically compresses `png'-files with the DEFLATE method. `--layer-selector=ALGORITHM' Override the standard layer selector algorithm, which is `all-layers'. This version of Enblend offers the following algorithms: `all-layers' Select all layers in all images. `first-layer' Select only first layer in each multi-layer image. For single-layer images this is the same as `all-layers'. `largest-layer' Select largest layer in each multi-layer image, where the "largeness", this is the size is defined by the product of the layer width and its height. The channel width of the layer is ignored. For single-layer images this is the same as `all-layers'. `no-layer' Do not select any layer in any image. This algorithm is useful to temporarily exclude some images in response files. `-h' `--help' Print information on the available options and exit. `-l LEVELS' `--levels=LEVELS' Use at most this many LEVELS for pyramid (1) blending if LEVELS is positive, or reduce the maximum number of levels used by -LEVELS if LEVELS is negative; `auto' or `automatic' restore the default, which is to use the maximum possible number of levels for each overlapping region. The number of levels used in a pyramid controls the balance between local and global image features (contrast, saturation, ...) in the blended region. Fewer levels emphasize local features and suppress global ones. The more levels a pyramid has, the more global features will be taken into account. As a guideline, remember that each new level works on a linear scale twice as large as the previous one. So, the zeroth layer, the original image, obviously defines the image at single-pixel scale, the first level works at two-pixel scale, and generally, the n-th level contains image data at 2^n -pixel scale. This is the reason why an image of widthxheight pixels cannot be deconstructed into a pyramid of more than floor(log_2(min(width, height))) levels. If too few levels are used, "halos" around regions of strong local feature variation can show up. On the other hand, if too many levels are used, the image might contain too much global features. Usually, the latter is not a problem, but is highly desired. This is the reason, why the default is to use as many levels as is possible given the size of the overlap regions. Enblend may still use a smaller number of levels if the geometry of the overlap region demands. Positive values of LEVELS limit the maximum number of pyramid levels. Depending on the size and geometry of the overlap regions this may or may not influence any pyramid. Negative values of LEVELS reduce the number of pyramid levels below the maximum no matter what the actual maximum is and thus always influence all pyramids. Use `auto' or `automatic' as LEVELS to restore the automatic calculation of the maximum number of levels. The valid range of the absolute value of LEVELS is 1 to 29. `-o' `--output=FILE' Place output in FILE. If `--output' is not specified, the default is to put the resulting image in `a.tif'. `--parameter=KEY[=VALUE]:...' Set a KEY-VALUE pair, where VALUE is optional. This option is cumulative. Separate multiple pairs with the usual numeric delimiters. This option has the negated form `--no-parameter', which takes one or more KEYs and removes them from the list of defined parameters. The special key `*' deletes all parameters at once. Parameters allow the developers to change the internal workings of Enblend without the need to recompile. `-v' `--verbose[=LEVEL]' Without an argument, increase the verbosity of progress reporting. Giving more `--verbose' options will make Enblend more verbose. Directly set a verbosity level with a non-negative integral LEVEL. Each level includes all messages of the lower levels. Level Messages 0 only warnings and errors 1 reading and writing of images 2 mask generation, pyramid, and blending 3 reading of response files, color conversions 4 image sizes, bounding boxes and intersection sizes 5 detailed information on the optimizer runs (Enblend only) 6 estimations of required memory in selected processing steps The default verbosity level of Enblend is 1. `-V' `--version' Output information on the Enblend version. Team this option with `--verbose' to show configuration details, like the extra features that have been compiled in. `-w' `--wrap=MODE' Blend around the boundaries of the panorama. As this option significantly increases memory usage and computation time only use it, if the panorama will be * consulted for any kind measurement, this is, all boundaries must match as accurately as possible, or * printed out and the boundaries glued together, or * fed into a virtual reality (VR) generator, which creates a seamless environment. Otherwise, always avoid this option! With this option Enblend treats the panorama of width w and height h as an infinite data structure, where each pixel P(x, y) of the input images represents the set of pixels S_P(x, y) (2). MODE takes the following values: `none' `open' This is a "no-op"; it has the same effect as not giving `--wrap' at all. The set of input images is considered open at its boundaries. `horizontal' Wrap around horizontally: S_P(x, y) = {P(x + m * w, y): m in Z}. This is useful for 360o horizontal panoramas as it eliminates the left and right borders. `vertical' Wrap around vertically: S_P(x, y) = {P(x, y + n * h): m in Z}. This is useful for 360o vertical panoramas as it eliminates the top and bottom borders. `both' `horizontal+vertical' `vertical+horizontal' Wrap around both horizontally and vertically: S_P(x, y) = {P(x + m * w, y + n * h): m, n in Z}. In this mode, both left and right borders, as well as top and bottom borders, are eliminated. Specifying `--wrap' without MODE selects horizontal wrapping. `-x' Checkpoint partial results to the output file after each blending step. ---------- Footnotes ---------- (1) As Dr. Daniel Jackson correctly noted (http://stargate.wikia.com/wiki/The_Tomb), actually, it is not a pyramid: "Ziggaurat, it's a Ziggaurat (http://en.wikipedia.org/wiki/Ziggaurat)." (2) Solid-state physicists will be reminded of the BORN-VON KA'RMA'N boundary condition (http://en.wikipedia.org/wiki/Born-von_Karman_boundary_condition).  File: enblend.info, Node: Extended Options, Next: Mask Generation Options, Prev: Common Options, Up: Invocation 3.4 Extended Options ==================== Extended options control the image cache, the color model, and the cropping of the output image. `-b BLOCKSIZE' Set the BLOCKSIZE in kilobytes (KB) of Enblend's image cache. This is the amount of data that Enblend will move to and from the disk at one time. The default is 2048 KB, which should be ok for most systems. See *note Tuning Memory Usage:: for details. Note that Enblend must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with `enblend --version --verbose'. `-c' `--ciecam' Force the use of the CIECAM02 color appearance model for blending colors instead of blending inside the RGB color cube. All input files should have identical ICC profiles when this option is specified. If no ICC profile is present, Enblend assumes that all images use the sRGB color space. *Note Color Profiles::. Please keep in mind that using CIECAM02 blending may not only change the colors in the output image, but Enblend may choose different seam line routes as some seam-line optimizers are guided by image differences. This option can be negated; see option `--no-ciecam' below. `-d' `--depth=DEPTH' Force the number of bits per channel and the numeric format of the output image. Enblend always uses a smart way to change the channel depth to assure highest image quality (at the expense of memory), whether requantization is implicit because of the output format or explicit with option `--depth'. * If the output-channel width is larger than the input-channel width of the input images, the input images' channels are widened to the output channel width immediately after loading, that is, as soon as possible. Enblend then performs all blending operations at the output-channel width, thereby preserving minute color details which can appear in the blending areas. * If the output-channel width is smaller than the input-channel width of the input images, the output image's channels are narrowed only right before it is written to disk, that is, as late as possible. Thus the data benefits from the wider input channels for the longest time. All DEPTH specifications are valid in lowercase as well as uppercase letters. For integer format, use `8', `uint8' Unsigned 8 bit; range: 0..255 `int16' Signed 16 bit; range: -32768..32767 `16', `uint16' Unsigned 16 bit; range: 0..65535 `int32' Signed 32 bit; range: -2147483648..2147483647 `32', `uint32' Unsigned 32 bit; range: 0..4294967295 For floating-point format, use `r32', `real32', `float' IEEE754 single precision floating-point, 32 bit wide, 24 bit significant * Minimum normalized value: 1.2*10^-38 * Epsilon: 1.2*10^-7 * Maximum finite value: 3.4*10^38 `r64', `real64', `double' IEEE754 double precision floating-point, 64 bit wide, 53 bit significant * Minimum normalized value: 2.2*10^-308 * Epsilon: 2.2*10^-16 * Maximum finite value: 1.8*10^308 If the requested DEPTH is not supported by the output file format, Enblend warns and chooses the DEPTH that matches best. The OpenEXR data format is treated as IEEE754 float internally. Externally, on disk, OpenEXR data is represented by "half" precision floating-point numbers. OpenEXR (http://www.openexr.com/about.html#features) half precision floating-point, 16 bit wide, 10 bit significant * Minimum normalized value: 9.3*10^-10 * Epsilon: 2.0*10^-3 * Maximum finite value: 4.3*10^9 `-f WIDTHxHEIGHT' `-f WIDTHxHEIGHT+xXOFFSET+yYOFFSET' Ensure that the minimum "canvas" size of the output image is at least WIDTHxHEIGHT. Optionally specify the XOFFSET and YOFFSET, too. This option only is useful when the input images are cropped TIFF files, such as those produced by `nona'(1). Note that option `-f' neither rescales the output image, nor shrinks the canvas size below the minimum size occupied by the union of all input images. `--fallback-profile=PROFILE-FILENAME' Use the ICC profile in PROFILE-FILENAME instead of the default sRGB. See option `--ciecam' and *note Color Profiles::. This option only is effective if the input images come without color profiles and blending is performed in CIECAM02 color appearance model. `-g' Save alpha channel as "associated". See the TIFF documentation (http://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html) for an explanation. Gimp (before version 2.0) and CinePaint (*note Helpful Programs::) exhibit unusual behavior when loading images with unassociated alpha channels. Use option `-g' to work around this problem. With this flag Enblend will create the output image with the associated alpha tag set, even though the image is really unassociated alpha. `--gpu' Use the graphics card - in fact the graphics processing unit (GPU) - to accelerate some computations. This is an experimental feature that may not work on all systems. In this version of Enblend, 4.1.2, only mask optimization by Simulated Annealing benefits from this option. Note that GPU-support must have been compiled into Enblend for this option to be available. Find out about this feature with `enblend --version --verbose'. `-m CACHESIZE' Set the CACHESIZE in megabytes (MB) of Enblend's image cache. This is the amount of memory Enblend will use for storing image data before swapping to disk. The default is 1024 MB, which is good for systems with 3-4 gigabytes (GB) of RAM. See *note Tuning Memory Usage:: for details. Note that Enblend must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with `enblend --version --verbose'. `--no-ciecam' Disable the use of the CIECAM02 color appearance model for blending colors. See option `--ciecam' for details. Also see *note Color Profiles::. ---------- Footnotes ---------- (1) The stitcher `nona' is part of Hugin. *Note Helpful Programs::.  File: enblend.info, Node: Mask Generation Options, Prev: Extended Options, Up: Invocation 3.5 Mask Generation Options =========================== These options control the generation and the usage of masks. `--anneal=TAU[:DELTA-E-MAX[:DELTA-E-MIN[:K-MAX]]]' Set the parameters of the Simulated Annealing optimizer (see *note Table:optimizer-strategies::). TAU TAU is the temperature reduction factor in the Simulated Annealing; it also can be thought of as "cooling factor". The closer TAU is to one, the more accurate the annealing run will be, and the longer it will take. Append a percent sign (`%') to specify TAU as a percentage. Valid range: 0 < TAU < 1. The default is 0.75; values around 0.95 are reasonable. Usually, slower cooling results in more converged points. DELTA-E-MAX DELTA-E-MIN DELTA-E-MAX and DELTA-E-MIN are the maximum and minimum cost change possible by any single annealing move. Valid range: 0 < DELTA-E-MIN < DELTA-E-MAX. In particular they determine the initial and final annealing temperatures according to: DELTA-E-MAX T_initial = ----------------------- log(K-MAX / (K-MAX - 2)) DELTA-E-MIN T_final = ----------------------- log(K-MAX^2 - K-MAX - 1) The defaults are: DELTA-E-MAX: 7000.0 and DELTA-E-MIN: 5.0. K-MAX K-MAX is the maximum number of "moves" the optimizer will make for each line segment. Higher values more accurately sample the state space, at the expense of a higher computation cost. Valid range: K-MAX >= 3. The default is 32. Values around 100 seem reasonable. `--coarse-mask[=FACTOR]' Use a scaled-down version of the input images to create the seam line. This option reduces the number of computations necessary to compute the seam line and the amount of memory necessary to do so. It is the default. If omitted FACTOR defaults to 8, this means, option `--coarse-mask' shrinks the overlapping _areas_ by a factor of 8x8. With FACTOR = 8 the total memory allocated during a run of Enblend shrinks approximately by 80% and the maximum amount of memory in use at a time is decreased to 60% (Enblend compiled with image cache) or 40% (Enblend compiled without image cache). Valid range: FACTOR = 1, 2, 3,.... Also see *note Table:mask-generation::. `--no-optimize' `--optimize' -------------------------------------------------------------- `--fine-mask' Use NFT mask. Vectorize NFT mask, optimize vertices with simulated annealing and DIJKSTRA'S shortest path algorithm, fill vector contours. `--coarse-mask'Scale down overlap Scale down overlap region, compute NFT region, vectorize NFT mask and vectorize it, mask, optimize fill vector contours. vertices with simulated annealing and DIJKSTRA'S shortest path algorithm, fill vector contours. Table 3.4: Various options that control the generation of masks. All mask computations are based on the Nearest-Feature Transformation (NFT) of the overlap region. `--dijkstra=RADIUS' Set the search RADIUS of the DIJKSTRA Shortest Path algorithm used in DIJKSTRA Optimization (see *note Table:optimizer-strategies::). A small value prefers straight line segments and thus shorter seam lines. Larger values instruct the optimizer to let the seam line take more detours when searching for the best seam line. Valid range: RADIUS >= 1. Default: 25 pixels. `--fine-mask' Instruct Enblend to employ the full-size images to create the seam line, which can be slow. Use this option, for example, if you have very narrow overlap regions. Also see *note Table 3.4: Table:mask-generation. `--image-difference=ALGORITHM[:LUMINANCE-WEIGHT[:CHROMINANCE-WEIGHT]]' Enblend calculates the difference of a pair of overlapping color images when it generates the primary seam with a Graph-Cut or before it optimizes a seam. It employs a user-selectable ALGORITHM that itself is controlled by the weights for luminance differences LUMINANCE-WEIGHT, w_luminance and color differences CHROMINANCE-WEIGHT, w_chrominance. For black-and-white images the difference is simple the absolute difference of each pair of pixels. `maximum-hue-luminance' `maximum-hue-lum' `max-hue-luminance' `max-hue-lum' `max' Calculate the difference d as the maximum of the differences of the luminances l and hues h of each pair of pixels P1 and P2: d = max(w_luminance * |l(P_1) - l(P_2)|, w_chrominance * |h(P_1) - h(p_2)|) This algorithm was the default for Enblend up to version 4.0. `delta-e' `de' Calulate the difference d as the EUCLIDEAN distance of the pixels in L*a*b* space: d = sqrt(w_luminance * (L(P_1) - L(P_2))^2 + w_chrominance * (a(P_1) - a(P_2))^2 + w_chrominance * (b(P_1) - b(P_2))^2) This is the default in Enblend version 4.1 and later. Note that the "delta-E" mentioned here has nothing to do with DELTA-E-MAX and DELTA-E-MIN of option `--anneal'. Both LUMINANCE-WEIGHT and CHROMINANCE-WEIGHT must be non-negative, their sum must be positive. Enblend automatically normalizes the sum of LUMINANCE-WEIGHT and CHROMINANCE-WEIGHT to one. Thus `--image-difference=delta-e:2:1' and `--image-difference=delta-e:0.6667:0.3333' define the same weighting function. The default LUMINANCE-WEIGHT is 1.0 and the default CHROMINANCE-WEIGHT is 1.0. At higher verbosity levels Enblend computes the true size of the overlap area in pixels and it calculates the average and standard deviation of the difference per pixel in the normalized luminance interval [0...1]. These statistical measures are based on ALGORITHM, therefore they should only be compared for identical ALGORITHMs. The average difference is a rough measure of quality with lower values meaning better matches. `--load-masks[=IMAGE-TEMPLATE]' Instead of generating masks, use those in IMAGE-TEMPLATE. The default is `mask-%n.tif'. The mask images have to be a 8-bit grayscale images. See `--save-masks' below for details. `--mask-vectorize=DISTANCE' Set the mask vectorization DISTANCE Enblend uses to partition each seam. Thus, break down the seam to segments of length DISTANCE each. If Enblend uses a coarse mask (`--coarse-mask') or Enblend optimizes (`--optimize') a mask it vectorizes the initial seam line before performing further operations. See *note Table 3.4: Table:mask-generation. for the precise conditions. DISTANCE tells Enblend how long to make each of the line segments called vectors here. The unit of DISTANCE is pixels unless it is a percentage as explained in the next paragraph. In fine masks one mask pixel corresponds to one pixel in the input image, whereas in coarse masks one pixel represents for example 8 pixels in the input image. Append a percentage sign (`%') to DISTANCE to specify the segment length as a fraction of the diagonal of the rectangle including the overlap region. Relative measures do not depend on coarse or fine masks, they are recomputed for each mask. Values around 5%-10% are a good starting point. This option massively influences the mask generation process! Large DISTANCE values lead to shorter, straighter, less wiggly, less baroque seams that are on the other hand less optimal, because they run through regions of larger image mismatch instead of avoiding them. Small DISTANCE values give the optimizers more possibilities to run the seam around high mismatch areas. What should _never_ happen though, are loops in the seam line. Counter loops with higher weights of DISTANCE-WEIGHT (in option `--optimizer-weights'), larger vectorization DISTANCEs, TAUs (in option `--anneal') that are closer to one, and blurring of the difference image with option `--smooth-difference'. Use option `--visualize' to check the results. Valid range: DISTANCE >= 4. Enblend limits DISTANCE so that it never gets below 4 even if it has been given as a percentage. The user will be warned in such cases. Default: 4 pixels for coarse masks and 20 pixels for fine masks. `--no-optimize' Turn off seam line optimization. Combined with option `--fine-mask' this will produce the same type of mask as Enblend version 2.5, namely the result of a Nearest-Feature Transform (NFT).(1) Also see *note Table 3.4: Table:mask-generation. `--optimize' Use a multi-strategy approach to route the seam line around mismatches in the overlap region. This is the default. *note Table:optimizer-strategies:: explains these strategies; also see *note Table 3.4: Table:mask-generation. Simulated Annealing Tune with option `--anneal' = TAU : DELTA-E-MAX : DELTA-E-MIN : K-MAX. Simulated-Annealing (http://en.wikipedia.org/wiki/Simulated_annealing) DIJKSTRA Shortest Path Tune with option `--dijkstra' = RADIUS. DIJKSTRA algorithm (http://en.wikipedia.org/wiki/Dijkstra_algorithm) Table 3.5: Enblend's strategies to optimize the seam lines between images. `--optimizer-weights=DISTANCE-WEIGHT[:MISMATCH-WEIGHT]' Set the weights of the seam-line optimizer. If omitted, MISMATCH-WEIGHT defaults to 1. The seam-line optimizer considers two qualities of the seam line: * The distance of the seam line from its initial position, which has been determined by NFT (see option `--no-optimize'). * The total "mismatch" accumulated along it. The optimizer weights DISTANCE-WEIGHT and MISMATCH-WEIGHT define how to weight these two criteria. Enblend up to version 3.2 used 1:1. This version of Enblend (4.1.2) uses 8.0:1.0. A large DISTANCE-WEIGHT pulls the optimized seam line closer to the initial postion. A large MISMATCH-WEIGHT makes the seam line go on detours to find a path along which the mismatch between the images is small. If the optimized seam line shows cusps or loops (see option `--visualize'), reduce MISMATCH-WEIGHT or increase DISTANCE-WEIGHT. Both weights must be non-negative. They cannot be both zero at the same time. Otherwise, their absolute values are not important as Enblend normalizes their sum. `--primary-seam-generator=ALGORITHM' Select the algorithm responsible for generating the general seam route. This is the ALGORITHM that produces an initial seam line, which is the basis for later, optional optimizations (see `--optimize'). Nearest Feature Transform (NFT) is the only algorithm up to and including Enblend version 4.0. Version 4.1 adds a Graph-Cut (GC) algorithm. In this version of Enblend NFT is the default. Valid ALGORITHM names are: nearest-feature-transform nft Nearest Feature Transform graph-cut gc Graph-Cut See *note Primary Seam Generators:: for details. `--save-masks' `--save-masks=IMAGE-TEMPLATE' Save the generated masks to IMAGE-TEMPLATE. The default is `mask-%n.tif'. Enblend saves masks as 8 bit grayscale (single channel) images. For accuracy we recommend to choose a lossless format. Use this option if you wish to edit the location of the seam line by hand. This will give you images of the right sizes that you can edit to make your changes. Later, use option `--load-masks' to blend the project with your custom seam lines. Enblend will stop after saving all masks unless option `--output' is given, too. With both options given, this is, `--save-masks' and `--output', Enblend saves all masks and then proceeds to blend the output image. IMAGE-TEMPLATE defines a template that is expanded for each input file. In a template a percent sign (`%') introduces a variable part. All other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (*note Common Options::). *note Table:mask-template-characters:: lists all variables. A fancy mask filename template could look like this: %D/mask-%02n-%f.tif It puts the mask files into the same directory as the output file (`%D'), generates a two-digit index (`%02n') to keep the mask files nicely sorted, and decorates the mask filename with the name of the associated input file (`%f') for easy recognition. `--smooth-difference=RADIUS' _This option has been deprecated._ Smooth the difference image prior to seam-line optimization to get a shorter and - on the length scale of RADIUS - also a straighter seam-line. The default is not to smooth. If RADIUS is larger than zero Enblend blurs the difference images of the overlap regions with a GAUSSIAN filter having a radius of RADIUS pixels. Values of 0.5 to 1.5 pixels for RADIUS are good starting points; use option `--visualize' to directly judge the effect. When using this option in conjunction with option `--coarse-mask'=FACTOR, keep in mind that the smoothing occurs _after_ the overlap regions have been shrunken. Thus, blurring affects a FACTORxFACTOR times larger area in the original images. Valid range: RADIUS >= 0.0. `--visualize[=VISUALIZE-TEMPLATE]' Create an image according to VISUALIZE-TEMPLATE that visualizes the unoptimized mask and the applied optimizations (if any). The default is `vis-%n.tif'. The image shows Enblend's view of the overlap region and how it decided to route the seam line. If you are experiencing artifacts or unexpected output, it may be useful to include this visualization image in your bug report. *Note Bug Reports::. VISUALIZE-TEMPLATE defines a template that is expanded for each input file. In a template, a percent sign (`%') introduces a variable part; all other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (*note Common Options::). *note Table:mask-template-characters:: lists all variables. *Visualization Image.* The visualization image shows the symmetric difference of the pixels in the rectangular region where two images overlap. The larger the difference the lighter shade of gray it appears in the visualization image. Enblend paints the non-overlapping parts of the image pair - these are the regions where _no_ blending occurs - in dark red. *note Table:visualization-colors:: shows the meanings of all the colors that are used in seam-line visualization images. dark red Non-overlapping parts of image pair. various shades of gray Difference of the pixel values in the overlap region. dark blue Location of an optimizer sample. medium green First sample of a line segment. light green Any other but first sample of a line segment. bright cyan State space sample inside the DIJKSTRA radius. bright magenta Non-converged point. dark yellow Initial seam line as generated by the primary seam generator. Enblend marks a non-movable ("frozen") endpoint of a seam-line segment with a bright white cross, whereas it uses a light orange diamond to denote an endpoint that the optimizer is allowed to move around. bright yellow Final seam line. Table 3.6: Colors used in seam-line visualization images. `%%' Produces a literal `%'-sign. `%i' Expands to the index of the mask file starting at zero. `%i' supports setting a pad character or a width specification: `%' PAD WIDTH `i' PAD is either `0' or any punctuation character; the default pad character is `0'. WIDTH is an integer specifying the minimum width of the number. The default is the smallest width given the number of input images, this is 1 for 2-9 images, 2 for 10-99 images, 3 for 100-999 images, and so on. Examples: `%i', `%02i', or `%_4i'. `%n' Expands to the number of the mask file starting at one. Otherwise it behaves identically to `%i', including pad character and width specification. `%p' This is the full name (path, filename, and extension) of the input file associated with the mask. Example: If the input file is called `/home/luser/snap/img.jpg', `%p' expands to `/home/luser/snap/img.jpg', or shorter: `%p' => `/home/luser/snap/img.jpg'. `%P' This is the full name of the output file. `%d' Is replaced with the directory part of the associated input file. *note Stripping a non-directory suffix from a file name: (coreutils.info)dirname invocation. Example (cont.): `%d' => `/home/luser/snap'. `%D' Is replaced with the directory part of the output file. `%b' Is replaced with the non-directory part (often called "basename") of the associated input file. *note Stripping a directory and suffix from a file name: (coreutils.info)basename invocation. Example (cont.): `%b' => `img.jpg'. `%B' Is replaced with the non-directory part of the output file. `%f' Is replaced with the filename without path and extension of the associated input file. Example (cont.): `%f' => `img'. `%F' Is replaced with the filename without path and extension of the output file. `%e' Is replaced with the extension (including the leading dot) of the associated input file. Example (cont.): `%e' => `.jpg'. `%E' Is replaced with the extension of the output file. Table 3.7: Special characters to control the generation of mask filenames. ---------- Footnotes ---------- (1) MUHAMMAD H. ALSUWAIYEL and MARINA GAVRILOVA, "On the Distance Transform of Binary Images", Proceedings of the International Conference on Imaging Science, Systems, and Technology, June 2000, Vols. I and II, pages 83-86.  File: enblend.info, Node: Primary Seam Generators, Next: Color Profiles, Prev: Invocation, Up: Top 4 Primary Seam Generators ************************* This version (4.1.2) of Enblend supports two main algorithms to generate seam lines. Use option `--primary-seam-generator' to select one of the generators. Nearest Feature Transform (NFT) The NFT, also known as Distance Transform (http://en.wikipedia.org/wiki/Distance_transform), is a fast and efficient technique to produce a seam line route given the geometries of multiple overlapping images. NFT as implemented in this version of Enblend only takes into account the _shape of the overlap area._ It completely ignore the images' contents. Graph-Cut (GC) GC (http://en.wikipedia.org/wiki/Graph_cuts_in_computer_vision) is a region-oriented way of segmenting images. The generator is based on the idea of finding a minimum cost "cut" of a graph created from a given image pair. A "cut" is where the seam line appears. GC determines the cost from the overlapping images' contents. The most significant difference between the two algorithms is the output mask gradation. NFT produces a coarse approximation of the seam, running as far away from the overlap-region borders as possible. The resulting mask could then be blended as-is, however, Enblend by default runs image-content dependent optimizers to increase the mask gradation and for example omits the regions where the images differ. The result is a finer seam line, which only loosely follows the shape of NFT's primary seam. Graph-Cut, on the other hand, is capable of producing the final mask in one pass without the need of further optimizers. It looks for a seam line that is _globally_ optimal, taking into account * feature frequency, as well as * image dissimilarity. This means, the seam is less likely to cross lines like for example fences, lampposts, or road markings, where they would be visible. The optimizers which run after NFT can also be run after GC. Nevertheless, GC works best just with a fine mask (option `--fine-mask'); optimizers are then automatically _turned off_ to take full advantage of the detailed seam GC produces. GC requires more memory and computation time to complete than NFT. Thus, it is best to prefer NFT where the images used are large and execution time is crucial. If quality is the priority, using GC and fine mask usually produces visually more pleasing results. GC is currently limited to seams that begin and end on the images' borders. This means that the algorithm cannot run in cases where, for example, one image is contained in another, resulting in a loop-like seam. In such cases, though, Enblend automatically falls back to a NFT-generated seam, making its application transparent to the user.  File: enblend.info, Node: Color Profiles, Next: Understanding Masks, Prev: Primary Seam Generators, Up: Top 5 Color Profiles **************** Enblend and Enfuse expect that either 1. no input image has a color profile or 2. all come with the _same_ ICC (http://en.wikipedia.org/wiki/ICC_profile) profile. In case 1 the applications blend or fuse in the RGB-cube, whereas in case 2 the images first are transformed to CIECAM02 (http://en.wikipedia.org/wiki/CIECAM02) color space - respecting the input color profile - then they are blended or fused, and finally the data transformed back to RGB color space. Moreover, in case 2, Enblend and Enfuse assign the input color profile to the output image. Mixing different ICC profiles or alternating between images with profiles and without them generates warnings as it generally leads to unpredictable results. The options `--ciecam' (*note Extended Options::) and its opposite `--no-ciecam' (*note Extended Options::) overrule the default profile selection procedure described above. Use option `--ciecam' on a set of input images _without_ color profiles to assign a profile to them and perform the blending or fusing process in CIECAM02 color space. The default profile is sRGB (http://en.wikipedia.org/wiki/SRGB). Override this setting with option `--fallback-profile' (*note Extended Options::). On the other hand, suppress the utilization of CIECAM02 blending or fusing of a set of input images _with_ color profiles with option `--no-ciecam'. The only reason for the latter is to shorten the blending- or fusing-time, because transforming to and back from the CIECAM02 color space are computationally expensive operations. Option `--ciecam' as well as `--fallback-profile' have no effect on images with attached color profiles, just as option `--no-ciecam' has no effect on images without profiles. The impact of blending in CIECAM02 color space as opposed to the RGB cube vary with the contents of the input images. Generally colors lying close together in RGB space experience less change when switching the blending spaces. However, colors close the border of any color space can see marked changes. For color geeks: The transformations to CIECAM02 color space and back use * perceptual rendering intent, * the D50 white point, * 500 lumen surrounding light ("average" in CIECAM02 parlance), and * assume complete adaption.  File: enblend.info, Node: Understanding Masks, Next: Tuning Memory Usage, Prev: Color Profiles, Up: Top 6 Understanding Masks ********************* A "binary mask" indicates for every pixel of an image if this pixel must be considered in further processing, or ignored. For a "weight mask", the value of the mask determines how much the pixel contributes, zero again meaning "no contribution". Masks arise in two places: as part of the input files and as separate files, showing the actual pixel weights prior to image blendung or fusion. We shall explore both occurrences in the next sections. 6.1 Masks in Input Files ======================== Each of the input files for Enfuse and Enblend can contain its own mask. Both applications interpret them as binary masks no matter how many bits per image pixel they contain. Use ImageMagick's `identify' or, for TIFF files, `tiffinfo' to inquire quickly whether a file contains a mask. *note Helpful Programs:: shows where to find these programs on the web. $ identify -format "%f %m %wx%h %r %q-bit" remapped-0000.tif remapped-0000.tif TIFF 800x533 DirectClassRGBMatte 8-bit ^^^^^ mask $ tiffinfo remapped-0000.tif TIFF Directory at offset 0x1a398a (1718666) Subfile Type: (0 = 0x0) Image Width: 800 Image Length: 533 Resolution: 150, 150 pixels/inch Position: 0, 0 Bits/Sample: 8 Sample Format: unsigned integer Compression Scheme: PackBits Photometric Interpretation: RGB color Extra Samples: 1 <<<<< mask Orientation: row 0 top, col 0 lhs Samples/Pixel: 4 <<<<< R, G, B, and mask Rows/Strip: 327 Planar Configuration: single image plane The "Matte" part of the image class and the "Extra Samples" line tell us that the file features a mask. Also, many interactive image manipulation programs show the mask as a separate channel, sometimes called "Alpha". There, the white (high mask value) parts of the mask enable pixels and black (low mask value) parts suppress them. The multitude of terms all describing the concept of a mask is confusing. Mask A mask defines a selection of pixels. A value of zero represents an unselected pixel. The maximum value ("white") represents a selected pixel and the values between zero and the maximum are partially selected pixels. See Gimp-Savy (http://gimp-savvy.com/BOOK/index.html?node42.html). Alpha Channel The alpha channel stores the transpacency value for each pixel, typically in the range from zero to one. A value of zero means the pixel is completely transparent, thus does not contribute to the image. A value of one on the other hand means the pixel is completely opaque. Matte The notion "matte" as used by ImageMagick refers to an inverted alpha channel, more precisely: 1 - alpha. See ImageMagick (http://www.imagemagick.org/Usage/channels/#trans) for further explanations. Enblend and Enfuse only consider pixels that have an associated mask value other than zero. If an input image does not have an alpha channel, Enblend warns and assumes a mask of all non-zero values, that is, it will use every pixel of the input image for fusion. Stitchers like `nona' add a mask to their output images. Sometimes it is helpful to manually modify a mask before fusion. For example to suppress unwanted objects (insects and cars come into mind) that moved across the scene during the exposures. If the masks of all input images are black at a certain position, the output image will have a hole in that position. 6.2 Weight Mask Files ===================== ...  File: enblend.info, Node: Tuning Memory Usage, Next: Helpful Programs, Prev: Understanding Masks, Up: Top 7 Tuning Memory Usage ********************* The default configuration of Enblend and Enfuse assumes a system with 3-4 GB of RAM. If Enblend and Enfuse have been compiled with the "image-cache" feature, they do not rely on the operating system's memory management, but use their own image cache in the file system. To find out whether your version uses the image cache say enblend --verbose --version or enfuse --verbose --version Enblend and Enfuse put the file that holds the image cache either in the directory pointed to by the environment variable `TMPDIR', or, if the variable is not set, in directory `/tmp'. It is prudent to ensure write permissions and enough of free space on the volume with the cache file. The size of the image cache is user configurable with the option `-m CACHE-SIZE' (*note Extended Options::). Furthermore, option `-b BUFFER-SIZE' (*note Extended Options::) allows for fine-tuning the size of a single buffer inside the image cache. Note that CACHE-SIZE is given in megabytes, whereas the unit of BUFFER-SIZE is kilobytes. Usually the user lets the operating system take care of the memory management of all processes. However, users of Enblend or Enfuse might want to control the balance between the operating systems' Virtual Memory (http://en.wikipedia.org/wiki/Virtual_memory) system and the image cache for several reasons. * Paging in or out parts of a process' image runs at kernel level and thus can make user processes appear unresponsive or "jumpy". The caching mechanism of Enblend and Enfuse of course runs as a user process, which is why it has less detrimental effects on the system's overall responsiveness. * The image cache has been optimized for accesses to image data. All algorithms in Enblend and Enfuse have been carefully arranged to play nice with the image cache. An operating system's cache has no knowledge of these particular memory access patterns. * The disk access of the operating system to the swap device has been highly optimized. Enblend and Enfuse on the other hand use the standard IO-layer, which is a much slower interface. * Limiting the amount of image cache prevents Enblend and Enfuse from eating up most or all RAM, thereby forcing all user applications into the swap. The CACHE-SIZE should be set in such a way as to reconcile all of the above aspects even for the biggest data sets, that is, projects with many large images. *note Table:cache-size-settings:: suggests some cache- and buffer-sizes for different amounts of available RAM. RAM | CACHE-SIZE | BUFFER-SIZE | Comment MB | MB | KB | ------+------------+-------------+--------- 4096 | 1024 | 2048 | default 2048 | 512--1024 | 1024 | 1024 | 256--512 | 256--512 | Table 7.1: Suggested cache-size settings On systems with considerably more than 4 GB of RAM it is recommended to run Enblend or Enfuse versions without image cache.  File: enblend.info, Node: Helpful Programs, Next: Bug Reports, Prev: Tuning Memory Usage, Up: Top 8 Helpful Additional Programs ***************************** Several programs and libraries have proven helpful when working with Enfuse and Enblend. *Raw Image Conversion* * DCRaw (http://www.cybercom.net/~dcoffin/dcraw/) is a universal raw-converter written by DAVID COFFIN. * UFRaw (http://ufraw.sourceforge.net/), a raw converter written by UDI FUCHS and based on DCRaw, adds a GUI (`ufraw'), versatile batch processing (`ufraw-batch'), and some additional features such as cropping, noise reduction with wavelets, and automatic lens error correction. *Image Alignment and Rendering* * ALE (http://auricle.dyndns.org/ALE/), DAVID HILVERT'S anti-lamenessing engine for the real die-hard command-line users aligns, filters, and renders images. * Hugin (http://hugin.sourceforge.net/) is a GUI that aligns and stitches images. It comes with several command line tools, like `nona' to stitch panorama images, `align_image_stack' to align overlapping images for HDR or create focus stacks, and `fulla' to correct lens errors. * PanoTools (http://panotools.sourceforge.net/) the successor of HELMUT DERSCH'S original PanoTools (http://www.all-in-one.ee/~dersch/) offers a set of command-line driven applications to create panoramas. Most notable are `PTOptimizer' and `PTmender'. *Image Manipulation* * CinePaint (http://www.cinepaint.org/) is a branch of an early Gimp forked off at version 1.0.4. It sports much less features than the current Gimp, but offers 8 bit, 16 bit and 32 bit color channels, HDR (for example floating-point TIFF, and OpenEXR), and a tightly integrated color management system. * The Gimp (http://www.gimp.org/) is a general purpose image manipulation program. At the time of this writing it is still limited to images with only 8 bits per channel. * ImageMagick (http://www.imagemagick.org/) and its clone GraphicsMagick (http://www.graphicsmagick.org/) are general purpose command-line driven image manipulation programs, for example, `convert', `display', `identify', and `montage'. *High Dynamic Range* * OpenEXR (http://www.openexr.com/) offers libraries and some programs to work with the EXR HDR format. * PFSTools (http://pfstools.sourceforge.net/) create, modify, and tonemap high-dynamic range images. *Libraries* * LibJPEG (http://www.ijg.org/) is a library for handling the JPEG (JFIF) image format. * LibPNG (http://www.libpng.org/pub/png/libpng.html) is a library that handles the Portable Network Graphics (PNG) image format. * LibTIFF (http://www.remotesensing.org/libtiff/) offers a library and utility programs to manipulate the ubiquitous Tagged Image File Format, TIFF. The nifty `tiffinfo' command quickly inquires the properties of TIFF files. *Meta-Data Handling* * EXIFTool (http://www.sno.phy.queensu.ca/~phil/exiftool/) reads and writes EXIF meta data. In particular it copies meta data from one image to another. * LittleCMS (http://www.littlecms.com/) is the color management library used by Hugin, DCRaw, UFRaw, Enblend, and Enfuse. It supplies some binaries, too. `tifficc', an ICC color profile applier, is of particular interest.  File: enblend.info, Node: Bug Reports, Next: Authors, Prev: Helpful Programs, Up: Top Appendix A Bug Reports ********************** Most of this appendix was taken from the Octave (http://www.gnu.org/software/octave/) documentation. Bug reports play an important role in making Enblend and Enfuse reliable and enjoyable. When you encounter a problem, the first thing to do is to see if it is already known. To this end visit the package's LaunchPad (https://launchpad.net/) bug database (https://bugs.launchpad.net/enblend). Search it for your particular problem. If it is not known, please report it. In order for a bug report to serve its purpose, you must include the information that makes it possible to fix the bug. A.1 Have You Really Found a Bug? ================================ If you are not sure whether you have found a bug, here are some guidelines: * If Enblend or Enfuse get a fatal signal, for any options or input images, that is a bug. * If Enblend or Enfuse produce incorrect results, for any input whatever, that is a bug. * If Enblend or Enfuse produce an error message for valid input, that is a bug. * If Enblend or Enfuse do not produce an error message for invalid input, that is a bug. A.2 How to Report Bugs ====================== The fundamental principle of reporting bugs usefully is this: report all the facts. If you are not sure whether to state a fact or leave it out, state it. Often people omit facts because they think they know what causes the problem and they conclude that some details do not matter. Play it safe and give a specific, complete example. Keep in mind that the purpose of a bug report is to enable someone to fix the bug if it is not known. Always write your bug reports on the assumption that the bug is not known. Try to make your bug report self-contained. If we have to ask you for more information, it is best if you include all the previous information in your response, as well as the information that was missing. To enable someone to investigate the bug, you should include all these things: * The exact version and configuration of Enblend or Enfuse. You can get this by running it with the options `--version' and `--verbose'. * A complete set of input images that will reproduce the bug. Strive for a minimal set of _small_(1) images. * The type of machine you are using, and the operating system name and its version number. * A complete list of any modifications you have made to the source. Be precise about these changes. Show a `diff' for them. * Details of any other deviations from the standard procedure for installing Enblend and Enfuse. * The _exact command line_ you use to call Enblend or Enfuse, which then triggers the bug. Examples: ~/local/bin/enblend -v \ --fine-mask \ --optimizer-weights=3:2 --mask-vectorize=12.5% \ image-1.png image-2.png or: /local/bin/enfuse \ --verbose \ --exposure-weight=0 --saturation-weight=0 --entropy-weight=1 \ --gray-projector=l-star \ --entropy-cutoff=1.667% \ layer-01.ppm layer-02.ppm layer-03.ppm If you call Enblend or Enfuse from within a GUI like, for example, Hugin (http://hugin.sourceforge.net/) or KImageFuser (http://panorama.dyndns.org/index.php?lang=en&subject=KImageFuser&texttag=KImagefuser) by HARRY VAN DER WOLF, copy&paste or write down the command line that launches Enblend or Enfuse. * A description of what behavior you observe that you believe is incorrect. For example, "The application gets a fatal signal," or, "The output image contains black holes." Of course, if the bug is that the application gets a fatal signal, then one cannot miss it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. A.3 Sending Patches for Enblend or Enfuse ========================================= If you would like to write bug fixes or improvements for Enblend or Enfuse, that is very helpful. When you send your changes, please follow these guidelines to avoid causing extra work for us in studying the patches. If you do not follow these guidelines, your information might still be useful, but using it will take extra work. * Send an explanation with your changes of what problem they fix or what improvement they bring about. For a bug fix, just include a copy of the bug report, and explain why the change fixes the bug. * Always include a proper bug report for the problem you think you have fixed. We need to convince ourselves that the change is right before installing it. Even if it is right, we might have trouble judging it if we do not have a way to reproduce the problem. * Include all the comments that are appropriate to help people reading the source in the future understand why this change was needed. * Do not mix together changes made for different reasons. Send them individually. If you make two changes for separate reasons, then we might not want to install them both. We might want to install just one. * Use the version control system to make your diffs. Prefer the unified diff (http://en.wikipedia.org/wiki/Diff#Unified_format) format: `hg diff --unified 4'. * You can increase the probability that your patch gets applied by basing it on a recent revision of the sources. ---------- Footnotes ---------- (1) Images of a size less than 1500x1000 pixels qualify as small.  File: enblend.info, Node: Authors, Next: FDL, Prev: Bug Reports, Up: Top Appendix B Authors ****************** ANDREW MIHAL () has written Enblend and Enfuse. *Contributors* * PABLO D'ANGELO () added the contrast criteria. * JOE BEDA: Win32 porting up to version 3.2. * KORNEL BENKO, : CMake support for version 4.0. * ROGER GOODMAN: Proofreading of the manuals. * MAX LYONS. * MARK aka mjz: Win32 porting up to version 3.2. * THOMAS MODES, : Win32 porting of version 4.0. * RYAN SLEEVI, : Win32 porting of version 4.0. * CHRISTOPH SPIEL () added the gray projectors, the LoG-based edge detection, an O(n)-algorithm for the calculation of local contrast, entropy weighting, and various other features. * BRENT TOWNSHEND, : HDR support. Thanks to SIMON ANDRIOT and PABLO JOUBERT for suggesting the MERTENS-KAUTZ-VAN REETH technique and the name "Enfuse".  File: enblend.info, Node: FDL, Next: Program Index, Prev: Authors, Up: Top Appendix C GNU Free Documentation License ***************************************** Version 1.2, November 2002 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See `http://www.gnu.org/copyleft/'. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.  File: enblend.info, Node: Program Index, Next: Syntactic-Comment Index, Prev: FDL, Up: Top Program Index ************* [index] * Menu: * ale: Helpful Programs. (line 20) * align_image_stack (Hugin): Helpful Programs. (line 27) * cinepaint <1>: Helpful Programs. (line 39) * cinepaint: Extended Options. (line 143) * convert (ImageMagick): Helpful Programs. (line 50) * dcraw <1>: Helpful Programs. (line 10) * dcraw: Standard Workflow. (line 9) * display (ImageMagick): Helpful Programs. (line 50) * exiftool: Helpful Programs. (line 78) * exrdisplay (OpenEXR): Helpful Programs. (line 56) * fulla (Hugin): Helpful Programs. (line 27) * gimp <1>: Helpful Programs. (line 46) * gimp <2>: Extended Options. (line 143) * gimp: Standard Workflow. (line 9) * gm (GraphicsMagick): Helpful Programs. (line 50) * hugin <1>: Helpful Programs. (line 24) * hugin <2>: Extended Options. (line 123) * hugin <3>: Standard Workflow. (line 9) * hugin: Overview. (line 25) * identify (ImageMagick) <1>: Helpful Programs. (line 50) * identify (ImageMagick): Understanding Masks. (line 22) * montage (ImageMagick): Helpful Programs. (line 50) * nona (Hugin) <1>: Helpful Programs. (line 27) * nona (Hugin): Extended Options. (line 123) * PanoTools <1>: Standard Workflow. (line 9) * PanoTools: Overview. (line 25) * pfshdrcalibrate (PFScalibration): Helpful Programs. (line 59) * pfsin (PFSTools): Helpful Programs. (line 59) * pfsout (PFSTools): Helpful Programs. (line 59) * pfstmo_* (PFStmo): Helpful Programs. (line 59) * pfsview (PFSTools): Helpful Programs. (line 59) * PTmender (PanoTools): Helpful Programs. (line 32) * PTOptimizer (PanoTools): Helpful Programs. (line 32) * tifficc (LittleCMS): Helpful Programs. (line 82) * tiffinfo (libtiff) <1>: Helpful Programs. (line 74) * tiffinfo (libtiff): Understanding Masks. (line 22) * ufraw <1>: Helpful Programs. (line 13) * ufraw: Standard Workflow. (line 9) * ufraw-batch: Helpful Programs. (line 13)  File: enblend.info, Node: Syntactic-Comment Index, Next: Option Index, Prev: Program Index, Up: Top Syntactic-Comment Index *********************** [index] * Menu: * enblend-response-file: Response Files. (line 106) * enfuse-response-file: Response Files. (line 107) * filename-globbing: Response Files. (line 152) * glob: Response Files. (line 148) * globbing: Response Files. (line 150) * layer-selector: Response Files. (line 204) * response-file: Response Files. (line 105)  File: enblend.info, Node: Option Index, Next: General Index, Prev: Syntactic-Comment Index, Up: Top Option Index ************ [index] * Menu: * --anneal: Mask Generation Options. (line 9) * --ciecam: Extended Options. (line 22) * --coarse-mask: Mask Generation Options. (line 55) * --compression: Common Options. (line 23) * --depth: Extended Options. (line 39) * --dijkstra: Mask Generation Options. (line 95) * --fallback-profile: Extended Options. (line 131) * --fine-mask: Mask Generation Options. (line 108) * --gpu: Extended Options. (line 151) * --help: Common Options. (line 104) * --image-difference: Mask Generation Options. (line 115) * --layer-selector: Common Options. (line 78) * --levels: Common Options. (line 108) * --load-masks: Mask Generation Options. (line 171) * --mask-vectorize: Mask Generation Options. (line 178) * --no-ciecam: Extended Options. (line 175) * --no-optimize: Mask Generation Options. (line 225) * --no-parameter: Common Options. (line 162) * --optimize: Mask Generation Options. (line 233) * --optimizer-weights: Mask Generation Options. (line 256) * --output: Common Options. (line 152) * --parameter: Common Options. (line 158) * --primary-seam-generator: Mask Generation Options. (line 284) * --save-masks: Mask Generation Options. (line 307) * --smooth-difference: Mask Generation Options. (line 341) * --verbose: Common Options. (line 171) * --version: Common Options. (line 206) * --visualize: Mask Generation Options. (line 362) * --wrap: Common Options. (line 213) * -a: Common Options. (line 15) * -b <1>: Tuning Memory Usage. (line 6) * -b: Extended Options. (line 10) * -c: Extended Options. (line 22) * -d: Extended Options. (line 39) * -f: Extended Options. (line 119) * -g: Extended Options. (line 139) * -h: Common Options. (line 104) * -l: Common Options. (line 108) * -m <1>: Tuning Memory Usage. (line 6) * -m: Extended Options. (line 163) * -o: Common Options. (line 152) * -V: Common Options. (line 206) * -v: Common Options. (line 171) * -w: Common Options. (line 213) * -x: Common Options. (line 265)  File: enblend.info, Node: General Index, Prev: Option Index, Up: Top General Index ************* [index] * Menu: * # (response file comment): Response Files. (line 56) * 360o panoramas: Common Options. (line 213) * @ (response file prefix): Response Files. (line 6) * a.tif: Common Options. (line 154) * affine transformation: Standard Workflow. (line 48) * algorithms, globbing: Response Files. (line 146) * alpha channel <1>: Standard Workflow. (line 69) * alpha channel: Overview. (line 18) * alpha channel, associated: Extended Options. (line 139) * anneal parameters: Mask Generation Options. (line 9) * arithmetic JPEG compression: Common Options. (line 41) * authors, list of: Authors. (line 6) * binary mask: Understanding Masks. (line 6) * bits per channel: Extended Options. (line 39) * blur difference image: Mask Generation Options. (line 341) * bug database, LaunchPad: Bug Reports. (line 12) * bug reports: Bug Reports. (line 6) * Burt-Adelson multiresolution spline: Overview. (line 6) * canvas size: Extended Options. (line 119) * channel width: Extended Options. (line 39) * channel, alpha: Overview. (line 18) * checkpoint results: Common Options. (line 265) * chrominance weight: Mask Generation Options. (line 115) * CIECAM02 <1>: Color Profiles. (line 13) * CIECAM02: Extended Options. (line 22) * coarse mask: Mask Generation Options. (line 55) * color appearance model <1>: Color Profiles. (line 13) * color appearance model: Extended Options. (line 22) * color cube, RGB: Color Profiles. (line 13) * color profile <1>: Color Profiles. (line 6) * color profile: Extended Options. (line 25) * color space, sRGB <1>: Color Profiles. (line 24) * color space, sRGB: Extended Options. (line 25) * colors, visualization image: Mask Generation Options. (line 420) * compression: Common Options. (line 23) * compression, arithmetic JPEG: Common Options. (line 41) * compression, deflate: Common Options. (line 52) * compression, JPEG: Common Options. (line 29) * compression, LZW: Common Options. (line 63) * compression, packbits: Common Options. (line 67) * conversion, raw: Standard Workflow. (line 34) * D50 white point: Color Profiles. (line 55) * default layer selection: Response Files. (line 204) * default output filename: Common Options. (line 154) * deflate compression: Common Options. (line 52) * delta-E: Mask Generation Options. (line 140) * difference image: Mask Generation Options. (line 115) * DIJKSTRA radius: Mask Generation Options. (line 95) * double precision float, IEEE754: Extended Options. (line 92) * fallback profile: Extended Options. (line 131) * feathering, detrimental effect of: Overview. (line 25) * filename, literal: Invocation. (line 10) * fine mask: Mask Generation Options. (line 108) * format of response file: Response Files. (line 56) * free documentation license (FDL): FDL. (line 6) * frozen seam-line endpoint: Mask Generation Options. (line 412) * general index: General Index. (line 6) * generator, seam: Mask Generation Options. (line 284) * glob(7): Response Files. (line 171) * globbing algorithm literal: Response Files. (line 157) * globbing algorithm none: Response Files. (line 179) * globbing algorithm sh: Response Files. (line 188) * globbing algorithm shell: Response Files. (line 182) * globbing algorithm wildcard: Response Files. (line 157) * globbing algorithms: Response Files. (line 146) * GNU free documentation license: FDL. (line 6) * GPU (Graphics Processing Unit): Extended Options. (line 151) * grammar, response file: Response Files. (line 70) * grammar, syntactic comment: Response Files. (line 138) * graph-cut (GC): Mask Generation Options. (line 301) * graphcut (GC): Primary Seam Generators. (line 21) * graphcut, details: Primary Seam Generators. (line 29) * graphcut, limitations: Primary Seam Generators. (line 59) * graphics processing unit: Extended Options. (line 151) * half precision float, OpenEXR: Extended Options. (line 108) * helpful programs: Helpful Programs. (line 6) * hue-luminance maximum: Mask Generation Options. (line 130) * Hugin: Bug Reports. (line 95) * ICC profile <1>: Color Profiles. (line 6) * ICC profile: Extended Options. (line 25) * IEEE754 double precision float: Extended Options. (line 92) * IEEE754 single precision float: Extended Options. (line 82) * image cache: Tuning Memory Usage. (line 9) * image cache, block size: Extended Options. (line 10) * image cache, cache size: Extended Options. (line 163) * image cache, location: Tuning Memory Usage. (line 20) * image colors, visualization: Mask Generation Options. (line 420) * image difference: Mask Generation Options. (line 115) * image, multi-layer: Overview. (line 39) * image, visualization: Mask Generation Options. (line 379) * index, general: General Index. (line 6) * index, option: Option Index. (line 6) * index, program: Program Index. (line 6) * index, syntactic-comment: Syntactic-Comment Index. (line 6) * input image requirements: Image Requirements. (line 6) * input mask: Understanding Masks. (line 18) * invocation: Invocation. (line 6) * JPEG compression: Common Options. (line 29) * KImageFuser: Bug Reports. (line 95) * LaunchPad: Bug Reports. (line 12) * LaunchPad, bug database: Bug Reports. (line 12) * layer selection: Common Options. (line 78) * layer selection, all layers: Common Options. (line 83) * layer selection, default: Response Files. (line 204) * layer selection, first layer: Common Options. (line 86) * layer selection, largest-layer: Common Options. (line 90) * layer selection, no layer: Common Options. (line 97) * lens distortion, correction of: Standard Workflow. (line 48) * levels, pyramid: Common Options. (line 108) * LibJPEG: Helpful Programs. (line 63) * LibPNG: Helpful Programs. (line 66) * LibTiff: Helpful Programs. (line 70) * literal filename: Invocation. (line 10) * load mask: Mask Generation Options. (line 171) * loops in seam line: Mask Generation Options. (line 208) * luminance weight: Mask Generation Options. (line 115) * luminance-hue maximum: Mask Generation Options. (line 130) * LZW compression: Common Options. (line 63) * mask template character, %: Mask Generation Options. (line 424) * mask template character, B: Mask Generation Options. (line 475) * mask template character, b: Mask Generation Options. (line 468) * mask template character, D: Mask Generation Options. (line 465) * mask template character, d: Mask Generation Options. (line 458) * mask template character, E: Mask Generation Options. (line 494) * mask template character, e: Mask Generation Options. (line 488) * mask template character, F: Mask Generation Options. (line 484) * mask template character, f: Mask Generation Options. (line 478) * mask template character, i: Mask Generation Options. (line 427) * mask template character, n: Mask Generation Options. (line 442) * mask template character, P: Mask Generation Options. (line 455) * mask template character, p: Mask Generation Options. (line 447) * mask template characters, table of: Mask Generation Options. (line 496) * mask, binary: Understanding Masks. (line 6) * mask, coarse: Mask Generation Options. (line 55) * mask, fine: Mask Generation Options. (line 108) * mask, generation: Mask Generation Options. (line 90) * mask, input files: Understanding Masks. (line 18) * mask, load: Mask Generation Options. (line 171) * mask, optimization visualization: Mask Generation Options. (line 362) * mask, save: Mask Generation Options. (line 307) * mask, vectorization distance: Mask Generation Options. (line 178) * mask, weight: Understanding Masks. (line 6) * masks, understanding: Understanding Masks. (line 6) * match quality: Mask Generation Options. (line 162) * maximum hue-luminance: Mask Generation Options. (line 130) * memory, tuning usage of: Tuning Memory Usage. (line 6) * multi-directory TIFF: Overview. (line 39) * multi-layer image: Overview. (line 39) * nearest feature transform (NFT) <1>: Primary Seam Generators. (line 11) * nearest feature transform (NFT): Mask Generation Options. (line 297) * nearest-feature transform (NFT): Mask Generation Options. (line 90) * nearest-feature transform (NFT), Graph-Cut (GC): Mask Generation Options. (line 410) * Octave: Bug Reports. (line 6) * only save mask: Mask Generation Options. (line 318) * OpenEXR, data format: Extended Options. (line 104) * OpenEXR, half precision float: Extended Options. (line 108) * optimize seam: Mask Generation Options. (line 225) * optimize strategy: Mask Generation Options. (line 252) * optimize, anneal parameters: Mask Generation Options. (line 9) * optimizer weights: Mask Generation Options. (line 256) * optimizer, simulated annealing <1>: Mask Generation Options. (line 9) * optimizer, simulated annealing: Extended Options. (line 154) * option index: Option Index. (line 6) * options, common: Common Options. (line 6) * options, extended: Extended Options. (line 6) * options, mask generation: Mask Generation Options. (line 6) * order, of processing: Response Files. (line 9) * output file compression: Common Options. (line 23) * output filename, default: Common Options. (line 154) * output image, set size of: Extended Options. (line 119) * overview: Overview. (line 6) * packbits compression: Common Options. (line 67) * parallax error: Standard Workflow. (line 58) * perceptual rendering intent: Color Profiles. (line 53) * photometric alignment: Standard Workflow. (line 50) * primary seam generator <1>: Primary Seam Generators. (line 6) * primary seam generator: Mask Generation Options. (line 284) * problem reports: Bug Reports. (line 9) * processing order: Response Files. (line 9) * profile, fallback: Extended Options. (line 131) * profile, ICC <1>: Color Profiles. (line 6) * profile, ICC: Extended Options. (line 25) * program index: Program Index. (line 6) * programs, helpful additional: Helpful Programs. (line 6) * pyramid levels: Common Options. (line 108) * quality, match: Mask Generation Options. (line 162) * radius, DIJKSTRA: Mask Generation Options. (line 95) * raw conversion: Standard Workflow. (line 34) * rendering intent, perceptual: Color Profiles. (line 53) * response file <1>: Response Files. (line 6) * response file: Invocation. (line 10) * response file, comment (#): Response Files. (line 56) * response file, force recognition of: Response Files. (line 100) * response file, format: Response Files. (line 56) * response file, grammar: Response Files. (line 70) * response file, syntactic comment: Response Files. (line 126) * results, checkpoint: Common Options. (line 265) * RGB color cube: Color Profiles. (line 13) * save mask: Mask Generation Options. (line 307) * save mask, only: Mask Generation Options. (line 318) * seam generation: Primary Seam Generators. (line 6) * seam generation, details: Primary Seam Generators. (line 29) * seam line, loops: Mask Generation Options. (line 208) * seam optimization: Mask Generation Options. (line 225) * seam, primary generator: Mask Generation Options. (line 284) * seam-line endpoint, frozen: Mask Generation Options. (line 412) * simulated annealing optimizer <1>: Mask Generation Options. (line 9) * simulated annealing optimizer: Extended Options. (line 154) * single precision float, IEEE754: Extended Options. (line 82) * size, canvas: Extended Options. (line 119) * smooth difference image: Mask Generation Options. (line 341) * SourceForge: Overview. (line 45) * sRGB color space <1>: Color Profiles. (line 24) * sRGB color space: Extended Options. (line 25) * syntactic comment, grammar: Response Files. (line 138) * syntactic comment, response file: Response Files. (line 126) * syntactic-comment index: Syntactic-Comment Index. (line 6) * TIFF, multi-directory: Overview. (line 39) * tiffcopy: Overview. (line 39) * tiffsplit: Overview. (line 39) * TMPDIR: Tuning Memory Usage. (line 20) * transformation, affine: Standard Workflow. (line 48) * understanding masks: Understanding Masks. (line 6) * virtual reality: Common Options. (line 223) * visualization image: Mask Generation Options. (line 379) * visualization image colors: Mask Generation Options. (line 420) * visualization of mask: Mask Generation Options. (line 362) * weight mask: Understanding Masks. (line 6) * weight, chrominance: Mask Generation Options. (line 115) * weight, luminance: Mask Generation Options. (line 115) * weights, optimizer: Mask Generation Options. (line 256) * white point, D50: Color Profiles. (line 55) * workflow: Workflow. (line 6) * workflow with Enblend: Standard Workflow. (line 9) * workflow with Enfuse: Standard Workflow. (line 9) * workflow, external mask manipulation: External Mask Manipulation. (line 6) * workflow, external masks: External Mask Manipulation. (line 33) * workflow, standard: Standard Workflow. (line 6) * wrap around: Common Options. (line 213)  Tag Table: Node: Top891 Node: Overview2082 Ref: Overview-Footnote-14521 Ref: Overview-Footnote-24702 Node: Workflow4844 Node: Standard Workflow5243 Ref: Figure:photographic-workflow5503 Node: External Mask Manipulation8177 Ref: Figure:external-mask-workflow9494 Node: Invocation9979 Node: Image Requirements10683 Node: Response Files12157 Ref: Table:response-file-format14181 Ref: Table:response-file-syntactic-comment16646 Ref: Table:globbing-algorithms17547 Node: Common Options19006 Ref: Common Options-Footnote-128438 Ref: Common Options-Footnote-228630 Node: Extended Options28789 Ref: Extended Options-Footnote-135421 Node: Mask Generation Options35494 Ref: Table:mask-generation38155 Ref: Table:optimizer-strategies45566 Ref: Table:visualization-colors51818 Ref: Table:mask-template-characters52733 Ref: Mask Generation Options-Footnote-154985 Node: Primary Seam Generators55213 Node: Color Profiles58088 Node: Understanding Masks60538 Node: Tuning Memory Usage64331 Ref: Table:cache-size-settings67073 Node: Helpful Programs67509 Node: Bug Reports71245 Ref: Bug Reports-Footnote-176900 Node: Authors76970 Node: FDL78135 Node: Program Index99116 Node: Syntactic-Comment Index102112 Node: Option Index102801 Node: General Index107166  End Tag Table enblend-enfuse-4.1.2+dfsg/doc/docstrings0000644000175100017510000000566612070530113020435 0ustar ametzlerametzler#! /usr/bin/env perl # This file is part of Enblend. # Licence details can be found in the file COPYING. # name: docstrings # synopsis: extract documentation strings from text files # author: Dr. Christoph L. Spiel # perl version: 5.10.0 # Grammar # '//' '<' TEXT # '/*' '<' TEXT '>' '*/' # where TEXT is on a single line use strict; use warnings; use English; use File::Basename; use IO::File; use IO::Handle; use constant COMMANDNAME => basename($0); my $regexp = qr(// \s* < \s* (.*) | /\* \s* < \s* (.*?) \s* > \s* \*/)x; sub open_file { my $file = shift; my $handle; if ($file eq '-') { $handle = new IO::Handle; $handle->fdopen(fileno(STDIN), 'r') or die(COMMANDNAME, qq(: cannot open standard input: $OS_ERROR\n)); } else { $handle = new IO::File($file, 'r') or die(COMMANDNAME, qq(: cannot open "$file": $OS_ERROR\n)); } return $handle; } sub insert_docstring { my ($docstrings, $data) = @_; my $value = $data->{VALUE}; $value =~ m{^(\S+)}; my $key = $1; if (exists $docstrings->{$key}) { my $previous_file = $docstrings->{$key}{FILENAME}; my $previous_line = $docstrings->{$key}{LINENUMBER}; warn(COMMANDNAME, qq(: warning: duplicate key "$key" at $data->{FILENAME}:$data->{LINENUMBER};\n), COMMANDNAME, qq(: warning: previous definition at $previous_file:$previous_line\n)); } $docstrings->{$key} = $data; } sub collect_docstrings { my ($docstrings, $filename, $file) = @_; my $basename = basename($filename); my $linenumber = 1; while (my $line = readline($file)) { while ($line =~ m{$regexp}g) { insert_docstring($docstrings, {FILENAME => $basename, LINENUMBER => $linenumber, VALUE => $1}) if $1; insert_docstring($docstrings, {FILENAME => $basename, LINENUMBER => $linenumber, VALUE => $2}) if $2; } ++$linenumber; } return $docstrings; } sub print_docstrings { my $docstrings = shift; foreach my $key (sort keys %$docstrings) { my $filename = $docstrings->{$key}{FILENAME}; my $linenumber = $docstrings->{$key}{LINENUMBER}; my $value = $docstrings->{$key}{VALUE}; print("\@c $filename:$linenumber\n", "\@set $value\n", "\n"); } } sub scan_file { my ($docstrings, $filename) = @_; my $file = open_file($filename); collect_docstrings($docstrings, $filename, $file); $file->close or die(COMMANDNAME, qq(: cannot close "$filename": $OS_ERROR\n)); } sub main { @ARGV = ('-') unless @ARGV; my $docstrings = {}; scan_file($docstrings, $_) foreach @ARGV; print_docstrings($docstrings); } main(); enblend-enfuse-4.1.2+dfsg/doc/stamp-10000644000175100017510000000014512224473525017541 0ustar ametzlerametzler@set UPDATED 15 February 2013 @set UPDATED-MONTH February 2013 @set EDITION 4.1.2 @set VERSION 4.1.2 enblend-enfuse-4.1.2+dfsg/doc/makeinfo-4.13-docbook.sed0000644000175100017510000000420312070530113022604 0ustar ametzlerametzler# name: makeinfo-4.13-docbook.sed # synopsis: Fix most of the cr@p makinfo-4.13 produces with "--docbook". # As we are at it, replace the DOCTYPE with the one we need. # sed: GNU sed 4.1.5 # We must splice in the DTD for MathML anyhow, so we recreate the # whole DOCTYPE. //c\ \ \ ]>\ # Makeinfo puts anchors into para-elements right in front of table- or # figure elements where they rather belong. This is semantically # wrong and prevents some formatters from referencing the table or # figure. s#]*\)>#
# s#
]*\)>#
# s#<\(table\|figure\)>#<\2 id="\1"># s#
]*\)>#
# # Makeinfo is double-minded (schizophrenic?) with "Table:foo" or # "Figure:bar" IDs, some are converted to "Table-foo" or "Figure-bar", # but some remain unchanged. So we convert all of them to the dashed # form. s#id="\(Table\|Figure\):\([^"]*\)"#id="\1-\2"#g # Related to the problem with anchors-in-para-elements instead to the # correct floating elements we must attach IDs to # variablelist-elements. \##N;s#[ \t\n]*#<\1mediaobject>#g # WTF? PDF is just not supported by the DTD. s### # When slurping in our *.txt files, Makeinfo picks up a ^L that breaks # well-formedness. s#\f$## # The lists of figures and tables are required to have some contents. s#List of \(Figures\|Tables\)#List of \1# # Remove the stupid Emacs syntactic comment at the end of the file. \# w luminance L P 1 L P 2 2 w chrominance a P 1 a P 2 2 w chrominance b P 1 b P 2 2 1 2 @end docbook This is the default in Enblend version@tie{}4.1 and later. Note that the ``delta-E'' mentioned here has nothing to do with @var{DELTA-E-MAX} and @var{DELTA-E-MIN} of option@tie{}@option{--anneal}. @end table Both @var{LUMINANCE-WEIGHT} and @var{CHROMINANCE-WEIGHT} must be non-negative, their sum must be positive. Enblend automatically normalizes the sum of @var{LUMINANCE-WEIGHT} and @var{CHROMINANCE-WEIGHT} to one. Thus @samp{--image-difference=delta-e:2:1} and @samp{--image-difference=delta-e:0.6667:0.3333} define the same weighting function. The default @var{LUMINANCE-WEIGHT} is @value{src::default-luminance-difference-weight} and the default @var{CHROMINANCE-WEIGHT} is @value{src::default-chrominance-difference-weight}. @cindex match quality @cindex quality, match At higher verbosity levels Enblend computes the true size of the overlap area in pixels and it calculates the average and standard deviation of the difference per pixel in the normalized luminance interval@tie{}[0@dots{}1]. These statistical measures are based on @var{ALGORITHM}, therefore they should only be compared for identical @var{ALGORITHM}s. The average difference is a rough measure of quality with lower values meaning better matches. @item --load-masks[=@var{IMAGE-TEMPLATE}] @opindex --load-masks @cindex mask, load @cindex load mask Instead of generating masks, use those in @var{IMAGE-TEMPLATE}. The default is @file{@value{src::default-mask-template}}. The mask images have to be a 8-bit grayscale images. See @option{--save-masks} below for details. @item --mask-vectorize=@var{DISTANCE} @opindex --mask-vectorize @cindex mask, vectorization distance Set the mask vectorization @var{DISTANCE} Enblend uses to partition each seam. Thus, break down the seam to segments of length @var{DISTANCE} each. If Enblend uses a coarse mask (@option{--coarse-mask}) or Enblend optimizes (@option{--optimize}) a mask it vectorizes the initial seam line before performing further operations. See @ref{Table:mask-generation} for the precise conditions. @var{DISTANCE} tells Enblend how long to make each of the line segments called vectors here. The unit of @var{DISTANCE} is pixels unless it is a percentage as explained in the next paragraph. In fine masks one mask pixel corresponds to one pixel in the input image, whereas in coarse masks one pixel represents for example @value{src::default-coarseness-factor}@dmn{pixels} in the input image. Append a percentage sign (@samp{%}) to @var{DISTANCE} to specify the segment length as a fraction of the diagonal of the rectangle including the overlap region. Relative measures do not depend on coarse or fine masks, they are recomputed for each mask. Values around 5%--10% are a good starting point. This option massively influences the mask generation process! Large @var{DISTANCE} values lead to shorter, straighter, less wiggly, less baroque seams that are on the other hand less optimal, because they run through regions of larger image mismatch instead of avoiding them. Small @var{DISTANCE} values give the optimizers more possibilities to run the seam around high mismatch areas. @cindex seam line, loops @cindex loops in seam line What should @emph{never} happen though, are loops in the seam line. Counter loops with higher weights of @var{DISTANCE-WEIGHT} (in option@tie{}@option{--optimizer-weights}), larger vectorization @var{DISTANCE}s, @var{TAU}s (in option@tie{}@option{--anneal}) that are closer to one, and blurring of the difference image with option@tie{}@option{--smooth-difference}. Use option@tie{}@option{--visualize} to check the results. Valid range: @var{DISTANCE} @geq{} @value{src::minimum-vectorize-distance}. Enblend limits @var{DISTANCE} so that it never gets below @value{src::minimum-vectorize-distance} even if it has been given as a percentage. The user will be warned in such cases. Default: @value{src::coarse-mask-vectorize-distance}@dmn{pixels} for coarse masks and @value{src::fine-mask-vectorize-distance}@dmn{pixels} for fine masks. @item --no-optimize @opindex --no-optimize @cindex optimize seam @cindex seam optimization Turn off seam line optimization. Combined with option@tie{}@option{--fine-mask} this will produce the same type of mask as Enblend version@tie{}2.5, namely the result of a @cindex nearest-feature transform (@acronym{NFT}) Nearest-Feature Transform (@acronym{NFT}).@footnote{@sc{Muhammad H. Alsuwaiyel} and @sc{Marina Gavrilova}, ``On the Distance Transform of Binary Images'', Proceedings of the International Conference on Imaging Science, Systems, and Technology, June 2000, @abbr{Vols@.} I and II, pages 83--86.} Also see @ref{Table:mask-generation}. @item --optimize @opindex --optimize @cindex optimize seam @cindex seam optimization Use a multi-strategy approach to route the seam line around mismatches in the overlap region. This is the default. @ref{Table:optimizer-strategies} explains these strategies; also see @ref{Table:mask-generation}. @float Table,Table:optimizer-strategies @table @asis @dbtitle{Optimizer Strategies} @item Simulated Annealing Tune with option@tie{}@code{--anneal} = @var{TAU} : @var{DELTA-E-MAX} : @var{DELTA-E-MIN} : @var{K-MAX}. @uref{http://@/en.wikipedia.org/@/wiki/@/Simulated_@/annealing, Simulated-Annealing} @item @sc{Dijkstra} Shortest Path Tune with option@tie{}@code{--dijkstra} = @var{RADIUS}. @uref{http://@/en.wikipedia.org/@/wiki/@/Dijkstra_@/algorithm, @sc{Dijkstra} algorithm} @end table @caption{Enblend's strategies to optimize the seam lines between images.} @shortcaption{Optimizer strategies} @cindex optimize strategy @end float @item --optimizer-weights=@var{DISTANCE-WEIGHT}[:@var{MISMATCH-WEIGHT}] @opindex --optimizer-weights @cindex optimizer weights @cindex weights, optimizer @cindex seam optimization Set the weights of the seam-line optimizer. If omitted, @var{MISMATCH-WEIGHT} defaults to 1. The seam-line optimizer considers two qualities of the seam line: @itemize @item The distance of the seam line from its initial position, which has been determined by @acronym{NFT} (see option@tie{}@option{--no-optimize}). @item The total ``mismatch'' accumulated along it. @end itemize The optimizer weights@tie{}@var{DISTANCE-WEIGHT} and @var{MISMATCH-WEIGHT} define how to weight these two criteria. Enblend up to version@tie{}3.2 used 1:1. This version of Enblend (@value{VERSION}) uses @value{src::default-optimizer-weight-distance}:@value{src::default-optimizer-weight-mismatch}. A large @var{DISTANCE-WEIGHT} pulls the optimized seam line closer to the initial postion. A large @var{MISMATCH-WEIGHT} makes the seam line go on detours to find a path along which the mismatch between the images is small. If the optimized seam line shows cusps or loops (see option@tie{}@option{--visualize}), reduce @var{MISMATCH-WEIGHT} or increase @var{DISTANCE-WEIGHT}. Both weights must be non-negative. They cannot be both zero at the same time. Otherwise, their absolute values are not important as Enblend normalizes their sum. @item --primary-seam-generator=@var{ALGORITHM} @opindex --primary-seam-generator @cindex primary seam generator @cindex seam, primary generator @cindex generator, seam Select the algorithm responsible for generating the general seam route. This is the @var{ALGORITHM} that produces an initial seam line, which is the basis for later, optional optimizations (see @option{--optimize}). Nearest Feature Transform (@acronym{NFT}) is the only algorithm up to and including Enblend version@tie{}4.0. Version@tie{}4.1 adds a Graph-Cut (@acronym{GC}) algorithm. In this version of Enblend @acronym{NFT} is the default. Valid @var{ALGORITHM} names are: @table @asis @item nearest-feature-transform @itemx nft @cindex nearest feature transform (@acronym{NFT}) Nearest Feature Transform @item graph-cut @itemx gc @cindex graph-cut (@acronym{GC}) Graph-Cut @end table See @ref{Primary Seam Generators} for details. @item --save-masks @itemx --save-masks=@var{IMAGE-TEMPLATE} @opindex --save-masks @cindex mask, save @cindex save mask Save the generated masks to @var{IMAGE-TEMPLATE}. The default is @file{@value{src::default-mask-template}}. Enblend saves masks as 8@dmn{bit} grayscale (single channel) images. For accuracy we recommend to choose a lossless format. Use this option if you wish to edit the location of the seam line by hand. This will give you images of the right sizes that you can edit to make your changes. Later, use option@tie{}@option{--load-masks} to blend the project with your custom seam lines. @cindex save mask, only @cindex only save mask Enblend will stop after saving all masks unless option@tie{}@option{--output} is given, too. With both options given, this is, @option{--save-masks} and @option{--output}, Enblend saves all masks and then proceeds to blend the output image. @var{IMAGE-TEMPLATE} defines a template that is expanded for each input file. In a template a percent sign (@samp{%}) introduces a variable part. All other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (@pxref{Common Options}). @ref{Table:mask-template-characters} lists all variables. A fancy mask filename template could look like this: @example %D/mask-%02n-%f.tif @end example It puts the mask files into the same directory as the output file (@samp{%D}), generates a two-digit index (@samp{%02n}) to keep the mask files nicely sorted, and decorates the mask filename with the name of the associated input file (@samp{%f}) for easy recognition. @item --smooth-difference=@var{RADIUS} @opindex --smooth-difference @cindex smooth difference image @cindex blur difference image @emph{This option has been deprecated.} Smooth the difference image prior to seam-line optimization to get a shorter and -- on the length scale of @var{RADIUS} -- also a straighter seam-line. The default is not to smooth. If @var{RADIUS} is larger than zero Enblend blurs the difference images of the overlap regions with a @sc{Gaussian} filter having a radius of @var{RADIUS}@dmn{pixels}. Values of 0.5 to 1.5@dmn{pixels} for @var{RADIUS} are good starting points; use option@tie{}@option{--visualize} to directly judge the effect. When using this option in conjunction with option@tie{}@code{--coarse-mask}=@/@var{FACTOR}, keep in mind that the smoothing occurs @emph{after} the overlap regions have been shrunken. Thus, blurring affects a @var{FACTOR}@classictimes{}@/@var{FACTOR} times larger area in the original images. Valid range: @var{RADIUS} @geq{} @value{src::minimum-smooth-difference}. @item --visualize[=@var{VISUALIZE-TEMPLATE}] @opindex --visualize @cindex mask, optimization visualization @cindex visualization of mask Create an image according to @var{VISUALIZE-TEMPLATE} that visualizes the unoptimized mask and the applied optimizations (if any). The default is @file{@value{src::default-visualize-template}}. The image shows Enblend's view of the overlap region and how it decided to route the seam line. If you are experiencing artifacts or unexpected output, it may be useful to include this visualization image in your bug report. @xref{Bug Reports}. @var{VISUALIZE-TEMPLATE} defines a template that is expanded for each input file. In a template, a percent sign (@samp{%}) introduces a variable part; all other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (@pxref{Common Options}). @ref{Table:mask-template-characters} lists all variables. @noindent @strong{Visualization Image.} @cindex visualization image @cindex image, visualization @need 150 The visualization image shows the symmetric difference of the pixels in the rectangular region where two images overlap. The larger the difference the lighter shade of gray it appears in the visualization image. Enblend paints the non-overlapping parts of the image pair -- these are the regions where @emph{no} blending occurs -- in @value{src::visualize-no-overlap-value-color}. @ref{Table:visualization-colors} shows the meanings of all the colors that are used in seam-line visualization images. @float Table,Table:visualization-colors @table @asis @dbtitle{Visualization Colors} @item @value{src::visualize-no-overlap-value-color} Non-overlapping parts of image pair. @item various shades of gray Difference of the pixel values in the overlap region. @item @value{src::visualize-state-space-color} Location of an optimizer sample. @item @value{src::visualize-first-vertex-value-color} First sample of a line segment. @item @value{src::visualize-next-vertex-value-color} Any other but first sample of a line segment. @item @value{src::visualize-state-space-inside-color} @cindex @sc{Dijkstra} radius @cindex radius, @sc{Dijkstra} State space sample inside the @sc{Dijkstra} radius. @item @value{src::visualize-state-space-unconverged-color} Non-converged point. @item @value{src::visualize-initial-path-color} @cindex nearest-feature transform (@acronym{NFT}), Graph-Cut (@acronym{GC}) Initial seam line as generated by the primary seam generator. @cindex frozen seam-line endpoint @cindex seam-line endpoint, frozen Enblend marks a non-movable (``frozen'') endpoint of a seam-line segment with a @value{src::visualize-frozen-point} @value{src::mark-frozen-point}, whereas it uses a @value{src::visualize-movable-point} @value{src::mark-movable-point} to denote an endpoint that the optimizer is allowed to move around. @item @value{src::visualize-short-path-value-color} Final seam line. @end table @caption{Colors used in seam-line visualization images.} @shortcaption{Visualization colors} @cindex visualization image colors @cindex image colors, visualization @cindex colors, visualization image @end float @ifnotinfo @cindex seam-line visualization example @cindex visualization example @ref{Figure:seam-line-visualization} shows an example of a seam-line visualization. It was produced with an Enblend run at all defaults, but @option{--fine-mask} and @option{--visualize} enabled. The large @value{src::visualize-no-overlap-value-color} border is ``off-limits'' for Enblend, for the images do not overlap there. The dark wedge inside the @value{src::visualize-no-overlap-value-color} frame is where the images share a common region. The initial seam-line (@value{src::visualize-initial-path-color}) is almost straight with the exception of a single bend on the left side of the image and the final seam-line (@value{src::visualize-short-path-value-color}) meanders around it. @ifhtml @float Figure,Figure:seam-line-visualization @rimage{seam-line-visualization} @caption{Seam-line visualization of a simple overlap. The 853@classictimes{}238@dmn{pixel} image is shown at a magification of 100%.} @shortcaption{Seam-line visualization} @end float @end ifhtml @iftex @float Figure,Figure:seam-line-visualization @rimage{seam-line-visualization, 15cm} @caption{Seam-line visualization of a simple overlap. The 853@classictimes{}238@dmn{pixel} image has been rescaled to a width of approximately 15@dmn{cm}.} @shortcaption{Seam-line visualization} @end float @end iftex @ifdocbook @float Figure,Figure:seam-line-visualization @rimage{seam-line-visualization, 15cm} @caption{Seam-line visualization of a simple overlap. The 853@classictimes{}238@dmn{pixel} image has been rescaled to a width of approximately 15@dmn{cm}.} @shortcaption{Seam-line visualization} @end float @end ifdocbook @end ifnotinfo @end table @page @include mask-template-characters.texi @node Primary Seam Generators @chapter Primary Seam Generators @cindex primary seam generator @cindex seam generation @include seam-generators.texi @node Color Profiles @chapter Color Profiles @cindex profile, @acronym{ICC} @cindex @acronym{ICC} profile @cindex color profile @include color-profiles.texi @node Understanding Masks @chapter Understanding Masks @cindex understanding masks @cindex masks, understanding @include understanding-masks.texi @node Tuning Memory Usage @chapter Tuning Memory Usage @cindex memory, tuning usage of @opindex -b @opindex -m @include tuning-memory-usage.texi @node Helpful Programs @chapter Helpful Additional Programs @cindex helpful programs @cindex programs, helpful additional @include helpful-programs.texi @node Bug Reports @appendix Bug Reports @cindex bug reports @include bug-reports.texi @node Authors @appendix Authors @cindex authors, list of @include authors.texi @node FDL @appendix @acronym{GNU} Free Documentation License @cindex free documentation license (@acronym{FDL}) @cindex @acronym{GNU} free documentation license @include fdl.texi @c @c End of Document @c @ifnotdocbook @node Program Index @unnumbered Program Index @cindex program index @cindex index, program @printindex pg @node Syntactic-Comment Index @unnumbered Syntactic-Comment Index @cindex syntactic-comment index @cindex index, syntactic-comment @printindex sc @node Option Index @unnumbered Option Index @cindex option index @cindex index, option @printindex op @node General Index @unnumbered General Index @cindex general index @cindex index, general @printindex cp @end ifnotdocbook @bye enblend-enfuse-4.1.2+dfsg/doc/Makefile.in0000664000175100017510000011474012232763263020412 0ustar ametzlerametzler# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/entropy.gp.in $(srcdir)/entropy-cutoff.gp.in \ $(srcdir)/exposure-cutoff.gp.in $(srcdir)/gaussian.gp.in \ $(srcdir)/laplacian-of-gaussian.gp.in \ $(srcdir)/sharp-edge.gp.in $(srcdir)/smooth-edge.gp.in \ $(enblend_TEXINFOS) $(top_srcdir)/mdate-sh \ $(srcdir)/versenblend.texi $(srcdir)/stamp-vti \ $(enfuse_TEXINFOS) $(srcdir)/versenfuse.texi $(srcdir)/stamp-1 \ $(top_srcdir)/texinfo.tex ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_gl.m4 \ $(top_srcdir)/m4/ax_check_glu.m4 \ $(top_srcdir)/m4/ax_check_glut.m4 \ $(top_srcdir)/m4/ax_lang_compiler_ms.m4 \ $(top_srcdir)/m4/ax_openmp.m4 \ $(top_srcdir)/m4/ax_prog_perl_modules.m4 \ $(top_srcdir)/m4/ax_pthread.m4 \ $(top_srcdir)/m4/ax_with_prog.m4 $(top_srcdir)/m4/lrint.m4 \ $(top_srcdir)/m4/lrintf.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = entropy.gp entropy-cutoff.gp exposure-cutoff.gp \ gaussian.gp laplacian-of-gaussian.gp sharp-edge.gp \ smooth-edge.gp CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = AM_V_DVIPS = $(am__v_DVIPS_@AM_V@) am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@) am__v_DVIPS_0 = @echo " DVIPS " $@; am__v_DVIPS_1 = AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@) am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@) am__v_MAKEINFO_0 = @echo " MAKEINFO" $@; am__v_MAKEINFO_1 = AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@) am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@) am__v_INFOHTML_0 = @echo " INFOHTML" $@; am__v_INFOHTML_1 = AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@) am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@) am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@; am__v_TEXI2DVI_1 = AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@) am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@) am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@; am__v_TEXI2PDF_1 = AM_V_texinfo = $(am__v_texinfo_@AM_V@) am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@) am__v_texinfo_0 = -q am__v_texinfo_1 = AM_V_texidevnull = $(am__v_texidevnull_@AM_V@) am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@) am__v_texidevnull_0 = > /dev/null am__v_texidevnull_1 = INFO_DEPS = $(srcdir)/enblend.info $(srcdir)/enfuse.info TEXINFO_TEX = $(top_srcdir)/texinfo.tex am__TEXINFO_TEX_DIR = $(top_srcdir) DVIS = enblend.dvi enfuse.dvi PDFS = enblend.pdf enfuse.pdf PSS = enblend.ps enfuse.ps HTMLS = enblend.html enfuse.html TEXINFOS = enblend.texi enfuse.texi TEXI2PDF = $(TEXI2DVI) --pdf --batch MAKEINFOHTML = $(MAKEINFO) --html DVIPS = dvips am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__installdirs = "$(DESTDIR)$(infodir)" am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ \ -I $(top_builddir) -I $(srcdir) AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ \ -I $(top_builddir) -I $(srcdir) \ --css-include=@srcdir@/default.css \ $(MAKEINFOHTMLFLAGS) AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_LIBS = @EXTRA_LIBS@ FIG2DEV = @FIG2DEV@ GLUT_CFLAGS = @GLUT_CFLAGS@ GLUT_LIBS = @GLUT_LIBS@ GLU_CFLAGS = @GLU_CFLAGS@ GLU_LIBS = @GLU_LIBS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ GNUPLOT = @GNUPLOT@ GREP = @GREP@ HAVE_INLINE = @HAVE_INLINE@ HELP2MAN = @HELP2MAN@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ OPENEXR_CFLAGS = @OPENEXR_CFLAGS@ OPENEXR_LIBS = @OPENEXR_LIBS@ OPENGL_CFLAGS = @OPENGL_CFLAGS@ OPENGL_LIBS = @OPENGL_LIBS@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ POW_LIB = @POW_LIB@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ RASTER_DIR = @RASTER_DIR@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ TIDY = @TIDY@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLLINT = @XMLLINT@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ ax_pthread_config = @ax_pthread_config@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ info_TEXINFOS = enblend.texi \ enfuse.texi enblend_TEXINFOS = auxmac.texi auxmac.tex \ varsenblend.texi fdl.texi \ mask-template-characters.texi \ helpful-programs.texi \ seam-generators.texi \ color-profiles.texi \ tuning-memory-usage.texi \ understanding-masks.texi \ workflow.texi filespec.texi \ external-masks.texi \ bug-reports.texi authors.texi \ photographic-workflow.fig \ external-mask-workflow.fig \ seam-line-visualization.tif \ default.css enfuse_TEXINFOS = auxmac.texi auxmac.tex \ varsenfuse.texi fdl.texi \ mask-template-characters.texi \ helpful-programs.texi \ color-profiles.texi \ tuning-memory-usage.texi \ understanding-masks.texi \ workflow.texi filespec.texi \ external-masks.texi \ bug-reports.texi authors.texi \ config-edge.gp config.gp \ entropy-cutoff.gp.in \ exposure-cutoff.gp.in \ entropy.gp.in gaussian.gp.in \ laplacian-of-gaussian.gp.in \ sharp-edge.gp.in sharp-edge.data \ smooth-edge.gp.in smooth-edge.data \ local-analysis-window.fig \ photographic-workflow.fig \ focus-stack-decision-tree.fig \ external-mask-workflow.fig \ default.css TEXI2DVI = texi2dvi $(TEXI2DVIFLAGS) $(EXTRATEXI2DVIFLAGS) EXTRA_DIST = \ docstrings seam-line-visualization.tif makeinfo-4.13-docbook.sed \ CMakeLists.txt macros.cmake \ CreateVersTexi.pl define2set.pl fig2txt.pl ReplaceValues.pl # created by make(1), user probably wants to rebuild (often?) MOSTLYCLEANFILES = varsenblend.texi varsenfuse.texi # created by make(1) CLEANFILES = entropy.{txt,eps,svg,pdf} \ entropy-cutoff.{txt,eps,svg,pdf} \ exposure-cutoff.{txt,eps,svg,pdf} \ external-mask-workflow.{txt,eps,svg,pdf} \ gaussian.{txt,eps,svg,pdf} \ laplacian-of-gaussian.{txt,eps,svg,pdf} \ local-analysis-window.{txt,eps,svg,pdf} \ photographic-workflow.{txt,eps,svg,pdf} \ focus-stack-decision-tree.{txt,eps,svg,pdf} \ sharp-edge.{txt,eps,svg,pdf} \ smooth-edge.{txt,eps,svg,pdf} \ seam-line-visualization.{eps,png} \ *.xml \ *.fig.bak \ *.msg # created by configure(1) or LaTeX DISTCLEANFILES = texinfo.tex \ enblend.sc enblend.scs \ enfuse.sc enfuse.scs MAINTAINERCLEANFILES = enblend.info enfuse.info XMLLINT_FLAGS = --noout --valid all: all-am .SUFFIXES: .SUFFIXES: .dvi .html .info .pdf .ps .texi $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): entropy.gp: $(top_builddir)/config.status $(srcdir)/entropy.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ entropy-cutoff.gp: $(top_builddir)/config.status $(srcdir)/entropy-cutoff.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ exposure-cutoff.gp: $(top_builddir)/config.status $(srcdir)/exposure-cutoff.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gaussian.gp: $(top_builddir)/config.status $(srcdir)/gaussian.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ laplacian-of-gaussian.gp: $(top_builddir)/config.status $(srcdir)/laplacian-of-gaussian.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ sharp-edge.gp: $(top_builddir)/config.status $(srcdir)/sharp-edge.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ smooth-edge.gp: $(top_builddir)/config.status $(srcdir)/smooth-edge.gp.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ .texi.info: $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \ am__cwd=`pwd` && $(am__cd) $(srcdir) && \ rm -rf $$backupdir && mkdir $$backupdir && \ if ($(MAKEINFO) --version) >/dev/null 2>&1; then \ for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \ if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \ done; \ else :; fi && \ cd "$$am__cwd"; \ if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $@ $<; \ then \ rc=0; \ $(am__cd) $(srcdir); \ else \ rc=$$?; \ $(am__cd) $(srcdir) && \ $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \ fi; \ rm -rf $$backupdir; exit $$rc .texi.dvi: $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \ $< .texi.pdf: $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \ $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \ $< .texi.html: $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp) $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \ -o $(@:.html=.htp) $<; \ then \ rm -rf $@ && mv $(@:.html=.htp) $@; \ else \ rm -rf $(@:.html=.htp); exit 1; \ fi $(srcdir)/enblend.info: enblend.texi $(srcdir)/versenblend.texi $(enblend_TEXINFOS) $(srcdir)/versenblend.texi: $(srcdir)/stamp-vti $(srcdir)/stamp-vti: enblend.texi $(top_srcdir)/configure @(dir=.; test -f ./enblend.texi || dir=$(srcdir); \ set `$(SHELL) $(top_srcdir)/mdate-sh $$dir/enblend.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > vti.tmp @cmp -s vti.tmp $(srcdir)/versenblend.texi \ || (echo "Updating $(srcdir)/versenblend.texi"; \ cp vti.tmp $(srcdir)/versenblend.texi) -@rm -f vti.tmp @cp $(srcdir)/versenblend.texi $@ mostlyclean-vti: -rm -f vti.tmp maintainer-clean-vti: -rm -f $(srcdir)/stamp-vti $(srcdir)/versenblend.texi $(srcdir)/enfuse.info: enfuse.texi $(srcdir)/versenfuse.texi $(enfuse_TEXINFOS) $(srcdir)/versenfuse.texi: $(srcdir)/stamp-1 $(srcdir)/stamp-1: enfuse.texi $(top_srcdir)/configure @(dir=.; test -f ./enfuse.texi || dir=$(srcdir); \ set `$(SHELL) $(top_srcdir)/mdate-sh $$dir/enfuse.texi`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(VERSION)"; \ echo "@set VERSION $(VERSION)") > 1.tmp @cmp -s 1.tmp $(srcdir)/versenfuse.texi \ || (echo "Updating $(srcdir)/versenfuse.texi"; \ cp 1.tmp $(srcdir)/versenfuse.texi) -@rm -f 1.tmp @cp $(srcdir)/versenfuse.texi $@ mostlyclean-1: -rm -f 1.tmp maintainer-clean-1: -rm -f $(srcdir)/stamp-1 $(srcdir)/versenfuse.texi .dvi.ps: $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \ $(DVIPS) $(AM_V_texinfo) -o $@ $< uninstall-dvi-am: @$(NORMAL_UNINSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \ rm -f "$(DESTDIR)$(dvidir)/$$f"; \ done uninstall-html-am: @$(NORMAL_UNINSTALL) @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \ rm -rf "$(DESTDIR)$(htmldir)/$$f"; \ done uninstall-info-am: @$(PRE_UNINSTALL) @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \ if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \ then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \ done; \ else :; fi @$(NORMAL_UNINSTALL) @list='$(INFO_DEPS)'; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \ (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \ echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \ else :; fi); \ done uninstall-pdf-am: @$(NORMAL_UNINSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \ rm -f "$(DESTDIR)$(pdfdir)/$$f"; \ done uninstall-ps-am: @$(NORMAL_UNINSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \ rm -f "$(DESTDIR)$(psdir)/$$f"; \ done dist-info: $(INFO_DEPS) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; \ for base in $$list; do \ case $$base in \ $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$base; then d=.; else d=$(srcdir); fi; \ base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \ for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \ if test -f $$file; then \ relfile=`expr "$$file" : "$$d/\(.*\)"`; \ test -f "$(distdir)/$$relfile" || \ cp -p $$file "$(distdir)/$$relfile"; \ else :; fi; \ done; \ done mostlyclean-aminfo: -rm -rf enblend.t2d enblend.t2p enfuse.t2d enfuse.t2p clean-aminfo: -test -z "enblend.dvi enblend.pdf enblend.ps enblend.html enfuse.dvi enfuse.pdf \ enfuse.ps enfuse.html" \ || rm -rf enblend.dvi enblend.pdf enblend.ps enblend.html enfuse.dvi enfuse.pdf \ enfuse.ps enfuse.html maintainer-clean-aminfo: @list='$(INFO_DEPS)'; for i in $$list; do \ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \ done tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-info check-am: all-am check: check-am all-am: Makefile $(INFO_DEPS) installdirs: for dir in "$(DESTDIR)$(infodir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-aminfo clean-generic clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: $(DVIS) html-am: $(HTMLS) info: info-am info-am: $(INFO_DEPS) install-data-am: install-info-am install-dvi: install-dvi-am install-dvi-am: $(DVIS) @$(NORMAL_INSTALL) @list='$(DVIS)'; test -n "$(dvidir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \ $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \ done install-exec-am: install-html-am: $(HTMLS) @$(NORMAL_INSTALL) @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \ $(am__strip_dir) \ d2=$$d$$p; \ if test -d "$$d2"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \ $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \ else \ list2="$$list2 $$d2"; \ fi; \ done; \ test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \ done; } install-info: install-info-am install-info-am: $(INFO_DEPS) @$(NORMAL_INSTALL) @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \ $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \ fi; \ for file in $$list; do \ case $$file in \ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \ esac; \ if test -f $$file; then d=.; else d=$(srcdir); fi; \ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \ if test -f $$ifile; then \ echo "$$ifile"; \ else : ; fi; \ done; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done @$(POST_INSTALL) @if $(am__can_run_installinfo); then \ list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \ for file in $$list; do \ relfile=`echo "$$file" | sed 's|^.*/||'`; \ echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\ install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\ done; \ else : ; fi install-man: install-pdf: install-pdf-am install-pdf-am: $(PDFS) @$(NORMAL_INSTALL) @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done install-ps: install-ps-am install-ps-am: $(PSS) @$(NORMAL_INSTALL) @list='$(PSS)'; test -n "$(psdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-1 \ maintainer-clean-aminfo maintainer-clean-generic \ maintainer-clean-vti mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-1 mostlyclean-aminfo mostlyclean-generic \ mostlyclean-vti pdf: pdf-am pdf-am: $(PDFS) ps: ps-am ps-am: $(PSS) uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \ uninstall-pdf-am uninstall-ps-am .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-aminfo clean-generic \ clean-local cscopelist-am ctags-am dist-info distclean \ distclean-generic distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-1 maintainer-clean-aminfo \ maintainer-clean-generic maintainer-clean-vti mostlyclean \ mostlyclean-1 mostlyclean-aminfo mostlyclean-generic \ mostlyclean-vti pdf pdf-am ps ps-am tags-am uninstall \ uninstall-am uninstall-dvi-am uninstall-html-am \ uninstall-info-am uninstall-pdf-am uninstall-ps-am export TEXINPUTS=$(top_builddir):$(srcdir) # Phony Targets .PHONY: install-html install-html: @echo '*** Target "install-html" has been deprecated.' @echo '*** Use target "install-xhtml" instead of "install-html".' false .PHONY: html html: @echo '*** Target "html" has been deprecated.' @echo '*** Use target "xhtml" instead of "html".' false .PHONY: clean-local clean-local: -rm -rf enblend.xhtml enfuse.xhtml raster # The following exported variables are respected by html2xhml(1). export TIDY SED XMLLINT .PHONY: xhtml xhtml: $(HTMLS:.html=.xhtml) .PHONY: validate-xhtml validate-xhtml: $(HTMLS:.html=.xhtml) for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$xhtml; then \ for y in $$xhtml/*.xhtml; do \ $(XMLLINT) $(XMLLINT_FLAGS) $$y; \ done; \ else \ $(XMLLINT) $(XMLLINT_FLAGS) $$xhtml; \ fi; \ done .PHONY: install-xhtml install-xhtml: xhtml @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$x; then \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$xhtml"; \ $(INSTALL_DATA) $$xhtml/* "$(DESTDIR)$(htmldir)/$$xhtml"; \ else \ $(INSTALL_DATA) *.xhtml *.svg $(RASTER_DIR) "$(DESTDIR)$(htmldir)"; \ fi; \ done .PHONY: uninstall-xhtml uninstall-xhtml: @$(NORMAL_UNINSTALL) for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$x; then \ rm -rf "$(DESTDIR)$(htmldir)/$$xhtml"; \ else \ rm -rf "$(DESTDIR)$(htmldir)/*.xhtml" \ "$(DESTDIR)$(htmldir)/*.svg" \ "$(DESTDIR)$(htmldir)/$(RASTER_DIR)"; \ fi; \ done .PHONY: xml xml: $(info_TEXINFOS:.texi=.xml) .PHONY: validate-xml validate-xml: $(info_TEXINFOS:.texi=.xml) for x in $(info_TEXINFOS); do \ $(XMLLINT) $(XMLLINT_FLAGS) `basename $$x .texi`.xml; \ done # Implicit Rules %.txt: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.pdf: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.eps: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.svg: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< $(RASTER_DIR)/%.png: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.txt: %.fig $(SED) -e '1,/---BEGIN-TEXT---/d' \ -e '/---END-TEXT---/,$$d' \ -e 's/^# \?//' < $< > $@ %.eps: %.fig $(FIG2DEV) -L eps $< $@ %.pdf: %.fig $(FIG2DEV) -L pdf $< $@ %.png: %.fig $(FIG2DEV) -L png $< $@ %.svg: %.fig $(FIG2DEV) -L svg $< | \ $(SED) -e '//d' -e 's/style="stroke-width:.025in/style="stroke-width:0.001px/' > $@ $(RASTER_DIR)/%.png: %.fig $(MKDIR_P) $(RASTER_DIR) $(FIG2DEV) -L png $< $@ %.eps: %.tif $(CONVERT) $< eps2:$@ %.png: %.tif $(CONVERT) $< $@ %.xhtml: %.html test -d "$<" && test "$<" = enblend.html && { \ $(MKDIR_P) "$@/$(RASTER_DIR)"; \ for i in $(enblend_TEXINFOS); do \ base="$${i%%.*}"; \ test -f "$$base.svg" && { cp "$$base.svg" "$@"; \ cp "$(RASTER_DIR)/$$base.png" "$@/$(RASTER_DIR)"; } ; \ test -f "$$base.png" && cp "$$base.png" "$@"; \ done; } ; true test -d "$<" && test "$<" = enfuse.html && { \ $(MKDIR_P) "$@/$(RASTER_DIR)"; \ for i in $(enfuse_TEXINFOS); do \ base="$${i%%.*}"; \ test -f "$$base.svg" && { cp "$$base.svg" "$@"; \ cp "$(RASTER_DIR)/$$base.png" "$@/$(RASTER_DIR)"; } ; \ test -f "$$base.png" && cp "$$base.png" "$@"; \ done; } ; true $(srcdir)/html2xhtml \ --meta="enblend-version,$(VERSION)" \ --tidy-flags="$(EXTRATIDYFLAGS)" \ --xmllint-flags="$(EXTRAXMLLINTFLAGS)" \ $< %.xml: %.texi - $(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook --output=- $< > $(basename $@)-orig.xml $(SED) \ -e '1,100s# $(basename $@)-clean.xml $(XMLLINT) \ --valid --noblanks --noent --nsclean --format --encode iso-8859-1 $(basename $@)-clean.xml \ > $@ || { rm $@; false; } # Explicit Rules varsenblend.texi: $(srcdir)/../src/enblend.cc \ $(srcdir)/../src/bounds.h \ $(srcdir)/../src/common.h \ $(srcdir)/../src/global.h $(PERL) $(srcdir)/docstrings $^ > $@ enblend.info: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.txt \ external-mask-workflow.txt enblend.dvi: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.eps \ external-mask-workflow.eps \ seam-line-visualization.eps enblend.html: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg $(RASTER_DIR)/photographic-workflow.png \ external-mask-workflow.svg $(RASTER_DIR)/external-mask-workflow.png \ seam-line-visualization.png enblend.pdf: $(enblend_TEXINFOS) \ photographic-workflow.pdf \ external-mask-workflow.pdf \ seam-line-visualization.png enblend.xhtml: enblend.html enblend.xml: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg \ external-mask-workflow.svg \ seam-line-visualization.png varsenfuse.texi: $(srcdir)/../src/enfuse.cc \ $(srcdir)/../src/bounds.h \ $(srcdir)/../src/common.h \ $(srcdir)/../src/global.h $(PERL) $(srcdir)/docstrings $^ > $@ enfuse.info: $(enfuse_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.txt \ external-mask-workflow.txt \ focus-stack-decision-tree.txt \ entropy.txt \ entropy-cutoff.txt \ exposure-cutoff.txt \ gaussian.txt \ laplacian-of-gaussian.txt \ local-analysis-window.txt \ sharp-edge.txt \ smooth-edge.txt enfuse.dvi: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.eps \ external-mask-workflow.eps \ focus-stack-decision-tree.eps \ entropy.eps \ entropy-cutoff.eps \ exposure-cutoff.eps \ gaussian.eps \ laplacian-of-gaussian.eps \ local-analysis-window.eps \ sharp-edge.eps \ smooth-edge.eps enfuse.html: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg $(RASTER_DIR)/photographic-workflow.png \ external-mask-workflow.svg $(RASTER_DIR)/external-mask-workflow.png \ focus-stack-decision-tree.svg $(RASTER_DIR)/ \ entropy.svg $(RASTER_DIR)/entropy.png \ entropy-cutoff.svg $(RASTER_DIR)/entropy-cutoff.png \ exposure-cutoff.svg $(RASTER_DIR)/exposure-cutoff.png \ gaussian.svg $(RASTER_DIR)/gaussian.png \ laplacian-of-gaussian.svg $(RASTER_DIR)/laplacian-of-gaussian.png \ local-analysis-window.svg $(RASTER_DIR)/local-analysis-window.png \ sharp-edge.svg $(RASTER_DIR)/sharp-edge.png \ smooth-edge.svg $(RASTER_DIR)/smooth-edge.png enfuse.pdf: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.pdf \ external-mask-workflow.pdf \ focus-stack-decision-tree.pdf \ entropy.pdf \ entropy-cutoff.pdf \ exposure-cutoff.pdf \ gaussian.pdf \ laplacian-of-gaussian.pdf \ local-analysis-window.pdf \ sharp-edge.pdf \ smooth-edge.pdf enfuse.xhtml: enfuse.html enfuse.xml: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg \ external-mask-workflow.svg \ focus-stack-decision-tree.svg \ entropy.svg \ entropy-cutoff.svg \ exposure-cutoff.svg \ gaussian.svg \ laplacian-of-gaussian.svg \ local-analysis-window.svg \ sharp-edge.svg \ smooth-edge.svg # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: enblend-enfuse-4.1.2+dfsg/doc/enfuse.info0000644000175100017510000077507512224473674020530 0ustar ametzlerametzlerThis is ../../doc/enfuse.info, produced by makeinfo version 4.13 from ../../doc/enfuse.texi. INFO-DIR-SECTION Individual utilities START-INFO-DIR-ENTRY * enfuse: (enfuse). Fuse images using a multiresolution spline. END-INFO-DIR-ENTRY This manual is for Enfuse (version 4.1.2, 7 October 2013), a program to merge different exposures of the same scene to produce an image that looks much like a tonemapped image. Copyright (C) 2004-2012 ANDREW MIHAL. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".  File: enfuse.info, Node: Top, Next: Overview, Up: (dir) Enfuse ****** This manual is for Enfuse (version 4.1.2, 7 October 2013), a program to merge different exposures of the same scene to produce an image that looks much like a tonemapped image. * Menu: * Overview:: Overview of Enfuse's features * Workflow:: Enfuse's role in combining images * Invocation:: Command line options and arguments * Color Profiles:: How Enblend handles ICC color profiles * Weighting Functions:: Description of all weighting functions * Understanding Masks:: How to interpret masks and mask files * Tuning Memory Usage:: Balancing RAM and swap * Applications:: Possible applications of Enfuse * Helpful Programs:: Useful other programs * Bug Reports:: How to write bug reports * Authors:: Major contributors * FDL:: GNU Free Documentation License * List of Tables:: List of all tables * List of Figures:: List of all figures * Program Index:: Names of programs referenced * Syntactic-Comment Index:: Keys of syntactic comments * Option Index:: Index of all options * General Index:: Topic index --- The Detailed Node Listing --- Overview Workflow * Standard Workflow:: The usual, all-in-one thing * External Mask Manipulation:: Fiddling around with the masks yourself Invocation * Common Options:: General options * Extended Options:: Memory control and others * Fusion Options:: Image fusion control * Expert Options:: Local contrast and local entropy selection configuration * Option Delimiters:: How to separate options' arguments Color Profiles Weighting Functions * Weighting Pixels:: General concept of weighting pixels * Exposure Weighting:: Weighting by exposure * Saturation Weighting:: Weighting by saturation * Local Contrast Weighting:: Weighting by local contrast * Local Entropy Weighting:: Weighting by local entropy Weighting Algorithms * Weighted Average:: Enfuse's default weighting algorithm * Disabling Averaging:: ``Super Trouper'' weighting for focus stacks Local Contrast Weighting * Standard Deviation:: Standard deviation (SDev) in a square of pixels * Laplacian of Gaussian:: LoG, a second derivative method * Blend SDev and LoG:: Mix both methods * Scaling and Choice of Mode:: How parameters do not scale; neither does mode Understanding Masks Tuning Memory Usage Applications * What Images:: What makes images fusable? * Repetition:: Just taking the same shot multiple times * Exposure Series:: Varying the exposure time * Flash Exposure Series:: Varying the flash output * Polarization Series:: Changing the polarizer angle * Focus Stacks:: Stacking images with different in-focus distance Exposure Series * Exposure Series Tips:: Some hints for beginners * Exposure Series Misconceptions:: What works despite the hype Focus Stacks * Why Focus Stacks:: Why take the hassle? * Preparing Focus Stacks:: How to get suitable input images * Local Contrast Based Fusing:: Fundamental command line options * Basic Focus Stacking:: Simple, standard deviation method * Advanced Focus Stacking:: Advanced, Laplacian technique * Expert Stacking:: Tips for focus stacking experts Advanced Focus Stacking * Local Contrast Problem:: What is the problem Kenneth? * Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges * Local Contrast Enhancement:: Boosting local contrast before weighting * Suppressing Noise or Recognizing Faint Edges:: The best of both worlds * Focus Stacking Decision Tree:: What to do and how to fuse Helpful Programs Bug Reports Authors FDL  File: enfuse.info, Node: Overview, Next: Workflow, Prev: Top, Up: Top 1 Overview ********** Enfuse merges overlapping images using the MERTENS-KAUTZ-VAN REETH exposure fusion algorithm.(1) This is a quick way for example to blend differently exposed images into a nice output image, without producing intermediate high-dynamic range (HDR) images that are then tonemapped to a viewable image. This simplified process often works much better than tonemapping algorithms. Enfuse can also be used to build extended depth-of-field (DOF) images by blending a focus stack. The idea is that pixels in the input images are weighted according to qualities such as, for example, proper exposure, good local contrast, or high saturation. These weights determine how much a given pixel will contribute to the final image. A BURT-ADELSON multiresolution spline blender(2) is used to combine the images according to the weights. The multiresolution blending ensures that transitions between regions where different images contribute are difficult to spot. Enfuse uses up to four criteria to judge the quality of a pixel, which *note Table:weighting-criteria:: briefly describes. Exposure The exposure criteria favors pixels with luminance close to the middle of the range. These pixels are considered better exposed than those with high or low luminance levels. Saturation The saturation criteria favors highly-saturated pixels. (Note that saturation is only defined for color pixels.) Local Contrast The contrast criteria favors pixels inside a high-contrast neighborhood. Enfuse can use standard deviation, Laplacian magnitude, or a blend of both as local contrast measure. Local Entropy The entropy criteria prefers pixels inside a high-entropy neighborhood. In addition, Enfuse allows the user to mitigate the problem of noisy images when using entropy weighting by setting a black threshold. Table 1.1: Enfuse's four weighting criteria. (Also see *note Table:default-weights:: for the default weights of these criteria.) For the concept of pixel weighting, and details on the different weighting functions, see *note Weighting Functions::. Adjust how much importance is given to each criterion by setting the weight parameters on the command line. For example, if you set `--exposure-weight=1.0' and `--saturation-weight=0.5', Enfuse will favor well-exposed pixels over highly-saturated pixels when blending the source images. The effect of these parameters on the final result will not always be clear in advance. The quality of the result is subject to your artistic interpretation. Playing with the weights may or may not give a more pleasing result. The authors encourage you to experiment, perhaps using down-sized(3) or cropped images for speed. Enfuse expects but does not require each input image to have an alpha channel. By setting the alpha values of pixels to zero, users can manually remove those pixels from consideration when blending. If an input image lacks an alpha channel, Enfuse will issue a warning and continue assuming all pixels should contribute to the final output. Any alpha value other than zero is interpreted as "this pixel should contribute to the final image". Enfuse reads all layers of multi-layer images, like, for example, multi-directory TIFF images(4). The input images are processed in the order they appear on the command line. Multi-layer images are processed from the first layer to the last before Enfuse considers the next image on the command line. Find out more about Enfuse on its SourceForge (http://sourceforge.net/) web page (http://enblend.sourceforge.net/). ---------- Footnotes ---------- (1) Tom Mertens, Jan Kautz, and Frank van Reeth, "Exposure Fusion", Proceedings of the 15th Pacific Conference on Computer Graphics and Applications, pages 382-390. (2) Peter J. Burt and Edward H. Adelson, "A Multiresolution Spline With Application to Image Mosaics", ACM Transactions on Graphics, Vol. 2, No. 4, October 1983, pages 217-236. (3) Downsampling with a good interpolator reduces noise, which might not desired to judge the image quality of the original-size image. Cropping might be an alternative, though. (4) Use utilities like, e.g., `tiffcopy' and `tiffsplit' of LibTIFF to manipulate multi-directory TIFF images. *Note Helpful Programs::.  File: enfuse.info, Node: Workflow, Next: Invocation, Prev: Overview, Up: Top 2 Workflow ********** Enfuse is a part of a chain of tools to assemble images. It merges photos of the same subject at the same location and same direction, but taken with varying exposure parameters. * Menu: * Standard Workflow:: The usual, all-in-one thing * External Mask Manipulation:: Fiddling around with the masks yourself  File: enfuse.info, Node: Standard Workflow, Next: External Mask Manipulation, Up: Workflow 2.1 Standard Workflow ===================== *note Figure:photographic-workflow:: shows where Enblend and Enfuse sit in the tool chain of the standard workflow. Figure 2.1: Photographic workflow with Enblend and Enfuse. Take Images Take _multiple_ images to form a panorama, an exposure series, a focus stack, etc. There is one exception with Enfuse when a single raw image is converted multiple times to get several - typically differently "exposed" - images. _Exemplary Benefits_ * Many pictures taken from the same vantage point but showing different viewing directions. - Panorama * Pictures of the same subject exposed with different shutter speeds. - Exposure series * Images of the same subject focussed at differing distances. - Focus stack _Remaining Problem:_ The "overlayed" images may not fit together, that is the overlay regions may not match exactly. Convert Images Convert the raw data (http://www.luminous-landscape.com/tutorials/understanding-series/u-raw-files.shtml) exploiting the full dynamic range of the camera and capitalize on a high-quality conversion. Align Images Align the images so as to make them match as well as possible. Again there is one exception and this is when images naturally align. For example, a series of images taken from a rock solid tripod with a cable release without touching the camera, or images taken with a shift lens, can align without further user intervention. This step submits the images to affine transformations. If necessary, it rectifies the lens' distortions (e.g. barrel or pincushion), too. Sometimes even luminance or color differences between pairs of overlaying images are corrected ("photometric alignment"). _Benefit:_ The overlay areas of images match as closely as possible given the quality if the input images and the lens model used in the transformation. _Remaining Problem:_ The images may still not align perfectly, for example, because of parallax (http://en.wikipedia.org/wiki/Parallax) errors, or blur produced by camera shake. Combine Images Enblend and Enfuse combine the aligned images into one. _Benefit:_ The overlay areas become imperceptible for all but the most mal-aligned images. _Remaining Problem:_ Enblend and Enfuse write images with an alpha channel. (For more information on alpha channels see *note Understanding Masks::.) Furthermore, the final image rarely is rectangular. Postprocess Postprocess the combined image with your favorite tool. Often the user will want to crop the image and simultaneously throw away the alpha channel. View Print Enjoy  File: enfuse.info, Node: External Mask Manipulation, Prev: Standard Workflow, Up: Workflow 2.2 External Mask Manipulation ============================== In the usual workflow Enblend and Enfuse generate the blending and fusing masks according to the command-line options and the input images and then they immediately use these masks for blending or fusing the output image. Sometimes more control over the masks is needed or wanted. To this end, both applications provide the option pair `--load-masks' and `--save-masks'. *Note Invocation::, for detailed explanations of both options. With the help of these options the processing can be broken up into two steps: Save masks with `--save-masks'. Generate masks and save them into image files. Avoid option `--output' unless the blended or fused image at this point is necessary. Load masks with `--load-masks'. Load masks from files and then blend or fuse the final image with the help of the loaded masks. In between these two steps the user may apply whatever transformation to the mask files, as long as their geometries and offsets remain the same. Thus the "Combine Images" box of *note Figure 2.1: Figure:photographic-workflow. becomes three activities as is depicted in *note Figure:external-mask-workflow::. Figure 2.2: Workflow for externally modified masks. To further optimize this kind of workflow, both Enblend and Enfuse stop after mask generation if option `--save-masks' is given, but _no output file_ is specified with the `--output' option. This way the time for pyramid generation, blending, fusing, and writing the final image to disk is saved, as well as no output image gets generated. Note that options `--save-masks' and `--load-masks' cannot be used simultaneously.  File: enfuse.info, Node: Invocation, Next: Color Profiles, Prev: Workflow, Up: Top 3 Invocation ************ `enfuse' [OPTIONS] [`--output='IMAGE] INPUT... Fuse the sequence of images INPUT... into a single IMAGE. Input images are either specified literally or via so-called response files (see below). The latter are an alternative to specifying image filenames on the command line. * Menu: * Image Requirements:: Input image requirements * Response Files:: Files listing the images' names * Common Options:: General options * Extended Options:: Memory control and others * Fusion Options:: Image fusion control * Expert Options:: Local contrast and local entropy selection configuration * Option Delimiters:: How to separate options' arguments  File: enfuse.info, Node: Image Requirements, Next: Response Files, Up: Invocation 3.1 Image Requirements ====================== All input images must comply with the following requirements. * The images overlap. * The images agree on their number of bits-per-channel, this is, their "depth": - `UINT8', - `UINT16', - `FLOAT', - etc. See option `--depth' below for an explanation of different (output) depths. * Enfuse understands the images' filename extensions as well as their file formats. You can check the supported extensions and formats by calling Enfuse with the option pair `--version --verbose' and scan the output for `Supported image formats' or `Supported file extensions'. Moreover, there are some "good practices", which are not enforced by the application, but almost certainly deliver superior results. * Either all files lack an ICC profile, or all images are supplied with the _same_ ICC profile. * If the images' meta-data contains resolution information ("DPI"), it is the same for all pictures.  File: enfuse.info, Node: Response Files, Next: Common Options, Prev: Image Requirements, Up: Invocation 3.2 Response Files ================== A response file contains names of images or other response filenames. Introduce response file names with an at-character (`@'). Enblend and Enfuse process the list INPUT strictly from left to right, expanding response files in depth-first order. (Multi-layer files are processed from first layer to the last.) The following examples only show Enblend, but Enfuse works exactly the same. Solely image filenames. Example: enblend image-1.tif image-2.tif image-3.tif The ultimate order in which the images are processed is: `image-1.tif', `image-2.tif', `image-3.tif'. Single response file. Example: enblend @list where file `list' contains img1.exr img2.exr img3.exr img4.exr Ultimate order: `img1.exr', `img2.exr', `img3.exr', `img4.exr'. Mixed literal names and response files. Example: enblend @master.list image-09.png image-10.png where file `master.list' comprises of image-01.png @first.list image-04.png @second.list image-08.png `first.list' is image-02.png image-03.png and `second.list' contains image-05.png image-06.png image-07.png Ultimate order: `image-01.png', `image-02.png', `image-03.png', `image-04.png', `image-05.png', `image-06.png', `image-07.png', `image-08.png', `image-09.png', `image-10.png', 3.2.1 Response File Format -------------------------- Response files contain one filename per line. Blank lines or lines beginning with a sharp sign (`#') are ignored; the latter can serve as comments. Filenames that begin with an at-character (`@') denote other response files. *note Table:response-file-format:: states a formal grammar of response files in EBNF (http://en.wikipedia.org/wiki/Ebnf). RESPONSE-FILE ::= LINE* LINE ::= (COMMENT | FILE-SPEC) [`\r'] `\n' COMMENT ::= SPACE* `#' TEXT FILE-SPEC ::= SPACE* `@' FILENAME SPACE* SPACE ::= ` ' | `\t' where TEXT is an arbitrary string and FILENAME is any filename. Table 3.1: EBNF definition of the grammar of response files. In a response file relative filenames are used relative the response file itself, not relative to the current-working directory of the application. The above grammar might unpleasantly surprise the user in the some ways. Whitespace trimmed at both line ends For convenience, whitespace at the beginning and at the end of each line is ignored. However, this implies that response files cannot represent filenames that start or end with whitespace, as there is no quoting syntax. Filenames with embedded whitespace cause no problems, though. Only whole-line comments Comments in response files always occupy a complete line. There are no "line-ending comments". Thus, in # exposure series img-0.33ev.tif # "middle" EV img-1.33ev.tif img+0.67ev.tif only the first line contains a comment, whereas the second line includes none. Rather, it refers to a file called `img-0.33ev.tif # "middle" EV'. Image filenames cannot start with `@' An at-sign invariably introduces a response file, even if the filename's extension hints towards an image. If Enblend or Enfuse do not recognize a response file, they will skip the file and issue a warning. To force a file being recognized as a response file add one of the following syntactic comments to the _first_ line of the file. response-file: true enblend-response-file: true enfuse-response-file: true Finally, here is an example of a valid response file. # 4\pi panorama! # These pictures were taken with the panorama head. @round-shots.list # Freehand sky shot. zenith.tif # "Legs, will you go away?" images. nadir-2.tif nadir-5.tif nadir.tif 3.2.2 Syntactic Comments ------------------------ Comments that follow the format described in *note Table:response-file-syntactic-comment:: are treated as instructions how to interpret the rest of the response file. A syntactic comment is effective immediately and its effect persists to the end of the response file, unless another syntactic comment undoes it. SYNTACTIC-COMMENT ::= SPACE* `#' SPACE* KEY SPACE* `:' SPACE* VALUE KEY ::= (`A' .. `Z' | `a' .. `z' | `-')+ where VALUE is an arbitrary string. Table 3.2: EBNF definition of the grammar of syntactic comments in response files. Unknown syntactic comments are silently ignored. 3.2.3 Globbing Algorithms ------------------------- The three equivalent syntactic keys * `glob', * `globbing', or * `filename-globbing' control the algorithm that Enblend or Enfuse use to glob filenames in response files. All versions of Enblend and Enfuse support at least two algorithms: `literal', which is the default, and `wildcard'. See *note Table:globbing-algorithms:: for a list of all possible globbing algorithms. To find out about the algorithms in your version of Enblend or Enfuse team up the options `--version' and `--verbose'. `literal' Do not glob. Interpret all filenames in response files as literals. This is the default. Please keep in mind that whitespace at both ends of a line in a response file _always_ gets discarded. `wildcard' Glob using the wildcard characters `?', `*', `[', and `]'. The W*N32 implementation only globs the filename part of a path, whereas all other implementations perform wildcard expansion in _all_ path components. Also see glob(7) (http://www.kernel.org/doc/man-pages/online/pages/man7/glob.7.html). `none' Alias for `literal'. `shell' The `shell' globbing algorithm works as `literal' does. In addition, it interprets the wildcard characters `{', `}', and `~'. This makes the expansion process behave more like common UN*X shells. `sh' Alias for `shell'. Table 3.3: Globbing algorithms for the use in response files Example: # Horizontal panorama # 15 images # filename-globbing: wildcard image_000[0-9].tif image_001[0-4].tif 3.2.4 Default Layer Selection ----------------------------- The key `layer-selector' provides the same functionality as does the command-line option `--layer-selector', but on a per response-file basis. *Note Common Options::. This syntactic comment affects the layer selection of all images listed after it including those in included response files until another `layer-selector' overrides it.  File: enfuse.info, Node: Common Options, Next: Extended Options, Prev: Response Files, Up: Invocation 3.3 Common Options ================== Common options control some overall features of Enfuse. Enfuse accepts arguments to any option in uppercase as well as in lowercase letters. For example, `deflate', `Deflate' and `DEFLATE' as arguments to the `--compression' option described below, all instruct Enfuse to use the DEFLATE compression scheme. This manual denotes all arguments in lowercase for consistency. `--compression=COMPRESSION' Write a compressed output file. Depending on the output file format, Enfuse accepts different values for COMPRESSION. JPEG format. The compression either is a literal integer or a keyword-option combination. `LEVEL' Set JPEG quality LEVEL, where LEVEL is an integer that ranges from 0-100. `jpeg[:LEVEL]' Same as above; without the optional argument just switch on (standard) JPEG compression. `jpeg-arith[:LEVEL]' Switch on arithmetic JPEG compression. With optional argument set the arithmetic compression LEVEL, where LEVEL is an integer that ranges from 0-100. TIF format. Here, COMPRESSION is one of the keywords: `none' Do not compress. This is the default. `deflate' Use the DEFLATE compression scheme also called ZIP-in-TIFF. DEFLATE is a lossless data compression algorithm that uses a combination of the LZ77 algorithm and HUFFMAN coding. `jpeg[:LEVEL]' Use JPEG compression. With optional argument set the compression LEVEL, where LEVEL is an integer that ranges from 0-100. `lzw' Use LEMPEL-ZIV-WELCH (LZW) adaptive compression scheme. LZW compression is lossless. `packbits' Use PACKBITS compression scheme. PACKBITS is a particular variant of run-length compression; it is lossless. Any other format. Other formats do not accept a COMPRESSION setting. However, VIGRA (http://hci.iwr.uni-heidelberg.de/vigra/) automatically compresses `png'-files with the DEFLATE method. `--layer-selector=ALGORITHM' Override the standard layer selector algorithm, which is `all-layers'. This version of Enfuse offers the following algorithms: `all-layers' Select all layers in all images. `first-layer' Select only first layer in each multi-layer image. For single-layer images this is the same as `all-layers'. `largest-layer' Select largest layer in each multi-layer image, where the "largeness", this is the size is defined by the product of the layer width and its height. The channel width of the layer is ignored. For single-layer images this is the same as `all-layers'. `no-layer' Do not select any layer in any image. This algorithm is useful to temporarily exclude some images in response files. `-h' `--help' Print information on the available options and exit. `-l LEVELS' `--levels=LEVELS' Use at most this many LEVELS for pyramid (1) blending if LEVELS is positive, or reduce the maximum number of levels used by -LEVELS if LEVELS is negative; `auto' or `automatic' restore the default, which is to use the maximum possible number of levels for each overlapping region. The number of levels used in a pyramid controls the balance between local and global image features (contrast, saturation, ...) in the blended region. Fewer levels emphasize local features and suppress global ones. The more levels a pyramid has, the more global features will be taken into account. As a guideline, remember that each new level works on a linear scale twice as large as the previous one. So, the zeroth layer, the original image, obviously defines the image at single-pixel scale, the first level works at two-pixel scale, and generally, the n-th level contains image data at 2^n -pixel scale. This is the reason why an image of widthxheight pixels cannot be deconstructed into a pyramid of more than floor(log_2(min(width, height))) levels. If too few levels are used, "halos" around regions of strong local feature variation can show up. On the other hand, if too many levels are used, the image might contain too much global features. Usually, the latter is not a problem, but is highly desired. This is the reason, why the default is to use as many levels as is possible given the size of the overlap regions. Enfuse may still use a smaller number of levels if the geometry of the overlap region demands. Positive values of LEVELS limit the maximum number of pyramid levels. Depending on the size and geometry of the overlap regions this may or may not influence any pyramid. Negative values of LEVELS reduce the number of pyramid levels below the maximum no matter what the actual maximum is and thus always influence all pyramids. Use `auto' or `automatic' as LEVELS to restore the automatic calculation of the maximum number of levels. The valid range of the absolute value of LEVELS is 1 to 29. `-o' `--output=FILE' Place output in FILE. If `--output' is not specified, the default is to put the resulting image in `a.tif'. `--parameter=KEY[=VALUE]:...' Set a KEY-VALUE pair, where VALUE is optional. This option is cumulative. Separate multiple pairs with the usual numeric delimiters. This option has the negated form `--no-parameter', which takes one or more KEYs and removes them from the list of defined parameters. The special key `*' deletes all parameters at once. Parameters allow the developers to change the internal workings of Enfuse without the need to recompile. `-v' `--verbose[=LEVEL]' Without an argument, increase the verbosity of progress reporting. Giving more `--verbose' options will make Enfuse more verbose. Directly set a verbosity level with a non-negative integral LEVEL. Each level includes all messages of the lower levels. Level Messages 0 only warnings and errors 1 reading and writing of images 2 mask generation, pyramid, and blending 3 reading of response files, color conversions 4 image sizes, bounding boxes and intersection sizes 5 detailed information on the optimizer runs (Enblend only) 6 estimations of required memory in selected processing steps The default verbosity level of Enfuse is 1. `-V' `--version' Output information on the Enfuse version. Team this option with `--verbose' to show configuration details, like the extra features that have been compiled in. `-w' `--wrap=MODE' Blend around the boundaries of the panorama. As this option significantly increases memory usage and computation time only use it, if the panorama will be * consulted for any kind measurement, this is, all boundaries must match as accurately as possible, or * printed out and the boundaries glued together, or * fed into a virtual reality (VR) generator, which creates a seamless environment. Otherwise, always avoid this option! With this option, Enfuse treats the panorama of width w and height h as an infinite data structure, where each pixel P(x, y) of the input images represents the set of pixels S_P(x, y) (2). MODE takes the following values: `none' `open' This is a "no-op"; it has the same effect as not giving `--wrap' at all. The set of input images is considered open at its boundaries. `horizontal' Wrap around horizontally: S_P(x, y) = {P(x + m * w, y): m in Z}. This is useful for 360o horizontal panoramas as it eliminates the left and right borders. `vertical' Wrap around vertically: S_P(x, y) = {P(x, y + n * h): m in Z}. This is useful for 360o vertical panoramas, as it eliminates the top and bottom borders. `both' `horizontal+vertical' `vertical+horizontal' Wrap around both horizontally and vertically: S_P(x, y) = {P(x + m * w, y + n * h): m, n in Z}. In this mode, both left and right borders, as well as top and bottom borders, are eliminated. Specifying `--wrap' without MODE selects horizontal wrapping. ---------- Footnotes ---------- (1) As Dr. Daniel Jackson correctly noted (http://stargate.wikia.com/wiki/The_Tomb), actually, it is not a pyramid: "Ziggaurat, it's a Ziggaurat (http://en.wikipedia.org/wiki/Ziggaurat)." (2) Solid-state physicists will be reminded of the BORN-VON KA'RMA'N boundary condition (http://en.wikipedia.org/wiki/Born-von_Karman_boundary_condition).  File: enfuse.info, Node: Extended Options, Next: Fusion Options, Prev: Common Options, Up: Invocation 3.4 Extended Options ==================== Extended options control the image cache, the color model, and the cropping of the output image. `-b BLOCKSIZE' Set the BLOCKSIZE in kilobytes (KB) of Enfuse's image cache. This is the amount of data that Enfuse will move to and from the disk at one time. The default is 2048 KB, which should be ok for most systems. See *note Tuning Memory Usage:: for details. Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with `enfuse --version --verbose'. `-c' `--ciecam' Force the use of the CIECAM02 color appearance model for blending colors instead of blending inside the RGB color cube. All input files should have identical ICC profiles when this option is specified. If no ICC profile is present, Enfuse assumes that all images use the sRGB color space. *Note Color Profiles::. Please keep in mind that using CIECAM02 blending may change the colors in the output image. This option can be negated; see option `--no-ciecam' below. `-d' `--depth=DEPTH' Force the number of bits per channel and the numeric format of the output image. Enfuse always uses a smart way to change the channel depth, to assure highest image quality (at the expense of memory), whether requantization is implicit because of the output format or explicit with option `--depth'. * If the output-channel width is larger than the input-channel width of the input images, the input images' channels are widened to the output channel width immediately after loading, that is, as soon as possible. Enfuse then performs all blending operations at the output-channel width, thereby preserving minute color details which can appear in the blending areas. * If the output-channel width is smaller than the input-channel width of the input images, the output image's channels are narrowed only right before it is written to disk, that is, as late as possible. Thus the data benefits from the wider input channels for the longest time. All DEPTH specifications are valid in lowercase as well as uppercase letters. For integer format, use `8', `uint8' Unsigned 8 bit; range: 0..255 `int16' Signed 16 bit; range: -32768..32767 `16', `uint16' Unsigned 16 bit; range: 0..65535 `int32' Signed 32 bit; range: -2147483648..2147483647 `32', `uint32' Unsigned 32 bit; range: 0..4294967295 For floating-point format, use `r32', `real32', `float' IEEE754 single precision floating-point, 32 bit wide, 24 bit significant * Minimum normalized value: 1.2*10^-38 * Epsilon: 1.2*10^-7 * Maximum finite value: 3.4*10^38 `r64', `real64', `double' IEEE754 double precision floating-point, 64 bit wide, 53 bit significant * Minimum normalized value: 2.2*10^-308 * Epsilon: 2.2*10^-16 * Maximum finite value: 1.8*10^308 If the requested DEPTH is not supported by the output file format, Enfuse warns and chooses the DEPTH that matches best. The OpenEXR data format is treated as IEEE754 float internally. Externally, on disk, OpenEXR data is represented by "half" precision floating-point numbers. OpenEXR (http://www.openexr.com/about.html#features) half precision floating-point, 16 bit wide, 10 bit significant * Minimum normalized value: 9.3*10^-10 * Epsilon: 2.0*10^-3 * Maximum finite value: 4.3*10^9 `-f WIDTHxHEIGHT' `-f WIDTHxHEIGHT+xXOFFSET+yYOFFSET' Ensure that the minimum "canvas" size of the output image is at least WIDTHxHEIGHT. Optionally specify the XOFFSET and YOFFSET, too. This option only is useful when the input images are cropped TIFF files, such as those produced by `nona'(1). Note that option `-f' neither rescales the output image, nor shrinks the canvas size below the minimum size occupied by the union of all input images. `--fallback-profile=PROFILE-FILENAME' Use the ICC profile in PROFILE-FILENAME instead of the default sRGB. See option `--ciecam' and *note Color Profiles::. This option only is effective if the input images come without color profiles and blending is performed in CIECAM02 color appearance model. `-g' Save alpha channel as "associated". See the TIFF documentation (http://www.awaresystems.be/imaging/tiff/tifftags/extrasamples.html) for an explanation. Gimp (before version 2.0) and CinePaint (*note Helpful Programs::) exhibit unusual behavior when loading images with unassociated alpha channels. Use option `-g' to work around this problem. With this flag Enfuse will create the output image with the associated alpha tag set, even though the image is really unassociated alpha. `-m CACHESIZE' Set the CACHESIZE in megabytes (MB) of Enfuse's image cache. This is the amount of memory Enfuse will use for storing image data before swapping to disk. The default is 1024 MB, which is good for systems with 3-4 gigabytes (GB) of RAM. See *note Tuning Memory Usage:: for details. Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with `enfuse --version --verbose'. `--no-ciecam' Disable the use of the CIECAM02 color appearance model for blending colors. See option `--ciecam' for details. Also see *note Color Profiles::. ---------- Footnotes ---------- (1) The stitcher `nona' is part of Hugin. *Note Helpful Programs::.  File: enfuse.info, Node: Fusion Options, Next: Expert Options, Prev: Extended Options, Up: Invocation 3.5 Fusion Options ================== Fusion options define the proportion to which each input image's pixel contributes to the output image. `--contrast-weight=WEIGHT' Sets the relative WEIGHT of high local-contrast pixels. Valid range: 0 <= WEIGHT <= 1. Default: 0.0. See *note Local Contrast Weighting:: and *note Option contrast-window-size: Expert Options. `--entropy-weight=WEIGHT' Sets the relative WEIGHT of high local entropy pixels. Valid range: 0 <= WEIGHT <= 1. Default: 0.0. See *note Local Entropy Weighting:: and *note Options entropy-window-size and entropy-cutoff: Expert Options. `--exposure-weight=WEIGHT' Sets the relative WEIGHT of the well-exposedness criterion. Increasing this weight relative to the others will make well-exposed pixels contribute more to the final output. Valid range: 0 <= WEIGHT <= 1. Default: 1.0. *Note Exposure Weighting::. `--exposure-mu=MEAN' Set the MEAN (this is, the center) of the Gaussian exposure weight curve. Valid range: 0 <= MEAN <= 1. Default: 0.5. Use this option to fine-tune exposure weighting (*note Exposure Weighting::). `--exposure-sigma=STD-DEV' Standard deviation STD-DEV of the Gaussian exposure weight curve. Low numbers give less weight to pixels that are far from `--wMu' and vice versa. Valid range: STD-DEV >= 0. Default: 0.2. Use this option to fine-tune exposure weighting (*note Exposure Weighting::). `--saturation-weight=WEIGHT' Sets the relative WEIGHT of high-saturation pixels. Increasing this weight makes pixels with high saturation contribute more to the final output. Valid range: 0 <= WEIGHT <= 1. Default: 0.2. Saturation weighting is only defined for color images. *Note Saturation Weighting::.  File: enfuse.info, Node: Expert Options, Next: Option Delimiters, Prev: Fusion Options, Up: Invocation 3.6 Expert Options ================== Expert options influence the workings of Enfuse that require the user to read the manual before applying them successfully. `--contrast-edge-scale=EDGE-SCALE' `--contrast-edge-scale=EDGE-SCALE:LCE-SCALE:LCE-FACTOR' A non-zero value for EDGE-SCALE switches on the Laplacian-of-Gaussian (LoG) edge detection algorithm. EDGE-SCALE is the radius of the Gaussian used in the search for edges. Default: 0.0 pixels. A positive LCE-SCALE turns on local contrast enhancement (LCE) before the LoG edge detection. LCE-SCALE is the radius of the Gaussian used in the enhancement step, LCE-FACTOR is the weight factor ("strength"). ENHANCED = (1 + LCE-FACTOR) x ORIGINAL - LCE-FACTOR x GaussianSmooth(ORIGINAL, LCE-SCALE). LCE-SCALE defaults to 0.0 pixels and LCE-FACTOR defaults to 0.0. Append `%' to LCE-SCALE to specify the radius as a percentage of EDGE-SCALE. Append `%' to LCE-FACTOR to specify the weight as a percentage. `--contrast-min-curvature=CURVATURE' Define the minimum CURVATURE for the LoG edge detection. Default: 0. Append a `%' to specify the minimum curvature relative to maximum pixel value in the source image (for example 255 or 65535). A positive value makes Enfuse use the local contrast data (controlled with `--contrast-window-size') for curvatures less than CURVATURE and LoG data for values above it. A negative value truncates all curvatures less than -CURVATURE to zero. Values above CURVATURE are left unchanged. This effectively suppresses weak edges. `--contrast-window-size=SIZE' Set the window SIZE for local contrast analysis. The window will be a square of SIZExSIZE pixels. If given an even SIZE, Enfuse will automatically use the next odd number. For contrast analysis SIZE values larger than 5 might result in a blurry composite image. Values of 3 and 5 have given good results on focus stacks. Valid range: SIZE >= 3. Default: 5 pixels. See also *note Option -contrast-weight: Fusion Options. and `--hard-mask' below. `--entropy-cutoff=LOWER-CUTOFF' `--entropy-cutoff=LOWER-CUTOFF:UPPER-CUTOFF' The first form defines the lower cutoff value below which pixels are treated as pure black when calculating the local entropy. The second form also defines the upper cutoff value above which pixels are treated as pure white. For color images LOWER-CUTOFF and UPPER-CUTOFF are applied separately and independently to each channel. Defaults: 0% for LOWER-CUTOFF and 100% for UPPER-CUTOFF, that is, all pixels' values are taken into account. Append a `%' to specify the cutoff relative to maximum pixel value in the source image (for example 255 or 65535). *note Figure:entropy-cutoff:: shows an example. +-----------------------+-----------------------+------------------------+-----------------------+-----------------------+ + + + + + + | : : : : | | : : : : | | : : : : | | : : : : | | : : : : | | : : : : * 1 ++...........................................................................................................##########*** | : : : : ** | | : : : : ** | | : : : : *** | | : : : : ** | | : : : : *** | | : : : : ** | | : : : : *** | | : : : : **# | | : : : : **## | | : : : : ***# | | : : : : **# | | : : : : ***# | | : : : : **# | | : : : ***# | 0.8 ++.............................................................................................***#.....................++ | : : : **## | | : : : ***# : | | : : : **# : | | : : : ***# : | | : : : **# : | | : : : **## : | | : : : ***# : | | : : : **# : | | : : : ***# : | | : : : **# : | | : : : ***# : | | : : : ***# : | | : : : **## : | | : : ***# : | 0.6 ++......................................................................**#.............................................++ | : : ***# : | | : : **# : : | | : : ***# : : | | : : ***# : : | | : : **## : : | | : : ***# : : | | : : **# : : | | : : ***# : : | | : : **# : : | | : : **## : : | | : : ***# : : | | : : **## : : | | : : ***# : : | | : : **# : : | | : ***# : : | 0.4 ++.............................................**#......................................................................++ | : **## : : | | : ***# : : : | | : **## : : : | | : ***# : : : | | : **# : : : | | : **## : : : | | : **# : : : | | : **## : : : | | : ***# : : : | | : **# : : : | | : ***# : : : | | : **# : : : | | : **## : : : | | ***# : : : | 0.2 ++.....................**##.............................................................................................++ | ***# : : : | | **# : : : : | | ***# : : : : | | **# : : : : | | **## : : : : | | ***# : : : : | | **# : : : : | | ***# : : : : | | **# : : : : | | ***# : : : : | | ***# : : : : | | **## : : : : | | *** : : : : | |** : : : : | 0 **......................................................................................................................++ ####### : : : : | | : : : : | | : : : : | | : : : : | | : : : + Y + Offset ****** | | : : :EntropyCutoff(Y, Lower, Upper) - Offset ###### | + + + + + + +-----------------------+-----------------------+------------------------+-----------------------+-----------------------+ 0 0.2 0.4 0.6 0.8 1 Y Figure 3.1: Linear lightness Y in comparison with an entropy-cutoff function for LOWER-CUTOFF = 5% and UPPER-CUTOFF = 90%, which are rather extreme values. Please note that we have shifted the original lightness curve up and the cut-off curve down by a very small OFFSET to emphasize that the proportional part of Y remains unaltered under the cut-off operation. Note that a high LOWER-CUTOFF value lightens the resulting image, as dark (and presumably noisy) pixels are averaged with _equal_ weights. With `--entropy-cutoff=0', the default, on the other hand, "noise" might be interpreted as high entropy and the noisy pixels get a high weight, which in turn renders the resulting image darker. Analogously, a low UPPER-CUTOFF darkens the output image. `--entropy-window-size=SIZE' Window SIZE for local entropy analysis. The window will be a square of SIZExSIZE pixels. In the entropy calculation SIZE values of 3 to 7 yield an acceptable compromise of the locality of the information and the significance of the local entropy value itself. Valid range: SIZE >= 3. Default: 3 pixels. If given an even SIZE Enfuse will automatically use the next odd number. `--exposure-cutoff=LOWER-CUTOFF' `--exposure-cutoff=LOWER-CUTOFF:UPPER-CUTOFF' `--exposure-cutoff=LOWER-CUTOFF:UPPER-CUTOFF:LOWER-PROJECTOR:UPPER-PROJECTOR' The first form sets the weight for all pixels below the lower cutoff to zero. The second form sets the lower cutoff and the upper cutoff at the same time. For color images the values of LOWER-CUTOFF and UPPER-CUTOFF refer to the gray-scale projection as selected with the option `--gray-projector'. The impact of this option is similar, but not identical to transforming _all_ input images with ImageMagick's (http://www.imagemagick.org/) `convert' (*note Helpful Programs::) prior to fusing with the following commands. # First form convert IMAGE \ \( +clone -threshold LOWER-CUTOFF \) \ -compose copy_opacity -composite \ MASKED-IMAGE # Second form convert IMAGE \ \( \ \( IMAGE -threshold LOWER-CUTOFF \) \ \( IMAGE -threshold UPPER-CUTOFF -negate \) \ -compose multiply -composite \ \) \ -compose copy_opacity -composite \ MASKED-IMAGE (Transforming some or all input images as shown in the above examples gives the user more flexibility because the thresholds can be chosen for each image individually.) The third form specifies projection operators as in option `--gray-projector' for the LOWER-CUTOFF and UPPER-CUTOFF thresholds. This option can be helpful if the user wants to exclude underexposed or overexposed pixels from the fusing process in _all_ of the input images. The values of LOWER-CUTOFF and UPPER-CUTOFF as well as the gray-scale projector determine which pixels are considered "underexposed" or "overexposed". As any change of the exposure-weight curve this option changes the brightness of the resulting image: increasing LOWER-CUTOFF lightens the final image and lowering UPPER-CUTOFF darkens it. Defaults: 0% for LOWER-CUTOFF and 100% for UPPER-CUTOFF, that is, all pixels' values are weighted according to the "uncut" exposure-weight curve. Append a `%' to specify the cutoff relative to the maximum pixel value in the source image (for example 255 or 65535). *note Figure:exposure-cutoff:: shows an example. The gray-scale projectors LOWER-PROJECTOR and UPPER-PROJECTOR default to `anti-value' and `value', which are usually the best choices for effective cutoff operations on the respective ends. +-----------------------+-----------------------+------------------------+-----------------------+-----------------------+ + + + + + + | : : : : | | : : : : | | : : : : | | : : : : | | : : : : | | : : : : | 1 ++.......................................................********.......................................................++ | : : *** *** : : | | : : ** ** : : | | : : ** ** : : | | : : ** ** : : | | : : ** ** : : | | : : ** ** : : | | : :** **: : | | : :* *: : | | : * * : | | : ** ** : | | : *: :* : | | : * : : * : | | : ** : : ** : | | : * : : * : | 0.8 ++..........................................**..............................**..........................................++ | : * : : * : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : * : : * : | | : * : : * : | | : * : : * : | | : * : : * : | 0.6 ++..................................*................................................*..................................++ | : * : : * : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : ** : : ** : | | : * : : * : | | : * : : * : | | : ** : : ** : | | : * : : * : | 0.4 ++.........................**................................................................**.........................++ | : * : : * : | | : ** : : ** : | | :** : : **: | | :* : : *: | | ** : : ** | | * : : * | | *: : : :* | | **: : : :** | | * : : : : * | | * : : : : * | | ** : : : : ** | | ** : : : : ** | | ** : : : : ** | | * : : : : * | 0.2 ++...............*......................................................................................*...............++ | ** : : : : ** | | ** : : : : ** | | ** : : : : ** | | ** : : : : ** | | *** : : : : *** | | ** : : : : ** | | ** : : : : ** | | *** : : : : *** | | ** : : : : ** | | : : : : *** | | : : : : | | : : : : | | : : : : | | : : : : | 0 *******..............................................................................................................***** | : : : : | | : : : : | | : : : : | | : : : : | | : : : : | | : : : ExposureCutoff(Y, Lower, Upper) ****** | + + + + + + +-----------------------+-----------------------+------------------------+-----------------------+-----------------------+ 0 0.2 0.4 0.6 0.8 1 Y Figure 3.2: Exposure weight, a Gaussian with MU = 0.5 and SIGMA = 0.2 submitted to an exposure-cutoff of LOWER-CUTOFF = 5% and UPPER-CUTOFF = 97%. Note that the application of the respective cutoffs is completely independent of the actual shape of the exposure weight function. If a set of images stubbornly refuses to "react" to this option, look at their histograms to verify the cutoff actually falls into populated ranges of the histograms. In the absence of an image manipulation program like The Gimp (http://www.gimp.org/), ImageMagick (http://www.imagemagick.org/) (*note Helpful Programs::) can be used to generate histograms (http://www.imagemagick.org/Usage/files/#histogram), like, for example, convert -define histogram:unique-colors=false \ IMAGE histogram:- | \ display `--gray-projector=PROJECTOR' Use gray projector PROJECTOR for conversion of RGB images to grayscale: (R, G, B) -> Y. In version 4.1.2 of Enfuse, the option is effective for exposure weighting and local contrast weighting. Default: `average'. Valid values for PROJECTOR are: `anti-value' Do the opposite of the `value' projector: take the minimum of all color channels. Y = min(R, G, B) This projector can be useful when exposure weighing while employing a lower cutoff (see option `--exposure-cutoff') to reduce the noise in the fused image. `average' Average red, green, and blue channel with equal weights. This is the default, and it often is a good projector for gamma = 1 data. Y = (R + G + B) / 3 `channel-mixer:RED-WEIGHT:GREEN-WEIGHT:BLUE-WEIGHT' Weight the channels as given. Y = RED-WEIGHT * R + GREEN-WEIGHT * G + BLUE-WEIGHT * B The weights are automatically normalized to one, so --gray-projector=channel-mixer:0.25:0.5:0.25 --gray-projector=channel-mixer:1:2:1 --gray-projector=channel-mixer:25:50:25 all define the same mixer configuration. The three weights RED-WEIGHT, GREEN-WEIGHT, and BLUE-WEIGHT define the relative weight of the respective color channel. The sum of all weights is normalized to one. `l-star' Use the L-channel of the L*a*b*-conversion of the image as its grayscale representation. This is a useful projector for gamma = 1 data. It reveals minute contrast variations even in the shadows and the highlights. This projector is computationally expensive. Compare with `pl-star', which is intended for gamma-corrected images. See Wikipedia (http://en.wikipedia.org/wiki/Lab_color_space) for a detailed description of the Lab color space. `lightness' Compute the lightness of each RGB pixel as in an Hue-Saturation-Lightness (HSL) conversion of the image. Y = (max(R, G, B) + min(R, G, B)) / 2 `luminance' Use the weighted average of the RGB pixel's channels as defined by CIE ("Commission Internationale de l'E'clairage") and the JPEG standard. Y = 0.30 * R + 0.59 * G + 0.11 * B `pl-star' Use the L-channel of the L*a*b*-conversion of the image as its grayscale representation. This is a useful projector for gamma-corrected data. It reveals minute contrast variations even in the shadows and the highlights. This projector is computationally expensive. Compare with `l-star', which is intended for gamma = 1 images. See Wikipedia (http://en.wikipedia.org/wiki/Lab_color_space) for a detailed description of the Lab color space. `value' Take the Value-channel of the Hue-Saturation-Value (HSV) conversion of the image. Y = max(R, G, B) `--hard-mask' Force hard blend masks on the finest scale. This is the opposite flag of `--soft-mask'. This blending mode avoids averaging of fine details (only) at the expense of increasing the noise. However it considerably improves the sharpness of focus stacks. Blending with hard masks has only proven useful with focus stacks. See also *note Option -contrast-weight: Fusion Options. and `--contrast-window-size' above. `--load-masks' `--load-masks=SOFT-MASK-TEMPLATE' `--load-masks=SOFT-MASK-TEMPLATE:HARD-MASK-TEMPLATE' Load masks from images instead of computing them. The masks have to be a grayscale images. First form: Load all soft-weight masks from files that were previously saved with option `--save-masks'. If option `--hard-mask' is effective only load hard masks. The defaults are `softmask-%n.tif' and `hardmask-%n.tif'. In the second form, SOFT-MASK-TEMPLATE defines the names of the soft-mask files. In the third form, HARD-MASK-TEMPLATE additionally defines the names of the hard-mask files. See option `--save-masks' below for the description of mask templates. Options `--load-masks' and `--save-masks' are mutually exclusive. `--save-masks' `--save-masks=SOFT-MASK-TEMPLATE' `--save-masks=SOFT-MASK-TEMPLATE:HARD-MASK-TEMPLATE' Save the generated weight masks to image files. First form: Save all soft-weight masks in files. If option `--hard-mask' is effective also save the hard masks. The defaults are `softmask-%n.tif' and `hardmask-%n.tif'. In the second form, SOFT-MASK-TEMPLATE defines the names of the soft-mask files. In the third form, HARD-MASK-TEMPLATE additionally defines the names of the hard-mask files. Enfuse will stop after saving all masks unless option `--output' is given, too. With both options given, this is, `--save-masks' and `--output', Enfuse saves all masks and then proceeds to fuse the output image. Both SOFT-MASK-TEMPLATE and HARD-MASK-TEMPLATE define templates that are expanded for each mask file. In a template a percent sign (`%') introduces a variable part. All other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (*note Common Options::). *note Table:mask-template-characters:: lists all variables. A fancy mask filename template could look like this: %D/soft-mask-%02n-%f.viff It puts the mask files into the same directory as the output file (`%D'), generates a two-digit index (`%02n') to keep the mask files nicely sorted, and decorates the mask filename with the name of the associated input file (`%f') for easy recognition. `--soft-mask' Consider all masks when fusing. This is the default. Options `--save-masks' and `--load-masks' are mutually exclusive. `%%' Produces a literal `%'-sign. `%i' Expands to the index of the mask file starting at zero. `%i' supports setting a pad character or a width specification: `%' PAD WIDTH `i' PAD is either `0' or any punctuation character; the default pad character is `0'. WIDTH is an integer specifying the minimum width of the number. The default is the smallest width given the number of input images, this is 1 for 2-9 images, 2 for 10-99 images, 3 for 100-999 images, and so on. Examples: `%i', `%02i', or `%_4i'. `%n' Expands to the number of the mask file starting at one. Otherwise it behaves identically to `%i', including pad character and width specification. `%p' This is the full name (path, filename, and extension) of the input file associated with the mask. Example: If the input file is called `/home/luser/snap/img.jpg', `%p' expands to `/home/luser/snap/img.jpg', or shorter: `%p' => `/home/luser/snap/img.jpg'. `%P' This is the full name of the output file. `%d' Is replaced with the directory part of the associated input file. *note Stripping a non-directory suffix from a file name: (coreutils.info)dirname invocation. Example (cont.): `%d' => `/home/luser/snap'. `%D' Is replaced with the directory part of the output file. `%b' Is replaced with the non-directory part (often called "basename") of the associated input file. *note Stripping a directory and suffix from a file name: (coreutils.info)basename invocation. Example (cont.): `%b' => `img.jpg'. `%B' Is replaced with the non-directory part of the output file. `%f' Is replaced with the filename without path and extension of the associated input file. Example (cont.): `%f' => `img'. `%F' Is replaced with the filename without path and extension of the output file. `%e' Is replaced with the extension (including the leading dot) of the associated input file. Example (cont.): `%e' => `.jpg'. `%E' Is replaced with the extension of the output file. Table 3.4: Special characters to control the generation of mask filenames.  File: enfuse.info, Node: Option Delimiters, Prev: Expert Options, Up: Invocation 3.7 Option Delimiters ===================== Enfuse allows the arguments supplied to the program's options to be separated by different separators. The online documentation and this manual, however, exclusively use the colon `:' in every syntax definition and in all examples. *Numeric Arguments* Valid delimiters are the the semicolon `;', the colon `:', and the slash `/'. All delimiters may be mixed within any option that takes numeric arguments. Examples: `--contrast-edge-scale=0.667:6.67:3.5' Separate all arguments with colons. `--contrast-edge-scale=0.667;6.67;3.5' Use semi-colons. `--contrast-edge-scale=0.667;6.67/3.5' Mix semicolon and slash in weird ways. `--entropy-cutoff=3%/99%' All delimiters also work in conjunction with percentages. `--gray-projector=channel-mixer:3/6/1' Separate arguments with a colon and two slashes. `--gray-projector=channel-mixer/30;60:10' Go wild and Enfuse will understand. *Filename Arguments* Here, the accepted delimiters are `,', `;', and `:'. Again, all delimiters may be mixed within any option that has filename arguments. Examples: `--save-masks=soft-mask-%03i.tif:hard-mask-03%i.tif' Separate all arguments with colons. `--save-masks=%d/soft-%n.tif,%d/hard-%n.tif' Use a comma.  File: enfuse.info, Node: Color Profiles, Next: Weighting Functions, Prev: Invocation, Up: Top 4 Color Profiles **************** Enblend and Enfuse expect that either 1. no input image has a color profile or 2. all come with the _same_ ICC (http://en.wikipedia.org/wiki/ICC_profile) profile. In case 1 the applications blend or fuse in the RGB-cube, whereas in case 2 the images first are transformed to CIECAM02 (http://en.wikipedia.org/wiki/CIECAM02) color space - respecting the input color profile - then they are blended or fused, and finally the data transformed back to RGB color space. Moreover, in case 2, Enblend and Enfuse assign the input color profile to the output image. Mixing different ICC profiles or alternating between images with profiles and without them generates warnings as it generally leads to unpredictable results. The options `--ciecam' (*note Extended Options::) and its opposite `--no-ciecam' (*note Extended Options::) overrule the default profile selection procedure described above. Use option `--ciecam' on a set of input images _without_ color profiles to assign a profile to them and perform the blending or fusing process in CIECAM02 color space. The default profile is sRGB (http://en.wikipedia.org/wiki/SRGB). Override this setting with option `--fallback-profile' (*note Extended Options::). On the other hand, suppress the utilization of CIECAM02 blending or fusing of a set of input images _with_ color profiles with option `--no-ciecam'. The only reason for the latter is to shorten the blending- or fusing-time, because transforming to and back from the CIECAM02 color space are computationally expensive operations. Option `--ciecam' as well as `--fallback-profile' have no effect on images with attached color profiles, just as option `--no-ciecam' has no effect on images without profiles. The impact of blending in CIECAM02 color space as opposed to the RGB cube vary with the contents of the input images. Generally colors lying close together in RGB space experience less change when switching the blending spaces. However, colors close the border of any color space can see marked changes. For color geeks: The transformations to CIECAM02 color space and back use * perceptual rendering intent, * the D50 white point, * 500 lumen surrounding light ("average" in CIECAM02 parlance), and * assume complete adaption.  File: enfuse.info, Node: Weighting Functions, Next: Understanding Masks, Prev: Color Profiles, Up: Top 5 Weighting Functions ********************* As has been noted in the Overview (*note Overview::), Enfuse supports four different types of weighting. The following subsections describe the concept of weighting and all weighting functions in detail. * Menu: * Weighting Pixels:: General concept of weighting pixels * Exposure Weighting:: Weighting by exposure * Saturation Weighting:: Weighting by saturation * Local Contrast Weighting:: Weighting by local contrast * Local Entropy Weighting:: Weighting by local entropy  File: enfuse.info, Node: Weighting Pixels, Next: Exposure Weighting, Up: Weighting Functions 5.1 Weighting Pixels ==================== Image fusion maps each pixel P(i, x, y) of every input image i to a single pixel Q(x, y) in the output image: P(i, x, y) -> Q(x, y), where x runs from 1 to the common width of the images, y from 1 to the common height, and i from 1 to the number of input images n. Enfuse allows for weighting the contribution of each P(i, x, y) to the final Q(x, y): w(P(1, x, y)) * P(1, x, y) + ... + w(P(n, x, y)) * P(n, x, y) -> Q(x, y), (W) where * each w is non-negative to yield a physical intensity and * the sum of all w is one to leave the total intensity unchanged. The pixel weights w themselves are weighted sums with the same constraints w(P) = w_exp * f_exp(P) + w_sat * f_sat(P) + w_cont * f_cont(P, r_cont) + w_ent * f_ent(P, r_ent), where we have abbreviated P(i, x, y) to P for simplicity. The user defines the constants w_exp, w_sat, w_cont, and w_ent with the options `--exposure-weight', `--saturation-weight', `--contrast-weight', and `--entropy-weight'. The functions f_exp, f_sat, f_cont, and f_ent along with the window sizes r_cont and r_ent are explained in the next sections. * Menu: * Weighted Average:: Enfuse's default weighting algorithm * Disabling Averaging:: ``Super Trouper'' weighting for focus stacks * Single Criterion Fusing:: Fusing with only one of the criteria  File: enfuse.info, Node: Weighted Average, Next: Disabling Averaging, Up: Weighting Pixels 5.1.1 Weighted Average ---------------------- By default, Enfuse uses a weighted average, where _each_ pixel contributes as much as its weight demands. Of course the weights can be extreme, favoring only a few pixels or even only one pixel in the input stack. Extremes are not typical, however. Equal weights are another extreme that turns (W) into an arithmetic average. This is why we sometimes speak of the "averaging property" of this weighting algorithm, like smoothing out noise.  File: enfuse.info, Node: Disabling Averaging, Next: Single Criterion Fusing, Prev: Weighted Average, Up: Weighting Pixels 5.1.2 Disabling Averaging: Option `--hard-mask' ----------------------------------------------- The weighted average computation as described above has proven to be widely successful with the exception of one special case: focus stacking (*note Focus Stacks::), where the averaging noticeably softens the final image. Use `--hard-mask' to switch Enfuse into a different ("Super Trouper") weighting mode, where the pixel with the highest weight wins, this is, gets weight one, and all other pixels get the weight of zero ("The Winner Takes It All."). With `--hard-mask' Equation (W) becomes P(i, x, y) -> Q(x, y), where w(P(i, x, y)) >= w(P(j, x, y)) for all 1 <= j <= n. Note that this "averaging" scheme lacks the nice noise-reduction property of the weighted average (W) , because only a single input pixel contributes to the output.  File: enfuse.info, Node: Single Criterion Fusing, Prev: Disabling Averaging, Up: Weighting Pixels 5.1.3 Single Criterion Fusing ----------------------------- Enfuse allows the user to weight each pixel of an input image by up to four different criteria (*note Overview::). However, it does not force the user to do so. For some applications and more often simply to gain further insight into the weighting and fusing process, looking at only a single criterion is the preferred way to work. The version of Enfuse for which this documentation was prepared, uses the default weights as stated in *note Table:default-weights::. Notice that by default _more than one_ weight is larger than zero, which means they are _active_. Criterion Weight ----------------------- Exposure 1.0 Saturation 0.2 Local Contrast 0.0 Local Entropy 0.0 Table 5.1: Enfuse's default weights as compiled into version 4.1.2. To disable a particular criterion set its weight to zero as for example enfuse \ --exposure-weight=1 --saturation-weight=0 \ --contrast-weight=0 --entropy-weight=0 \ img_[1-3].png instructs Enfuse to consider only the exposure weight. Combine this with option `--save-masks' and it will become clearer how Enfuse computes the exposure weight for the set of images. Another problem that can be inspected by fusing with just a single active criterion and saving the masks is if the weights of one criterion completely overpower all others.  File: enfuse.info, Node: Exposure Weighting, Next: Saturation Weighting, Prev: Weighting Pixels, Up: Weighting Functions 5.2 Exposure Weighting ====================== Exposure weighting prefers pixels with a luminance Y close to the center of the normalized, real-valued luminance interval [0, 1]. RGB-pixels get converted to luminance using the grayscale projector given by `--gray-projector', which defaults to `average'. Grayscale pixels are identified with luminance. In the normalized luminance interval 0.0 represents pure black and 1.0 represents pure white independently of the data type of the input image. This is, for a JPEG image the luminance 255 maps to 1.0 in the normalized interval and for a 32 bit TIFF picture the highest luminance value 4294967295 also maps to 1.0. The middle of the luminance interval, 0.5, is where a neutral gray tone ends up with every camera that had no exposure correction dialed in, for example the image of a gray- or white-card. The exposure weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account. The weighting function is the Gaussian w_exp(Y) = exp(-0.5 * ((Y - Mu) / Sigma)^2), whose center Mu and width Sigma are controlled by the command line options `--exposure-mu' and `--exposure-sigma' respectively. Mu defaults to 0.5 and Sigma defaults to 0.2. *note Figure:gaussian:: shows a Gaussian. 1 ++----------------------+-----------------------+---------******---------+-----------------------+----------------------++ + + + *** *** + + Gaussian(Y) ****** + | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | * * | | * * | | ** ** | | * * | | ** ** | | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | 0.8 ++ ** ** ++ | * * | | ** ** | | * * | | ** ** | | * * | | * * | | * * | | * * | | * * | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | * * | | * * | | ** ** | 0.6 ++ * * ++ | ** ** | | * * | | ** ** | | * * | | * * | | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | * * | | * * | | ** ** | 0.4 ++ * * ++ | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | ** ** | | * * | | * * | | ** ** | 0.2 ++ ** ** ++ | * * | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | *** *** | | ** ** | | *** *** | |*** ***| ** ** | | | | + + + + + + 0 ++----------------------+-----------------------+------------------------+-----------------------+----------------------++ 0 0.2 0.4 0.6 0.8 1 Y Figure 5.1: Gaussian function with the parameters MU = 0.5 and SIGMA = 0.2. The options `--exposure-mu' and `--exposure-sigma' are for fine-tuning the final result without changing the set of input images. Option `--exposure-mu' sets the point MU of optimum exposure. Increasing MU makes Enfuse prefer lighter pixels, rendering the final image lighter, and vice versa. Option `--exposure-sigma' defines the range SIGMA of acceptable exposures. Small values of SIGMA penalize exposures that deviate from MU more, and vice versa. *Summary of influential options* `--exposure-weight' *note Fusion Options:: `--exposure-mu' *note Fusion Options:: `--exposure-sigma' *note Fusion Options:: `--gray-projector' *note Expert Options::  File: enfuse.info, Node: Saturation Weighting, Next: Local Contrast Weighting, Prev: Exposure Weighting, Up: Weighting Functions 5.3 Saturation Weighting ======================== Saturation weighting prefers pixels with a high saturation. Enfuse computes the saturation of a pixel according to the following algorithm. MAX := maximum(R, G, B) MIN := minimum(R, G, B) if MAX = MIN then SATURATION := 0 else SUM := MAX + MIN DIFFERENCE := MAX - MIN if SUM <= 1 then SATURATION := DIFFERENCE / SUM else SATURATION := DIFFERENCE / (2 - SUM) end if end if Obviously, saturation weighting can only be defined for RGB images, not for grayscale ones! If you need something similar, check out *note Local Entropy Weighting::; entropy weighting works for both RGB and grayscale pictures. The saturation weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account. *Summary of influential options* `--saturation-weight' *note Fusion Options::  File: enfuse.info, Node: Local Contrast Weighting, Next: Local Entropy Weighting, Prev: Saturation Weighting, Up: Weighting Functions 5.4 Local Contrast Weighting ============================ Local contrast weighting favors pixels inside a high contrast neighborhood. The notion of "high contrast" is defined either by two different criteria or by a blend of both: * The standard deviation (SDev) of all the pixels in the local analysis window is large. *Note Standard Deviation::. * The Laplacian-of-Gaussian (LoG) has a large magnitude. *Note Laplacian of Gaussian::. * If the LoG magnitude is below a given threshold, use SDev data, otherwise stick with LoG. *Note Blend SDev and LoG::. Enfuse converts every RGB image to grayscale before it determines its contrast. Option `--gray-projector' (*note Expert Options::) controls the projector function. Depending on the subject, one of several grayscale projectors may yield the best black-and-white contrast for image fusion. In the following sections we describe each algorithm in detail. * Menu: * Standard Deviation:: Standard deviation (SDev) * Laplacian of Gaussian:: LoG, a second derivative method * Blend SDev and LoG:: Mix and match SDev and LoG * Scaling and Choice of Mode:: How parameters do not scale; neither does mode  File: enfuse.info, Node: Standard Deviation, Next: Laplacian of Gaussian, Up: Local Contrast Weighting 5.4.1 Standard Deviation ------------------------ The pixel under consideration C sits exactly in the center of a square, the so-called "local analysis window". It always has an uneven edge length. The user sets the size with option `--contrast-window-size'. *note Figure:local-analysis-window:: shows two windows with different sizes. Figure 5.2: Examples of local analysis windows for the sizes 3 and 5. "C" marks the center where the pixel gets the weight. "N" are neighboring pixels, which all contribute equally to the weight. During the analysis, Enfuse scans the local analysis window across all rows and all columns(1) of each of the input images to compute the contrast weight of every pixel. *Summary of influential options* `--contrast-weight' *note Fusion Options:: `--hard-mask' *note Fusion Options:: `--contrast-window-size' *note Expert Options:: `--gray-projector' *note Expert Options:: 5.4.1.1 Statistical Moments ........................... We start with the "probability function" w of the random variable X: w: x -> p({omega: X(omega) = x}). It associates a probability p with each of the n different possible outcomes omega of the random variable X. Based on w, we define the "expectation value" or "First Moment" of the random variable X: Ex X := sum(x_i * w(x_i), i = 1..n). Using the definition of the expectation value, we define the "variance", or "Second Moment" as Var X := Ex((X - Ex X)^2), and the "standard deviation" as Sdev X := sqrt(Var X). Obviously, the variance of X is the expectation value of the squared deviation from the expectation value of X itself. Note that the variance's dimension is X's dimension squared; the standard deviation rectifies the dimension to make it comparable with X itself again. 5.4.1.2 Estimators .................. In Enfuse, we assume that X follows a uniform probability function w(x) = const. That is, all pixel values in the local analysis window are considered to be equally probable. Thus, the expectation value and the variance can be estimated from the pixel values like this Ex X = sum(x_i, i = 1..n) / n. In other words: the expectation value is the arithmetic mean of the lightness of all pixels in the local analysis window. Analogously, the variance becomes Var X = sum((x_i - Ex x)^2, i = 1..n) / (n - 1). ---------- Footnotes ---------- (1) In the current implementation a `floor(contrast-window-size / 2)' wide border around the images remains unprocessed and gets a weight of zero.  File: enfuse.info, Node: Laplacian of Gaussian, Next: Blend SDev and LoG, Prev: Standard Deviation, Up: Local Contrast Weighting 5.4.2 Laplacian of Gaussian --------------------------- The "Laplacian of Gaussian" (LoG) is an operator to detect edges in an image. Sometimes the LoG-operator is also called MARR-HILDRETH operator. A Laplacian-of-Gaussian operator, `vigra::laplacianOfGaussian' (http://hci.iwr.uni-heidelberg.de/vigra/doc/vigra/group__CommonConvolutionFilters.html) is part of the package VIGRA (http://hci.iwr.uni-heidelberg.de/vigra/) that Enfuse is built upon and is used for edge detection if option `--contrast-edge-scale' is non-zero and `--contrast-min-curvature' equal to or less than zero. Let the Gaussian function be g(x, y) = 1/pi * exp((x^2 + y^2) / (2 * sigma^2))/(2 * sigma^2) The parameter sigma, the argument of option `--contrast-edge-scale', is the length scale on which edges are detected by g(x, y). We apply the Laplacian operator in Cartesian coordinates Delta := Nabla o Nabla = (d^2/dx^2 + d^2/dy^2) to g(x, y), to arrive at a continuous representation of the two-dimensional filter kernel k(x, y) = (xi^2 - 1) * exp(-xi^2) / (pi * sigma^4), where we have used the dimensionless distance xi from the origin xi^2 = (x^2 + y^2) / (2 * sigma^2). Enfuse uses a discrete approximation of k in the convolution with the image. The operator is radially symmetric with respect to the origin, which is why we can easily plot it in *note Figure:laplacian-of-gaussian::, setting R = sqrt(x^2 + y^2). 1 ++-----------------------------+------------------------------+-----------------------------+-----------------------------++ + + + + + | : : : | | : : : | | : ********** : | | : **** : ***** : | | : *** : ***** : | | : *** : ***** : | | : ** : ***** : | | : ** : ***** : | | : ** : ****** | | : ** : ******* | | : ** : : ************ | 0 ++.........................................**................................................................*************** | : ** : : | | : * : : | | : ** : : | | : ** : : | | : ** : : | | : * : : | | : ** : : | | : ** : : | | : * : : | | : ** : : | | : * : : | | : ** : : | -1 ++.................................*......................................................................................++ | : * : : | | : ** : : | | : * : : | | :** : : | | :* : : | | ** : : | | * : : | | ** : : | | *: : : | | **: : : | | * : : : | | ** : : : | -2 ++..........................*.............................................................................................++ | ** : : : | | * : : : | | ** : : : | | * : : : | | * : : : | | * : : : | | * : : : | | * : : : | | * : : : | | * : : : | | * : : : | | ** : : : | | * : : : | -3 ++...................**...................................................................................................++ | * : : : | | ** : : : | | * : : : | | ** : : : | | * : : : | | ** : : : | | * : : : | | ** : : : | | * : : : | | ** : : : | | * : : : | | ** : : : | -4 ++............**..........................................................................................................++ | * : : : | | ** : : : | | * : : : | | ** : : : | | ** : : : | | * : : : | | * : : : | | ** : : : | | ** : : : | | ** : : : | | ** : : : | | ** : : : | -5 ++.***....................................................................................................................++ **** : : : | | : : : | | : : : | | : : : | | : : : | | : : : | | : : : | | : : : | | : : : | | : : : | | : : LaplacianOfGaussian(R, Sigma) ****** | + + + + + -6 ++-----------------------------+------------------------------+-----------------------------+-----------------------------++ 0 0.5 1 1.5 2 R Figure 5.3: Laplacian-of-Gaussian function for sigma = 0.5. See also HIPR2: Laplacian of Gaussian (http://homepages.inf.ed.ac.uk/rbf/HIPR2/log.htm). Sometimes the LoG is plagued by noise in the input images. After all, it is a numerical approximation of the second derivative and deriving always "roughens" a function. The (normalized) mask files relentlessly disclose such problems. Use option `--contrast-min-curvature' with a _negative_ argument CURVATURE to suppress all edges with a curvature below -CURVATURE (which is a positive value). Check the effects with the mask files and particularly the hard-mask files (`hardmask-%n.tif') if using option `--hard-mask'. To indicate the CURVATURE in relative terms, which is particularly comprehensible for humans, append a percent sign (`%'). Try minimum curvatures starting from -0.5% to -3%. *Summary of influential options* `--contrast-weight' *note Fusion Options:: `--hard-mask' *note Fusion Options:: `--contrast-edge-scale' *note Expert Options:: `--contrast-min-curvature' *note Expert Options::  File: enfuse.info, Node: Blend SDev and LoG, Next: Scaling and Choice of Mode, Prev: Laplacian of Gaussian, Up: Local Contrast Weighting 5.4.3 Blend Standard Deviation and Laplacian of Gaussian -------------------------------------------------------- Enfuse can team the standard deviation computation and Laplacian of Gaussian to deliver the best of both methods. Use a _positive_ argument CURVATURE with option `--contrast-min-curvature' to combine both algorithms. In this mode of operation Enfuse computes the SDev-weight and the LoG-weight, then uses the LoG to decide whether to go with that value or prefer the SDev data. If the LoG is greater than CURVATURE Enfuse uses the weight delivered by the LoG, otherwise the SDev-weight is rescaled such that its maximum is equal to CURVATURE, and the scaled SDev is used as weight. This technique merges the two edge detection methods where they are best. The LoG excels with clear edges and cannot be fooled by strong but smooth gradients. However, it is bad at detecting faint edges and it is susceptible to noise. The SDev on the other hand shines with even the most marginal edges, and resists noise quite well. Its weakness is that is is easily deceived by strong and smooth gradients. Tuning CURVATURE the user can pick the best threshold for a given set of images. *Summary of influential options* `--contrast-weight' *note Fusion Options:: `--hard-mask' *note Fusion Options:: `--contrast-window-size' *note Expert Options:: `--gray-projector' *note Expert Options:: `--contrast-edge-scale' *note Expert Options:: `--contrast-min-curvature' *note Expert Options::  File: enfuse.info, Node: Scaling and Choice of Mode, Prev: Blend SDev and LoG, Up: Local Contrast Weighting 5.4.4 Scaling and Choice of Mode -------------------------------- Experience has shown that neither the parameters EDGESCALE and CURVATURE nor the mode of operation (SDev-only, LoG-only, or a blend of both) scales to different image sizes. In practice, this means that if you start with a set of reduced size images, say 2808x1872 pixels, carefully optimize EDGESCALE, CURVATURE and so on, and find LoG-only the best mode, and then switch to the original resolution of 5616x3744 pixels, multiplying (or dividing) the parameters by four and sticking to LoG-only might _not_ result in the best fused image. For best quality, perform the parameter optimization and the search for the most appropriate mode at the final resolution.  File: enfuse.info, Node: Local Entropy Weighting, Prev: Local Contrast Weighting, Up: Weighting Functions 5.5 Local Entropy Weighting =========================== Entropy weighting prefers pixels inside a high entropy neighborhood. Let S be an n-ary source. Watching the output of S an observer on average gains the information H_a(n) := sum(p(x) * log_a(1 / p(x)), x in S) per emitted message, where we assume the knowledge of the probability function p(S). The expectation value H_a(n) is called "entropy" of the source S. Entropy measures our uncertainty if we are to guess which message gets chosen by the source in the future. The unit of the entropy depends on the choice of the constant a > 1. Obviously H_b(n) = H_a(n) / log_a(b) holds for all b > 1. We use a = 2 for entropy weighting and set the entropy of the "impossible message" to zero according to lim(p * log_a(1 / p), p -> 0) = 0. *note Figure:entropy:: shows an entropy function. 1 ++----------------------+-----------------------+------************------+-----------------------+----------------------++ + + + **** **** + + Entropy(p) ****** + | *** *** | | *** *** | | *** *** | | *** *** | | ** ** | | *** *** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | | ** ** | 0.8 ++ ** ** ++ | * * | | ** ** | | ** ** | | ** ** | | * * | | ** ** | | ** ** | | * * | | ** ** | | ** ** | | * * | | ** ** | | * * | | * * | | * * | | * * | | ** ** | | * * | 0.6 ++ ** ** ++ | * * | | ** ** | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | * * | | * * | | ** ** | | * * | | ** ** | | * * | | * * | | ** ** | | * * | 0.4 ++ * * ++ | * * | | * * | | * * | | * * | | * * | | ** ** | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | 0.2 ++ * * ++ | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | | * * | |* *| |* *| |* *| |* *| |* *| * * * * * + + + + * 0 ++----------------------+-----------------------+------------------------+-----------------------+----------------------++ 0 0.2 0.4 0.6 0.8 1 p Figure 5.4: Entropy function H for an experiment with exactly two outcomes. For more on (information) entropy visit Wikipedia (http://en.wikipedia.org/wiki/Information_entropy). Enfuse computes a pixel's entropy by considering the pixel itself and its surrounding pixels quite similar to *note Local Contrast Weighting::. The size of the window is set by `--entropy-window-size'. Choosing the right size is difficult, because there is a serious tradeoff between the locality of the data and the size of the sample used to compute H. A large window results in a large sample size and therefore in a reliable entropy, but considering pixels far away from the center degrades H into a non-local measure. For small windows the opposite holds true. Another difficulty arises from the use of entropy as a weighting function in dark parts of an image, that is, in areas where the signal-to-noise ratio is low. Without any precautions, high noise is taken to be high entropy, which might not be desired. Use option `--entropy-cutoff' to control the black level when computing the entropy. On the other extreme side of lightness, very light parts of an image, the sensor might already have overflown without the signal reaching 1.0 in the normalized luminance interval. For these pixels the entropy is zero and Enfuse can be told of the threshold by properly setting the second argument of `--entropy-cutoff'. *Summary of influential options* `--entropy-weight' *note Fusion Options:: `--entropy-window-size' *note Expert Options:: `--entropy-cutoff' *note Expert Options::  File: enfuse.info, Node: Understanding Masks, Next: Tuning Memory Usage, Prev: Weighting Functions, Up: Top 6 Understanding Masks ********************* A "binary mask" indicates for every pixel of an image if this pixel must be considered in further processing, or ignored. For a "weight mask", the value of the mask determines how much the pixel contributes, zero again meaning "no contribution". Masks arise in two places: as part of the input files and as separate files, showing the actual pixel weights prior to image blendung or fusion. We shall explore both occurrences in the next sections. 6.1 Masks in Input Files ======================== Each of the input files for Enfuse and Enblend can contain its own mask. Both applications interpret them as binary masks no matter how many bits per image pixel they contain. Use ImageMagick's `identify' or, for TIFF files, `tiffinfo' to inquire quickly whether a file contains a mask. *note Helpful Programs:: shows where to find these programs on the web. $ identify -format "%f %m %wx%h %r %q-bit" remapped-0000.tif remapped-0000.tif TIFF 800x533 DirectClassRGBMatte 8-bit ^^^^^ mask $ tiffinfo remapped-0000.tif TIFF Directory at offset 0x1a398a (1718666) Subfile Type: (0 = 0x0) Image Width: 800 Image Length: 533 Resolution: 150, 150 pixels/inch Position: 0, 0 Bits/Sample: 8 Sample Format: unsigned integer Compression Scheme: PackBits Photometric Interpretation: RGB color Extra Samples: 1 <<<<< mask Orientation: row 0 top, col 0 lhs Samples/Pixel: 4 <<<<< R, G, B, and mask Rows/Strip: 327 Planar Configuration: single image plane The "Matte" part of the image class and the "Extra Samples" line tell us that the file features a mask. Also, many interactive image manipulation programs show the mask as a separate channel, sometimes called "Alpha". There, the white (high mask value) parts of the mask enable pixels and black (low mask value) parts suppress them. The multitude of terms all describing the concept of a mask is confusing. Mask A mask defines a selection of pixels. A value of zero represents an unselected pixel. The maximum value ("white") represents a selected pixel and the values between zero and the maximum are partially selected pixels. See Gimp-Savy (http://gimp-savvy.com/BOOK/index.html?node42.html). Alpha Channel The alpha channel stores the transpacency value for each pixel, typically in the range from zero to one. A value of zero means the pixel is completely transparent, thus does not contribute to the image. A value of one on the other hand means the pixel is completely opaque. Matte The notion "matte" as used by ImageMagick refers to an inverted alpha channel, more precisely: 1 - alpha. See ImageMagick (http://www.imagemagick.org/Usage/channels/#trans) for further explanations. Enblend and Enfuse only consider pixels that have an associated mask value other than zero. If an input image does not have an alpha channel, Enblend warns and assumes a mask of all non-zero values, that is, it will use every pixel of the input image for fusion. Stitchers like `nona' add a mask to their output images. Sometimes it is helpful to manually modify a mask before fusion. For example to suppress unwanted objects (insects and cars come into mind) that moved across the scene during the exposures. If the masks of all input images are black at a certain position, the output image will have a hole in that position. 6.2 Weight Mask Files ===================== ...  File: enfuse.info, Node: Tuning Memory Usage, Next: Applications, Prev: Understanding Masks, Up: Top 7 Tuning Memory Usage ********************* The default configuration of Enblend and Enfuse assumes a system with 3-4 GB of RAM. If Enblend and Enfuse have been compiled with the "image-cache" feature, they do not rely on the operating system's memory management, but use their own image cache in the file system. To find out whether your version uses the image cache say enblend --verbose --version or enfuse --verbose --version Enblend and Enfuse put the file that holds the image cache either in the directory pointed to by the environment variable `TMPDIR', or, if the variable is not set, in directory `/tmp'. It is prudent to ensure write permissions and enough of free space on the volume with the cache file. The size of the image cache is user configurable with the option `-m CACHE-SIZE' (*note Extended Options::). Furthermore, option `-b BUFFER-SIZE' (*note Extended Options::) allows for fine-tuning the size of a single buffer inside the image cache. Note that CACHE-SIZE is given in megabytes, whereas the unit of BUFFER-SIZE is kilobytes. Usually the user lets the operating system take care of the memory management of all processes. However, users of Enblend or Enfuse might want to control the balance between the operating systems' Virtual Memory (http://en.wikipedia.org/wiki/Virtual_memory) system and the image cache for several reasons. * Paging in or out parts of a process' image runs at kernel level and thus can make user processes appear unresponsive or "jumpy". The caching mechanism of Enblend and Enfuse of course runs as a user process, which is why it has less detrimental effects on the system's overall responsiveness. * The image cache has been optimized for accesses to image data. All algorithms in Enblend and Enfuse have been carefully arranged to play nice with the image cache. An operating system's cache has no knowledge of these particular memory access patterns. * The disk access of the operating system to the swap device has been highly optimized. Enblend and Enfuse on the other hand use the standard IO-layer, which is a much slower interface. * Limiting the amount of image cache prevents Enblend and Enfuse from eating up most or all RAM, thereby forcing all user applications into the swap. The CACHE-SIZE should be set in such a way as to reconcile all of the above aspects even for the biggest data sets, that is, projects with many large images. *note Table:cache-size-settings:: suggests some cache- and buffer-sizes for different amounts of available RAM. RAM | CACHE-SIZE | BUFFER-SIZE | Comment MB | MB | KB | ------+------------+-------------+--------- 4096 | 1024 | 2048 | default 2048 | 512--1024 | 1024 | 1024 | 256--512 | 256--512 | Table 7.1: Suggested cache-size settings On systems with considerably more than 4 GB of RAM it is recommended to run Enblend or Enfuse versions without image cache.  File: enfuse.info, Node: Applications, Next: Helpful Programs, Prev: Tuning Memory Usage, Up: Top 8 Applications of Enfuse ************************ This section describes some of the novel possibilities that Enfuse offers the photographer. In contrast to the previous chapters, it centers around the image effects. * Menu: * What Images:: What makes images fusable? * Repetition:: Just taking the same shot multiple times * Exposure Series:: Varying the exposure time * Flash Exposure Series:: Varying the flash output * Polarization Series:: Changing the polarizer angle * Focus Stacks:: Stacking images with different in-focus distance  File: enfuse.info, Node: What Images, Next: Repetition, Up: Applications 8.1 What Makes Images Fusable? ============================== Images should align well to be suitable for fusion. However, there is no hard mathematical rule what "well" means. The alignment requirements for 16 MPixel images to yield a sharp 4"x6" print at 300 dpi ("dpi" means dots per inch) or even for web presentation are relatively low, whereas the alignment of 8 MPixel images for a 12"x18" print ought to be tight. If the input images need to be aligned, Hugin (*note Helpful Programs::) is the tool of choice. It produces images exactly in the format that Enfuse expects. Sometimes images naturally align extremely well so that no re-alignment is required. An image series with preprogrammed exposure steps taken in rapid succession where the camera is mounted on a heavy tripod and a humongous ball head, mirror lockup, and a cable release are used, comes to mind. When in doubt about what will work, try it, and judge for yourself. Useful ideas for a good alignment: * Fix all camera parameters that are not explicitly varied. _Aperture_ Engage full manual () or aperture-priority () mode. _Auto-focus_ Disable "Auto Focus". Be aware that the auto-focus function could be linked to shutter-release button position "half pressed" or to the shutter release in insidious ways. _Closed eyepiece_ (This applies only to single lens reflex cameras.) Close the eyepiece when using a cable release to suppress variations in stray light. _Exposure time/Shutter speed_ Use the shortest possible exposure time or, in other words, use the fastest shutter speed to avoid blur caused by camera shake or motion blur. _Flash power_ Explicitly control the flash power of _all_ flashes. This is sometimes called "flash exposure lock". _Sensitivity_ Disable "Auto ISO". _White balance_ Disable "Auto White Balance". Instead, use the most suitable fixed white balance or take the white balance off a white card. When in doubt, use the setting "Daylight" or equivalent. * Steady the camera by any means. * Apply your best camera bracing technique combined with controlled breathing. * Prefer a monopod, or better, a rigid tripod with a heavy head. * Use a cable release if possible. * (This applies to cameras with a moving mirror only.) Engage "mirror lockup". * Consider automatic bracketing when applicable. * Activate camera- or lens-based image stabilization if you are sure that it improves the image quality in your particular case; otherwise disengage the feature. For some lens-based image stabilization systems, it is known that they "lock" into different positions every time they are activated. Moreover, some stabilization systems decrease the image quality when the lens is mounted on a tripod. * Fire in rapid succession.  File: enfuse.info, Node: Repetition, Next: Exposure Series, Prev: What Images, Up: Applications 8.2 Repetition - Noise Reduction ================================ *Main Purpose*: Reduce noise With the default settings, Enfuse computes a weighted average of the input pixels. For a series of images, repeated with identical settings, this results in a reduction of (photon shot) noise. In other words, the dynamic range increases slightly, because the higher signal-to-noise ratio makes darker shades usable. Furthermore, smooth or glossy surfaces get a "cleaner" look, and edges become visually sharper. The nitty-gritty reportage look that sometimes stems from a high sensitivity setting disappears. Averaged images, and therefore low-noise images, are the base for a multitude of techniques like, for example, differences. The most prominent method in this class is dark-frame subtraction. The defaults set `--exposure-weight=1.0' and `--saturation-weight=0.2'. Eliminating the saturation component with `--saturation-weight=0.0' can be worth an extra run.  File: enfuse.info, Node: Exposure Series, Next: Flash Exposure Series, Prev: Repetition, Up: Applications 8.3 Exposure Series - Dynamic Range Increase ============================================ *Main Purpose*: Increase manageable dynamic range An exposure series is a set of images taken with identical parameters except for the exposure time. Some cameras even provide special functions to automate recording exposure series. See the instruction manual of your model for details. Enfuse's defaults, `--exposure-weight=1.0' and `--saturation-weight=0.2' are well suited for fusion of _color_ images. Remember that saturation weighting only works for RGB data. Option `--saturation-weight' helps to control burnt-out highlights, as these are heavily desaturated. Alternatively, use option `--exposure-cutoff' to suppress noise or blown-out highlights without altering the overall brightness too much. If no image suffers from troublesome highlights, the relative saturation weight can be reduced and even be set to zero. For black and white images `--entropy-weight' can be an alternative to `--saturation-weight' because it suppresses overexposed pixels, as these contain little information. However, entropy weighting is not limited to gray-scale data; it has been successfully applied to RGB images, too. Note that entropy weighting considers _each_ color channel of an RGB image separately and chooses the channel with the minimum entropy as representative for the whole pixel. Enfuse offers the photographer tremendous flexibility in fusing differently exposed images. Whether you combine only two pictures or a series of 21, Enfuse imposes no limits on you. Accordingly, the photographic effects achieved range from subtle to surreal, like the late 1980s "Max Headroom" TV-Series, to really unreal. Like some time ago in the chemical days of photography, when a new developer opened unseen possibilities for artists, exposure fusion extends a photographer's expressive space in the digital age. Whether the results look good or bad, whether the images are dull or exciting, is entirely up the artist. In the next sections we give assistance to starters, and rectify several misconceptions about Enfuse. * Menu: * Exposure Series Tips:: Some hints for beginners * Exposure Series Misconceptions:: What works despite the hype  File: enfuse.info, Node: Exposure Series Tips, Next: Exposure Series Misconceptions, Up: Exposure Series 8.3.1 Tips For Beginners ------------------------ Here are some tips to get you in business quickly. _Include the best single exposure._ Include the exposure you would have taken if you did not use Enfuse in your series. It gives you a solid starting point. Think of the other images as augmenting this best single exposure to bring out the light and dark features you would like to see. _Begin with as small a number of images as possible._ Pre-visualizing the results of Enfuse is difficult. The more images put into the fusion process and the wider their EV-spacing is, the more challenging visualizing the output image becomes. Therefore, start off with as few images as possible. You can take a larger series of images and only use part of it. _Start with a moderate EV-spacing._ As has been pointed out in the previous item, a wide EV-spacing makes pre-visualization harder. So start out with a spacing of 2/3 EV to 1+1/3 EV.  File: enfuse.info, Node: Exposure Series Misconceptions, Prev: Exposure Series Tips, Up: Exposure Series 8.3.2 Common Misconceptions --------------------------- Here are some surprisingly common misconceptions about exposure series. _A single image cannot be the source of an exposure series._ Raw-files in particular lend themselves to be converted multiple times and the results being fused together. The technique is simpler, faster, and usually even looks better than digital blending (http://luminous-landscape.com/tutorials/digital-blending.shtml) (as opposed to using a graduated neutral density filter) or blending exposures (http://www.gimpguru.org/Tutorials/BlendingExposures/) in an image manipulation program. Moreover, perfect alignment comes free of charge! _An exposure series must feature symmetrically-spaced exposures._ Twice wrong! Neither do the exposures have to be "symmetric" like {0 EV, -2/3 EV, +2/3 EV}, nor does the number of exposures have to be odd. Series like {-1-1/3 EV, -1/3 EV, +1/3 EV} or {-1 EV, 1 EV} might be just right. By the way, the order in which the images were taken does not matter either. _An exposure series must cover the whole dynamic range of the scene._ If you do not want to cover the whole range, you do not have to. Some HDR programs require the user to take a light probe,(1) whereas Enfuse offers the user complete freedom of exposure. _All exposure values must be different._ You can repeat any exposure as often as you like. That way you combine an exposure series with parts of *note Repetition::, emphasizing the multiply occuring exposures and reducing noise. ---------- Footnotes ---------- (1) Paul E. Debevec (http://www.debevec.org/) defines: "A "light probe" image is an omnidirectional, high dynamic range image that records the incident illumination conditions at a particular point in space."  File: enfuse.info, Node: Flash Exposure Series, Next: Polarization Series, Prev: Exposure Series, Up: Applications 8.4 Flash Exposure Series - Directed Lighting ============================================= *Main Purpose*: ??? ...  File: enfuse.info, Node: Polarization Series, Next: Focus Stacks, Prev: Flash Exposure Series, Up: Applications 8.5 Polarization Series - Saturation Enhancement ================================================ *Main Purpose*: Reflection suppression, saturation enhancement In the current implementation of Enfuse, it is not possible in general to fuse a polarization series. Naively abusing `--saturation-weight' will not work.  File: enfuse.info, Node: Focus Stacks, Prev: Polarization Series, Up: Applications 8.6 Focus Stacks - Depth-of-Field Increase ========================================== *Main Purpose*: Synthetic Depth-of-Field Increase A "focus stack" is a series of images where the distance of the focal plane from the sensor varies. Sloppily speaking, the images were focussed at different distances. Fusing such a stack increases the depth-of-field (DOF) beyond the physical limits of diffraction. * Menu: * Why Focus Stacks:: Why take the hassle? * Preparing Focus Stacks:: How to get suitable input images * Local Contrast Based Fusing:: Fundamental command line options * Basic Focus Stacking:: Simple, standard deviation method * Advanced Focus Stacking:: Advanced, Laplacian technique * Expert Stacking:: Tips for focus stacking experts  File: enfuse.info, Node: Why Focus Stacks, Next: Preparing Focus Stacks, Up: Focus Stacks 8.6.1 Why create focus stacks? ------------------------------ Given * a fixed sensor or film size, * a lens' particular focal length, and * a notion about "sharpness", technically speaking the size of the circle-of-confusion (CoC) the photographer controls the depth-of-field with the aperture. Smaller apertures - this is larger aperture numbers - increase the DOF and vice versa. However, smaller apertures increase diffraction which in turn renders the image unsharp. So, there is an optimum aperture where the photographer gets maximum DOF. Sadly, for some purposes like macro shots it is not enough. One way out is to combine the sharp parts of images focused at different distances, thereby artificially increasing the total DOF. This is exactly what Enfuse can do. All lenses have a so called "sweet spot" aperture, where their resolution is best. Taking pictures at this aperture, the photographer squeezes the maximum quality out of the lens. But: the "sweet spot" aperture often is only one or two stops away from wide open. Wouldn't it be great to be able combine these best-possible images to form one high-quality, sufficient-DOF image? Welcome to Enfuse's local-contrast selection abilities.  File: enfuse.info, Node: Preparing Focus Stacks, Next: Local Contrast Based Fusing, Prev: Why Focus Stacks, Up: Focus Stacks 8.6.2 Preparing Focus Stacks ---------------------------- We are going to combine images with limited DOF to increase their in-focus parts. The whole process is about image sharpness. Therefore, the input images must align very well, not just well, but very well. For optimum results the maximum control point distance in Hugin (*note Helpful Programs::) should not exceed 0.3-0.5 pixels to ensure perfect blending. As in all image fusion operations it is preferable to use 16 bit linear (gamma = 1) images throughout, but 8 bit gamma encoded images will do. Naturally, high SNR input data always is welcome.  File: enfuse.info, Node: Local Contrast Based Fusing, Next: Basic Focus Stacking, Prev: Preparing Focus Stacks, Up: Focus Stacks 8.6.3 Local Contrast Based Fusing --------------------------------- A bare bones call to Enfuse for focus stacking could look like this. enfuse \ --exposure-weight=0 \ --saturation-weight=0 \ --contrast-weight=1 \ --hard-mask \ ... \ --output=output.tif \ input-<0000-9999>.tif Here is what each option causes: `--exposure-weight=0' Switch *off* exposure based pixel selection. The default weight is 1.0. `--saturation-weight=0' Switch *off* saturation based pixel selection. The default weight is 0.2. `--contrast-weight=1' Switch *on* pixel selection based on local contrast. `--hard-mask' Select the best pixel from the image stack and ignore all others. Without this option, Enfuse uses all pixels in the stack and weights them according to their respective quality, which in our case is local contrast. Without `--hard-mask', the result will always look a bit soft. *Note Local Contrast Weighting::. If you want to see some entertaining progress messages - local-contrast weighting takes a while -, also pass the `--verbose' option for a verbose progress report.  File: enfuse.info, Node: Basic Focus Stacking, Next: Advanced Focus Stacking, Prev: Local Contrast Based Fusing, Up: Focus Stacks 8.6.4 Basic Focus Stacking -------------------------- For a large class of image stacks Enfuse's default algorithm, as selected in *note Local Contrast Based Fusing::, to determine the sharpness produces nice results. The algorithm uses a moving square window, the so-called contrast window. It computes the standard deviation of the pixels inside of the window. The program then selects the window's center pixel of the image in the stack where the standard deviation is largest, that is, the local contrast reaches the maximum. However, the algorithm fails to deliver good masks for images which exhibit high contrast edges on the scale of the contrast window size. The typical artifacts that show up are * faint dark seams on the light side of the high contrast edges and * extremely soft, slightly lighter seams on the dark side of the high contrast edges, where the distance of the seams from the middle of the edge is comparable to the contrast window size. If your results do not show any of these artifacts, stick with the basic algorithm. Advanced focus stacking, as described in the next sections, delivers superior results in case of artifacts, though requires manually tuning several parameters.  File: enfuse.info, Node: Advanced Focus Stacking, Next: Expert Stacking, Prev: Basic Focus Stacking, Up: Focus Stacks 8.6.5 Advanced Focus Stacking ----------------------------- If your fused image shows any of the defects described in the previous section, you can try a more difficult-to-use algorithm that effectively works around the seam artifacts. It is described in the next section. * Menu: * Local Contrast Problem:: What is the problem Kenneth? * Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges * Local Contrast Enhancement:: Boosting local contrast before weighting * Suppressing Noise or Recognizing Faint Edges:: The best of both worlds * Focus Stacking Decision Tree:: What to do and how to fuse  File: enfuse.info, Node: Local Contrast Problem, Next: Laplacian Edge Detection, Up: Advanced Focus Stacking 8.6.5.1 A Detailed Look at the Problem ...................................... Let us use an example to illustrate the problem of relating the sharpness with the local contrast variations. Say we use a 5x5 contrast window. Moreover, let `sharp_edge' and `smooth_edge' be two specific configurations: sharp_edge = [ 0, 0, 200, 0, 0; 0, 225, 0, 0, 0; 0, 255, 0, 0, 0; 215, 0, 0, 0, 0; 200, 0, 0, 0, 0] smooth_edge = [ 0, 62, 125, 187, 250; 1, 63, 126, 188, 251; 2, 65, 127, 190, 252; 3, 66, 128, 191, 253; 5, 67, 130, 192, 255] where `;' separates the rows and `,' separates the columns. This is in fact Octave (http://www.gnu.org/software/octave/) syntax. *note Figure:sharp-edge:: and *note Figure:smooth-edge:: show plots of the matrices `sharp_edge' and `smooth_edge'. sharp_edge ****** 250 $$$$$$ 200 %%%%%% 150 @@@@@@ 100 &&&&&& 50 ====== ** ** * ** * ** * ** * ** * * ** * * * * * * * * * * * * * * * * * * * * * * 300 ++ * * * * | * * * * | * * * * | * * * * | ** * * 250 |+ ** * * | *** * * | *** * * | * * * * * | ** * * * * 200 |+ * * * * ** | * * * * ** **** | * * * * * **** | * * * * * **** | * * * *** **** 150 |+ * * * * ** ****** | * * * * ** ***** | * * * * ******* ** ****** | * * * ** * ******** ** ******** 100 |+ * * * * * ** **** ** **** | * * * * * * **** ** **| | * * * * * * **** ** * | | * * * * * ** **** ** | | * * * %% * * * ** ***** * | 50 |+ ** * * % * *** ** ***** ** | | * * * -% @ * ** ***** ** *** | | ** * * -%% @@ ** ** ***** ** ** | | * * * %%%. @ * * **** * | |** * * -- @@@@.. && * ** ** **** ** | 0 *** ** @@@@ &&&&&&&===** * **** * | | ***** * &&&&&&&===== ..*** ** **** ** | | ***** * ===== =====******* * **--- | | *** - ==========&&&&.** **** ** ** .. ------ | | --+.===== &&&&@@@@@@. & ** ***** ** . ------ | | - ==...&&&@@@@@ . @ & ** ** ***** ** .. -- 4 | -- = && @@...%%%%%% @ & ** * ***** ** . -- | -- == & @ %...$. % @ & ** * ***.. .. - | - = & @ % .$ %%..@@ & ** ** ** .... -- | --. == && @@ %% .. %% @@ ..&. *** * .. ..... -- | - =... & @ % . % @@ && ==.*** ** . .... - | -- = &..@. % .. %% @@ && = .. ***** * .. .- 3 | -- = & @.%.. %% @@ && == . **** ** . - | - = & @ %%%%@@@ && = .. ***.. .. -- |-- = & @@@@ &&&&. == . | ..... - 0+-- = &. &&&&&&& =====..... |. ..... -- ---- =.&&&&========= ...... .| .... +-- ----- .===== ===== ..... . | .- 2 -- 1- ========&&&&. = .... .. | -- --===== &&&&&& . & = ..... | - --&&& @@@@@@@ & = .. ..|.. -- -----+ @ & = . | .... - 2----@ & = .. | .. 1 ---&- = . | - --=- +. | -- 3--- | -- ----- | - ---- |-- - 40 Figure 8.1: 3D plot augmented by contour plot of the matrix `sharp_edge'. smooth_edge ****** 250 $$$$$$ 200 %%%%%% 150 @@@@@@ 100 &&&&&& 50 ====== ******** ***** **| ** * | ******** ** | ****** ** * | 300 ++ ** * ** | | ******** ** ******** | | ***** ** ***** ** | | ** * ** ** | | ******* ** ******** ** | 250 |+ ***** ** ****** ** ** | | ** * ** ** ******** | | * * ******* ***** ** | | ** ****** ** ** * | | * ** ** ******** ** | 200 |+ ** ******** ***** ** * | | ***** ** ** * ** | | ** ** ******** ** ******** | | ** ***** ** ***** ** | | ** ** ** ** ** | 150 |+ ************ ************ ** | | *** ** *** ** ** | | ** ** ******** ** ******* | | ** ****** ** ***** | | 100 |+ * ** * ** | | | ** ******** ** ******** | | | ***** ** ***** | | | ** * **+ +-- | | | * ** ********-- ----- | | 50 |+ ** ****** - --=-- | | | * ** -- == +----- | | | ** ******** - == .. ---&-| | | ***** --.. == . && ----- | |** -- .... == .. & | ---- | 0 *+ - ....= .. && | .. -@--- | | -- == ..... & | . @@ ----- | | - = .. .... && |. @ ----% | | -- == . .&... .| @ ..%% ----- | | -++. = .. & ...... | @@ . % ----- | | -- .... == .. & .. ..|. @ ..%% -$ 4 | - ....= . && . | @.... . % $$- | -- == ..... & .. @@ .... ..%% $- | - = . .... & . @@| ...%. $$- | --. = .. ...&. .. @@ | ..%% ..... $- | -- .... == .. && ..... @@ | . % .... $$ | - ..... = . && .. ....@ | ..%% .$ 3 | -- =.... && . @..... | . % $$ | - == . .... && .. @ ..|. ..%% $$- |-- == .. ...&. . @@ | ...%. $- 0+-- == .. && ....... @ |. %% ..... $$- ---- == . & ...... @ .| % .... +$- -----= .. & . ..@.. . |% $$ 2 -- 1- && .. @@ .... .. %% $- ---- & . @ .....% | $$ ----& .. @@ .. %..|.. $- -----+ @ . %% | .... $$ 2---- @@ .. %% | .. 1 --@-- . %% | $$ ---- +.%% | $- 3--% | $$ ----- | $ ---- |$$ - 40 Figure 8.2: 3D plot augmented by contour plot of the matrix `smooth_edge'. Our intuition lets us "see" an extremely sharp edge in the first matrix, whereas the second one describes an extraordinarily smooth diagonal intensity ramp. Which one will be selected? Well, `sharp_edge' has a standard deviation of 88.07 and `smooth_edge' has 88.41. Thus, `smooth_edge' wins, contradicting our intuition, and even worse, our intention! Sadly, configurations like `smooth_edge' occur more often with high-quality, good bokeh (http://www.luminous-landscape.com/essays/bokeh.shtml) lenses. In fact, they are the very manifestation of "good bokeh". Therefore, Laplacian edge detection plays an important role when working with high-quality lenses.  File: enfuse.info, Node: Laplacian Edge Detection, Next: Local Contrast Enhancement, Prev: Local Contrast Problem, Up: Advanced Focus Stacking 8.6.5.2 Laplacian Edge Detection ................................ Enfuse provides a Laplacian-based algorithm that can help in situations where weighting based on the standard deviation fails. It is activated with a positive value for SCALE in `--contrast-edge-scale'=SCALE. The Laplacian will detect two-dimensional _curvature_ on the scale of SCALE. Here and in the following we simply speak of "curvature" where we mean "magnitude of curvature". That is, we shall not distinguish between convex and concave edges. Enfuse always use the magnitude of curvature for weighting. Typically, SCALE ranges between 0.1 pixels and 0.5 pixels, where 0.3 pixels is a good starting point. To find the best value for SCALE though, usually some experimentation will be necessary. Use `--save-masks' to get all soft-mask (default: `softmask-%n.tif') and hard-mask files (default: `hardmask-%n.tif'). Check how different scales affect the artifacts. Also *note Understanding Masks::.  File: enfuse.info, Node: Local Contrast Enhancement, Next: Suppressing Noise or Recognizing Faint Edges, Prev: Laplacian Edge Detection, Up: Advanced Focus Stacking 8.6.5.3 Local Contrast Enhancement .................................. Sometimes Enfuse misses smoother edges with `--contrast-edge-scale' and a little local contrast enhancement (LCE) helps. Set `--contrast-edge-scale'=SCALE:LCE-SCALE:LCE-FACTOR. where LCE-SCALE and LCE-FACTOR work like the unsharp mask (http://www.cambridgeincolour.com/tutorials/unsharp-mask.htm) filters in various image manipulation programs. Start with LCE-SCALE ten times the value of SCALE and a LCE-FACTOR of 2-5. LCE-SCALE can be specified as a percentage of SCALE. LCE-FACTOR also can be specified as a percentage. Examples: --contrast-edge-scale=0.3:3.0:3 --contrast-edge-scale=0.3:1000%:3.0 --contrast-edge-scale=0.3:3:300% --contrast-edge-scale=0.3:1000%:300% By default LCE is turned off.  File: enfuse.info, Node: Suppressing Noise or Recognizing Faint Edges, Next: Focus Stacking Decision Tree, Prev: Local Contrast Enhancement, Up: Advanced Focus Stacking 8.6.5.4 Suppressing Noise or Recognizing Faint Edges .................................................... The Laplacian-based algorithm is much better at resisting the seam problem than the local-contrast algorithm, but it has two shortcomings: 1. The Laplacian is very susceptible to noise and 2. it fails to recognize faint edges. The `--contrast-min-curvature' option helps to mitigate both flaws. The argument to `--contrast-min-curvature'=CURVATURE either is an absolute lightness value, for example 0..255 for 8 bit data and 0..65535 for 16 bit data, or, when given with a `%'-sign it is a relative lightness value ranging from 0% to 100%. To suppress unreal edges or counter excessive noise, use the `--contrast-min-curvature' option with a _negative_ curvature measure CURVATURE. This forces all curvatures less than -CURVATURE to zero. A _positive_ curvature measure CURVATURE makes Enfuse merge the LoG data with the local-contrast data. Every curvature larger than or equal to CURVATURE is left unchanged, and every curvature less than CURVATURE gets replaced with the rescaled local-contrast data, such that the largest local contrast is just below CURVATURE. This combines the best parts of both techniques and ensures a precise edge detection over the whole range of edge curvatures. *Summary* `--contrast-edge-scale=0.3' Use LoG to detect edges on a scale of 0.3 pixels. Apply the default grayscale projector: `average'. `--contrast-edge-scale=0.3 --gray-projector=l-star' Use LoG to detect edges on a scale of 0.3 pixels. Apply the L*-grayscale projector. `--contrast-edge-scale=0.3:3:300%' Use LoG to detect edges on a scale of 0.3 pixels, pre-sharpen the input images by 300% on a scale of 3 pixels. Apply the default grayscale projector: `average'. `--contrast-edge-scale=0.3 --contrast-min-curvature=-0.5%' Use LoG to detect edges on a scale of 0.3 pixels. Apply the default grayscale projector: `average' and throw away all edges with a curvature of less than 0.5%. `--contrast-edge-scale=0.3 --contrast-min-curvature=0.5% --contrast-window-size=7' Use LoG to detect edges on a scale of 0.3 pixels. Apply the default grayscale projector: `average' and throw away all edges with a curvature of less than 0.5% and replace the LoG data between 0% and 0.5% with SDev data. Use a window of 7x7 pixel window to compute the SDev.  File: enfuse.info, Node: Focus Stacking Decision Tree, Prev: Suppressing Noise or Recognizing Faint Edges, Up: Advanced Focus Stacking 8.6.5.5 Focus Stacking Decision Tree .................................... *note Figure:focus-stacking-decision-tree:: helps the user to arrive at a well-fused focus stack with as few steps as possible. Figure 8.3: Focus stacking decision tree. Always start with the default, contrast weighting with a local contrast window. Only if seams appear as described in *note Advanced Focus Stacking:: switch to Laplacian-of-Gaussian contrast detection. If some seams remain even in LoG-mode, decrease the sensitivity of the edge detection with a positive `--contrast-min-curvature'. A too high value of `--contrast-min-curvature' suppresses fine detail though. Part of the detail can be brought back with pre-sharpening, that is, *note Local Contrast Enhancement:: or combining LoG with local-contrast-window mode by using a negative `--contrast-min-curvature'. Carefully examining the masks (option `--save-masks') that Enfuse uses helps to judge the effects of the parameters.  File: enfuse.info, Node: Expert Stacking, Prev: Advanced Focus Stacking, Up: Focus Stacks 8.6.6 Tips For Focus Stacking Experts ------------------------------------- We have collected some advice with which even focus-stacking adepts can benefit. * Ensure that the sensor is clean. Aligning focus stacks requires varying the viewing angle, which corresponds to a changing focal length. Hence, the same pixel on the sensor gets mapped onto different positions in the final image. Dirt spots will occur not only once but as many times as there are images in the stack - something that is no fun to correct in postprocessing. Along the same lines, the photographer may want to consider to prepare dark frames before, and possibly also after, the shoot of the focus stack, to subtract hot pixels before fusion. * Prefer a low-sensitivity setting ("ISO") on the camera to get low-noise images. Fusing with `--hard-mask' does not average, and thus does not suppress any noise in the input images. * If the transition of in-focus to out-of-focus areas is too abrupt, record the images with closest and farthest focusing distances twice: first with the intended working aperture, and a second time with a small aperture (large aperture number). The small aperture will give the fused image a more natural in-focus to out-of-focus transition and the working-aperture shots supply the detail in the in-focus regions.  File: enfuse.info, Node: Helpful Programs, Next: Bug Reports, Prev: Applications, Up: Top 9 Helpful Additional Programs ***************************** Several programs and libraries have proven helpful when working with Enfuse and Enblend. *Raw Image Conversion* * DCRaw (http://www.cybercom.net/~dcoffin/dcraw/) is a universal raw-converter written by DAVID COFFIN. * UFRaw (http://ufraw.sourceforge.net/), a raw converter written by UDI FUCHS and based on DCRaw, adds a GUI (`ufraw'), versatile batch processing (`ufraw-batch'), and some additional features such as cropping, noise reduction with wavelets, and automatic lens error correction. *Image Alignment and Rendering* * ALE (http://auricle.dyndns.org/ALE/), DAVID HILVERT'S anti-lamenessing engine for the real die-hard command-line users aligns, filters, and renders images. * Hugin (http://hugin.sourceforge.net/) is a GUI that aligns and stitches images. It comes with several command line tools, like `nona' to stitch panorama images, `align_image_stack' to align overlapping images for HDR or create focus stacks, and `fulla' to correct lens errors. * PanoTools (http://panotools.sourceforge.net/) the successor of HELMUT DERSCH'S original PanoTools (http://www.all-in-one.ee/~dersch/) offers a set of command-line driven applications to create panoramas. Most notable are `PTOptimizer' and `PTmender'. *Image Manipulation* * CinePaint (http://www.cinepaint.org/) is a branch of an early Gimp forked off at version 1.0.4. It sports much less features than the current Gimp, but offers 8 bit, 16 bit and 32 bit color channels, HDR (for example floating-point TIFF, and OpenEXR), and a tightly integrated color management system. * The Gimp (http://www.gimp.org/) is a general purpose image manipulation program. At the time of this writing it is still limited to images with only 8 bits per channel. * ImageMagick (http://www.imagemagick.org/) and its clone GraphicsMagick (http://www.graphicsmagick.org/) are general purpose command-line driven image manipulation programs, for example, `convert', `display', `identify', and `montage'. *High Dynamic Range* * OpenEXR (http://www.openexr.com/) offers libraries and some programs to work with the EXR HDR format. * PFSTools (http://pfstools.sourceforge.net/) create, modify, and tonemap high-dynamic range images. *Libraries* * LibJPEG (http://www.ijg.org/) is a library for handling the JPEG (JFIF) image format. * LibPNG (http://www.libpng.org/pub/png/libpng.html) is a library that handles the Portable Network Graphics (PNG) image format. * LibTIFF (http://www.remotesensing.org/libtiff/) offers a library and utility programs to manipulate the ubiquitous Tagged Image File Format, TIFF. The nifty `tiffinfo' command quickly inquires the properties of TIFF files. *Meta-Data Handling* * EXIFTool (http://www.sno.phy.queensu.ca/~phil/exiftool/) reads and writes EXIF meta data. In particular it copies meta data from one image to another. * LittleCMS (http://www.littlecms.com/) is the color management library used by Hugin, DCRaw, UFRaw, Enblend, and Enfuse. It supplies some binaries, too. `tifficc', an ICC color profile applier, is of particular interest.  File: enfuse.info, Node: Bug Reports, Next: Authors, Prev: Helpful Programs, Up: Top Appendix A Bug Reports ********************** Most of this appendix was taken from the Octave (http://www.gnu.org/software/octave/) documentation. Bug reports play an important role in making Enblend and Enfuse reliable and enjoyable. When you encounter a problem, the first thing to do is to see if it is already known. To this end visit the package's LaunchPad (https://launchpad.net/) bug database (https://bugs.launchpad.net/enblend). Search it for your particular problem. If it is not known, please report it. In order for a bug report to serve its purpose, you must include the information that makes it possible to fix the bug. A.1 Have You Really Found a Bug? ================================ If you are not sure whether you have found a bug, here are some guidelines: * If Enblend or Enfuse get a fatal signal, for any options or input images, that is a bug. * If Enblend or Enfuse produce incorrect results, for any input whatever, that is a bug. * If Enblend or Enfuse produce an error message for valid input, that is a bug. * If Enblend or Enfuse do not produce an error message for invalid input, that is a bug. A.2 How to Report Bugs ====================== The fundamental principle of reporting bugs usefully is this: report all the facts. If you are not sure whether to state a fact or leave it out, state it. Often people omit facts because they think they know what causes the problem and they conclude that some details do not matter. Play it safe and give a specific, complete example. Keep in mind that the purpose of a bug report is to enable someone to fix the bug if it is not known. Always write your bug reports on the assumption that the bug is not known. Try to make your bug report self-contained. If we have to ask you for more information, it is best if you include all the previous information in your response, as well as the information that was missing. To enable someone to investigate the bug, you should include all these things: * The exact version and configuration of Enblend or Enfuse. You can get this by running it with the options `--version' and `--verbose'. * A complete set of input images that will reproduce the bug. Strive for a minimal set of _small_(1) images. * The type of machine you are using, and the operating system name and its version number. * A complete list of any modifications you have made to the source. Be precise about these changes. Show a `diff' for them. * Details of any other deviations from the standard procedure for installing Enblend and Enfuse. * The _exact command line_ you use to call Enblend or Enfuse, which then triggers the bug. Examples: ~/local/bin/enblend -v \ --fine-mask \ --optimizer-weights=3:2 --mask-vectorize=12.5% \ image-1.png image-2.png or: /local/bin/enfuse \ --verbose \ --exposure-weight=0 --saturation-weight=0 --entropy-weight=1 \ --gray-projector=l-star \ --entropy-cutoff=1.667% \ layer-01.ppm layer-02.ppm layer-03.ppm If you call Enblend or Enfuse from within a GUI like, for example, Hugin (http://hugin.sourceforge.net/) or KImageFuser (http://panorama.dyndns.org/index.php?lang=en&subject=KImageFuser&texttag=KImagefuser) by HARRY VAN DER WOLF, copy&paste or write down the command line that launches Enblend or Enfuse. * A description of what behavior you observe that you believe is incorrect. For example, "The application gets a fatal signal," or, "The output image contains black holes." Of course, if the bug is that the application gets a fatal signal, then one cannot miss it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. A.3 Sending Patches for Enblend or Enfuse ========================================= If you would like to write bug fixes or improvements for Enblend or Enfuse, that is very helpful. When you send your changes, please follow these guidelines to avoid causing extra work for us in studying the patches. If you do not follow these guidelines, your information might still be useful, but using it will take extra work. * Send an explanation with your changes of what problem they fix or what improvement they bring about. For a bug fix, just include a copy of the bug report, and explain why the change fixes the bug. * Always include a proper bug report for the problem you think you have fixed. We need to convince ourselves that the change is right before installing it. Even if it is right, we might have trouble judging it if we do not have a way to reproduce the problem. * Include all the comments that are appropriate to help people reading the source in the future understand why this change was needed. * Do not mix together changes made for different reasons. Send them individually. If you make two changes for separate reasons, then we might not want to install them both. We might want to install just one. * Use the version control system to make your diffs. Prefer the unified diff (http://en.wikipedia.org/wiki/Diff#Unified_format) format: `hg diff --unified 4'. * You can increase the probability that your patch gets applied by basing it on a recent revision of the sources. ---------- Footnotes ---------- (1) Images of a size less than 1500x1000 pixels qualify as small.  File: enfuse.info, Node: Authors, Next: FDL, Prev: Bug Reports, Up: Top Appendix B Authors ****************** ANDREW MIHAL () has written Enblend and Enfuse. *Contributors* * PABLO D'ANGELO () added the contrast criteria. * JOE BEDA: Win32 porting up to version 3.2. * KORNEL BENKO, : CMake support for version 4.0. * ROGER GOODMAN: Proofreading of the manuals. * MAX LYONS. * MARK aka mjz: Win32 porting up to version 3.2. * THOMAS MODES, : Win32 porting of version 4.0. * RYAN SLEEVI, : Win32 porting of version 4.0. * CHRISTOPH SPIEL () added the gray projectors, the LoG-based edge detection, an O(n)-algorithm for the calculation of local contrast, entropy weighting, and various other features. * BRENT TOWNSHEND, : HDR support. Thanks to SIMON ANDRIOT and PABLO JOUBERT for suggesting the MERTENS-KAUTZ-VAN REETH technique and the name "Enfuse".  File: enfuse.info, Node: FDL, Next: List of Tables, Prev: Authors, Up: Top Appendix C GNU Free Documentation License ***************************************** Version 1.2, November 2002 Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements." 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. See `http://www.gnu.org/copyleft/'. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation.  File: enfuse.info, Node: List of Tables, Next: List of Figures, Prev: FDL, Up: Top List of Tables ************** * Menu: * Table 1.1: Weighting criteria: Table:weighting-criteria. * Table 3.1: Grammar of response ...: Table:response-file-format. * Table 3.2: Grammar of ...: Table:response-file-syntactic-comment. * Table 3.3: Globbing algorithms: Table:globbing-algorithms. * Table 3.4: Mask template ...: Table:mask-template-characters. * Table 5.1: Default weights: Table:default-weights. * Table 7.1: Suggested ...: Table:cache-size-settings.  File: enfuse.info, Node: List of Figures, Next: Program Index, Prev: List of Tables, Up: Top List of Figures *************** * Menu: * Figure 2.1: Photographic workflow: Figure:photographic-workflow. * Figure 2.2: External masks ...: Figure:external-mask-workflow. * Figure 3.1: Entropy cutoff ...: Figure:entropy-cutoff. * Figure 3.2: Exposure cutoff ...: Figure:exposure-cutoff. * Figure 5.1: Gaussian function: Figure:gaussian. * Figure 5.2: Local analysis window: Figure:local-analysis-window. * Figure 5.3: Laplacian-of-Gaussian: Figure:laplacian-of-gaussian. * Figure 5.4: Entropy function: Figure:entropy. * Figure 8.1: Sharp edge: Figure:sharp-edge. * Figure 8.2: Smooth edge: Figure:smooth-edge. * Figure 8.3: Focus stacking ...: Figure:focus-stacking-decision-tree.  File: enfuse.info, Node: Program Index, Next: Syntactic-Comment Index, Prev: List of Figures, Up: Top Program Index ************* [index] * Menu: * ale: Helpful Programs. (line 20) * align_image_stack (Hugin): Helpful Programs. (line 27) * cinepaint <1>: Helpful Programs. (line 39) * cinepaint: Extended Options. (line 140) * convert (ImageMagick): Helpful Programs. (line 50) * dcraw <1>: Helpful Programs. (line 10) * dcraw: Standard Workflow. (line 9) * display (ImageMagick): Helpful Programs. (line 50) * exiftool: Helpful Programs. (line 78) * exrdisplay (OpenEXR): Helpful Programs. (line 56) * fulla (Hugin): Helpful Programs. (line 27) * gimp <1>: Helpful Programs. (line 46) * gimp <2>: Extended Options. (line 140) * gimp: Standard Workflow. (line 9) * gm (GraphicsMagick): Helpful Programs. (line 50) * hugin <1>: Helpful Programs. (line 24) * hugin <2>: What Images. (line 13) * hugin <3>: Extended Options. (line 120) * hugin: Standard Workflow. (line 9) * identify (ImageMagick) <1>: Helpful Programs. (line 50) * identify (ImageMagick): Understanding Masks. (line 22) * montage (ImageMagick): Helpful Programs. (line 50) * nona (Hugin) <1>: Helpful Programs. (line 27) * nona (Hugin): Extended Options. (line 120) * PanoTools: Standard Workflow. (line 9) * pfshdrcalibrate (PFScalibration): Helpful Programs. (line 59) * pfsin (PFSTools): Helpful Programs. (line 59) * pfsout (PFSTools): Helpful Programs. (line 59) * pfstmo_* (PFStmo): Helpful Programs. (line 59) * pfsview (PFSTools): Helpful Programs. (line 59) * PTmender (PanoTools): Helpful Programs. (line 32) * PTOptimizer (PanoTools): Helpful Programs. (line 32) * tifficc (LittleCMS): Helpful Programs. (line 82) * tiffinfo (libtiff) <1>: Helpful Programs. (line 74) * tiffinfo (libtiff): Understanding Masks. (line 22) * ufraw <1>: Helpful Programs. (line 13) * ufraw: Standard Workflow. (line 9) * ufraw-batch: Helpful Programs. (line 13)  File: enfuse.info, Node: Syntactic-Comment Index, Next: Option Index, Prev: Program Index, Up: Top Syntactic-Comment Index *********************** [index] * Menu: * enblend-response-file: Response Files. (line 106) * enfuse-response-file: Response Files. (line 107) * filename-globbing: Response Files. (line 152) * glob: Response Files. (line 148) * globbing: Response Files. (line 150) * layer-selector: Response Files. (line 204) * response-file: Response Files. (line 105)  File: enfuse.info, Node: Option Index, Next: General Index, Prev: Syntactic-Comment Index, Up: Top Option Index ************ [index] * Menu: * --ciecam: Extended Options. (line 22) * --compression: Common Options. (line 15) * --contrast-edge-scale: Expert Options. (line 11) * --contrast-min-curvature: Expert Options. (line 30) * --contrast-weight: Fusion Options. (line 10) * --contrast-window-size: Expert Options. (line 43) * --depth: Extended Options. (line 36) * --entropy-cutoff: Expert Options. (line 60) * --entropy-weight: Fusion Options. (line 20) * --entropy-window-size: Expert Options. (line 188) * --exposure-cutoff: Expert Options. (line 205) * --exposure-mu: Fusion Options. (line 41) * --exposure-sigma: Fusion Options. (line 52) * --exposure-weight: Fusion Options. (line 30) * --fallback-profile: Extended Options. (line 128) * --gray-projector: Expert Options. (line 383) * --hard-mask <1>: Expert Stacking. (line 22) * --hard-mask <2>: Disabling Averaging. (line 6) * --hard-mask: Expert Options. (line 462) * --help: Common Options. (line 96) * --layer-selector: Common Options. (line 70) * --levels: Common Options. (line 100) * --load-masks: Expert Options. (line 476) * --no-ciecam: Extended Options. (line 160) * --no-parameter: Common Options. (line 154) * --output: Common Options. (line 144) * --saturation-weight: Fusion Options. (line 64) * --save-masks: Expert Options. (line 495) * --soft-mask: Expert Options. (line 527) * --verbose: Common Options. (line 163) * --version: Common Options. (line 198) * --wrap: Common Options. (line 205) * -b <1>: Tuning Memory Usage. (line 6) * -b: Extended Options. (line 10) * -c: Extended Options. (line 22) * -d: Extended Options. (line 36) * -f: Extended Options. (line 116) * -g: Extended Options. (line 136) * -h: Common Options. (line 96) * -l: Common Options. (line 100) * -m <1>: Tuning Memory Usage. (line 6) * -m: Extended Options. (line 148) * -o: Common Options. (line 144) * -V: Common Options. (line 198) * -v: Common Options. (line 163) * -w: Common Options. (line 205)  File: enfuse.info, Node: General Index, Prev: Option Index, Up: Top General Index ************* [index] * Menu: * # (response file comment): Response Files. (line 56) * 360o panoramas: Common Options. (line 205) * @ (response file prefix): Response Files. (line 6) * a.tif: Common Options. (line 146) * active criterion: Single Criterion Fusing. (line 12) * advanced focus stacking: Advanced Focus Stacking. (line 6) * advanced focus stacking, recognizing faint edges: Suppressing Noise or Recognizing Faint Edges. (line 6) * advanced focus stacking, suppressing noise: Suppressing Noise or Recognizing Faint Edges. (line 6) * affine transformation: Standard Workflow. (line 48) * algorithms, globbing: Response Files. (line 146) * alpha channel <1>: Standard Workflow. (line 69) * alpha channel: Overview. (line 65) * alpha channel, associated: Extended Options. (line 136) * anti-value gray projector: Expert Options. (line 393) * aperture, sweet spot: Why Focus Stacks. (line 24) * applications of enfuse: Applications. (line 6) * arithmetic JPEG compression: Common Options. (line 33) * authors, list of: Authors. (line 6) * average gray projector: Expert Options. (line 402) * average, disabling: Disabling Averaging. (line 6) * average, weighted: Weighted Average. (line 6) * basic focus stacking: Basic Focus Stacking. (line 6) * binary mask: Understanding Masks. (line 6) * bits per channel: Extended Options. (line 36) * blending exposures: Exposure Series Misconceptions. (line 9) * bug database, LaunchPad: Bug Reports. (line 12) * bug reports: Bug Reports. (line 6) * Burt-Adelson multiresolution spline: Overview. (line 21) * canvas size: Extended Options. (line 116) * channel width: Extended Options. (line 36) * channel, alpha: Overview. (line 65) * channel-mixer gray projector: Expert Options. (line 408) * CIECAM02 <1>: Color Profiles. (line 13) * CIECAM02: Extended Options. (line 22) * circle-of-confusion: Why Focus Stacks. (line 12) * color appearance model <1>: Color Profiles. (line 13) * color appearance model: Extended Options. (line 22) * color cube, RGB: Color Profiles. (line 13) * color profile <1>: Color Profiles. (line 6) * color profile: Extended Options. (line 25) * color space, sRGB <1>: Color Profiles. (line 24) * color space, sRGB: Extended Options. (line 25) * compression: Common Options. (line 15) * compression, arithmetic JPEG: Common Options. (line 33) * compression, deflate: Common Options. (line 44) * compression, JPEG: Common Options. (line 21) * compression, LZW: Common Options. (line 55) * compression, packbits: Common Options. (line 59) * contrast enhancement, local: Local Contrast Enhancement. (line 6) * contrast weighting using a blend of methods: Blend SDev and LoG. (line 6) * contrast weighting using laplacian-of-gaussian: Laplacian of Gaussian. (line 6) * contrast weighting using standard deviation: Standard Deviation. (line 6) * conversion, raw: Standard Workflow. (line 34) * conversion, RGB'-L*a*b*: Expert Options. (line 446) * conversion, RGB-L*a*b*: Expert Options. (line 424) * criteria, overpowering one another: Single Criterion Fusing. (line 36) * criterion, active: Single Criterion Fusing. (line 12) * D50 white point: Color Profiles. (line 55) * dark frame: Expert Stacking. (line 18) * decision tree, focus stacking: Focus Stacking Decision Tree. (line 6) * default layer selection: Response Files. (line 204) * default output filename: Common Options. (line 146) * default weights: Single Criterion Fusing. (line 24) * deflate compression: Common Options. (line 44) * delimiters, option: Option Delimiters. (line 6) * depth-of-field: Why Focus Stacks. (line 15) * depth-of-focus increase: Focus Stacks. (line 6) * digital blending: Exposure Series Misconceptions. (line 9) * disabling average: Disabling Averaging. (line 6) * double precision float, IEEE754: Extended Options. (line 89) * dynamic range increase <1>: Flash Exposure Series. (line 6) * dynamic range increase: Exposure Series. (line 6) * edge detection, laplacian: Laplacian Edge Detection. (line 6) * entropy: Local Entropy Weighting. (line 12) * entropy, definition: Local Entropy Weighting. (line 8) * estimators: Standard Deviation. (line 60) * expectation value: Standard Deviation. (line 41) * expert focus stacking tips: Expert Stacking. (line 6) * exposure series: Exposure Series. (line 6) * exposure series, common misconceptions: Exposure Series Misconceptions. (line 6) * exposure series, tips for beginners: Exposure Series Tips. (line 6) * fallback profile: Extended Options. (line 128) * filename template: Expert Options. (line 483) * filename, literal: Invocation. (line 10) * flash exposure series: Flash Exposure Series. (line 6) * focus stacking decision tree: Focus Stacking Decision Tree. (line 6) * focus stacking, advanced: Advanced Focus Stacking. (line 6) * focus stacking, basic: Basic Focus Stacking. (line 6) * focus stacks: Focus Stacks. (line 6) * focus stacks, fusing: Local Contrast Based Fusing. (line 6) * focus stacks, preparation: Preparing Focus Stacks. (line 6) * focus stacks, why create them: Why Focus Stacks. (line 6) * format of response file: Response Files. (line 56) * free documentation license (FDL): FDL. (line 6) * fusing, local-contrast-based: Local Contrast Based Fusing. (line 6) * fusing, single criterion: Single Criterion Fusing. (line 6) * general index: General Index. (line 6) * glob(7): Response Files. (line 171) * globbing algorithm literal: Response Files. (line 157) * globbing algorithm none: Response Files. (line 179) * globbing algorithm sh: Response Files. (line 188) * globbing algorithm shell: Response Files. (line 182) * globbing algorithm wildcard: Response Files. (line 157) * globbing algorithms: Response Files. (line 146) * GNU free documentation license: FDL. (line 6) * grammar, response file: Response Files. (line 70) * grammar, syntactic comment: Response Files. (line 138) * gray projector: Expert Options. (line 383) * gray projector, anti-value: Expert Options. (line 393) * gray projector, average: Expert Options. (line 402) * gray projector, channel-mixer: Expert Options. (line 408) * gray projector, l-star: Expert Options. (line 424) * gray projector, lightness: Expert Options. (line 435) * gray projector, luminance: Expert Options. (line 440) * gray projector, pl-star: Expert Options. (line 446) * gray projector, value: Expert Options. (line 457) * half precision float, OpenEXR: Extended Options. (line 105) * helpful programs: Helpful Programs. (line 6) * hot pixels: Expert Stacking. (line 18) * Hugin: Bug Reports. (line 95) * ICC profile <1>: Color Profiles. (line 6) * ICC profile: Extended Options. (line 25) * IEEE754 double precision float: Extended Options. (line 89) * IEEE754 single precision float: Extended Options. (line 79) * image cache: Tuning Memory Usage. (line 9) * image cache, block size: Extended Options. (line 10) * image cache, cache size: Extended Options. (line 148) * image cache, location: Tuning Memory Usage. (line 20) * image, multi-layer: Overview. (line 73) * images, fusable: What Images. (line 6) * index, general: General Index. (line 6) * index, option: Option Index. (line 6) * index, program: Program Index. (line 6) * index, syntactic-comment: Syntactic-Comment Index. (line 6) * input image requirements: Image Requirements. (line 6) * input mask: Understanding Masks. (line 18) * invocation: Invocation. (line 6) * JPEG compression: Common Options. (line 21) * KImageFuser: Bug Reports. (line 95) * l-star gray projector: Expert Options. (line 424) * laplacian edge detection: Laplacian Edge Detection. (line 6) * Laplacian of Gaussian (LoG): Laplacian of Gaussian. (line 6) * Laplacian-of-Gaussian: Expert Options. (line 11) * LaunchPad: Bug Reports. (line 12) * LaunchPad, bug database: Bug Reports. (line 12) * layer selection: Common Options. (line 70) * layer selection, all-layers: Common Options. (line 75) * layer selection, default: Response Files. (line 204) * layer selection, first-layer: Common Options. (line 78) * layer selection, largest-layer: Common Options. (line 82) * layer selection, no layer: Common Options. (line 89) * lens distortion, correction of: Standard Workflow. (line 48) * levels, pyramid: Common Options. (line 100) * LibJPEG: Helpful Programs. (line 63) * LibPNG: Helpful Programs. (line 66) * LibTiff: Helpful Programs. (line 70) * light probe: Exposure Series Misconceptions. (line 28) * lightness gray projector: Expert Options. (line 435) * literal filename: Invocation. (line 10) * local analysis window: Standard Deviation. (line 6) * local contrast enhancement: Local Contrast Enhancement. (line 6) * local contrast problem: Local Contrast Problem. (line 6) * local-contrast-based fusing: Local Contrast Based Fusing. (line 6) * luminance gray projector: Expert Options. (line 440) * LZW compression: Common Options. (line 55) * mask template character, %: Expert Options. (line 532) * mask template character, B: Expert Options. (line 583) * mask template character, b: Expert Options. (line 576) * mask template character, D: Expert Options. (line 573) * mask template character, d: Expert Options. (line 566) * mask template character, E: Expert Options. (line 602) * mask template character, e: Expert Options. (line 596) * mask template character, F: Expert Options. (line 592) * mask template character, f: Expert Options. (line 586) * mask template character, i: Expert Options. (line 535) * mask template character, n: Expert Options. (line 550) * mask template character, P: Expert Options. (line 563) * mask template character, p: Expert Options. (line 555) * mask template characters, table of: Expert Options. (line 604) * mask, binary: Understanding Masks. (line 6) * mask, filename template: Expert Options. (line 483) * mask, input files: Understanding Masks. (line 18) * mask, loading: Expert Options. (line 480) * mask, save: Expert Options. (line 495) * mask, weight: Understanding Masks. (line 6) * masks, understanding: Understanding Masks. (line 6) * memory, tuning usage of: Tuning Memory Usage. (line 6) * Mertens-Kautz-Van Reeth exposure fusion: Overview. (line 6) * mode of operation (SDev, LoG, ...): Scaling and Choice of Mode. (line 6) * multi-directory TIFF: Overview. (line 73) * multi-layer image: Overview. (line 73) * natural sharp-unsharp transition: Expert Stacking. (line 33) * noise reduction: Repetition. (line 6) * Octave: Bug Reports. (line 6) * only save mask: Expert Options. (line 504) * OpenEXR, data format: Extended Options. (line 101) * OpenEXR, half precision float: Extended Options. (line 105) * option delimiters: Option Delimiters. (line 6) * option index: Option Index. (line 6) * options, common: Common Options. (line 6) * options, expert: Expert Options. (line 6) * options, extended: Extended Options. (line 6) * options, fusion: Fusion Options. (line 6) * order, of processing: Response Files. (line 9) * output file compression: Common Options. (line 15) * output filename, default: Common Options. (line 146) * output image, set size of: Extended Options. (line 116) * overpowering criteria: Single Criterion Fusing. (line 36) * overview: Overview. (line 6) * packbits compression: Common Options. (line 59) * parallax error: Standard Workflow. (line 58) * perceptual rendering intent: Color Profiles. (line 53) * photometric alignment: Standard Workflow. (line 50) * pixels, hot: Expert Stacking. (line 18) * pl-star gray projector: Expert Options. (line 446) * polarization series: Polarization Series. (line 6) * probability function: Standard Deviation. (line 37) * problem reports: Bug Reports. (line 9) * problem, local contrast: Local Contrast Problem. (line 6) * processing order: Response Files. (line 9) * profile, fallback: Extended Options. (line 128) * profile, ICC <1>: Color Profiles. (line 6) * profile, ICC: Extended Options. (line 25) * program index: Program Index. (line 6) * programs, helpful additional: Helpful Programs. (line 6) * pyramid levels: Common Options. (line 100) * raw conversion: Standard Workflow. (line 34) * rendering intent, perceptual: Color Profiles. (line 53) * response file <1>: Response Files. (line 6) * response file: Invocation. (line 10) * response file, comment (#): Response Files. (line 56) * response file, force recognition of: Response Files. (line 100) * response file, format: Response Files. (line 56) * response file, grammar: Response Files. (line 70) * response file, syntactic comment: Response Files. (line 126) * RGB color cube: Color Profiles. (line 13) * RGB'-L*a*b* conversion: Expert Options. (line 446) * RGB-L*a*b* conversion: Expert Options. (line 424) * saturation enhancement: Polarization Series. (line 6) * save mask: Expert Options. (line 495) * save mask, only: Expert Options. (line 504) * scaling of parameters: Scaling and Choice of Mode. (line 6) * sensor, use of clean: Expert Stacking. (line 9) * series, exposure: Exposure Series. (line 6) * series, flash exposure: Flash Exposure Series. (line 6) * series, polarization: Polarization Series. (line 6) * series, simple: Repetition. (line 6) * simple series: Repetition. (line 6) * single criterion fusing: Single Criterion Fusing. (line 6) * single precision float, IEEE754: Extended Options. (line 79) * size, canvas: Extended Options. (line 116) * SourceForge: Overview. (line 79) * sRGB color space <1>: Color Profiles. (line 24) * sRGB color space: Extended Options. (line 25) * standard deviation: Standard Deviation. (line 49) * statistical moments: Standard Deviation. (line 37) * subtraction of dark frame: Expert Stacking. (line 18) * sweet spot aperture: Why Focus Stacks. (line 24) * syntactic comment, grammar: Response Files. (line 138) * syntactic comment, response file: Response Files. (line 126) * syntactic-comment index: Syntactic-Comment Index. (line 6) * TIFF, multi-directory: Overview. (line 73) * tiffcopy: Overview. (line 73) * tiffsplit: Overview. (line 73) * tips, focus stacking experts: Expert Stacking. (line 6) * TMPDIR: Tuning Memory Usage. (line 20) * transformation, affine: Standard Workflow. (line 48) * transition, natural sharp-unsharp: Expert Stacking. (line 33) * understanding masks: Understanding Masks. (line 6) * value gray projector: Expert Options. (line 457) * variance: Standard Deviation. (line 45) * virtual reality: Common Options. (line 215) * weight mask: Understanding Masks. (line 6) * weight, entropy: Fusion Options. (line 20) * weight, exposure: Fusion Options. (line 30) * weight, local contrast: Fusion Options. (line 10) * weighted average: Weighted Average. (line 6) * weighting functions: Weighting Functions. (line 6) * weighting, contrast using a blend of methods: Blend SDev and LoG. (line 6) * weighting, contrast using laplacian-of-gaussian: Laplacian of Gaussian. (line 6) * weighting, contrast using standard deviation: Standard Deviation. (line 6) * weighting, exposure <1>: Exposure Weighting. (line 6) * weighting, exposure: Overview. (line 30) * weighting, general concept of: Weighting Pixels. (line 6) * weighting, local contrast <1>: Local Contrast Weighting. (line 6) * weighting, local contrast: Overview. (line 39) * weighting, local entropy <1>: Local Entropy Weighting. (line 6) * weighting, local entropy: Overview. (line 44) * weighting, saturation <1>: Saturation Weighting. (line 6) * weighting, saturation: Overview. (line 35) * weights, default: Single Criterion Fusing. (line 24) * white point, D50: Color Profiles. (line 55) * window, local-analysis: Standard Deviation. (line 6) * workflow: Workflow. (line 6) * workflow with Enblend: Standard Workflow. (line 9) * workflow with Enfuse: Standard Workflow. (line 9) * workflow, external mask manipulation: External Mask Manipulation. (line 6) * workflow, external masks: External Mask Manipulation. (line 33) * workflow, standard: Standard Workflow. (line 6) * wrap around: Common Options. (line 205)  Tag Table: Node: Top879 Node: Overview4940 Ref: Table:weighting-criteria6133 Ref: Overview-Footnote-18705 Ref: Overview-Footnote-28874 Ref: Overview-Footnote-39055 Ref: Overview-Footnote-49237 Node: Workflow9379 Node: Standard Workflow9809 Ref: Figure:photographic-workflow10068 Node: External Mask Manipulation12742 Ref: Figure:external-mask-workflow14058 Node: Invocation14543 Node: Image Requirements15388 Node: Response Files16524 Ref: Table:response-file-format18547 Ref: Table:response-file-syntactic-comment21012 Ref: Table:globbing-algorithms21913 Node: Common Options23372 Ref: Common Options-Footnote-132400 Ref: Common Options-Footnote-232592 Node: Extended Options32751 Ref: Extended Options-Footnote-138741 Node: Fusion Options38814 Node: Expert Options40816 Ref: Figure:entropy-cutoff43842 Ref: Figure:exposure-cutoff60548 Ref: Table:mask-template-characters80375 Node: Option Delimiters82591 Node: Color Profiles83975 Node: Weighting Functions86411 Node: Weighting Pixels87079 Node: Weighted Average88668 Node: Disabling Averaging89261 Node: Single Criterion Fusing90249 Ref: Table:default-weights90987 Node: Exposure Weighting91772 Ref: Figure:gaussian93208 Node: Saturation Weighting106165 Node: Local Contrast Weighting107280 Node: Standard Deviation108642 Ref: Figure:local-analysis-window109091 Ref: Standard Deviation-Footnote-1111159 Node: Laplacian of Gaussian111310 Ref: Figure:laplacian-of-gaussian112884 Node: Blend SDev and LoG126175 Node: Scaling and Choice of Mode127855 Node: Local Entropy Weighting128701 Ref: Figure:entropy129684 Node: Understanding Masks143489 Node: Tuning Memory Usage147286 Ref: Table:cache-size-settings150023 Node: Applications150459 Node: What Images151183 Node: Repetition154370 Node: Exposure Series155453 Node: Exposure Series Tips157835 Node: Exposure Series Misconceptions158947 Ref: Exposure Series Misconceptions-Footnote-1160728 Node: Flash Exposure Series160941 Node: Polarization Series161183 Node: Focus Stacks161623 Node: Why Focus Stacks162505 Node: Preparing Focus Stacks163840 Node: Local Contrast Based Fusing164590 Node: Basic Focus Stacking165925 Node: Advanced Focus Stacking167298 Node: Local Contrast Problem168062 Ref: Figure:sharp-edge169246 Ref: Figure:smooth-edge176295 Node: Laplacian Edge Detection184572 Node: Local Contrast Enhancement185706 Node: Suppressing Noise or Recognizing Faint Edges186682 Node: Focus Stacking Decision Tree189313 Ref: Figure:focus-stacking-decision-tree189658 Node: Expert Stacking190442 Node: Helpful Programs191965 Node: Bug Reports195693 Ref: Bug Reports-Footnote-1201347 Node: Authors201417 Node: FDL202581 Node: List of Tables223562 Node: List of Figures224182 Node: Program Index225053 Node: Syntactic-Comment Index227987 Node: Option Index228675 Node: General Index232188  End Tag Table enblend-enfuse-4.1.2+dfsg/doc/workflow.texi0000644000175100017510000000634212070530113021070 0ustar ametzlerametzler@ref{Figure:photographic-workflow} shows where Enblend and Enfuse sit in the tool chain of the standard workflow. @float Figure,Figure:photographic-workflow @vimage{photographic-workflow} @caption{Photographic workflow with Enblend and Enfuse.} @shortcaption{Photographic workflow} @cindex workflow with Enblend @cindex workflow with Enfuse @pindex dcraw @pindex ufraw @pindex hugin @pindex PanoTools @pindex gimp @end float @table @asis @dbtitle{Photographic Workflow} @item Take Images Take @emph{multiple} images to form a panorama, an exposure series, a focus stack, etc. There is one exception with Enfuse when a single raw image is converted multiple times to get several -- typically differently ``exposed'' -- images. @noindent @emph{Exemplary Benefits} @itemize @item Many pictures taken from the same vantage point but showing different viewing directions. -- Panorama @item Pictures of the same subject exposed with different shutter speeds. -- Exposure series @item Images of the same subject focussed at differing distances. -- Focus stack @end itemize @noindent @emph{Remaining Problem:} The ``overlayed'' images may not fit together, that is the overlay regions may not match exactly. @item Convert Images @cindex raw conversion @cindex conversion, raw Convert the @uref{http://@/www.luminous-@/landscape.com/@/tutorials/@/understanding-@/series/@/u-@/raw-@/files.shtml, raw data} exploiting the full dynamic range of the camera and capitalize on a high-quality conversion. @item Align Images Align the images so as to make them match as well as possible. Again there is one exception and this is when images naturally align. For example, a series of images taken from a rock solid tripod with a cable release without touching the camera, or images taken with a shift lens, can align without further user intervention. @cindex affine transformation @cindex transformation, affine This step submits the images to affine transformations. @cindex lens distortion, correction of If necessary, it rectifies the lens' distortions (e.g.@: barrel or pincushion), too. @cindex photometric alignment Sometimes even luminance or color differences between pairs of overlaying images are corrected (``photometric alignment''). @noindent @emph{Benefit:} The overlay areas of images match as closely as possible given the quality if the input images and the lens model used in the transformation. @noindent @emph{Remaining Problem:} @cindex parallax error The images may still not align perfectly, for example, because of @uref{http://@/en.wikipedia.org/@/wiki/@/Parallax, parallax} errors, or blur produced by camera shake. @item Combine Images Enblend and Enfuse combine the aligned images into one. @noindent @emph{Benefit:} The overlay areas become imperceptible for all but the most mal-aligned images. @noindent @emph{Remaining Problem:} @cindex alpha channel Enblend and Enfuse write images with an alpha channel. (For more information on alpha channels see @ref{Understanding Masks}.) Furthermore, the final image rarely is rectangular. @item Postprocess Postprocess the combined image with your favorite tool. Often the user will want to crop the image and simultaneously throw away the alpha channel. @end table @noindent View @noindent Print @noindent Enjoy enblend-enfuse-4.1.2+dfsg/doc/config.gp0000644000175100017510000000053012070530113020111 0ustar ametzlerametzler# Gnuplot configuration # ASCII size is given in characters. Dumb_Width = 131 Dumb_Height = 98 # SVG size is given in pixels. For SVG the size, of course, is only a # suggestion. Svg_Width = 720 Svg_Height = 540 # PDF size is given in inches. Pdf_Width = 5 Pdf_Height = 3.75 # PNG size is given in pixels. Png_Width = 720 Png_Height = 540 enblend-enfuse-4.1.2+dfsg/doc/external-mask-workflow.fig0000644000175100017510000000561512070530113023437 0ustar ametzlerametzler#FIG 3.2 Produced by xfig version 3.2.5 Portrait Center Metric A4 100.00 Single -2 # ---BEGIN-TEXT--- # o # | # _______V________ # / \ # | Generate Masks | <-- Enblend, Enfuse --save-masks # \________________/ # | # _______V________ # / \ # | Modify Masks | <-- Any tool # \________________/ # | # _______V________ # / \ # | Blend or Fuse | # | Using Masks | <-- Enblend, Enfuse --load-masks # \________________/ # | # O # ---END-TEXT--- 1200 2 0 32 #ffff66 6 1485 3735 1845 4095 1 3 0 1 0 7 50 -1 0 0.000 1 0.0000 1665 3915 90 90 1665 3915 1755 3915 1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 1665 3915 158 158 1665 3915 1823 3915 -6 1 3 0 1 0 7 50 -1 0 0.000 1 0.0000 1665 990 90 90 1665 990 1755 990 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1665 1080 1665 1395 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1665 2520 1665 2835 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1665 1800 1665 2115 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 3240 1597 2430 1597 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 3240 2317 2340 2317 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 3240 1350 3240 1800 5895 1800 5895 1511 5682 1350 3240 1350 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 3240 2070 3240 2520 4500 2520 4500 2231 4287 2070 3240 2070 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 4275 2070 4275 2231 4488 2231 4275 2070 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 5670 1350 5670 1511 5883 1511 5670 1350 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 2430 1395 2430 1800 900 1800 900 1395 2430 1395 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 2340 2115 2340 2520 990 2520 990 2115 2340 2115 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 2385 2835 2385 3465 945 3465 945 2835 2385 2835 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 3240 3172 2385 3172 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 3240 2925 3240 3375 5850 3375 5850 3086 5637 2925 3240 2925 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 5625 2925 5625 3086 5838 3086 5625 2925 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 1665 3465 1665 3780 4 0 0 50 -1 16 11 0.0000 4 180 705 3330 2369 Any tool\001 4 0 0 50 -1 16 11 0.0000 4 165 2580 3330 1642 Enblend, Enfuse --save-masks\001 4 1 0 50 -1 16 11 0.0000 4 135 1365 1665 1642 Generate Masks\001 4 1 0 50 -1 16 11 0.0000 4 180 1170 1665 2362 Modify Masks\001 4 1 0 50 -1 16 11 0.0000 4 135 1185 1665 3082 Blend or Fuse\001 4 1 0 50 -1 16 11 0.0000 4 180 1065 1665 3330 Using Masks\001 4 0 0 50 -1 16 11 0.0000 4 165 2535 3330 3217 Enblend, Enfuse --load-masks\001 enblend-enfuse-4.1.2+dfsg/doc/filespec.texi0000644000175100017510000002212112070530113021001 0ustar ametzlerametzler@cindex @samp{@@} (response file prefix) A response file contains names of images or other response filenames. Introduce response file names with an at-character (@samp{@@}). @cindex processing order @cindex order, of processing Enblend and Enfuse process the list @var{INPUT} strictly from left to right, expanding response files in depth-first order. (Multi-layer files are processed from first layer to the last.) The following examples only show Enblend, but Enfuse works exactly the same. @table @asis @dbtitle{Response File Examples} @item Solely image filenames. Example: @example enblend image-1.tif image-2.tif image-3.tif @end example The ultimate order in which the images are processed is: @file{image-@/1.tif}, @file{image-@/2.tif}, @file{image-@/3.tif}. @item Single response file. Example: @example enblend @@list @end example where file@tie{}@file{list} contains @example img1.exr img2.exr img3.exr img4.exr @end example Ultimate order: @file{img1.exr}, @file{img2.exr}, @file{img3.exr}, @file{img4.exr}. @item Mixed literal names and response files. Example: @example enblend @@master.list image-09.png image-10.png @end example where file@tie{}@file{master.list} comprises of @example image-01.png @@first.list image-04.png @@second.list image-08.png @end example @file{first.list} is @example image-02.png image-03.png @end example and @file{second.list} contains @example image-05.png image-06.png image-07.png @end example Ultimate order: @file{image-@/01.png}, @file{image-@/02.png}, @file{image-@/03.png}, @file{image-@/04.png}, @file{image-@/05.png}, @file{image-@/06.png}, @file{image-@/07.png}, @file{image-@/08.png}, @file{image-@/09.png}, @file{image-@/10.png}, @end table @c @menu @c * Response File Format:: Definition of the files' format @c * Syntactic Comments:: Control interpretation of response files @c * Globbing Algorithms:: Various ways to glob filenames @c @end menu @c @node Response File Format @subsection Response File Format @cindex response file, format @cindex format of response file @cindex @samp{#} (response file comment) @cindex response file, comment (@samp{#}) Response files contain one filename per line. Blank lines or lines beginning with a sharp sign (@samp{#}) are ignored; the latter can serve as comments. Filenames that begin with an at-character (@samp{@@}) denote other response files. @ref{Table:response-file-format} states a formal grammar of response files in @uref{http://@/en.wikipedia.org/@/wiki/@/Ebnf, @acronym{EBNF}}. @float Table,Table:response-file-format @multitable {@var{response-file}} {::=} {abcdefghijklmnopqrstuvwxyzabcdefghijklm} @item @var{response-file} @tab ::= @tab @var{line}* @item @var{line} @tab ::= @tab (@var{comment} | @var{file-spec}) [@samp{\r}] @samp{\n} @item @var{comment} @tab ::= @tab @var{space}* @samp{#} @var{text} @item @var{file-spec} @tab ::= @tab @var{space}* @samp{@@} @var{filename} @var{space}* @item @var{space} @tab ::= @tab @samp{ } | @samp{\t} @end multitable @noindent where @var{text} is an arbitrary string and @var{filename} is any filename. @caption{@acronym{EBNF} definition of the grammar of response files.} @shortcaption{Grammar of response files} @cindex response file, grammar @cindex grammar, response file @end float In a response file relative filenames are used relative the response file itself, not relative to the current-working directory of the application. @noindent The above grammar might unpleasantly surprise the user in the some ways. @table @asis @dbtitle{Response File Grammar} @item Whitespace trimmed at both line ends For convenience, whitespace at the beginning and at the end of each line is ignored. However, this implies that response files cannot represent filenames that start or end with whitespace, as there is no quoting syntax. Filenames with embedded whitespace cause no problems, though. @item Only whole-line comments Comments in response files always occupy a complete line. There are no ``line-ending comments''. Thus, in @example # exposure series img-0.33ev.tif # "middle" EV img-1.33ev.tif img+0.67ev.tif @end example only the first line contains a comment, whereas the second line includes none. Rather, it refers to a file called @w{@samp{img-@/0.33ev.tif # "middle" EV}}. @item Image filenames cannot start with @samp{@@} An at-sign invariably introduces a response file, even if the filename's extension hints towards an image. @end table @cindex response file, force recognition of If Enblend or Enfuse do not recognize a response file, they will skip the file and issue a warning. To force a file being recognized as a response file add one of the following syntactic comments to the @emph{first} line of the file. @example @group @scindex response-file response-file: true @scindex enblend-response-file enblend-response-file: true @scindex enfuse-response-file enfuse-response-file: true @end group @end example @noindent Finally, here is an example of a valid response file. @example @group # 4\pi panorama! # These pictures were taken with the panorama head. @@round-shots.list # Freehand sky shot. zenith.tif # "Legs, will you go away?" images. nadir-2.tif nadir-5.tif nadir.tif @end group @end example @c @node Syntactic Comments @subsection Syntactic Comments @cindex response file, syntactic comment @cindex syntactic comment, response file Comments that follow the format described in @ref{Table:response-file-syntactic-comment} are treated as instructions how to interpret the rest of the response file. A syntactic comment is effective immediately and its effect persists to the end of the response file, unless another syntactic comment undoes it. @float Table,Table:response-file-syntactic-comment @multitable {@var{syntactic-comment}} {::=} {abcdefghijklmnopqrstuvwxyzabcdefghijklm} @item @var{syntactic-comment} @tab ::= @tab @var{space}* @samp{#} @var{space}* @var{key} @var{space}* @samp{:} @var{space}* @var{value} @item @var{key} @tab ::= @tab (@samp{A} .. @samp{Z} | @samp{a} .. @samp{z} | @samp{-})+ @end multitable @noindent where @var{value} is an arbitrary string. @caption{@acronym{EBNF} definition of the grammar of syntactic comments in response files.} @shortcaption{Grammar of syntactic comments} @cindex syntactic comment, grammar @cindex grammar, syntactic comment @end float Unknown syntactic comments are silently ignored. @c @node Globbing Algorithms @subsection Globbing Algorithms @cindex globbing algorithms @cindex algorithms, globbing The three equivalent syntactic keys @itemize @item @scindex glob @code{glob}, @item @scindex globbing @code{globbing}, or @item @scindex filename-globbing @code{filename-globbing} @end itemize control the algorithm that Enblend or Enfuse use to glob filenames in response files. @cindex globbing algorithm @samp{literal} @cindex globbing algorithm @samp{wildcard} All versions of Enblend and Enfuse support at least two algorithms: @code{literal}, which is the default, and @code{wildcard}. See @ref{Table:globbing-algorithms} for a list of all possible globbing algorithms. To find out about the algorithms in your version of Enblend or Enfuse team up the options@tie{}@option{--version} and @option{--verbose}. @float Table,Table:globbing-algorithms @table @code @dbtitle{Globbing Algorithms} @item literal @cindex globbing algorithm @samp{literal} Do not glob. Interpret all filenames in response files as literals. This is the default. Please keep in mind that whitespace at both ends of a line in a response file @emph{always} gets discarded. @item wildcard @cindex globbing algorithm @samp{wildcard} @cindex glob(7) Glob using the wildcard characters@tie{}@samp{?}, @samp{*}, @samp{[}, and @samp{]}. The @acronym{W*N32} implementation only globs the filename part of a path, whereas all other implementations perform wildcard expansion in @emph{all} path components. Also see @uref{http://www.kernel.org/@/doc/@/man-pages/@/online/@/pages/@/man7/@/glob.7.html, glob(7)}. @item none @cindex globbing algorithm @samp{none} Alias for @code{literal}. @item shell @cindex globbing algorithm @samp{shell} The @code{shell} globbing algorithm works as @code{literal} does. In addition, it interprets the wildcard characters@tie{}@samp{@{}, @samp{@}}, and @samp{~}. This makes the expansion process behave more like common @acronym{UN*X} shells. @item sh @cindex globbing algorithm @samp{sh} Alias for @code{shell}. @end table @caption{Globbing algorithms for the use in response files} @shortcaption{Globbing algorithms} @cindex globbing algorithms @cindex algorithms, globbing @end float Example: @example @group # Horizontal panorama # 15 images # filename-globbing: wildcard image_000[0-9].tif image_001[0-4].tif @end group @end example @c @node Default Layer Selection @subsection Default Layer Selection @cindex default layer selection @cindex layer selection, default The key @code{layer-selector} @scindex layer-selector provides the same functionality as does the command-line option@tie{}@option{--layer-selector}, but on a per response-file basis. @xref{Common Options}. This syntactic comment affects the layer selection of all images listed after it including those in included response files until another @code{layer-selector} overrides it. enblend-enfuse-4.1.2+dfsg/doc/enfuse.texi0000644000175100017510000054643312107440552020525 0ustar ametzlerametzler\input auxmac \input texinfo @c @c Header @c @c %**start of header @setfilename enfuse.info @include versenfuse.texi @settitle Fusing Multiple Images with Enfuse @value{VERSION} @include auxmac.texi @include varsenfuse.texi @include config-h.texi @set default-image-cache-cachesize 1024@dmn{MB} @set default-image-cache-blocksize 2048@dmn{KB} @c Define a new index for syntactic comments. @defcodeindex sc @c Define a new index for options. @defcodeindex op @c %**end of header @c @c Categorization for the GNU Info System @c @dircategory Individual utilities @direntry * enfuse: (enfuse). Fuse images using a multiresolution spline. @end direntry @c @c Summary Description and Copyright @c @copying This manual is for Enfuse (version @value{VERSION}, @value{UPDATED}), a program to merge different exposures of the same scene to produce an image that looks much like a tonemapped image. Copyright @copyright{} 2004--2012 @sc{Andrew Mihal}. @quotation Permission is granted to copy, distribute and/or modify this document under the terms of the @acronym{GNU} Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. A copy of the license is included in the section entitled ``@acronym{GNU} Free Documentation License''. @end quotation @end copying @c @c Title Page and Copyright @c @titlepage @title Enfuse @subtitle Fusing Multiple Images @subtitle with Enfuse version @value{VERSION}, @value{UPDATED} @author Andrew Mihal @page @vskip 0pt plus 1fill @insertcopying @end titlepage @ifnothtml @summarycontents @end ifnothtml @contents @c For the TeX output the List-of-Tables and List-of-Figures appear @c right after the Table-of-Contents. In all other formats they go @c right before the indices. @iftex @c Adjust page number so that we get roman numerals for the @c List-of-Tables and List-of-Figures. This screws up Texinfo's page @c count so that we must undo it later. @tex \global\pageno=-4 @end tex @unnumbered List of Tables @listoffloats Table @unnumbered List of Figures @listoffloats Figure @end iftex @c @c ``Top'' Node and Master Menu @c @ifnottex @node Top @top Enfuse This manual is for Enfuse (version@tie{}@value{VERSION}, @value{UPDATED}), a program to merge different exposures of the same scene to produce an image that looks much like a tonemapped image. @end ifnottex @menu * Overview:: Overview of Enfuse's features * Workflow:: Enfuse's role in combining images * Invocation:: Command line options and arguments * Color Profiles:: How Enblend handles @acronym{ICC} color profiles * Weighting Functions:: Description of all weighting functions * Understanding Masks:: How to interpret masks and mask files * Tuning Memory Usage:: Balancing @acronym{RAM} and swap * Applications:: Possible applications of Enfuse * Helpful Programs:: Useful other programs * Bug Reports:: How to write bug reports * Authors:: Major contributors * FDL:: @acronym{GNU} Free Documentation License @ifnotdocbook * List of Tables:: List of all tables * List of Figures:: List of all figures * Program Index:: Names of programs referenced * Syntactic-Comment Index:: Keys of syntactic comments * Option Index:: Index of all options * General Index:: Topic index @end ifnotdocbook @detailmenu --- The Detailed Node Listing --- Overview Workflow * Standard Workflow:: The usual, all-in-one thing * External Mask Manipulation:: Fiddling around with the masks yourself Invocation * Common Options:: General options * Extended Options:: Memory control and others * Fusion Options:: Image fusion control * Expert Options:: Local contrast and local entropy selection configuration * Option Delimiters:: How to separate options' arguments Color Profiles Weighting Functions * Weighting Pixels:: General concept of weighting pixels * Exposure Weighting:: Weighting by exposure * Saturation Weighting:: Weighting by saturation * Local Contrast Weighting:: Weighting by local contrast * Local Entropy Weighting:: Weighting by local entropy Weighting Algorithms * Weighted Average:: Enfuse's default weighting algorithm * Disabling Averaging:: ``Super Trouper'' weighting for focus stacks Local Contrast Weighting * Standard Deviation:: Standard deviation (@acronym{SDev}) in a square of pixels * Laplacian of Gaussian:: @acronym{LoG}, a second derivative method * Blend SDev and LoG:: Mix both methods * Scaling and Choice of Mode:: How parameters do not scale; neither does mode Understanding Masks Tuning Memory Usage Applications * What Images:: What makes images fusable? * Repetition:: Just taking the same shot multiple times * Exposure Series:: Varying the exposure time * Flash Exposure Series:: Varying the flash output * Polarization Series:: Changing the polarizer angle * Focus Stacks:: Stacking images with different in-focus distance Exposure Series * Exposure Series Tips:: Some hints for beginners * Exposure Series Misconceptions:: What works despite the hype Focus Stacks * Why Focus Stacks:: Why take the hassle? * Preparing Focus Stacks:: How to get suitable input images * Local Contrast Based Fusing:: Fundamental command line options * Basic Focus Stacking:: Simple, standard deviation method * Advanced Focus Stacking:: Advanced, Laplacian technique * Expert Stacking:: Tips for focus stacking experts Advanced Focus Stacking * Local Contrast Problem:: What is the problem Kenneth? * Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges * Local Contrast Enhancement:: Boosting local contrast before weighting * Suppressing Noise or Recognizing Faint Edges:: The best of both worlds * Focus Stacking Decision Tree:: What to do and how to fuse Helpful Programs Bug Reports Authors FDL @end detailmenu @end menu @c @c Document Body @c @node Overview @chapter Overview @c Undo the roman page numbering we used for the Table-of-Contents, @c the List-of-Tables, and the List-of-Figures. @tex \global\pageno=1 @end tex @cindex overview @cindex Mertens-Kautz-Van Reeth exposure fusion Enfuse merges overlapping images using the @sc{Mertens}-@sc{Kautz}-@sc{Van Reeth} exposure fusion algorithm.@footnote{Tom Mertens, Jan Kautz, and Frank van Reeth, ``Exposure Fusion'', Proceedings of the 15th Pacific Conference on Computer Graphics and Applications, pages 382--390.} This is a quick way for example to blend differently exposed images into a nice output image, without producing intermediate high-dynamic range (@acronym{HDR}) images that are then tonemapped to a viewable image. This simplified process often works much better than tonemapping algorithms. Enfuse can also be used to build extended depth-of-field (@acronym{DOF}) images by blending a focus stack. The idea is that pixels in the input images are weighted according to qualities such as, for example, proper exposure, good local contrast, or high saturation. These weights determine how much a given pixel will contribute to the final image. @cindex Burt-Adelson multiresolution spline A @sc{Burt}-@sc{Adelson} multiresolution spline blender@footnote{Peter J. Burt and Edward H. Adelson, ``A Multiresolution Spline With Application to Image Mosaics'', @acronym{ACM} Transactions on Graphics, @abbr{Vol@.} 2, @abbr{No@.} 4, October 1983, pages 217--236.} is used to combine the images according to the weights. The multiresolution blending ensures that transitions between regions where different images contribute are difficult to spot. Enfuse uses up to four criteria to judge the quality of a pixel, which @ref{Table:weighting-criteria} briefly describes. @float Table,Table:weighting-criteria @table @asis @dbtitle{Weighting Criteria} @item Exposure @cindex weighting, exposure The exposure criteria favors pixels with luminance close to the middle of the range. These pixels are considered better exposed than those with high or low luminance levels. @item Saturation @cindex weighting, saturation The saturation criteria favors highly-saturated pixels. (Note that saturation is only defined for color pixels.) @item Local Contrast @cindex weighting, local contrast The contrast criteria favors pixels inside a high-contrast neighborhood. Enfuse can use standard deviation, Laplacian magnitude, or a blend of both as local contrast measure. @item Local Entropy @cindex weighting, local entropy The entropy criteria prefers pixels inside a high-entropy neighborhood. In addition, Enfuse allows the user to mitigate the problem of noisy images when using entropy weighting by setting a black threshold. @end table @caption{Enfuse's four weighting criteria. (Also see @ref{Table:default-weights} for the default weights of these criteria.)} @shortcaption{Weighting criteria} @end float For the concept of pixel weighting, and details on the different weighting functions, see @ref{Weighting Functions}. Adjust how much importance is given to each criterion by setting the weight parameters on the command line. For example, if you set @samp{--exposure-weight=1.0} and @samp{--saturation-weight=0.5}, Enfuse will favor well-exposed pixels over highly-saturated pixels when blending the source images. The effect of these parameters on the final result will not always be clear in advance. The quality of the result is subject to your artistic interpretation. Playing with the weights may or may not give a more pleasing result. The authors encourage you to experiment, perhaps using down-sized@footnote{Downsampling with a good interpolator reduces noise, which might not desired to judge the image quality of the original-size image. Cropping might be an alternative, though.} or cropped images for speed. @cindex alpha channel @cindex channel, alpha Enfuse expects but does not require each input image to have an alpha channel. By setting the alpha values of pixels to zero, users can manually remove those pixels from consideration when blending. If an input image lacks an alpha channel, Enfuse will issue a warning and continue assuming all pixels should contribute to the final output. Any alpha value other than zero is interpreted as ``this pixel should contribute to the final image''. @cindex multi-layer image @cindex image, multi-layer @cindex multi-directory @acronym{TIFF} @cindex @acronym{TIFF}, multi-directory @cindex @command{tiffcopy} @cindex @command{tiffsplit} Enfuse reads all layers of multi-layer images, like, for example, multi-directory @acronym{TIFF} images@footnote{Use utilities like, e.g., @command{tiffcopy} and @command{tiffsplit} of LibTIFF to manipulate multi-directory @acronym{TIFF} images. @xref{Helpful Programs}.}. The input images are processed in the order they appear on the command line. Multi-layer images are processed from the first layer to the last before Enfuse considers the next image on the command line. @cindex SourceForge Find out more about Enfuse on its @uref{http://@/sourceforge.net/, SourceForge} @uref{http://@/enblend.sourceforge.net/, web page}. @node Workflow @chapter Workflow @cindex workflow Enfuse is a part of a chain of tools to assemble images. It merges photos of the same subject at the same location and same direction, but taken with varying exposure parameters. @menu * Standard Workflow:: The usual, all-in-one thing * External Mask Manipulation:: Fiddling around with the masks yourself @end menu @node Standard Workflow @section Standard Workflow @cindex workflow, standard @include workflow.texi @node External Mask Manipulation @section External Mask Manipulation @cindex workflow, external mask manipulation @include external-masks.texi @node Invocation @chapter Invocation @cindex invocation @command{enfuse} [@var{OPTIONS}] [@code{--output=}@var{IMAGE}] @var{INPUT}@enddots{} @noindent Fuse the sequence of images @var{INPUT}@dots{} into a single @var{IMAGE}. @cindex literal filename @cindex filename, literal @cindex response file Input images are either specified literally or via so-called response files (see below). The latter are an alternative to specifying image filenames on the command line. @menu * Image Requirements:: Input image requirements * Response Files:: Files listing the images' names * Common Options:: General options * Extended Options:: Memory control and others * Fusion Options:: Image fusion control * Expert Options:: Local contrast and local entropy selection configuration * Option Delimiters:: How to separate options' arguments @end menu @node Image Requirements @section Image Requirements @cindex input image requirements All input images must comply with the following requirements. @itemize @item The images overlap. @item The images agree on their number of bits-per-channel, this is, their ``depth'': @itemize -- @item @code{UINT8}, @item @code{UINT16}, @item @code{FLOAT}, @item etc. @end itemize See option@tie{}@option{--depth} below for an explanation of different (output) depths. @item Enfuse understands the images' filename extensions as well as their file formats. You can check the supported extensions and formats by calling Enfuse with the option pair @option{--version@tie{}--verbose} and scan the output for @samp{Supported image formats} or @samp{Supported file extensions}. @end itemize Moreover, there are some ``good practices'', which are not enforced by the application, but almost certainly deliver superior results. @itemize @item Either all files lack an @acronym{ICC} profile, or all images are supplied with the @emph{same} @acronym{ICC} profile. @item If the images' meta-data contains resolution information (``@acronym{DPI}''), it is the same for all pictures. @end itemize @node Response Files @section Response Files @cindex response file @include filespec.texi @node Common Options @section Common Options @cindex options, common Common options control some overall features of Enfuse. Enfuse accepts arguments to any option in uppercase as well as in lowercase letters. For example, @samp{deflate}, @samp{Deflate} and @samp{DEFLATE} as arguments to the @code{--compression} option described below, all instruct Enfuse to use the @sc{Deflate} compression scheme. This manual denotes all arguments in lowercase for consistency. @table @code @item --compression=@var{COMPRESSION} @opindex --compression @cindex output file compression @cindex compression Write a compressed output file. Depending on the output file format, Enfuse accepts different values for @var{COMPRESSION}. @table @asis @item @acronym{JPEG} format. @cindex @acronym{JPEG} compression @cindex compression, @acronym{JPEG} The compression either is a literal integer or a keyword-option combination. @table @code @item @var{LEVEL} Set @acronym{JPEG} quality@tie{}@var{LEVEL}, where @var{LEVEL} is an integer that ranges from 0--100. @item jpeg[:@var{LEVEL}] Same as above; without the optional argument just switch on (standard) @acronym{JPEG} compression. @item jpeg-arith[:@var{LEVEL}] @cindex arithmetic @acronym{JPEG} compression @cindex compression, arithmetic @acronym{JPEG} Switch on arithmetic @acronym{JPEG} compression. With optional argument set the arithmetic compression@tie{}@var{LEVEL}, where @var{LEVEL} is an integer that ranges from 0--100. @end table @item @acronym{TIF} format. Here, @var{COMPRESSION} is one of the keywords: @table @code @item none Do not compress. This is the default. @item deflate @cindex deflate compression @cindex compression, deflate Use the @sc{Deflate} compression scheme also called @acronym{ZIP}-in-@acronym{TIFF}. @sc{Deflate} is a lossless data compression algorithm that uses a combination of the @acronym{LZ77} algorithm and @sc{Huffman} coding. @item jpeg[:@var{LEVEL}] @cindex compression, @acronym{JPEG} Use @acronym{JPEG} compression. With optional argument set the compression@tie{}@var{LEVEL}, where @var{LEVEL} is an integer that ranges from 0--100. @item lzw @cindex @acronym{LZW} compression @cindex compression, @acronym{LZW} Use @sc{Lempel}-@sc{Ziv}-@sc{Welch} (@acronym{LZW}) adaptive compression scheme. @acronym{LZW} compression is lossless. @item packbits @cindex packbits compression @cindex compression, packbits Use @sc{PackBits} compression scheme. @sc{PackBits} is a particular variant of run-length compression; it is lossless. @end table @item Any other format. Other formats do not accept a @var{COMPRESSION} setting. However, @uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/, @acronym{VIGRA}} automatically compresses @file{png}-files with the @sc{Deflate} method. @end table @item --layer-selector=@var{ALGORITHM} @opindex --layer-selector @cindex layer selection @cindex layer selection Override the standard layer selector algorithm, which is @samp{@value{src::layer-selector}}. This version of Enfuse offers the following algorithms: @table @code @item all-layers @cindex layer selection, all-layers Select all layers in all images. @item first-layer @cindex layer selection, first-layer Select only first layer in each multi-layer image. For single-layer images this is the same as @samp{all-layers}. @item largest-layer @cindex layer selection, largest-layer Select largest layer in each multi-layer image, where the ``largeness'', this is the size is defined by the product of the layer width and its height. The channel width of the layer is ignored. For single-layer images this is the same as @samp{all-layers}. @item no-layer @cindex layer selection, no layer Do not select any layer in any image. This algorithm is useful to temporarily exclude some images in response files. @end table @item -h @itemx --help @opindex -h @opindex --help Print information on the available options and exit. @item -l @var{LEVELS} @itemx --levels=@var{LEVELS} @opindex -l @opindex --levels @cindex pyramid levels @cindex levels, pyramid Use at most this many @var{LEVELS} for pyramid @footnote{As Dr.@tie{}Daniel Jackson correctly @uref{http://stargate.wikia.com/@/wiki/@/The_@/Tomb, noted}, actually, it is not a pyramid: ``Ziggaurat, it's a @uref{http://en.wikipedia.org/@/wiki/@/Ziggaurat, Ziggaurat}.''} blending if @var{LEVELS} is positive, or reduce the maximum number of levels used by @minus{}@var{LEVELS} if @var{LEVELS} is negative; @samp{auto} or @samp{automatic} restore the default, which is to use the maximum possible number of levels for each overlapping region. The number of levels used in a pyramid controls the balance between local and global image features (contrast, saturation, @dots{}) in the blended region. Fewer levels emphasize local features and suppress global ones. The more levels a pyramid has, the more global features will be taken into account. As a guideline, remember that each new level works on a linear scale twice as large as the previous one. So, the zeroth layer, the original image, obviously defines the image at single-pixel scale, the first level works at two-pixel scale, and generally, the @math{n}-th level contains image data at @power{2, n}-pixel scale. This is the reason why an image of @math{width}@classictimes{}@/@math{height}@dmn{pixels} cannot be deconstructed into a pyramid of more than @ifinfo @display @math{floor(log_2(min(width, height)))} @end display @end ifinfo @html log 2 ( min width height ) @end html @tex $\lfloor \log_2(\min(\mathit{width}, \mathit{height})) \rfloor$ @end tex @docbook 2 width height   @end docbook levels. If too few levels are used, ``halos'' around regions of strong local feature variation can show up. On the other hand, if too many levels are used, the image might contain too much global features. Usually, the latter is not a problem, but is highly desired. This is the reason, why the default is to use as many levels as is possible given the size of the overlap regions. Enfuse may still use a smaller number of levels if the geometry of the overlap region demands. Positive values of @var{LEVELS} limit the maximum number of pyramid levels. Depending on the size and geometry of the overlap regions this may or may not influence any pyramid. Negative values of @var{LEVELS} reduce the number of pyramid levels below the maximum no matter what the actual maximum is and thus always influence all pyramids. Use @samp{auto} or @samp{automatic} as @var{LEVELS} to restore the automatic calculation of the maximum number of levels. The valid range of the absolute value of @var{LEVELS} is @value{src::minimum-pyramid-levels} to @value{src::maximum-pyramid-levels}. @item -o @itemx --output=@var{FILE} @opindex -o @opindex --output Place output in @var{FILE}. @cindex @file{@value{src::default-output-filename}} @cindex default output filename @cindex output filename, default If @option{--output} is not specified, the default is to put the resulting image in @file{@value{src::default-output-filename}}. @item --parameter=@var{KEY}[=@var{VALUE}]:@dots{} Set a @var{KEY}-@var{VALUE} pair, where @var{VALUE} is optional. This option is cumulative. Separate multiple pairs with the usual numeric delimiters. This option has the negated form @option{--no-parameter}, @opindex --no-parameter which takes one or more @var{KEY}s and removes them from the list of defined parameters. The special key@tie{}@samp{*} deletes all parameters at once. Parameters allow the developers to change the internal workings of Enfuse without the need to recompile. @item -v @itemx --verbose[=@var{LEVEL}] @opindex -v @opindex --verbose Without an argument, increase the verbosity of progress reporting. Giving more @option{--verbose}@tie{}options will make Enfuse more verbose. Directly set a verbosity level with a non-negative integral @var{LEVEL}. Each level includes all messages of the lower levels. @table @asis @item Level Messages @item 0 only warnings and errors @item 1 reading and writing of images @item 2 mask generation, pyramid, and blending @item 3 reading of response files, color conversions @item 4 image sizes, bounding boxes and intersection sizes @item 5 detailed information on the optimizer runs (Enblend only) @item 6 estimations of required memory in selected processing steps @end table The default verbosity level of Enfuse is @value{src::default-verbosity-level}. @item -V @itemx --version @opindex -V @opindex --version Output information on the Enfuse version. Team this option with @option{--verbose} to show configuration details, like the extra features that have been compiled in. @item -w @itemx --wrap=@var{MODE} @opindex -w @opindex --wrap @cindex 360@textdegree{} panoramas @cindex wrap around Blend around the boundaries of the panorama. As this option significantly increases memory usage and computation time only use it, if the panorama will be @itemize @item consulted for any kind measurement, this is, all boundaries must match as accurately as possible, or @item printed out and the boundaries glued together, or @item @cindex virtual reality fed into a virtual reality (@abbr{VR}) generator, which creates a seamless environment. @end itemize Otherwise, always avoid this option! With this option, Enfuse treats the panorama of width@tie{}@math{w} and height@tie{}@math{h} as an infinite data structure, where each pixel@tie{}@math{P(x, y)} of the input images represents the set of pixels @ifinfo @math{S_P(x, y)} @end ifinfo @html S P x y @end html @tex $S_P(x, y)$ @end tex @docbook S P x y @end docbook @footnote{Solid-state physicists will be reminded of the @uref{http://@/en.wikipedia.org/@/wiki/@/Born-@/von_@/Karman_@/boundary_@/condition, @sc{Born}-@sc{von@tie{}K@'arm@'an} boundary condition}.}. @var{MODE} takes the following values: @table @samp @item none @itemx open This is a ``no-op''; it has the same effect as not giving @option{--wrap} at all. The set of input images is considered open at its boundaries. @item horizontal Wrap around horizontally: @ifinfo @display @math{S_P(x, y) = @{P(x + m * w, y): m in Z@}.} @end display @end ifinfo @html S P x y = { P x + m w y : m   in   Z } . @end html @tex $$ S_P(x, y) = \{P(x + m w, y): m \in Z\}. $$ @end tex @docbook S P x y P x m w y m Z @end docbook This is useful for 360@textdegree{} horizontal panoramas as it eliminates the left and right borders. @item vertical Wrap around vertically: @ifinfo @display @math{S_P(x, y) = @{P(x, y + n * h): m in Z@}.} @end display @end ifinfo @html S P x y = { P x y + n h : n   in   Z } . @end html @tex $$ S_P(x, y) = \{P(x, y + n h): n \in Z\}. $$ @end tex This is useful for 360@textdegree{} vertical panoramas, as it eliminates the top and bottom borders. @item both @itemx horizontal+vertical @itemx vertical+horizontal Wrap around both horizontally and vertically: @ifinfo @display @math{S_P(x, y) = @{P(x + m * w, y + n * h): m, n in Z@}.} @end display @end ifinfo @html S P x y = { P x + m w y + n h : m , n   in   Z } . @end html @tex $$ S_P(x, y) = \{P(x + m w, y + n h): m, n \in Z\}. $$ @end tex @docbook S P x y P x m w y n h n Z m Z @end docbook In this mode, both left and right borders, as well as top and bottom borders, are eliminated. @end table Specifying @option{--wrap} without @var{MODE} selects horizontal wrapping. @end table @node Extended Options @section Extended Options @cindex options, extended Extended options control the image cache, the color model, and the cropping of the output image. @table @code @item -b @var{BLOCKSIZE} @opindex -b @cindex image cache, block size Set the @var{BLOCKSIZE} in kilobytes (@acronym{KB}) of Enfuse's image cache. This is the amount of data that Enfuse will move to and from the disk at one time. The default is @value{default-image-cache-blocksize}, which should be ok for most systems. See @ref{Tuning Memory Usage} for details. Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with @code{enfuse --version --verbose}. @item -c @itemx --ciecam @opindex -c @opindex --ciecam @cindex color appearance model @cindex @acronym{CIECAM02} Force the use of the @acronym{CIECAM02} color appearance model for blending colors instead of blending inside the @acronym{RGB} color cube. @cindex color profile @cindex @acronym{ICC} profile @cindex profile, @acronym{ICC} @cindex @acronym{sRGB} color space @cindex color space, @acronym{sRGB} All input files should have identical @acronym{ICC} profiles when this option is specified. If no @acronym{ICC} profile is present, Enfuse assumes that all images use the @acronym{sRGB} color space. @xref{Color Profiles}. Please keep in mind that using @acronym{CIECAM02} blending may change the colors in the output image. This option can be negated; see option@tie{}@option{--no-ciecam} below. @item -d @itemx --depth=@var{DEPTH} @opindex -d @opindex --depth @cindex bits per channel @cindex channel width Force the number of bits per channel and the numeric format of the output image. Enfuse always uses a smart way to change the channel depth, to assure highest image quality (at the expense of memory), whether requantization is implicit because of the output format or explicit with option@tie{}@option{--depth}. @itemize @item If the output-channel width is larger than the input-channel width of the input images, the input images' channels are widened to the output channel width immediately after loading, that is, as soon as possible. Enfuse then performs all blending operations at the output-channel width, thereby preserving minute color details which can appear in the blending areas. @item If the output-channel width is smaller than the input-channel width of the input images, the output image's channels are narrowed only right before it is written to disk, that is, as late as possible. Thus the data benefits from the wider input channels for the longest time. @end itemize All @var{DEPTH} specifications are valid in lowercase as well as uppercase letters. For integer format, use @table @asis @item @code{8}, @code{uint8} Unsigned 8@dmn{bit}; range: 0..255 @item @code{int16} Signed 16@dmn{bit}; range: @minus{}32768..32767 @item @code{16}, @code{uint16} Unsigned 16@dmn{bit}; range: 0..65535 @item @code{int32} Signed 32@dmn{bit}; range: @minus{}2147483648..2147483647 @item @code{32}, @code{uint32} Unsigned 32@dmn{bit}; range: 0..4294967295 @end table For floating-point format, use @c Minimum positive normalized value: 2^(2 - 2^k) @c Epsilon: 2^(1 - n) @c Maximum finite value: (1 - 2^(-n)) * 2^(2^k) @table @asis @c IEEE single: 32 bits, n = 24, k = 32 - n - 1 = 7 @item @code{r32}, @code{real32}, @code{float} @cindex @acronym{IEEE754} single precision float @cindex single precision float, @acronym{IEEE754} @acronym{IEEE754} single precision floating-point, 32@dmn{bit} wide, 24@dmn{bit} significant @itemize @item Minimum normalized value: @semilog{1.2, -38} @item Epsilon: @semilog{1.2, -7} @item Maximum finite value: @semilog{3.4, 38} @end itemize @c IEEE double: 64 bits, n = 53, k = 64 - n - 1 = 10 @item @code{r64}, @code{real64}, @code{double} @cindex @acronym{IEEE754} double precision float @cindex double precision float, @acronym{IEEE754} @acronym{IEEE754} double precision floating-point, 64@dmn{bit} wide, 53@dmn{bit} significant @itemize @item Minimum normalized value: @semilog{2.2, -308} @item Epsilon: @semilog{2.2, -16} @item Maximum finite value: @semilog{1.8, 308} @end itemize @end table If the requested @var{DEPTH} is not supported by the output file format, Enfuse warns and chooses the @var{DEPTH} that matches best. @cindex @acronym{OpenEXR}, data format The @acronym{OpenEXR} data format is treated as @acronym{IEEE754}@tie{}float internally. Externally, on disk, @acronym{OpenEXR} data is represented by ``half'' precision floating-point numbers. @c ILM half: 16 bits, n = 10, k = 16 - n - 1 = 5 @cindex @acronym{OpenEXR}, half precision float @cindex half precision float, @acronym{OpenEXR} @uref{http://@/www.openexr.com/@/about.html#@/features, @acronym{OpenEXR}} half precision floating-point, 16@dmn{bit} wide, 10@dmn{bit} significant @itemize @item Minimum normalized value: @semilog{9.3, -10} @item Epsilon: @semilog{2.0, -3} @item Maximum finite value: @semilog{4.3, 9} @end itemize @item -f @var{WIDTH}x@var{HEIGHT} @itemx -f @var{WIDTH}x@var{HEIGHT}+x@var{XOFFSET}+y@var{YOFFSET} @opindex -f @cindex output image, set size of @cindex canvas size @cindex size, canvas Ensure that the minimum ``canvas'' size of the output image is at least @var{WIDTH}@classictimes{}@/@var{HEIGHT}. Optionally specify the @var{XOFFSET} and @var{YOFFSET}, too. @pindex nona @r{(Hugin)} @pindex hugin This option only is useful when the input images are cropped @acronym{TIFF} files, such as those produced by @command{nona}@footnote{The stitcher @command{nona} is part of Hugin. @xref{Helpful Programs}.}. Note that option@tie{}@option{-f} neither rescales the output image, nor shrinks the canvas size below the minimum size occupied by the union of all input images. @item --fallback-profile=@var{PROFILE-FILENAME} @opindex --fallback-profile @cindex profile, fallback @cindex fallback profile @cindex @acronym{CIECAM02} Use the @acronym{ICC} profile in @var{PROFILE-FILENAME} instead of the default @acronym{sRGB}. See option@tie{}@option{--ciecam} and @ref{Color Profiles}. This option only is effective if the input images come without color profiles and blending is performed in @acronym{CIECAM02} color appearance model. @item -g @opindex -g @cindex alpha channel, associated Save alpha channel as ``associated''. See the @uref{http://@/www.awaresystems.be/@/imaging/@/tiff/@/tifftags/@/extrasamples.html, @acronym{TIFF} documentation} for an explanation. @pindex gimp @pindex cinepaint Gimp (before version@tie{}2.0) and CinePaint (@pxref{Helpful Programs}) exhibit unusual behavior when loading images with unassociated alpha channels. Use option @option{-g} to work around this problem. With this flag Enfuse will create the output image with the associated alpha tag set, even though the image is really unassociated alpha. @item -m @var{CACHESIZE} @opindex -m @cindex image cache, cache size Set the @var{CACHESIZE} in megabytes (@acronym{MB}) of Enfuse's image cache. This is the amount of memory Enfuse will use for storing image data before swapping to disk. The default is @value{default-image-cache-cachesize}, which is good for systems with 3--4@dmn{gigabytes} (@acronym{GB}) of @acronym{RAM}. See @ref{Tuning Memory Usage} for details. Note that Enfuse must have been compiled with the image-cache feature for this option to be effective. Find out about extra features with @code{enfuse --version --verbose}. @item --no-ciecam @opindex --no-ciecam @cindex color appearance model @cindex @acronym{CIECAM02} Disable the use of the @acronym{CIECAM02} color appearance model for blending colors. See option@tie{}@option{--ciecam} for details. Also see @ref{Color Profiles}. @end table @node Fusion Options @section Fusion Options @cindex options, fusion Fusion options define the proportion to which each input image's pixel contributes to the output image. @table @code @item --contrast-weight=@var{WEIGHT} @opindex --contrast-weight @cindex weight, local contrast Sets the relative @var{WEIGHT} of high local-contrast pixels. Valid range: @value{src::minimum-weight-contrast} @leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-contrast}. Default: @value{src::default-weight-contrast}. See @ref{Local Contrast Weighting} and @ref{Expert Options, Option contrast-window-size}. @item --entropy-weight=@var{WEIGHT} @opindex --entropy-weight @cindex weight, entropy Sets the relative @var{WEIGHT} of high local entropy pixels. Valid range: @value{src::minimum-weight-entropy} @leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-entropy}. Default: @value{src::default-weight-entropy}. See @ref{Local Entropy Weighting} and @ref{Expert Options, Options entropy-window-size and entropy-cutoff}. @item --exposure-weight=@var{WEIGHT} @opindex --exposure-weight @cindex weight, exposure Sets the relative @var{WEIGHT} of the well-exposedness criterion. Increasing this weight relative to the others will make well-exposed pixels contribute more to the final output. Valid range: @value{src::minimum-weight-exposure} @leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-exposure}. Default: @value{src::default-weight-exposure}. @xref{Exposure Weighting}. @item --exposure-mu=@var{MEAN} @opindex --exposure-mu Set the @var{MEAN} (this is, the center) of the Gaussian exposure weight curve. Valid range: @value{src::minimum-exposure-mu} @leq{} @var{MEAN} @leq{} @value{src::maximum-exposure-mu}. Default: @value{src::default-exposure-mu}. Use this option to fine-tune exposure weighting (@pxref{Exposure Weighting}). @item --exposure-sigma=@var{STD-DEV} @opindex --exposure-sigma Standard deviation @var{STD-DEV} of the Gaussian exposure weight curve. Low numbers give less weight to pixels that are far from @option{--wMu} and vice versa. Valid range: @var{STD-DEV} @geq{} @value{src::minimum-exposure-sigma}. Default: @value{src::default-exposure-sigma}. Use this option to fine-tune exposure weighting (@pxref{Exposure Weighting}). @item --saturation-weight=@var{WEIGHT} @opindex --saturation-weight Sets the relative @var{WEIGHT} of high-saturation pixels. Increasing this weight makes pixels with high saturation contribute more to the final output. Valid range: @value{src::minimum-weight-saturation} @leq{} @var{WEIGHT} @leq{} @value{src::maximum-weight-saturation}. Default: @value{src::default-weight-saturation}. Saturation weighting is only defined for color images. @xref{Saturation Weighting}. @end table @node Expert Options @section Expert Options @cindex options, expert Expert options influence the workings of Enfuse that require the user to read the manual before applying them successfully. @table @code @item --contrast-edge-scale=@var{EDGE-SCALE} @itemx --contrast-edge-scale=@var{EDGE-SCALE}:@var{LCE-SCALE}:@var{LCE-FACTOR} @opindex --contrast-edge-scale @cindex Laplacian-of-Gaussian A non-zero value for @var{EDGE-SCALE} switches on the Laplacian-of-Gaussian (@acronym{LoG}) edge detection algorithm. @var{EDGE-SCALE} is the radius of the Gaussian used in the search for edges. Default: @value{src::default-edge-scale}@dmn{pixels}. A positive @var{LCE-SCALE} turns on local contrast enhancement (@acronym{LCE}) before the @acronym{LoG} edge detection. @var{LCE-SCALE} is the radius of the Gaussian used in the enhancement step, @var{LCE-FACTOR} is the weight factor (``strength''). @var{enhanced} = (1 + @var{LCE-FACTOR}) @classictimes{} @var{original} @minus{} @var{LCE-FACTOR} @classictimes{} Gaussian@/Smooth(@var{original}, @var{LCE-SCALE}). @var{LCE-SCALE} defaults to @value{src::default-lce-scale} pixels and @var{LCE-FACTOR} defaults to @value{src::default-lce-factor}. Append @samp{%} to @var{LCE-SCALE} to specify the radius as a percentage of @var{EDGE-SCALE}. Append @samp{%} to @var{LCE-FACTOR} to specify the weight as a percentage. @item --contrast-min-curvature=@var{CURVATURE} @opindex --contrast-min-curvature Define the minimum @var{CURVATURE} for the @acronym{LoG} edge detection. Default: @value{src::default-minimum-curvature}. Append a @samp{%} to specify the minimum curvature relative to maximum pixel value in the source image (for example 255 or 65535). A positive value makes Enfuse use the local contrast data (controlled with @option{--contrast-window-size}) for curvatures less than @var{CURVATURE} and @acronym{LoG} data for values above it. A negative value truncates all curvatures less than @minus{}@var{CURVATURE} to zero. Values above @var{CURVATURE} are left unchanged. This effectively suppresses weak edges. @item --contrast-window-size=@var{SIZE} @opindex --contrast-window-size Set the window @var{SIZE} for local contrast analysis. The window will be a square of @var{SIZE}@classictimes{}@/@var{SIZE} pixels. If given an even @var{SIZE}, Enfuse will automatically use the next odd number. For contrast analysis @var{SIZE} values larger than 5 might result in a blurry composite image. Values of 3 and 5 have given good results on focus stacks. Valid range: @var{SIZE} @geq{} @value{src::minimum-contrast-window-size}. Default: @value{src::default-contrast-window-size}@dmn{pixels}. See also @ref{Fusion Options, Option --contrast-weight} and @option{--hard-mask} below. @item --entropy-cutoff=@var{LOWER-CUTOFF} @itemx --entropy-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF} @opindex --entropy-cutoff The first form defines the lower cutoff value below which pixels are treated as pure black when calculating the local entropy. The second form also defines the upper cutoff value above which pixels are treated as pure white. For color images @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF} are applied separately and independently to each channel. Defaults: @value{src::default-entropy-lower-cutoff} for @var{LOWER-CUTOFF} and @value{src::default-entropy-upper-cutoff} for @var{UPPER-CUTOFF}, that is, all pixels' values are taken into account. Append a @samp{%} to specify the cutoff relative to maximum pixel value in the source image (for example 255 or 65535). @ref{Figure:entropy-cutoff} shows an example. @float Figure,Figure:entropy-cutoff @vimage{entropy-cutoff} @caption{Linear lightness@tie{}@var{Y} in comparison with an entropy-cutoff function for @var{LOWER-CUTOFF} = 5% and @var{UPPER-CUTOFF} = 90%, which are rather extreme values. Please note that we have shifted the original lightness curve up and the cut-off curve down by a very small @var{Offset} to emphasize that the proportional part of @var{Y} remains unaltered under the cut-off operation.} @shortcaption{Entropy cutoff function} @end float Note that a high @var{LOWER-CUTOFF} value lightens the resulting image, as dark (and presumably noisy) pixels are averaged with @emph{equal} weights. With @samp{--entropy-cutoff=0}, the default, on the other hand, ``noise'' might be interpreted as high entropy and the noisy pixels get a high weight, which in turn renders the resulting image darker. Analogously, a low @var{UPPER-CUTOFF} darkens the output image. @item --entropy-window-size=@var{SIZE} @opindex --entropy-window-size Window @var{SIZE} for local entropy analysis. The window will be a square of @var{SIZE}@classictimes{}@/@var{SIZE} pixels. In the entropy calculation @var{SIZE} values of 3 to 7 yield an acceptable compromise of the locality of the information and the significance of the local entropy value itself. Valid range: @var{SIZE} @geq{} @value{src::minimum-entropy-window-size}. Default: @value{src::default-entropy-window-size}@dmn{pixels}. If given an even @var{SIZE} Enfuse will automatically use the next odd number. @item --exposure-cutoff=@var{LOWER-CUTOFF} @itemx --exposure-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF} @itemx --exposure-cutoff=@var{LOWER-CUTOFF}:@var{UPPER-CUTOFF}:@var{LOWER-PROJECTOR}:@var{UPPER-PROJECTOR} @opindex --exposure-cutoff The first form sets the weight for all pixels below the lower cutoff to zero. The second form sets the lower cutoff and the upper cutoff at the same time. For color images the values of @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF} refer to the gray-scale projection as selected with the option @option{--gray-projector}. The impact of this option is similar, but not identical to transforming @emph{all} input images with @uref{http://@/www.imagemagick.org/, ImageMagick's} @command{convert} (@pxref{Helpful Programs}) prior to fusing with the following commands. @example @group # First form convert IMAGE \ \( +clone -threshold LOWER-CUTOFF \) \ -compose copy_opacity -composite \ MASKED-IMAGE @end group @group # Second form convert IMAGE \ \( \ \( IMAGE -threshold LOWER-CUTOFF \) \ \( IMAGE -threshold UPPER-CUTOFF -negate \) \ -compose multiply -composite \ \) \ -compose copy_opacity -composite \ MASKED-IMAGE @end group @end example (Transforming some or all input images as shown in the above examples gives the user more flexibility because the thresholds can be chosen for each image individually.) The third form specifies projection operators as in option@tie{}@option{--gray-projector} for the @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF} thresholds. This option can be helpful if the user wants to exclude underexposed or overexposed pixels from the fusing process in @emph{all} of the input images. The values of @var{LOWER-CUTOFF} and @var{UPPER-CUTOFF} as well as the gray-scale projector determine which pixels are considered ``underexposed'' or ``overexposed''. As any change of the exposure-weight curve this option changes the brightness of the resulting image: increasing @var{LOWER-CUTOFF} lightens the final image and lowering @var{UPPER-CUTOFF} darkens it. Defaults: @value{src::default-exposure-lower-cutoff} for @var{LOWER-CUTOFF} and @value{src::default-exposure-upper-cutoff} for @var{UPPER-CUTOFF}, that is, all pixels' values are weighted according to the ``uncut'' exposure-weight curve. Append a @samp{%} to specify the cutoff relative to the maximum pixel value in the source image (for example 255 or 65535). @ref{Figure:exposure-cutoff} shows an example. The gray-scale projectors @var{LOWER-PROJECTOR} and @var{UPPER-PROJECTOR} default to @samp{@value{src::default-exposure-lower-cutoff-projector}} and @samp{@value{src::default-exposure-upper-cutoff-projector}}, which are usually the best choices for effective cutoff operations on the respective ends. @float Figure,Figure:exposure-cutoff @vimage{exposure-cutoff} @caption{Exposure weight, a Gaussian with @var{Mu} = 0.5 and @var{Sigma} = 0.2 submitted to an exposure-cutoff of @var{LOWER-CUTOFF} = 5% and @var{UPPER-CUTOFF} = 97%.} @shortcaption{Exposure cutoff function} @end float Note that the application of the respective cutoffs is completely independent of the actual shape of the exposure weight function. If a set of images stubbornly refuses to ``react'' to this option, look at their histograms to verify the cutoff actually falls into populated ranges of the histograms. In the absence of an image manipulation program like @uref{http://@/www.gimp.org/, The Gimp}, @uref{http://@/www.imagemagick.org/, ImageMagick} (@pxref{Helpful Programs}) can be used to generate @uref{http://@/www.imagemagick.org/@/Usage/@/files/@/#histogram, histograms}, like, for example, @example @group convert -define histogram:unique-colors=false \ IMAGE histogram:- | \ display @end group @end example @item --gray-projector=@var{PROJECTOR} @opindex --gray-projector @cindex gray projector Use gray projector@tie{}@var{PROJECTOR} for conversion of @acronym{RGB} images to grayscale: @ifinfo @math{(R, G, B) --> Y.} @end ifinfo @html R G B Y . @end html @tex $(R, G, B) \rightarrow Y.$ @end tex @docbook R G B Y @end docbook In version@tie{}@value{VERSION} of Enfuse, the option is effective for exposure weighting and local contrast weighting. Default: @samp{average}. Valid values for @var{PROJECTOR} are: @table @code @item anti-value @cindex gray projector, @samp{anti-value} @cindex @samp{anti-value} gray projector Do the opposite of the @samp{value} projector: take the minimum of all color channels. @ifinfo @display @math{Y = min(R, G, B)} @end display @end ifinfo @html Y = min R G B @end html @tex $$ Y = \min(R, G, B) $$ @end tex @docbook Y R G B @end docbook This projector can be useful when exposure weighing while employing a lower cutoff (see option@tie{}@option{--exposure-cutoff}) to reduce the noise in the fused image. @item average @cindex gray projector, @samp{average} @cindex @samp{average} gray projector Average red, green, and blue channel with equal weights. This is the default, and it often is a good projector for @math{gamma = 1} data. @ifinfo @display @math{Y = (R + G + B) / 3} @end display @end ifinfo @html Y = R + G + B 3 @end html @tex $$ Y = {R + G + B \over 3} $$ @end tex @docbook Y R G B 3 @end docbook @item channel-mixer:@var{RED-WEIGHT}:@var{GREEN-WEIGHT}:@var{BLUE-WEIGHT} @cindex gray projector, @samp{channel-mixer} @cindex @samp{channel-mixer} gray projector Weight the channels as given. @ifinfo @display @math{Y = RED-WEIGHT * R + GREEN-WEIGHT * G + BLUE-WEIGHT * B} @end display @end ifinfo @html Y = RED-WEIGHT × R + GREEN-WEIGHT × G + BLUE-WEIGHT × B @end html @tex $$ \eqalign{Y \quad = \quad & \mathit{RED-WEIGHT} \times R \; + \cr & \mathit{GREEN-WEIGHT} \times G \; + \cr & \mathit{BLUE-WEIGHT} \times B \cr} $$ @end tex @docbook Y RED-WEIGHT R GREEN-WEIGHT G BLUE-WEIGHT B @end docbook The weights are automatically normalized to one, so @example --gray-projector=channel-mixer:0.25:0.5:0.25 --gray-projector=channel-mixer:1:2:1 --gray-projector=channel-mixer:25:50:25 @end example all define the same mixer configuration. The three weights @var{RED-WEIGHT}, @var{GREEN-WEIGHT}, and @var{BLUE-WEIGHT} define the relative weight of the respective color channel. The sum of all weights is normalized to one. @item l-star @cindex gray projector, @samp{l-star} @cindex @samp{l-star} gray projector @cindex RGB-L*a*b* conversion @cindex conversion, RGB-L*a*b* Use the L-channel of the L*a*b*-conversion of the image as its grayscale representation. This is a useful projector for gamma = 1 data. It reveals minute contrast variations even in the shadows and the highlights. This projector is computationally expensive. Compare with @samp{pl-star}, which is intended for gamma-corrected images. See @uref{http://@/en.wikipedia.org/@/wiki/@/Lab_@/color_@/space, Wikipedia} for a detailed description of the @acronym{Lab}@tie{}color space. @item lightness @cindex gray projector, @samp{lightness} @cindex @samp{lightness} gray projector Compute the lightness of each @acronym{RGB} pixel as in an Hue-Saturation-Lightness (@acronym{HSL}) conversion of the image. @ifinfo @display @math{Y = (max(R, G, B) + min(R, G, B)) / 2} @end display @end ifinfo @html Y = max R G B + min R G B 2 @end html @tex $$ Y = {\max(R, G, B) + \min(R, G, B) \over 2} $$ @end tex @docbook Y R G B R G B 2 @end docbook @item luminance @cindex gray projector, @samp{luminance} @cindex @samp{luminance} gray projector Use the weighted average of the @acronym{RGB} pixel's channels as defined by @acronym{CIE} (``Commission Internationale de l'@'Eclairage'') and the @acronym{JPEG} standard. @ifinfo @display @math{Y = 0.30 * R + 0.59 * G + 0.11 * B} @end display @end ifinfo @html Y = 0.30 × R + 0.59 × G + 0.11 × B @end html @tex $$ Y = 0.30 \times R + 0.59 \times G + 0.11 \times B $$ @end tex @docbook Y 0.30 R 0.59 G 0.11 B @end docbook @item pl-star @cindex gray projector, @samp{pl-star} @cindex @samp{pl-star} gray projector @cindex RGB'-L*a*b* conversion @cindex conversion, RGB'-L*a*b* Use the L-channel of the L*a*b*-conversion of the image as its grayscale representation. This is a useful projector for gamma-corrected data. It reveals minute contrast variations even in the shadows and the highlights. This projector is computationally expensive. Compare with @samp{l-star}, which is intended for gamma = 1 images. See @uref{http://@/en.wikipedia.org/@/wiki/@/Lab_@/color_@/space, Wikipedia} for a detailed description of the @acronym{Lab}@tie{}color space. @item value @cindex gray projector, @samp{value} @cindex @samp{value} gray projector Take the Value-channel of the Hue-Saturation-Value (@acronym{HSV}) conversion of the image. @ifinfo @display @math{Y = max(R, G, B)} @end display @end ifinfo @html Y = max R G B @end html @tex $$ Y = \max(R, G, B) $$ @end tex @docbook Y R G B @end docbook @end table @item --hard-mask @opindex --hard-mask Force hard blend masks on the finest scale. This is the opposite flag of @option{--soft-mask}. This blending mode avoids averaging of fine details (only) at the expense of increasing the noise. However it considerably improves the sharpness of focus stacks. Blending with hard masks has only proven useful with focus stacks. See also @ref{Fusion Options, Option --contrast-weight} and @option{--contrast-window-size} above. @item --load-masks @itemx --load-masks=@var{SOFT-MASK-TEMPLATE} @itemx --load-masks=@var{SOFT-MASK-TEMPLATE}:@var{HARD-MASK-TEMPLATE} @opindex --load-masks Load masks from images instead of computing them. The masks have to be a grayscale images. @cindex mask, loading First form: Load all soft-weight masks from files that were previously saved with option@tie{}@option{--save-masks}. If option@tie{}@option{--hard-mask} is effective only load hard masks. The defaults are @file{@value{src::default-soft-mask-template}} and @file{@value{src::default-hard-mask-template}}. @cindex filename template @cindex mask, filename template In the second form, @var{SOFT-MASK-TEMPLATE} defines the names of the soft-mask files. In the third form, @var{HARD-MASK-TEMPLATE} additionally defines the names of the hard-mask files. See option@tie{}@option{--save-masks} below for the description of mask templates. Options@tie{}@option{--load-masks} and @option{--save-masks} are mutually exclusive. @item --save-masks @itemx --save-masks=@var{SOFT-MASK-TEMPLATE} @itemx --save-masks=@var{SOFT-MASK-TEMPLATE}:@var{HARD-MASK-TEMPLATE} @opindex --save-masks @cindex mask, save @cindex save mask Save the generated weight masks to image files. First form: Save all soft-weight masks in files. If option@tie{}@option{--hard-mask} is effective also save the hard masks. The defaults are @file{@value{src::default-soft-mask-template}} and @file{@value{src::default-hard-mask-template}}. @cindex filename template @cindex mask, filename template In the second form, @var{SOFT-MASK-TEMPLATE} defines the names of the soft-mask files. In the third form, @var{HARD-MASK-TEMPLATE} additionally defines the names of the hard-mask files. @cindex save mask, only @cindex only save mask Enfuse will stop after saving all masks unless option@tie{}@option{--output} is given, too. With both options given, this is, @option{--save-masks} and @option{--output}, Enfuse saves all masks and then proceeds to fuse the output image. Both @var{SOFT-MASK-TEMPLATE} and @var{HARD-MASK-TEMPLATE} define templates that are expanded for each mask file. In a template a percent sign (@samp{%}) introduces a variable part. All other characters are copied literally. Lowercase letters refer to the name of the respective input file, whereas uppercase ones refer to the name of the output file (@pxref{Common Options}). @ref{Table:mask-template-characters} lists all variables. A fancy mask filename template could look like this: @example %D/soft-mask-%02n-%f.viff @end example It puts the mask files into the same directory as the output file (@samp{%D}), generates a two-digit index (@samp{%02n}) to keep the mask files nicely sorted, and decorates the mask filename with the name of the associated input file (@samp{%f}) for easy recognition. @item --soft-mask @opindex --soft-mask Consider all masks when fusing. This is the default. @end table @c The extra s fix another stupid Texinfo problem with DocBook. @docbook @end docbook Options@tie{}@option{--save-masks} and @option{--load-masks} are mutually exclusive. @docbook @end docbook @page @include mask-template-characters.texi @node Option Delimiters @section Option Delimiters @cindex option delimiters @cindex delimiters, option Enfuse allows the arguments supplied to the program's options to be separated by different separators. The online documentation and this manual, however, exclusively use the colon @samp{:} in every syntax definition and in all examples. @need 500 @noindent @strong{Numeric Arguments} Valid delimiters are the the semicolon @samp{;}, the colon @samp{:}, and the slash @samp{/}. All delimiters may be mixed within any option that takes numeric arguments. @noindent Examples: @table @samp @item --contrast-edge-scale=0.667:6.67:3.5 Separate all arguments with colons. @item --contrast-edge-scale=0.667;6.67;3.5 Use semi-colons. @item --contrast-edge-scale=0.667;6.67/3.5 Mix semicolon and slash in weird ways. @item --entropy-cutoff=3%/99% All delimiters also work in conjunction with percentages. @item --gray-projector=channel-mixer:3/6/1 Separate arguments with a colon and two slashes. @item --gray-projector=channel-mixer/30;60:10 Go wild and Enfuse will understand. @end table @need 500 @noindent @strong{Filename Arguments} Here, the accepted delimiters are @samp{,}, @samp{;}, and @samp{:}. Again, all delimiters may be mixed within any option that has filename arguments. @noindent Examples: @table @samp @item --save-masks=soft-mask-%03i.tif:hard-mask-03%i.tif Separate all arguments with colons. @item --save-masks=%d/soft-%n.tif,%d/hard-%n.tif Use a comma. @end table @node Color Profiles @chapter Color Profiles @cindex profile, @acronym{ICC} @cindex @acronym{ICC} profile @cindex color profile @include color-profiles.texi @node Weighting Functions @chapter Weighting Functions @cindex weighting functions As has been noted in the Overview (@pxref{Overview}), Enfuse supports four different types of weighting. The following subsections describe the concept of weighting and all weighting functions in detail. @menu * Weighting Pixels:: General concept of weighting pixels * Exposure Weighting:: Weighting by exposure * Saturation Weighting:: Weighting by saturation * Local Contrast Weighting:: Weighting by local contrast * Local Entropy Weighting:: Weighting by local entropy @end menu @node Weighting Pixels @section Weighting Pixels @cindex weighting, general concept of Image fusion maps each pixel@tie{}@math{P(i, x, y)} of every input image @math{i} to a single pixel@tie{}@math{Q(x, y)} in the output image: @ifinfo @display @math{P(i, x, y) --> Q(x, y),} @end display @end ifinfo @html P i x y Q x y , @end html @tex $$ P(i, x, y) \rightarrow Q(x, y), $$ @end tex @docbook P i x y Q x y @end docbook @noindent where @math{x} runs from 1 to the common width of the images, @math{y} from 1 to the common height, and @math{i} from 1 to the number of input images@tie{}@math{n}. @macro equationW{} @ifnotdocbook @ifnottex (W) @end ifnottex @end ifnotdocbook @tex (W)% @end tex @docbook @end docbook @end macro Enfuse allows for weighting the contribution of each @math{P(i, x, y)} to the final @math{Q(x, y)}: @ifinfo @display @math{w(P(1, x, y)) * P(1, x, y) + ... + w(P(n, x, y)) * P(n, x, y) --> Q(x, y),}@w{ }@equationW{} @end display @end ifinfo @html w ( P 1 x y ) × P 1 x y + ... + w ( P n x y ) × P n x y Q i x y , @equationW{} @end html @tex $$ w(P(1, x, y)) P(1, x, y) + \ldots + w(P(n, x, y)) P(n, x, y) \rightarrow Q(x, y),\hskip4em\hbox{@equationW{}} $$ @end tex @docbook Pixel Weighting Function w P 1 x y P 1 x y ... w P n x y P n x y Q x y @end docbook @noindent where @itemize @item each @math{w} is non-negative to yield a physical intensity and @item the sum of all @math{w} is one to leave the total intensity unchanged. @end itemize @noindent The pixel weights@tie{}@math{w} themselves are weighted sums with the same constraints @ifinfo @display @math{w(P) = w_exp * f_exp(P) + w_sat * f_sat(P) + w_cont * f_cont(P, r_cont) + w_ent * f_ent(P, r_ent),} @end display @noindent where we have abbreviated @math{P(i, x, y)} to @math{P} for simplicity. The user defines the constants@tie{}@math{w_exp}, @math{w_sat}, @math{w_cont}, and @math{w_ent} with the options @option{--exposure-weight}, @option{--saturation-weight}, @option{--contrast-weight}, and @option{--entropy-weight}. The functions@tie{}@math{f_exp}, @math{f_sat}, @math{f_cont}, and @math{f_ent} along with the window sizes@tie{}@math{r_cont} and @math{r_ent} are explained in the next sections. @end ifinfo @html

w ( P ) = w exp × f exp ( P ) + w sat × f sat ( P ) + w cont × f cont P r cont + w ent × f ent P r ent

where we have abbreviated P ( i , x , y ) to P for simplicity. The user defines the constants  w exp , w sat , w cont , and w ent with the options `--exposure-weight', `--saturation-weight', `--contrast-weight', and `--entropy-weight' respectively. The functions  f exp , f sat , f cont , and f ent along with the window sizes  r cont and r ent are explained in the next sections.

@end html @tex $$ \eqalign{w(P) \quad = \quad & w_{\mathrm{exp}} \; f_{\mathrm{exp}}(P) + \cr & w_{\mathrm{sat}} \; f_{\mathrm{sat}}(P) + \cr & w_{\mathrm{cont}} \; f_{\mathrm{cont}}(P, r_{\mathrm{cont}}) + \cr & w_{\mathrm{ent}} \; f_{\mathrm{ent}}(P, r_{\mathrm{ent}}), \cr} $$ \noindent where we have abbreviated $P(i, x, y)$ to $P$ for simplicity. The user defines the constants~$w_{\mathrm{exp}}$, $w_{\mathrm{sat}}$, $w_{\mathrm{cont}}$, and $w_{\mathrm{ent}}$ with the options `{\tt --exposure-weight}', `{\tt --saturation-weight}', `{\tt --contrast-weight}', and `{\tt --entropy-weight}' respectively. The functions~$f_{\mathrm{exp}}$, $f_{\mathrm{sat}}$, $f_{\mathrm{cont}}$, and $f_{\mathrm{ent}}$ along with the window sizes~$r_{\mathrm{cont}}$ and $r_{\mathrm{ent}}$ are explained in the next sections. @end tex @docbook w P w exp f exp P w sat f sat P w cont f cont P r cont w ent f ent P r ent where we have abbreviated P i x y to P for simplicity. The user defines the constants  w exp , w sat , w cont , and w ent , with the options --exposure-weight, --saturation-weight, --contrast-weight, and --entropy-weight respectively. The functions  f exp , f sat , f cont , and f ent along with the window sizes  r cont and r ent are explained in the next sections. @end docbook @menu * Weighted Average:: Enfuse's default weighting algorithm * Disabling Averaging:: ``Super Trouper'' weighting for focus stacks * Single Criterion Fusing:: Fusing with only one of the criteria @end menu @node Weighted Average @subsection Weighted Average @cindex weighted average @cindex average, weighted By default, Enfuse uses a weighted average, where @emph{each} pixel contributes as much as its weight demands. Of course the weights can be extreme, favoring only a few pixels or even only one pixel in the input stack. Extremes are not typical, however. Equal weights are another extreme that turns @equationW{} into an arithmetic average. This is why we sometimes speak of the ``averaging property'' of this weighting algorithm, like smoothing out noise. @node Disabling Averaging @subsection Disabling Averaging: Option@tie{}@option{--hard-mask} @cindex disabling average @cindex average, disabling @opindex --hard-mask The weighted average computation as described above has proven to be widely successful with the exception of one special case: focus stacking (@pxref{Focus Stacks}), where the averaging noticeably softens the final image. Use @option{--hard-mask} to switch Enfuse into a different (``Super Trouper'') weighting mode, where the pixel with the highest weight wins, this is, gets weight@tie{}one, and all other pixels get the weight of zero (@uref{http://@/en.wikipedia.org/@/wiki/@/The_@/Winner_@/Takes_@/It_@/All,,``The Winner Takes It All.''}). With @option{--hard-mask} Equation@tie{}@equationW{} becomes @ifinfo @display @math{P(i, x, y) --> Q(x, y),} @end display @noindent where @display @math{w(P(i, x, y)) >= w(P(j, x, y))} for all @math{1 <= j <= n}. @end display @end ifinfo @html P i x y Q x y ,   where   w ( P i x y ) w ( P j x y )   for all   1 j n . @end html @tex $$ P(i, x, y) \rightarrow Q(x, y), \hbox{ where } w(P(i, x, y)) \ge w(P(j, x, y)) \hbox{ for all } 1 \le j \le n. $$ @end tex @docbook P i x y Q x y where 1 j n w P i x y w P j x y @end docbook @noindent Note that this ``averaging'' scheme lacks the nice noise-reduction property of the weighted average@tie{}@equationW{}, because only a single input pixel contributes to the output. @node Single Criterion Fusing @subsection Single Criterion Fusing @cindex single criterion fusing @cindex fusing, single criterion Enfuse allows the user to weight each pixel of an input image by up to four different criteria (@pxref{Overview}). However, it does not force the user to do so. For some applications and more often simply to gain further insight into the weighting and fusing process, looking at only a single criterion is the preferred way to work. @cindex active criterion @cindex criterion, active The version of Enfuse for which this documentation was prepared, uses the default weights as stated in @ref{Table:default-weights}. Notice that by default @emph{more than one} weight is larger than zero, which means they are @emph{active}. @float Table,Table:default-weights @multitable {Local Contrast} {0.0} @headitem Criterion @tab Weight @item Exposure @tab @value{src::default-weight-exposure} @item Saturation @tab @value{src::default-weight-saturation} @item Local Contrast @tab @value{src::default-weight-contrast} @item Local Entropy @tab @value{src::default-weight-entropy} @end multitable @caption{Enfuse's default weights as compiled into version@tie{}@value{VERSION}.} @shortcaption{Default weights} @cindex default weights @cindex weights, default @end float To disable a particular criterion set its weight to zero as for example @example enfuse \ --exposure-weight=1 --saturation-weight=0 \ --contrast-weight=0 --entropy-weight=0 \ img_[1-3].png @end example instructs Enfuse to consider only the exposure weight. Combine this with option@tie{}@option{--save-masks} and it will become clearer how Enfuse computes the exposure weight for the set of images. @cindex overpowering criteria @cindex criteria, overpowering one another Another problem that can be inspected by fusing with just a single active criterion and saving the masks is if the weights of one criterion completely overpower all others. @node Exposure Weighting @section Exposure Weighting @cindex weighting, exposure Exposure weighting prefers pixels with a luminance@tie{}@math{Y} close to the center of the normalized, real-valued luminance interval@tie{}@math{[0, 1]}. @acronym{RGB}-pixels get converted to luminance using the grayscale projector given by @option{--gray-@/projector}, which defaults to @code{average}. Grayscale pixels are identified with luminance. In the normalized luminance interval 0.0 represents pure black and 1.0 represents pure white independently of the data type of the input image. This is, for a @acronym{JPEG} image the luminance@tie{}255 maps to 1.0 in the normalized interval and for a 32@dmn{bit} @acronym{TIFF} picture the highest luminance value@tie{}4294967295 also maps to 1.0. The middle of the luminance interval, 0.5, is where a neutral gray tone ends up with every camera that had no exposure correction dialed in, for example the image of a gray- or white-card. The exposure weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account. The weighting function is the Gaussian @ifinfo @display @math{w_exp(Y) = exp(-0.5 * ((Y - Mu) / Sigma)^2),} @end display @end ifinfo @html w exp ( Y ) = exp ( - 1 2 ( Y - Mu Sigma ) 2 ) @end html @tex $$ w_{\mathrm{exp}}(Y) = \exp\left(-{1 \over 2} \left(Y - \mathit{Mu} \over \mathit{Sigma} \right)^2\right), $$ @end tex @docbook w exp Y 1 2 Y Mu Sigma 2 @end docbook @noindent whose center@tie{}@math{Mu} and width@tie{}@math{Sigma} are controlled by the command line options@tie{}@option{--exposure-mu} and @option{--exposure-sigma} respectively. @math{Mu} defaults to @value{src::default-exposure-mu} and @math{Sigma} defaults to @value{src::default-exposure-sigma}. @ref{Figure:gaussian} shows a Gaussian. @float Figure,Figure:gaussian @vimage{gaussian} @caption{Gaussian function with the parameters @var{Mu} = 0.5 and @var{Sigma} = 0.2.} @shortcaption{Gaussian function} @end float The options@tie{}@option{--exposure-mu} and @option{--exposure-sigma} are for fine-tuning the final result without changing the set of input images. Option@tie{}@option{--exposure-mu} sets the point @var{Mu} of optimum exposure. Increasing @var{Mu} makes Enfuse prefer lighter pixels, rendering the final image lighter, and vice versa. Option@tie{}@option{--exposure-sigma} defines the range @var{Sigma} of acceptable exposures. Small values of @var{Sigma} penalize exposures that deviate from @var{Mu} more, and vice versa. @optionsummaryheading{} @table @option @item --exposure-weight @ref{Fusion Options} @item --exposure-mu @ref{Fusion Options} @item --exposure-sigma @ref{Fusion Options} @item --gray-projector @ref{Expert Options} @end table @node Saturation Weighting @section Saturation Weighting @cindex weighting, saturation Saturation weighting prefers pixels with a high saturation. Enfuse computes the saturation of a pixel according to the following algorithm. @example @group @var{max} := maximum(@var{R}, @var{G}, @var{B}) @var{min} := minimum(@var{R}, @var{G}, @var{B}) @b{if} @var{max} = @var{min} @b{then} @var{saturation} := 0 @b{else} @var{sum} := @var{max} + @var{min} @var{difference} := @var{max} - @var{min} @b{if} @var{sum} @leq{} 1 @b{then} @var{saturation} := @var{difference} / @var{sum} @b{else} @var{saturation} := @var{difference} / (2 - @var{sum}) @b{end if} @b{end if} @end group @end example @noindent Obviously, saturation weighting can only be defined for @acronym{RGB} images, not for grayscale ones! If you need something similar, check out @ref{Local Entropy Weighting}; entropy weighting works for both @acronym{RGB} and grayscale pictures. The saturation weighting algorithm only looks at a single pixel at a time; the pixel's neighborhood is not taken into account. @optionsummaryheading{} @table @option @item --saturation-weight @ref{Fusion Options} @end table @node Local Contrast Weighting @section Local Contrast Weighting @cindex weighting, local contrast Local contrast weighting favors pixels inside a high contrast neighborhood. The notion of ``high contrast'' is defined either by two different criteria or by a blend of both: @itemize @item The standard deviation (@acronym{SDev}) of all the pixels in the local analysis window is large. @xref{Standard Deviation}. @item The Laplacian-of-Gaussian (@acronym{LoG}) has a large magnitude. @xref{Laplacian of Gaussian}. @item If the @acronym{LoG} magnitude is below a given threshold, use @acronym{SDev} data, otherwise stick with @acronym{LoG}. @xref{Blend SDev and LoG}. @end itemize Enfuse converts every @acronym{RGB} image to grayscale before it determines its contrast. Option@tie{}@option{--gray-projector} (@pxref{Expert Options}) controls the projector function. Depending on the subject, one of several grayscale projectors may yield the best black-and-white contrast for image fusion. In the following sections we describe each algorithm in detail. @menu * Standard Deviation:: Standard deviation (@acronym{SDev}) * Laplacian of Gaussian:: @acronym{LoG}, a second derivative method * Blend SDev and LoG:: Mix and match @acronym{SDev} and @acronym{LoG} * Scaling and Choice of Mode:: How parameters do not scale; neither does mode @end menu @node Standard Deviation @subsection Standard Deviation @cindex weighting, contrast using standard deviation @cindex contrast weighting using standard deviation @cindex local analysis window @cindex window, local-analysis The pixel under consideration@tie{}C sits exactly in the center of a square, the so-called @dfn{local analysis window}. It always has an uneven edge length. The user sets the size with option@tie{}@option{--contrast-window-size}. @ref{Figure:local-analysis-window} shows two windows with different sizes. @float Figure,Figure:local-analysis-window @vimage{local-analysis-window} @caption{Examples of local analysis windows for the sizes 3 and 5. ``C'' marks the center where the pixel gets the weight. ``N'' are neighboring pixels, which all contribute equally to the weight.} @shortcaption{Local analysis window} @end float During the analysis, Enfuse scans the local analysis window across all rows and all columns@footnote{In the current implementation a @code{floor(contrast-window-size / 2)} wide border around the images remains unprocessed and gets a weight of zero.} of each of the input images to compute the contrast weight of every pixel. @optionsummaryheading{} @table @option @item --contrast-weight @ref{Fusion Options} @item --hard-mask @ref{Fusion Options} @item --contrast-window-size @ref{Expert Options} @item --gray-projector @ref{Expert Options} @end table @subsubsection Statistical Moments @cindex statistical moments @cindex probability function We start with the @dfn{probability function} @math{w} of the random variable@tie{}@math{X}: @ifinfo @display @math{w: x --> p(@{omega: X(omega) = x@})}. @end display @end ifinfo @html w : x p ( { ω : X ( ω ) = x } ) . @end html @tex $$ w: x \rightarrow p(\{\omega: X(\omega) = x\}). $$ @end tex @docbook : w x p ω X ω x @end docbook @noindent It associates a probability@tie{}@math{p} with each of the @math{n} different possible outcomes@tie{}@inlineomega{} of the random variable@tie{}@math{X}. @cindex expectation value Based on @math{w}, we define the @dfn{expectation value} or ``First Moment'' of the random variable@tie{}@math{X}: @ifinfo @display @math{Ex X := sum(x_i * w(x_i), i = 1..n).} @end display @end ifinfo @html Ex X := i = 1 n x i × w ( x i ) . @end html @tex $$ \hbox{\sf Ex } X := \sum_{i = 1}^n x_i w(x_i). $$ @end tex @docbook Ex X 1 X i 1 n x i w x i @end docbook @cindex variance @noindent Using the definition of the expectation value, we define the @dfn{variance}, or ``Second Moment'' as @ifinfo @display @math{Var X := Ex((X - Ex X)^2)}, @end display @end ifinfo @html Var X := Ex ( ( X - Ex X ) 2 ) @end html @tex $$ \hbox{\sf Var } X := \hbox{\sf Ex}\left( (X - \hbox{\sf Ex } X)^2 \right), $$ @end tex @docbook Var X X 2 X Ex X Ex X 2 @end docbook @cindex standard deviation @noindent and the @dfn{standard deviation} as @ifinfo @display @math{Sdev X := sqrt(Var X)}. @end display @end ifinfo @html σ X := Var X . @end html @tex $$ \sigma X := \sqrt{\hbox{\sf Var } X}. $$ @end tex @docbook X 2 2 X 2 Var X @end docbook Obviously, the variance of @math{X} is the expectation value of the squared deviation from the expectation value of @math{X} itself. Note that the variance's dimension is @math{X}'s dimension squared; the standard deviation rectifies the dimension to make it comparable with @math{X} itself again. @subsubsection Estimators @cindex estimators In Enfuse, we assume that @math{X} follows a uniform probability function@tie{}@math{w(x)} = const. That is, all pixel values in the local analysis window are considered to be equally probable. Thus, the expectation value and the variance can be estimated from the pixel values like this @ifinfo @display @math{Ex X = sum(x_i, i = 1..n) / n.} @end display @end ifinfo @html Ex X := 1 n i = 1 n x i . @end html @tex $$ \hbox{\sf Ex } X := {1 \over n} \sum_{i = 1}^n x_i. $$ @end tex @docbook Ex X 1 n i 1 n x i @end docbook @noindent In other words: the expectation value is the arithmetic mean of the lightness of all pixels in the local analysis window. Analogously, the variance becomes @ifinfo @display @math{Var X = sum((x_i - Ex x)^2, i = 1..n) / (n - 1).} @end display @end ifinfo @html Var X := 1 n - 1 Ex ( ( X - Ex X ) 2 ) . @end html @tex $$ \hbox{\sf Var } X := {1 \over {n - 1}} \, \hbox{\sf Ex}\left( (X - \hbox{\sf Ex } X)^2 \right). $$ @end tex @docbook Var X 1 n 1 Ex X Ex X 2 @end docbook @node Laplacian of Gaussian @subsection Laplacian of Gaussian @cindex weighting, contrast using laplacian-of--gaussian @cindex contrast weighting using laplacian-of--gaussian @cindex Laplacian of Gaussian (@acronym{LoG}) The @dfn{Laplacian of Gaussian} (@acronym{LoG}) is an operator to detect edges in an image. Sometimes the @acronym{LoG}-operator is also called @sc{Marr}-@sc{Hildreth} operator. A Laplacian-of-Gaussian operator, @uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/@/doc/@/vigra/@/group__@/Common@/Convolution@/Filters.html, @code{vigra::@/laplacian@/Of@/Gaussian}} is part of the package@tie{}@uref{http://@/hci.iwr.uni-@/heidelberg.de/@/vigra/, @acronym{VIGRA}} that Enfuse is built upon and is used for edge detection if option@tie{}@option{--contrast-edge-scale} is non-zero and @option{--contrast-min-curvature} equal to or less than zero. Let the Gaussian function be @ifinfo @display @math{g(x, y) = 1/pi * exp((x^2 + y^2) / (2 * sigma^2))/(2 * sigma^2)} @end display @end ifinfo @html g x y = 1 2 π σ 2 exp ( - x 2 + y 2 2 σ 2 ) @end html @tex $$ g(x, y) = {1 \over {2 \pi \sigma^2}} \, {\exp\left(-{{x^2 + y^2} \over {2 \sigma^2}}\right)} $$ @end tex @docbook g x y 1 2 π σ 2 x 2 y 2 2 σ 2 @end docbook @noindent The parameter@tie{}@inlinesigma{}, the argument of option@tie{}@option{--contrast-edge-scale}, is the length scale on which edges are detected by @math{g(x, y)}. We apply the Laplacian operator in Cartesian coordinates @ifinfo @display @math{Delta := Nabla o Nabla = (d^2/dx^2 + d^2/dy^2)} @end display @end ifinfo @html Δ · = 2 x 2 + 2 y 2 @end html @tex $$ \bigtriangleup \equiv \nabla \cdot \nabla = {\partial^2 \over \partial x^2} + {\partial^2 \over \partial y^2} $$ @end tex @docbook x 2 y 2 @end docbook to @math{g(x, y)}, to arrive at a continuous representation of the two-dimensional filter kernel @ifinfo @display @math{k(x, y) = (xi^2 - 1) * exp(-xi^2) / (pi * sigma^4),} @end display @end ifinfo @html k x y = ξ 2 - 1 π σ 4 exp ( - ξ 2 ) , @end html @tex $$ k(x, y) = {{\xi^2 - 1} \over {\pi \sigma^4}} \exp(-\xi^2), $$ @end tex @docbook k x y ξ 2 1 π σ 4 ξ 2 @end docbook where we have used the dimensionless distance@tie{}@inlinexi{} from the origin @ifinfo @display @math{xi^2 = (x^2 + y^2) / (2 * sigma^2).} @end display @end ifinfo @html ξ 2 = x 2 + y 2 2 σ 2 . @end html @tex $$ \xi^2 = {{x^2 + y^2} \over {2 \sigma^2}}. $$ @end tex @docbook ξ 2 x 2 y 2 2 σ 2 @end docbook @noindent Enfuse uses a discrete approximation of @math{k} in the convolution with the image. The operator is radially symmetric with respect to the origin, which is why we can easily plot it in @ref{Figure:laplacian-of-gaussian}, setting @ifinfo @math{R = sqrt(x^2 + y^2)}. @end ifinfo @html R = x 2 + y 2 . @end html @tex $R = \sqrt{x^2 + y^2}$. @end tex @docbook R 2 x 2 y 2 @end docbook @float Figure,Figure:laplacian-of-gaussian @vimage{laplacian-of-gaussian} @caption{Laplacian-of-Gaussian function for @inlinesigma{} = 0.5.} @shortcaption{Laplacian-of-Gaussian} @end float @noindent See also @uref{http://@/homepages.inf.ed.ac.uk/@/rbf/@/HIPR2/@/log.htm, @acronym{HIPR2}: Laplacian of Gaussian}. Sometimes the @acronym{LoG} is plagued by noise in the input images. After all, it is a numerical approximation of the second derivative and deriving always ``roughens'' a function. The (normalized) mask files relentlessly disclose such problems. Use option@tie{}@option{--contrast-min-curvature} with a @emph{negative} argument@tie{}@var{CURVATURE} to suppress all edges with a curvature below @minus{}@var{CURVATURE} (which is a positive value). Check the effects with the mask files and particularly the hard-mask files (@file{@value{src::default-hard-mask-template}}) if using option@tie{}@option{--hard-mask}. To indicate the @var{CURVATURE} in relative terms, which is particularly comprehensible for humans, append a percent sign (@samp{%}). Try minimum curvatures starting from @minus{}0.5% to @minus{}3%. @optionsummaryheading{} @table @option @item --contrast-weight @ref{Fusion Options} @item --hard-mask @ref{Fusion Options} @item --contrast-edge-scale @ref{Expert Options} @item --contrast-min-curvature @ref{Expert Options} @end table @node Blend SDev and LoG @subsection Blend Standard Deviation and Laplacian of Gaussian @cindex weighting, contrast using a blend of methods @cindex contrast weighting using a blend of methods Enfuse can team the standard deviation computation and Laplacian of Gaussian to deliver the best of both methods. Use a @emph{positive} argument@tie{}@var{CURVATURE} with option@tie{}@option{--contrast-min-curvature} to combine both algorithms. In this mode of operation Enfuse computes the @acronym{SDev}-weight and the @acronym{LoG}-weight, then uses the @acronym{LoG} to decide whether to go with that value or prefer the @acronym{SDev} data. If the @acronym{LoG} is greater than @var{CURVATURE} Enfuse uses the weight delivered by the @acronym{LoG}, otherwise the @acronym{SDev}-weight is rescaled such that its maximum is equal to @var{CURVATURE}, and the scaled @acronym{SDev} is used as weight. This technique merges the two edge detection methods where they are best. The @acronym{LoG} excels with clear edges and cannot be fooled by strong but smooth gradients. However, it is bad at detecting faint edges and it is susceptible to noise. The @acronym{SDev} on the other hand shines with even the most marginal edges, and resists noise quite well. Its weakness is that is is easily deceived by strong and smooth gradients. Tuning @var{CURVATURE} the user can pick the best threshold for a given set of images. @optionsummaryheading{} @table @option @item --contrast-weight @ref{Fusion Options} @item --hard-mask @ref{Fusion Options} @item --contrast-window-size @ref{Expert Options} @item --gray-projector @ref{Expert Options} @item --contrast-edge-scale @ref{Expert Options} @item --contrast-min-curvature @ref{Expert Options} @end table @node Scaling and Choice of Mode @subsection Scaling and Choice of Mode @cindex scaling of parameters @cindex mode of operation (@acronym{SDev}, @acronym{LoG}, @dots{}) Experience has shown that neither the parameters @var{EDGESCALE} and @var{CURVATURE} nor the mode of operation (@acronym{SDev}-only, @acronym{LoG}-only, or a blend of both) scales to different image sizes. In practice, this means that if you start with a set of reduced size images, say 2808@classictimes{}1872 pixels, carefully optimize @var{EDGESCALE}, @var{CURVATURE} and so on, and find @acronym{LoG}-only the best mode, and then switch to the original resolution of 5616@classictimes{}3744 pixels, multiplying (or dividing) the parameters by four and sticking to @acronym{LoG}-only might @emph{not} result in the best fused image. For best quality, perform the parameter optimization and the search for the most appropriate mode at the final resolution. @node Local Entropy Weighting @section Local Entropy Weighting @cindex weighting, local entropy Entropy weighting prefers pixels inside a high entropy neighborhood. @cindex entropy, definition Let @math{S} be an @math{n}-ary source. Watching the output of @math{S} an observer on average gains the information @ifinfo @display @math{H_a(n) := sum(p(x) * log_a(1 / p(x)), x in S)} @end display @end ifinfo @html H a ( n ) := x S p ( x ) × log a ( 1 / p ( x ) ) @end html @tex $$ H_a(n) := \sum_{x \in S} p(x) \log_a(1 / p(x)) $$ @end tex @docbook H a n x x S p x a 1 p x @end docbook @cindex entropy @noindent per emitted message, where we assume the knowledge of the probability function@tie{}@math{p(S)}. The expectation value@tie{}@math{H_a(n)} is called @dfn{entropy} of the source@tie{}@math{S}. Entropy measures our uncertainty if we are to guess which message gets chosen by the source in the future. The unit of the entropy depends on the choice of the constant@tie{}@math{a > 1}. Obviously @ifinfo @display @math{H_b(n) = H_a(n) / log_a(b)} @end display @end ifinfo @html H b ( n ) = H a ( n ) / log a ( b ) @end html @tex $$ H_b(n) = H_a(n) / \log_a(b) $$ @end tex @docbook H b n H a n a b @end docbook @noindent holds for all @math{b > 1}. We use @math{a = 2} for entropy weighting and set the entropy of the ``impossible message'' to zero according to @ifinfo @display @math{lim(p * log_a(1 / p), p -> 0) = 0.} @end display @end ifinfo @html lim p 0 p × log a ( 1 / p ) = 0 . @end html @tex $$ \lim_{p \rightarrow 0} \, p \, \log_a(1 / p) = 0. $$ @end tex @docbook p p 0 p a 1 p 0 @end docbook @noindent @ref{Figure:entropy} shows an entropy function. @float Figure,Figure:entropy @vimage{entropy} @caption{Entropy function@tie{}H for an experiment with exactly two outcomes.} @shortcaption{Entropy function} @end float For more on (information) entropy visit @uref{http://@/en.wikipedia.org/@/wiki/@/Information_@/entropy, Wikipedia}. Enfuse computes a pixel's entropy by considering the pixel itself and its surrounding pixels quite similar to @ref{Local Contrast Weighting}. The size of the window is set by @option{--entropy-window-size}. Choosing the right size is difficult, because there is a serious tradeoff between the locality of the data and the size of the sample used to compute @math{H}. A large window results in a large sample size and therefore in a reliable entropy, but considering pixels far away from the center degrades @math{H} into a non-local measure. For small windows the opposite holds true. Another difficulty arises from the use of entropy as a weighting function in dark parts of an image, that is, in areas where the signal-to-noise ratio is low. Without any precautions, high noise is taken to be high entropy, which might not be desired. Use option@tie{}@option{--entropy-cutoff} to control the black level when computing the entropy. On the other extreme side of lightness, very light parts of an image, the sensor might already have overflown without the signal reaching 1.0 in the normalized luminance interval. For these pixels the entropy is zero and Enfuse can be told of the threshold by properly setting the second argument of @option{--entropy-cutoff}. @optionsummaryheading{} @table @option @item --entropy-weight @ref{Fusion Options} @item --entropy-window-size @ref{Expert Options} @item --entropy-cutoff @ref{Expert Options} @end table @node Understanding Masks @chapter Understanding Masks @cindex understanding masks @cindex masks, understanding @include understanding-masks.texi @node Tuning Memory Usage @chapter Tuning Memory Usage @cindex memory, tuning usage of @opindex -b @opindex -m @include tuning-memory-usage.texi @node Applications @chapter Applications of Enfuse @cindex applications of enfuse This section describes some of the novel possibilities that Enfuse offers the photographer. In contrast to the previous chapters, it centers around the image effects. @menu * What Images:: What makes images fusable? * Repetition:: Just taking the same shot multiple times * Exposure Series:: Varying the exposure time * Flash Exposure Series:: Varying the flash output * Polarization Series:: Changing the polarizer angle * Focus Stacks:: Stacking images with different in-focus distance @end menu @node What Images @section What Makes Images Fusable? @cindex images, fusable Images should align well to be suitable for fusion. However, there is no hard mathematical rule what ``well'' means. The alignment requirements for 16@dmn{MPixel} images to yield a sharp 4"@classictimes{}6" print at 300@dmn{dpi} (``dpi'' means dots per inch) or even for web presentation are relatively low, whereas the alignment of 8@dmn{MPixel} images for a 12"@classictimes{}18" print ought to be tight. @pindex hugin If the input images need to be aligned, Hugin (@pxref{Helpful Programs}) is the tool of choice. It produces images exactly in the format that Enfuse expects. Sometimes images naturally align extremely well so that no re-alignment is required. An image series with preprogrammed exposure steps taken in rapid succession where the camera is mounted on a heavy tripod and a humongous ball head, mirror lockup, and a cable release are used, comes to mind. When in doubt about what will work, try it, and judge for yourself. @noindent Useful ideas for a good alignment: @itemize @item Fix all camera parameters that are not explicitly varied. @table @emph @item Aperture Engage full manual (@key{M}) or aperture-priority (@key{A}) mode. @item Auto-focus Disable ``Auto Focus''. Be aware that the auto-focus function could be linked to shutter-release button position ``half pressed'' or to the shutter release in insidious ways. @item Closed eyepiece (This applies only to single lens reflex cameras.) Close the eyepiece when using a cable release to suppress variations in stray light. @item Exposure time/Shutter speed Use the shortest possible exposure time or, in other words, use the fastest shutter speed to avoid blur caused by camera shake or motion blur. @item Flash power Explicitly control the flash power of @emph{all} flashes. This is sometimes called ``flash exposure lock''. @item Sensitivity Disable ``Auto @acronym{ISO}''. @item White balance Disable ``Auto White Balance''. Instead, use the most suitable fixed white balance or take the white balance off a white card. When in doubt, use the setting ``Daylight'' or equivalent. @end table @item Steady the camera by any means. @itemize @item Apply your best camera bracing technique combined with controlled breathing. @item Prefer a monopod, or better, a rigid tripod with a heavy head. @item Use a cable release if possible. @item (This applies to cameras with a moving mirror only.) Engage ``mirror lockup''. @item Consider automatic bracketing when applicable. @item Activate camera- or lens-based image stabilization if you are sure that it improves the image quality in your particular case; otherwise disengage the feature. For some lens-based image stabilization systems, it is known that they ``lock'' into different positions every time they are activated. Moreover, some stabilization systems decrease the image quality when the lens is mounted on a tripod. @end itemize @item Fire in rapid succession. @end itemize @c http://www.usa.canon.com/dlc/controller?act=GetArticleAct&articleID=1786 @node Repetition @section Repetition -- Noise Reduction @cindex simple series @cindex series, simple @cindex noise reduction @mainpurpose Reduce noise @noindent With the default settings, Enfuse computes a weighted average of the input pixels. For a series of images, repeated with identical settings, this results in a reduction of (photon shot) noise. In other words, the dynamic range increases slightly, because the higher signal-to-noise ratio makes darker shades usable. Furthermore, smooth or glossy surfaces get a ``cleaner'' look, and edges become visually sharper. The nitty-gritty reportage look that sometimes stems from a high sensitivity setting disappears. Averaged images, and therefore low-noise images, are the base for a multitude of techniques like, for example, differences. The most prominent method in this class is dark-frame subtraction. The defaults set @samp{--exposure-weight=@value{src::default-weight-exposure}} and @samp{--saturation-weight=@value{src::default-weight-saturation}}. Eliminating the saturation component with @samp{--saturation-weight=0.0} can be worth an extra run. @node Exposure Series @section Exposure Series -- Dynamic Range Increase @cindex exposure series @cindex series, exposure @cindex dynamic range increase @mainpurpose Increase manageable dynamic range @noindent An exposure series is a set of images taken with identical parameters except for the exposure time. Some cameras even provide special functions to automate recording exposure series. See the instruction manual of your model for details. Enfuse's defaults, @samp{--exposure-weight=@value{src::default-weight-exposure}} and @samp{--saturation-weight=@value{src::default-weight-saturation}} are well suited for fusion of @emph{color} images. Remember that saturation weighting only works for @acronym{RGB} data. Option@tie{}@option{--saturation-weight} helps to control burnt-out highlights, as these are heavily desaturated. Alternatively, use option@tie{}@option{--exposure-cutoff} to suppress noise or blown-out highlights without altering the overall brightness too much. If no image suffers from troublesome highlights, the relative saturation weight can be reduced and even be set to zero. For black and white images @option{--entropy-weight} can be an alternative to @option{--saturation-weight} because it suppresses overexposed pixels, as these contain little information. However, entropy weighting is not limited to gray-scale data; it has been successfully applied to @acronym{RGB} images, too. Note that entropy weighting considers @emph{each} color channel of an @acronym{RGB} image separately and chooses the channel with the minimum entropy as representative for the whole pixel. Enfuse offers the photographer tremendous flexibility in fusing differently exposed images. Whether you combine only two pictures or a series of 21, Enfuse imposes no limits on you. Accordingly, the photographic effects achieved range from subtle to surreal, like the late 1980s ``Max Headroom'' @acronym{TV}-Series, to really unreal. Like some time ago in the chemical days of photography, when a new developer opened unseen possibilities for artists, exposure fusion extends a photographer's expressive space in the digital age. Whether the results look good or bad, whether the images are dull or exciting, is entirely up the artist. In the next sections we give assistance to starters, and rectify several misconceptions about Enfuse. @menu * Exposure Series Tips:: Some hints for beginners * Exposure Series Misconceptions:: What works despite the hype @end menu @node Exposure Series Tips @subsection Tips For Beginners @cindex exposure series, tips for beginners Here are some tips to get you in business quickly. @table @emph @item Include the best single exposure. Include the exposure you would have taken if you did not use Enfuse in your series. It gives you a solid starting point. Think of the other images as augmenting this best single exposure to bring out the light and dark features you would like to see. @item Begin with as small a number of images as possible. Pre-visualizing the results of Enfuse is difficult. The more images put into the fusion process and the wider their @acronym{EV}-spacing is, the more challenging visualizing the output image becomes. Therefore, start off with as few images as possible. You can take a larger series of images and only use part of it. @item Start with a moderate @acronym{EV}-spacing. As has been pointed out in the previous item, a wide @acronym{EV}-spacing makes pre-visualization harder. So start out with a spacing of 2/3@dmn{EV} to 1+1/3@dmn{EV}. @end table @node Exposure Series Misconceptions @subsection Common Misconceptions @cindex exposure series, common misconceptions Here are some surprisingly common misconceptions about exposure series. @table @emph @item A single image cannot be the source of an exposure series. @cindex digital blending @cindex blending exposures Raw-files in particular lend themselves to be converted multiple times and the results being fused together. The technique is simpler, faster, and usually even looks better than @uref{http://@/luminous-@/landscape.com/@/tutorials/@/digital-@/blending.shtml, digital blending} (as opposed to using a graduated neutral density filter) or @uref{http://@/www.gimpguru.org/@/Tutorials/@/Blending@/Exposures/, blending exposures} in an image manipulation program. Moreover, perfect alignment comes free of charge! @item An exposure series must feature symmetrically-spaced exposures. Twice wrong! Neither do the exposures have to be ``symmetric'' like @{0@dmn{EV}, @minus{}2/3@dmn{EV}, +2/3@dmn{EV}@}, nor does the number of exposures have to be odd. Series like @{@minus{}1@minus{}1/3@dmn{EV}, @minus{}1/3@dmn{EV}, +1/3@dmn{EV}@} or @{@minus{}1@dmn{EV}, 1@dmn{EV}@} might be just right. By the way, the order in which the images were taken does not matter either. @item An exposure series must cover the whole dynamic range of the scene. @cindex light probe If you do not want to cover the whole range, you do not have to. Some @acronym{HDR} programs require the user to take a light probe,@footnote{@uref{http://@/www.debevec.org/, Paul E.@tie{}Debevec} defines: ``A @dfn{light probe} image is an omnidirectional, high dynamic range image that records the incident illumination conditions at a particular point in space.''} whereas Enfuse offers the user complete freedom of exposure. @item All exposure values must be different. You can repeat any exposure as often as you like. That way you combine an exposure series with parts of @ref{Repetition}, emphasizing the multiply occuring exposures and reducing noise. @end table @node Flash Exposure Series @section Flash Exposure Series -- Directed Lighting @cindex flash exposure series @cindex series, flash exposure @cindex dynamic range increase @mainpurpose ??? ... @node Polarization Series @section Polarization Series -- Saturation Enhancement @cindex polarization series @cindex series, polarization @cindex saturation enhancement @mainpurpose Reflection suppression, saturation enhancement In the current implementation of Enfuse, it is not possible in general to fuse a polarization series. Naively abusing @option{--saturation-weight} will not work. @node Focus Stacks @section Focus Stacks -- Depth-of-Field Increase @cindex focus stacks @cindex depth-of-focus increase @mainpurpose Synthetic Depth-of-Field Increase A @dfn{focus stack} is a series of images where the distance of the focal plane from the sensor varies. Sloppily speaking, the images were focussed at different distances. Fusing such a stack increases the depth-of-field (@acronym{DOF}) beyond the physical limits of diffraction. @menu * Why Focus Stacks:: Why take the hassle? * Preparing Focus Stacks:: How to get suitable input images * Local Contrast Based Fusing:: Fundamental command line options * Basic Focus Stacking:: Simple, standard deviation method * Advanced Focus Stacking:: Advanced, Laplacian technique * Expert Stacking:: Tips for focus stacking experts @end menu @node Why Focus Stacks @subsection Why create focus stacks? @cindex focus stacks, why create them Given @itemize @item a fixed sensor or film size, @item a lens' particular focal length, and @item @cindex circle-of-confusion a notion about ``sharpness'', technically speaking the size of the circle-of-confusion (@acronym{CoC}) @end itemize @cindex depth-of-field @noindent the photographer controls the depth-of-field with the aperture. Smaller apertures -- this is larger aperture numbers -- increase the @acronym{DOF} and vice versa. However, smaller apertures increase diffraction which in turn renders the image unsharp. So, there is an optimum aperture where the photographer gets maximum @acronym{DOF}. Sadly, for some purposes like macro shots it is not enough. One way out is to combine the sharp parts of images focused at different distances, thereby artificially increasing the total @acronym{DOF}. This is exactly what Enfuse can do. @cindex sweet spot aperture @cindex aperture, sweet spot All lenses have a so called ``sweet spot'' aperture, where their resolution is best. Taking pictures at this aperture, the photographer squeezes the maximum quality out of the lens. But: the ``sweet spot'' aperture often is only one or two stops away from wide open. Wouldn't it be great to be able combine these best-possible images to form one high-quality, sufficient-@acronym{DOF} image? Welcome to Enfuse's local-contrast selection abilities. @node Preparing Focus Stacks @subsection Preparing Focus Stacks @cindex focus stacks, preparation We are going to combine images with limited @acronym{DOF} to increase their in-focus parts. The whole process is about image sharpness. Therefore, the input images must align very well, not just well, but very well. For optimum results the maximum control point distance in Hugin (@pxref{Helpful Programs}) should not exceed 0.3--0.5@dmn{pixels} to ensure perfect blending. As in all image fusion operations it is preferable to use 16@dmn{bit} linear (gamma = 1) images throughout, but 8@dmn{bit} gamma encoded images will do. Naturally, high @acronym{SNR} input data always is welcome. @node Local Contrast Based Fusing @subsection Local Contrast Based Fusing @cindex local-contrast-based fusing @cindex fusing, local-contrast-based @cindex focus stacks, fusing A bare bones call to Enfuse for focus stacking could look like this. @example enfuse \ --exposure-weight=0 \ --saturation-weight=0 \ --contrast-weight=1 \ --hard-mask \ @dots{} \ --output=output.tif \ input-<0000-9999>.tif @end example @noindent Here is what each option causes: @table @option @item --exposure-weight=0 Switch @strong{off} exposure based pixel selection. The default weight is @value{src::default-weight-exposure}. @item --saturation-weight=0 Switch @strong{off} saturation based pixel selection. The default weight is @value{src::default-weight-saturation}. @item --contrast-weight=1 Switch @strong{on} pixel selection based on local contrast. @item --hard-mask Select the best pixel from the image stack and ignore all others. Without this option, Enfuse uses all pixels in the stack and weights them according to their respective quality, which in our case is local contrast. Without @option{--hard-mask}, the result will always look a bit soft. @xref{Local Contrast Weighting}. @end table @noindent If you want to see some entertaining progress messages -- local-contrast weighting takes a while --, also pass the @option{--verbose}@tie{}option for a verbose progress report. @node Basic Focus Stacking @subsection Basic Focus Stacking @cindex basic focus stacking @cindex focus stacking, basic For a large class of image stacks Enfuse's default algorithm, as selected in @ref{Local Contrast Based Fusing}, to determine the sharpness produces nice results. The algorithm uses a moving square window, the so-called contrast window. It computes the standard deviation of the pixels inside of the window. The program then selects the window's center pixel of the image in the stack where the standard deviation is largest, that is, the local contrast reaches the maximum. However, the algorithm fails to deliver good masks for images which exhibit high contrast edges on the scale of the contrast window size. The typical artifacts that show up are @itemize @item faint dark seams on the light side of the high contrast edges and @item extremely soft, slightly lighter seams on the dark side of the high contrast edges, @end itemize @noindent where the distance of the seams from the middle of the edge is comparable to the contrast window size. If your results do not show any of these artifacts, stick with the basic algorithm. Advanced focus stacking, as described in the next sections, delivers superior results in case of artifacts, though requires manually tuning several parameters. @node Advanced Focus Stacking @subsection Advanced Focus Stacking @cindex advanced focus stacking @cindex focus stacking, advanced If your fused image shows any of the defects described in the previous section, you can try a more difficult-to-use algorithm that effectively works around the seam artifacts. It is described in the next section. @menu * Local Contrast Problem:: What is the problem Kenneth? * Laplacian Edge Detection:: Using a Laplacian-of-Gaussian to detect edges * Local Contrast Enhancement:: Boosting local contrast before weighting * Suppressing Noise or Recognizing Faint Edges:: The best of both worlds * Focus Stacking Decision Tree:: What to do and how to fuse @end menu @node Local Contrast Problem @subsubsection A Detailed Look at the Problem @cindex local contrast problem @cindex problem, local contrast Let us use an example to illustrate the problem of relating the sharpness with the local contrast variations. Say we use a 5@classictimes{}5 contrast window. Moreover, let @code{sharp_edge} and @code{smooth_edge} be two specific configurations: @example sharp_edge = [ 0, 0, 200, 0, 0; 0, 225, 0, 0, 0; 0, 255, 0, 0, 0; 215, 0, 0, 0, 0; 200, 0, 0, 0, 0] @end example @example smooth_edge = [ 0, 62, 125, 187, 250; 1, 63, 126, 188, 251; 2, 65, 127, 190, 252; 3, 66, 128, 191, 253; 5, 67, 130, 192, 255] @end example where @samp{;} separates the rows and @samp{,} separates the columns. This is in fact @uref{http://@/www.gnu.org/@/software/@/octave/, Octave} syntax. @ref{Figure:sharp-edge} and @ref{Figure:smooth-edge} show plots of the matrices @code{sharp_edge} and @code{smooth_edge}. @float Figure,Figure:sharp-edge @vimage{sharp-edge} @caption{3D plot augmented by contour plot of the matrix@tie{}@code{sharp_edge}.} @shortcaption{Sharp edge} @end float @float Figure,Figure:smooth-edge @vimage{smooth-edge} @caption{3D plot augmented by contour plot of the matrix@tie{}@code{smooth_edge}.} @shortcaption{Smooth edge} @end float @noindent Our intuition lets us ``see'' an extremely sharp edge in the first matrix, whereas the second one describes an extraordinarily smooth diagonal intensity ramp. Which one will be selected? Well, @code{sharp_edge} has a standard deviation of 88.07 and @code{smooth_edge} has 88.41. Thus, @code{smooth_edge} wins, contradicting our intuition, and even worse, our intention! Sadly, configurations like @code{smooth_edge} occur more often with high-quality, good @uref{http://@/www.luminous-@/landscape.com/@/essays/@/bokeh.shtml, bokeh} lenses. In fact, they are the very manifestation of ``good bokeh''. Therefore, Laplacian edge detection plays an important role when working with high-quality lenses. @node Laplacian Edge Detection @subsubsection Laplacian Edge Detection @cindex laplacian edge detection @cindex edge detection, laplacian Enfuse provides a Laplacian-based algorithm that can help in situations where weighting based on the standard deviation fails. It is activated with a positive value for @var{SCALE} in @code{--contrast-edge-scale}=@/@var{SCALE}. The Laplacian will detect two-dimensional @emph{curvature} on the scale of @var{SCALE}. Here and in the following we simply speak of ``curvature'' where we mean ``magnitude of curvature''. That is, we shall not distinguish between convex and concave edges. Enfuse always use the magnitude of curvature for weighting. Typically, @var{SCALE} ranges between 0.1@dmn{pixels} and 0.5@dmn{pixels}, where 0.3@dmn{pixels} is a good starting point. To find the best value for @var{SCALE} though, usually some experimentation will be necessary. Use @option{--save-masks} to get all soft-mask (default: @file{@value{src::default-soft-mask-template}}) and hard-mask files (default: @file{@value{src::default-hard-mask-template}}). Check how different scales affect the artifacts. Also @pxref{Understanding Masks}. @node Local Contrast Enhancement @subsubsection Local Contrast Enhancement @cindex local contrast enhancement @cindex contrast enhancement, local Sometimes Enfuse misses smoother edges with @option{--contrast-edge-scale} and a little local contrast enhancement (@acronym{LCE}) helps. Set @code{--contrast-edge-scale}=@/@var{SCALE}:@/@var{LCE-SCALE}:@/@var{LCE-FACTOR}. where @var{LCE-SCALE} and @var{LCE-FACTOR} work like the @uref{http://@/www.cambridgeincolour.com/@/tutorials/@/unsharp-@/mask.htm, unsharp mask} filters in various image manipulation programs. Start with @var{LCE-SCALE} ten times the value of @var{SCALE} and a @var{LCE-FACTOR} of 2--5. @var{LCE-SCALE} can be specified as a percentage of @var{SCALE}. @var{LCE-FACTOR} also can be specified as a percentage. Examples: @example --contrast-edge-scale=0.3:3.0:3 --contrast-edge-scale=0.3:1000%:3.0 --contrast-edge-scale=0.3:3:300% --contrast-edge-scale=0.3:1000%:300% @end example @noindent By default @acronym{LCE} is turned off. @node Suppressing Noise or Recognizing Faint Edges @subsubsection Suppressing Noise or Recognizing Faint Edges @cindex advanced focus stacking, suppressing noise @cindex advanced focus stacking, recognizing faint edges The Laplacian-based algorithm is much better at resisting the seam problem than the local-contrast algorithm, but it has two shortcomings: @enumerate @item The Laplacian is very susceptible to noise and @item it fails to recognize faint edges. @end enumerate @noindent The @option{--contrast-min-curvature} option helps to mitigate both flaws. The argument to @code{--contrast-min-curvature}=@var{CURVATURE} either is an absolute lightness value, for example 0..255 for 8@dmn{bit} data and 0..65535 for 16@dmn{bit} data, or, when given with a @samp{%}-sign it is a relative lightness value ranging from 0% to 100%. To suppress unreal edges or counter excessive noise, use the @option{--contrast-min-curvature} option with a @emph{negative} curvature measure @var{CURVATURE}. This forces all curvatures less than @minus{}@var{CURVATURE} to zero. A @emph{positive} curvature measure @var{CURVATURE} makes Enfuse merge the @acronym{LoG} data with the local-contrast data. Every curvature larger than or equal to @var{CURVATURE} is left unchanged, and every curvature less than @var{CURVATURE} gets replaced with the rescaled local-contrast data, such that the largest local contrast is just below @var{CURVATURE}. This combines the best parts of both techniques and ensures a precise edge detection over the whole range of edge curvatures. @noindent @strong{Summary} @table @code @item -@/-contrast-edge-scale=0.3 Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}. Apply the default grayscale projector: @code{average}. @item -@/-contrast-edge-scale=0.3 -@/-gray-projector=l-star Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}. Apply the L*-grayscale projector. @item -@/-contrast-edge-scale=0.3:3:300% Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}, pre-sharpen the input images by 300% on a scale of 3@dmn{pixels}. Apply the default grayscale projector: @code{average}. @item -@/-contrast-edge-scale=0.3 -@/-contrast-min-curvature=@minus{}0.5% Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}. Apply the default grayscale projector: @code{average} and throw away all edges with a curvature of less than 0.5%. @item -@/-contrast-edge-scale=0.3 -@/-contrast-min-curvature=0.5% -@/-contrast-window-size=7 Use @acronym{LoG} to detect edges on a scale of 0.3@dmn{pixels}. Apply the default grayscale projector: @code{average} and throw away all edges with a curvature of less than 0.5% and replace the @acronym{LoG} data between 0% and 0.5% with @acronym{SDev} data. Use a window of 7@classictimes{}7@dmn{pixel} window to compute the @acronym{SDev}. @end table @page @node Focus Stacking Decision Tree @subsubsection Focus Stacking Decision Tree @cindex focus stacking decision tree @cindex decision tree, focus stacking @ref{Figure:focus-stacking-decision-tree} helps the user to arrive at a well-fused focus stack with as few steps as possible. @float Figure,Figure:focus-stacking-decision-tree @vimage{focus-stack-decision-tree} @caption{Focus stacking decision tree.} @shortcaption{Focus stacking decision tree} @end float Always start with the default, contrast weighting with a local contrast window. Only if seams appear as described in @ref{Advanced Focus Stacking} switch to Laplacian-of-Gaussian contrast detection. If some seams remain even in @acronym{LoG}-mode, decrease the sensitivity of the edge detection with a positive @option{--contrast-min-curvature}. A too high value of @option{--contrast-min-curvature} suppresses fine detail though. Part of the detail can be brought back with pre-sharpening, that is, @ref{Local Contrast Enhancement} or combining @acronym{LoG} with local-contrast-window mode by using a negative @option{--contrast-min-curvature}. Carefully examining the masks (option@tie{}@option{--save-masks}) that Enfuse uses helps to judge the effects of the parameters. @node Expert Stacking @subsection Tips For Focus Stacking Experts @cindex expert focus stacking tips @cindex tips, focus stacking experts We have collected some advice with which even focus-stacking adepts can benefit. @itemize @item @cindex sensor, use of clean Ensure that the sensor is clean. Aligning focus stacks requires varying the viewing angle, which corresponds to a changing focal length. Hence, the same pixel on the sensor gets mapped onto different positions in the final image. Dirt spots will occur not only once but as many times as there are images in the stack -- something that is no fun to correct in postprocessing. @cindex dark frame @cindex subtraction of dark frame @cindex hot pixels @cindex pixels, hot Along the same lines, the photographer may want to consider to prepare dark frames before, and possibly also after, the shoot of the focus stack, to subtract hot pixels before fusion. @item @opindex --hard-mask Prefer a low-sensitivity setting (``@acronym{ISO}'') on the camera to get low-noise images. Fusing with @option{--hard-mask} does not average, and thus does not suppress any noise in the input images. @item If the transition of in-focus to out-of-focus areas is too abrupt, record the images with closest and farthest focusing distances twice: first with the intended working aperture, and a second time with a small aperture (large aperture number). @cindex natural sharp-unsharp transition @cindex transition, natural sharp-unsharp The small aperture will give the fused image a more natural in-focus to out-of-focus transition and the working-aperture shots supply the detail in the in-focus regions. @end itemize @node Helpful Programs @chapter Helpful Additional Programs @cindex helpful programs @cindex programs, helpful additional @include helpful-programs.texi @node Bug Reports @appendix Bug Reports @cindex bug reports @include bug-reports.texi @node Authors @appendix Authors @cindex authors, list of @include authors.texi @node FDL @appendix @acronym{GNU} Free Documentation License @cindex free documentation license (@acronym{FDL}) @cindex @acronym{GNU} free documentation license @include fdl.texi @c @c End of Document @c @c The List-of-Tables and List-of-Figures go right before the indices @c in all formats but TeX. For the TeX output they appear right after @c the Table-of-Contents. @ifnotdocbook @ifnottex @node List of Tables @unnumbered List of Tables @listoffloats Table @node List of Figures @unnumbered List of Figures @listoffloats Figure @end ifnottex @node Program Index @unnumbered Program Index @cindex program index @cindex index, program @printindex pg @node Syntactic-Comment Index @unnumbered Syntactic-Comment Index @cindex syntactic-comment index @cindex index, syntactic-comment @printindex sc @node Option Index @unnumbered Option Index @cindex option index @cindex index, option @printindex op @node General Index @unnumbered General Index @cindex general index @cindex index, general @printindex cp @end ifnotdocbook @bye enblend-enfuse-4.1.2+dfsg/doc/auxmac.texi0000644000175100017510000001060412070530113020470 0ustar ametzlerametzler@c @c Macro Definitions @c @c redefined commands @c Get the spacing of dimensions right. @ifnottex @macro dmn{unit} @tie{}\unit\ @end macro @end ifnottex @c extended commands @c Add a title to a DocBook element. @macro dbtitle{title} @docbook \title\ @end docbook @end macro @c Include a raster image. @macro rimage{filename, width} @ifinfo @image{\filename\, \width\} @end ifinfo @ifhtml @image{\filename\, \width\} @end ifhtml @iftex @center@image{\filename\, \width\} @end iftex @ifdocbook @image{\filename\, \width\} @end ifdocbook @docbook @c Yikes! The DocBook output of makeinfo 4.13a is so broken that we @c must supply the closing tag here.

@end docbook @end macro @c Include a vector image in a variety of ways: 1/ The Info format @c includes unchanged. 2/ XHTML first tries SVG then PNG in the @c ``raster'' subdirectory; if both fail, we leave a textual @c tombstone. Here, the CSS must take care of centering of the @c graphic. 3/ TeX and PDFTeX center the graphic. 4/ DocBook? @macro vimage{filename} @ifinfo @image{\filename\} @end ifinfo @html

[Image "\filename\" is not displayed, because of lacking SVG and PNG support.]

@end html @iftex @center@image{\filename\} @end iftex @ifdocbook @image{\filename\} @end ifdocbook @docbook @c Yikes! The DocBook output of makeinfo 4.13a is so broken that we @c must supply the closing tag here.
@end docbook @end macro @c Operators @c Generate a nice representation of base^exponent. @macro power{base, exponent} @ifinfo \base\^\exponent\ @end ifinfo @html \base\\exponent\ @end html @tex $\base\^{\exponent\}$% @end tex @docbook \base\\exponent\ @end docbook @end macro @macro classictimes @ifinfo x@c gobble following newline -- The Tricks of a Texinfo Wizard. @end ifinfo @html × @end html @tex \\ifmmode\\times\\else$\\times$\\fi% gobble following newline -- The Tricks of a TeX Wizard. @end tex @docbook × @end docbook @end macro @c Required for older versions of makeinfo. The definition of @geq @c for TeX lives in auxmac.tex. @ifnottex @macro geq @ifinfo >=@c @end ifinfo @html ≥ @end html @docbook ≥ @end docbook @end macro @end ifnottex @c Required for older versions of makeinfo. The definition of @leq @c for TeX lives in auxmac.tex. @ifnottex @macro leq @ifinfo <=@c @end ifinfo @html ≤ @end html @docbook ≤ @end docbook @end macro @end ifnottex @macro plusminus @ifinfo +/-@c @end ifinfo @html ± @end html @tex \\ifmmode\\pm\\else$\\pm$\\fi% @end tex @docbook ± @end docbook @end macro @c Special Characters @macro inlineomega @ifinfo @math{omega}@c @end ifinfo @html ω @end html @tex $\\omega$% @end tex @docbook ω @end docbook @end macro @macro inlinesigma @ifinfo @math{sigma}@c @end ifinfo @html σ @end html @tex $\\sigma$% @end tex @docbook σ @end docbook @end macro @macro inlinexi @ifinfo @math{xi}@c @end ifinfo @html ξ @end html @tex $\\xi$% @end tex @docbook ξ @end docbook @end macro @c Text Fragments @macro mainpurpose @ifinfo @strong{Main Purpose}: @end ifinfo @ifnotinfo @strong{Main Purpose: } @end ifnotinfo @end macro @macro optionsummaryheading @need 600 @c ensure we have at least 43pt of vertical space @noindent @strong{Summary of influential options} @end macro @macro semilog{significant, exponent} @ifinfo \significant\*10^\exponent\@c @end ifinfo @html \significant\ × 10 \exponent\ @end html @tex \\ifmmode\significant\ \\times 10^{\exponent\}\\else$\significant\ \\times 10^{\exponent\}$\\fi% @end tex @docbook \significant\×10\exponent\ @end docbook @end macro enblend-enfuse-4.1.2+dfsg/doc/seam-line-visualization.tif0000644000175100017510000042362212070530113023604 0ustar ametzlerametzlerII*&xyeUu<$̃"sA1XP mPmi|6m416&18GEEE( 2.( +Oo6O>E]3뗿̙3͛wwL6{`B'tfm(O9뮻u]Fmt%vmSoN"k&kO`)S;\PنnC]-kqwnVwB -tfO}M7t 7=;/zы@s9Nz7_w^ꏜr)o1,ۿ6h#X衇z[n9P9*W_[c5+ \s^_ve3rє){E L?{QnBkK/t7A5 i;̛wb-_Scyrw>,X{6:TE] _WZK/ET sLC9u֬籿= 'k&gK/]Z/omaֺ{]w]Gy+^ Z0:묳?|{p: L2u^Q20kƌwyk=k֬_l(Ѱ|򕯌.;UHyuס_5/b(N=r6`}kr~~`NpK3|IPB -d뮻Ι3ǟ#9 ᯊRȖ[nyw{WEg}?V[m>;znx47dKW]uՒõ[̞=q37lp{^ M/6eUV*oI5\SД]o6?s׋_bv(htnFO~r-Q pmp 5[oѓk3@CPAMR(+PklVP車`_CX]_4mj!؋xҁy.:= Vy]K._/3hkW\b_gurСSn?bkv~UWA8D$H, 8묳sϓO>Y-r)1mX >lpV M ĮJ͟KLFbM^LGzOW^G<4@V[0׻NFXjK?tUaHOzF#ɿ0EW^y]q(Ó޿k&a$Df`e]M6ylf` dC; K m&s~|&VrAS;{K_zM7w}7.b[vL /Ǽ'7xJ/Z zTA /[{Q5\N#8CR8u.(7\poč믿~GC=]h&p7ӟ  ,i#؆Hep [la- ڝw0:O?VmQ/쳏w #2wѰNW Wpˍ" lyK^AyWiZ=}YNvmt[Dj}ԂEK+ԋ< 78c> w5Y!DJX|AM["8zzΜ9+z0'z'C'k&f "&"pˆj,2{{8ófb1]vم]kXK.>NXvcw޶j?ޅYge]?!Fv-5z7|ň+}_ɇ.HTz_ZXٳgk=|;t2a 8,pHC^,ڒ/}Kg?bFL4E)cȃ+^2\!믘'ċNϫ$kզnz7z(b@)5c p,oQ[o xvg`,uyF혠8O,rr-]toi.}ჿpPծ:kW;|G)g]zP+/opb9^ءNh}Qmz6jK˴i.bdL2Z1uԼ|4 4'|!Ǥ&*1cd\{dR9m|O<__Fp&od0vƽ˴0 謼\pkY;4gv l{^Vh:ix;$&d4GpN:%d 0X im;}F_q_`O$Q4aW:K Fnyx-馛; s4x՗s Q<lHlt;}4P16\4Xi\Xg}V@J}kO8,m)Stzb+dn|a}ZxIf(ҏDՏcӛ(-jrqخV=2C*T 8WY|Š]vYiX %W}G@zGwcʑ +O1Kc ky֬YkR}wZv{BH{|%t7=SO?v"O`? c6R駟n]3Cϗ¿$&kMwډ512wY%&=bV]uUbΜM{7qW[o5sg3@H,T1Cr 8A뭷.}@>uOO~)SmcO˯)r(2hyڼp7ZӴ  #5`QN&-7 I7Lw]Q>H0BFup*Uum g:x/c!҆ W/ P) }M+QA3 Ѱ%c u]Ovq`uѐٳg~{%mlY~wa[n] nh4B 0\yZexӋ: )9ēXb 1/nѡdF=W HˡM1{biqI*Z,\lX(MuiTCE>ymDSO2\{=tV`뮻iOA~1\7 %Ӹ(W ~Hr|KO>{8o;eYW);ms01G-p)n|)9M"k_||2,NH\yUW]Maӽ>oIkc:TQ>Xf|%;Ҙ P Ys5V/~駟QI0D^{͙3Ghlϟs9'.V, ъz.BM҄4 +V*ua3b<6E fUIe.ñ96\* |F"Ջ8ד쁻2* sp>ģc]1r7AO kvP~Y= - I| @m3[+»H"?h2cp7(#=*%ۄd ʙg΁C`FK/xUQ~IZ 7ܰUu2i{vmID1mڴipao%խz+t)J@;fip;B뮻~뭷"-$P]s5بl+tP2<#4iz%@_wݷ]vz7th"nj}F}fH6])JOmvX F 0]n%W> 0jY|а*<*֭~F+S' sǍDzw dhrJ\M0v̓սخdA$?$:7޴"IwjVXaKBVQHW]hk I@'Py@R`/vyS]̋2=P$b/ҖV y]*tiN9I%+ʁ!s9/F( r6h1n57x#GG=z{.:-|;տݝoѡW\aj970ۦ:'=Oo 2ÌL 3yM^]bH2l(Ei5̆$,RHcȱp}/.*1[~ 2*x'vB Q,KΥJўM49jc{aO+~JgMeڡJ-8Z^56L/"fqUW=S# @g:-E90ؖ:J,Od+Kh&k;T-g2wyJu 7(<'R:j>z˝FQl 7I߽^S>5N`/[Lv2qIQv/X7氰!VxQQ@ ?묳yk̙ӛ+#c8P $ނlr %^_jci@j;omٛq f&{ 5>A?绖BЋfz 6?-BH :~?9<[%xCHQ/' 3g_xGm?`zƎZ+WM&~b˃ ǼKw "IP曣Н7'Ԉ+$*9CH !QDZMe 8sϽo bvSQ^8Y2ROb]mך7=i?u?o98[kli,`A( m2A_;{0(0^ŀ:DyZlYU#OZ: 0=яuAbKX=-~jzus6bű_4Mbvӱ m *pM7eΜVXaw/s|^ABEH} _h[Uh1IÿɭEm vWȰm-kSl0rUx8:" \&lg}eJXtG=Jz\umhUBK~bB[x-_. nj>s"U7OtI^l~ +_ ٳ!I[wΨ%]mUOyEOb9k7I9! ZMm!*x^c۞6k F"9mݾ/o[cùs7$ha z„[nuu^z 7ˀ.Uڊj@O?¹Y$sun-~wF :u0\ʇ֊M7&`~{k0{h07a_84FhQ"JUjWQֹ} "-]{T{󹵡|WtUbMڛ0NAPqGnJwӰ Gm ۓ@G!˸ gw%ǝP/%D da6h87Ý4LK΋VhQ`,jcOE[lE۱| .j}u2cv^J~>B *@, `MozWBs( 袋0UAnZK$0vBPxf" k]sͷV]u;^/Q/8J9%z=Zr$O{w5ğ&b j/C˩MFʎpF/0XUjzի("Zrs&oF[.]8?Bhc_|>,Z{xyPQh8V 7t  7@ᯂC -Xp1L Op‰[.bP"oڥ8@lӮ>xu;,V| {}fE '%{1'!<ۣޡ-nAIk[m駟vv^@8@1$P^{묳dy Fk#-A䌻o}[2RBk֙gH;HJy&QFt) %RgtH{z 0ebzqw;w.b4oQ7ʊ]1|筱LX=s̯|+Ĺ瞫fPHpt+ՉTSpw#8XW[6mL_ h0"-Mr=e7̙3LR+  va\~~3%(-$a^ 9jAuCZ)g&UWb%VBWOjҊMX: G!Ğp·*y,b=XO;\@)*tC6?]vzW[/R d p;:bg4_׺m);ve|EcMr'|u}{S u~j`gȶU|)!Gj]-HV5Bx:a Nj[pN(4E\+\_PMZOކ=}U: jW<9 3{@JBOd?ACڶ1 ci1~v23Z ]gҝcB{ }<6km}}V^3Y]y|io+F=S6^]cOM2hYy \r P{gIQd5 m:HgYgp|OqǝD IN D]}IzK, b 2![)cC/>LY8 ,HrfRno 1_K} B'l7_]i(#b`ѡy9r0 lY?`NAz7>On &lL;NW?M"*n5I{wbðv&ҮE- YFDh$H]8[(~SD3 s 4LЪ\S Ƞ@m6(74МRFӟVlF_{XQmܴG,Phkc =^Bf1[ʀV N-"z+J6N[J'RxS ^PAe OiѰm5tBcK)&?_*_<,Y{XʡGC.2x4*": G T]V"@+0~+ݍGeK݆'HEᝂg*:۶ ZT|')o={; MAX=ҞexEK.1꫿J{uBMC@EGU׉'> \YN[1'M]Őj}0_q?%u2#4c;tz9a[NA^>z|{INI 0ɂEOL GDA;%={ Eq~#]Iu@[pV+YٕW^y|N^id!GK 'E' 6DQ(zRFīT+8z}T?)?ETK5)/48vm>VwhoF $7<9˹$>k֬&e 5ڎ(qЭ6"l'T)]QTպXE:gk$`fr]efk\ʫ~~9?N>Z1yJC.Eَ7/ _$Лz!-9oNȪmriQZrA۱B0QɗOR51IWM '7xÌ\VGa>R5(StcD/3أDD8%& zTfȤe>bn+Cӊ Eq/-*JКW .`Ղfऺ#tAKeOjuI2TU#dZs}) w~`Z4YVcTy3T@T~Ѱo"[LwRþy-/TΥL@>}=re1ǧm<<l426%D.pSQUC6:rQDX, nό`Z$AW ϸ؎<'_zvHM=łSX/4cЩw9}ti?ewZIz-9Ј!!d_[V5bBzK쓱݄?,_uSGQ3CKk("4 oh^z&ffqڭ@<O=!ŮW;nz/t*[*-˗ 6@,F$JʲOIz Y GÔgX.XyjY"H{~vAM\Ё tmT1vm4kJqD( !et216^4ʻmg ,g؇WIuM:ٍiQf=v˜&ɻ=j6af<6}Zl;%~itknwt_^х.46(]'Uֱ> lCw~|<4 TQ,:' l uRrе )ƿ TLw}{+|QCˣ!<.Ucj*` `uv7Q9( 6r32Xν袋Jy95⥙ҴxG'ZߑLL&` vi=38#P7vg'YeEz:^{ mTubf9gwA6v1F u4t+Q/0lD r?i'sIz>nQz<[n?0w/ V[׃XhhCyĦ{zoHoծFwh4Q|l~/ iB_$rHZ7;;.&fm  Qh0X8 kSŚe+줓NO2YoEuς+jZUuByB2?fzSTxw:*39ahf݁x 317$)OaDw(F E;(P ҎndVth2ṘR8mk2jUQ;ogoK.t'͹o J|piW駟NUp&- sGl,Peb.>K<`h`(2?Jy;p!sݟ]\Ty%w=\yNB ()U0)CT*LO@)*>!5AA-bDu3s4]' O:iu/UV~s[sW]u^bz\91B8¢V=}ثS}Ek|N ;1'5Hfr-u9]-zWUgAZz`໾+qSP,t҇V^yo&&i)OJ ?ue+aZ,rNƅfC&.c$3 89݄CN9JyǓ4UPzafhrIh] -Q v=.cޖ?*+H^!zM`yq[9 ҕkX(hT*ʼiB Cp[o*+$_kEmp :t'6VhzQ[*'tDfhMǕ _hgrK6JBz㧻&&wDzcTiP{aQb kG~+jug3/206|jo),M Գ(|d z iⷾ 0}{Zvɛ~){aRWլ )n@+Wқ3, UNF9q0¯Dh~mDO3XҾ`FZT]|#,ҐھfKb~*!%!qvcץ"!`+[zv<@3N-]Ù.Eb}__ٙ͟H5iY>RRmjhsZh.Qug1QYפK1UZCf̘v-d aB_Qvf1FG9j-9e4 PR)`6d%B :9sa5܀e9[CW}jR;/qf5m-ǫԌ^nc#W|g7`}V/m2X-]f`Sŝ/#u '|2ЀrWD"EA.Yx6E]B__7gWxbS$ U#K-zSW5#i֫1|/S43_{vOl?h WDP,X7U]lk^ o)d)4Э=\o&MRp3r࿟?[?I5lk&nvo6c?XNo$ F7zmw7gtg{ojA^fk>W#O?mdژ 2|T7!Ivhx.r` DzJѹ;Fe1;~24L 4b-|}AE"ҮyLr @sU4w4vg@n;w.J[9)O4і:#B)x6R]r%T7{ rSGxxBoȴ=M2okx_L#tYl)I-|"5lZ._FhBz=m{gvr{34a#>O:@0bD4. ]KBnjv-\Dl>J[r1ı"gPc6ؤ,5Izn"IQRKK -G[%W]Uw|@pL+949МceyX1\b֍h4x4ٿd؂h%*-+ԇT^5u[c.n;IY>I{>%;[w]Zҕ =S\Vg6svJI`BtY2( ѨYfq||^?N;8^{*}iniTc_ve0ʿrʴ :3.f@RW47 [B( ֚S&(oy&3y_>=-uy V-bNA˜|k?% LE~ߵB kp/hϜͧr'lCNJr‡Y1,ud0)*X3Ȣq/7{ün`66;#yݷ[k|ϧf4M+9FҮsÄaf2j{=F_T'TDd[e3O rx=$0}}-F8*(t)ilhQЖɤ7)U=@i;g#"TmV9 =O9.sF4SQ7Q0"`UcrKL@Dki);/[YiNrxr {[.D ajk^kJP"lEFUͲrl(ѿJ[@苷SCZ3*~c¥ZTo~sK4ɪ4XL˵W^vZf?Y?igv8~ _,)*'l/Noc1Q%kEqo~hɜVj'Gs5loqr {^t 0HָKi06v :wG62f;*%!|FM k K^xqn+k^ɒW: 1Sif!.ΝXr8e,ޞ*3uszoQ ryUxs)|H]tѩ1jڴirPVBZ@fMaZmlCi%G9bvG`uN֡e^(ZmA: NƋmܖyjKPnYgyM)ƶvTtWa ۠fmoo~mJg֪sy9fcZ0V.d(D)@;aT:򤵋9e,?5|ɭHo? )Ba@`R ׽uBjԔ@+l%{ک%K,@ 7|ܺ뾮ˉA vDpZ~QKa74h4/pޓ|ry5,#b+"VΨE3Y{aUx8a Fr4[ 2 MHE f}VڰY[>R- oeE w3/GZoT&,hB{\${M rVqCb?elxbIP޺Pgmɱ쭒0Wc"]~4pѼ6ls{g,C a3?? D|31ildtAOJ+.]鈤 %n)trO`hݖV^ds&N`L>`cL(i}49 VoTJ BOt S~W0r=}F6};ߙ_+o[q_~ ҐH&?y;nدY[ޖȋIm6:\u%}tȎQ:cybi\E.6݃|i6 l6Fe.2I> ,vѣ|]5wNqN=IWq#%3FBetNϳm͕1Ӭd6(0wH˅B3n\Le#oN y ]m[8fl{֌3F)Jx<֊+!'7>ޙ.βkWM(4BcprN! ܟc9ӄCiQv&nL J+T_േ1tݢ8DޏeoUp@3omg_f( nz24aksymhJPsbSA#F]eLw$Jwfe$c::7i, *JǑPz/>fe^U7 `gs9'-]@|ҥ^,*kD1OeQӜO~hUJk&O<ĖoXRd!&G9:qa૱ʫS|/}m<6Jڮoi:7^BM w~GfD$: ?rwb6ƛC,2QRJO$O %.?_zm}`Q h@cxa -^ 6cH;!3dq*ZkW+D%0vZbTGI7j~hHTf' QT7_/n%iT‰-m:%')2I9Z }{oSؤZJt\Q5ޚ5kVO;h"e0v@m붣aN;o&7?䀟JvϜ9s' NK;:3R=y(9r|{]vc*AQ,zu(zi??izē_~j9M}k`SZ@5r)ղ#9 TbxX.ӷ&]x7vnxᲤWlAjVSVzHL Ѱ@xyl^g|r<ؖ&t#MFhI$Qw5.-sߗ%BN;?|wo0`2{n X퉽TJT /@,pMyt.2QF^{EɣF>CD:Trt|;xS]CBs笳w-(}Z̪2;+H-QsKAi\ dz~s%vTQEzA*ogH48%pȡZ&;-bqGm6qkF>b{ʑE?+-je0x|V^ΏP^//KOkVd8, (IR1x O6>StQ"wcX/H!+SZ<?iX ۾Lv42lwZӫ-U z[cZk?Qƥx>ؓRp>ƶ9_tҊEPw@&Q+"UF}G5gi]r3f([[o~>)]>W2 >s:O*iߠrδL_XfכЃ5DZ{y޻ F^_tAӜv0PFh XSl^ [mu)9[RW:WϞ=cr)kE pf9/Jf~j &d!Ib)&!O̙3ˣ2t'Q/R"ذ%0jYѰm n|P U b/W?°倎~ Gp%cJrʌHЗVKQyu 8U]w5Gq} \yl7  |zd׿E"ӉZu-e|k_j' W몮߫u}!sԶJ {fwr?2#a67 ejH>񏏞a~I - !iO{zi[P` W;N?B8SZldWh!d5,',>% Ic)R)ik!m^@tUXJZDXa*N %6hTrng5|t@4|ח/CO[_?Z/*vHuCN+D̓p. E,<1pRK<^ɉ4pfԪˆN. LKS#%lMYmN.1o.EYޭdcـgz ׍s#WKjXҘ4qs'N14z Tu[n9~nWfPo}G҃%x)&<~8Vƌ[EaY(gm>%Ve>|_Ȫ*bR$ٸb&Ä‚Xݺg3az_ZK."`Fn{lqś< ,9N3YΩaT*]LQ3'|rs+L HjAv t(U𼔪`ouƵ'KbT"#z-l.Z/waLhHcUTzSIVN{$uzӮZK;p Å\-aOli_ :Xi{_]ŖTblo^jNj-5//X Ń6 UVه&8ԓb qz7vTbvm9p"|4 /pC2a~ ei+òd͖ %j #O<~:]9a%}{1.>9HmW h7k,zR Jߧ p;#bxYS6>_fza_z+UTrQvbh"7cy/99WqٳgO9nƧ趍gJNALR 2_*w=#WڞSZC9rdOE`5?j-ެNCk;'GnVwzFb ]kM +J3aO?}6SNpsrk܎wt]f҇dgFA⦇h)R\}s]4+@ FM'O5L|*`NďvѹZԱ HYKo;9Ύ|lqu)#ҺޗPR&~zب$a4.].طv$UD ҏ `ƌFѧ /9[xygN1ӝۢR;Ur3/RQlS 'TPh=+ߩxpbK93 +\-%N L 4v栕q~4c80ܹs&6_h!tV s!{AO<E{uqPXz֯MkXp.>s Gե7oghW97cɠ?|MXL Wu9?†T_49&50afj9s6U3(>V-EL2R^3sբ t`Sv;_(Ѱ)mih?vc{`o+Y!o\uA]m(@hU4w^Ƥ/GɧbZB oiEZw/8toX/J#F'[EFKJ;: ,]ۂ~mxq>ap߿8%hy #+ +^:WYe厏ZNdnv{^zU[-liӦ#Fٯr΄}bEgbԨ6.P`64MCN{Ի"E[E4}:te- C`rbԀ(bګkQ`,H)SBltvR*h|ĢLd=ܓ'Ql[$-'p"~rLt{ѿ B"#Q$gD7.3o޼F=ydSObl6mMHַ:y7|g FX.V(ڼ袋 sn*!tC [7A9j`?Y6ܲ| 1[WmjT#0K%yvM)x'íE4xY8k}?|vabhP1ҿxmk}dMq{f {>Q4)k1NĮh*VkvyVb\!p:#0[qx+z!Rkg=Cu+XкSî׫6y(-ns,Uq#Sska"P|x eecs6|iWNeĵդsIVЋD1uS/g0e\=%LY[ ȎÊUK68)讻ů>6I7Wkg^탪ղA2Sꪈ QE"OjioDی7=%ܸ ^-M_*L(ʉO'yIPH*M&0 |C q&>J`P,L{x㍛AIV4/d7X¹ǘ6)8!3'ϟ#_NS-PcD%Ckc`zesKϮtj8id[ns;6[d$[V,K!S~ջ1GC1xoե$S(v[ $}i6V1ozCj*.˞i).{}mZo۹LGw 9vj4?Xݱ,;Wn 0R7$eT(MUj7HO2Qhb;OI+3^*K\ )S~vi z#d*9Ο( kVbU^;3$DidWVY4? cKoqDD/zݺ42eh(?,nlnvfQbgfR1ěcQ {\{ '?#sAJ [&u3;u }{:*@!5:;ۗǸ` F({v8-DhE$j=d hQuFm#pfɍ٩ W>xOROVܯ:h Mfiچc.!,[DGOݐ [ڙP'EܱM 7"<&MHx^()Rg?y'd%պ4 =Q:0zЄ]|܍60PFؒd)"5(\񰤒xݬXbA2vl6M˕j"N<O1k.: cáa6a ~P /x۞[m]*,]gUX %)X{W }&qj$JN;csKk#;6¼A՟&*qE<܁x@(uűSF*B;g?YC&ɟTϢQ_s&\ªB<ow]?K'$(8##%' [ʔ)N+U,\y4f~b'V|wnQa>,A|'(ڼ=RD.g/WRoŷDUEީ,Qxvq8?>ϞEZbDhIx/?S@LH3smQ? x:*ChLI2Jǎ%v/H<| V9Ώ y}h"k-nl fdC$nPOvdE @ljE[HLlO+hخ p!^-5Rb͝3{=Ivg8/F }xL4-ƤrGƛrmbKlR~P45.@dvx#Eij/ܯXujPn>Ds'NO+ HtjQJ?0;Pw@,iT\obEo6Yc}]NXNŁ.Q?.K5c6AV:-1m(($xJϾ3?F^uԏ:}ټHZz6&((yL.Ztئ -\s5_V5Z/4-92@iZLit+Z{ソNׂ&i"F -t2NxԥN(4Yљ9'aӗ(*DD !h{iK{~+^穇 ?H1^]'ʿZH)HCqNaͮ#FǏVgh1FF$[֤1N\Q0RSնz]VYezG(R9.~[FZ,z)!%9 @j$%$&J $ff,'E{x?H|R?F[8cFy[Y7B9'_ͬIU՘7* Bk!UpOj# _BL+M;g}:q:S*KI54(1$@:H`n'W( +cnhȞU#XO~r _6FW Ga/TݙxEVNX)"pw`B!vFȹv ]ΆH1s( Z)^1u]] |Mo::5F` tF ٣ia4p2Rl 'ϗDK/6l`"_Ij$q(ܬPaopY=!+jWncT4'1Rnɧ`o~0Fb,Դ*r\!G^,-*EvmYK7ZrahC1uT*\BI7/?hQEp,w7 d Ats_A=u:!6&m+<:w?pO_|K%*Yqi3 qBu1;l"3a5֧b]Q %sPG[YU(暯FtjDE9>>rl}ID{3RJUWH璿T- ΋&;ٳRLe[t0LePm,y`fξ]-'>Xt4K줛~ˆn|_7ŤI'WMΓ."ys-ըc5f7'db`QDȽ8J(N8k~^NYcìmZ5ƈIM2eܹL`޿{"8Zh{'>m?|#:cÂƚUA*pf5ٚMLKLߎaڌ3>&]z?(fEtjMz*sÛ6ıYk͚5k7okV!l(7<#,5BH5]o(s I$rNR0;s)Tw}$qV`sN \Nn/.Ϸ}1nXj{V%s Hꪫ*m![ZCc^e$I7R~t1y9v+JN;uUf48w^v"ؗ)0If6'M͇zU3]/i …G.$'54踰apڹaj[ZnͻGf\J&Fr¼M=C0\Ψmt7 +n vn (184^{mMpv3vʆqc2qO]r% 6,f>iWvѨQBA0= ҁLIrL;|qpQGr!^xaFnxXbydXd gюf՗TqD7iЭ&_40|AilM8/VPs!s̑gIVOzjhPo=!hmSkE 8~Ƴ:y%Ti$dk$nSQ^0JxQ<夿 JmTۥPpqqefM&d%5zuG YR QC<}ЙN ȭԟvc/nӼ&Q2]v6"G%ֳX|5opWk-%c`~Zk!wO1&5zMbr|>.?}衫k_6۬ЅzxS FH㦋$Ò#2S5{a'>іA'uge E(Z\ĝb6 X `l^DqcŚR5dr)ն6ry;h75 CʰfwW i@8|T 58q5r@`.\HwX̮^[& Њڶ1̣wZqnrXF$[Pa֦)/[2ӃT4Es$N>v Ju[BSs޿j|_p>z]Ka6fM 8ɓWUMZ3fު0[0d\A(Ʈ(vN-i+@F7[Ob^A3J[E̕Wp47N=T۬/2NFks5u^'o>]wiO[ilR ypi믧 Zx="{H6E$1*ˡb7O~L ,by{_;>Cj7oZWJ{]]7> }'ᾜ5^{6:qPAZűqSHԩS[cvsr[tJS51_36ア( RR_|;)Ozr-:`]К|pQuݯcO?',¹.&t‘JGsܓ#E]2y2 YfS2v6bRG3qD/FF&-}n|qiNҺ&vH̶00ct?hwq5v80K:n¢υv+Hc~N%Dׇoհ=D@0.X2I#|/bpV} aD%UغSePQ-"{[ӽ{=Ѥ>DAn6zw3 ؕ궰v5mU AVC2#c (mm]C}Oh]zɨA#i{4W;GZuOh54ѐ!;uY2O TM#gK01a륬G/GV4N$K ˏ FS/xthhR 3]v\4zk`k4ֵŸGi>R5SV Plih=vZkY'{="{W.Ҭ'e Wqˮ#<Α(kO9#bSP"갺-ԕ(34G2kY}IvZ#RA z"t;AwQ~PBbz6#0iڄsYde RaIttA4U(|RhþI%NF j|2A>ت"KZЄu{笞׉ J`co\"ɭ&"W#JP8rfckn嗓Jև'fd;D{aԘR"`i8-&iv 3аo~ -6c$a"Ӫl(2HM:Z>wy[,I9>"E]Ty{e (v^U/Zɚ5kѡ<>ӔEc9FGK}jwnsJ ?FCs&q]쑠HS@8c'!nGH7dm1S-^Bn7QdTkUz uyƌm\*^׫ߓ~mDj/X5|=kZꀿޢSF13R0;B5Fe7LZhJR2JL S2h U$oaFk=E42E0E򧋫IAUIdO"\wޛN*r-q݊p qv+2mڴ&D@5;h=}o|@]MUXՉWH ^~lfbmBo~Jm7u,ma̙0қo$Sw4DN d]E H$A;_z:kJ+ h[cцr=20[Q<yZw 2uuvH(X5ܠ"\*D˴bo+.Barhtk)SD1;nbg5!N 7 /vߛ߂Ox*}rw8 K?i9lxm{69w>9^{E!V^^=O>$N_җ_j򔅑DC&УM j'M"'XP:wh؝fJ%܈S)L[dˤ.\'lD"f3gNG-A]*^5/u.wϷG=Mt8Qwɼ?Lov p0Hز @'Z77&b|{饗&leKSk%m1 ,w}ۣ[{BqRuZ519y!v4[D$D V{ckR.>ez{R}A ѐ/Lץb"Ĉ4g5rl{JƜ`7yZk)+H N N)V*$~D(']1"T#N; U^]tH@?.}1HcCy}9Mhqi&ذg>OV$ة#=(S&ُC7Rnhjv7aVq^D)+^{mJ3{p:.}ڴ )(t-99&EI?j=0IFƈEB⪷^K??S{Ac{J#jΘ1c9쏳ķ8X&XX--{V:Vx  _t(ihrg▼jH$I1sDcf<#8nx/V(Zta<$^R.vPs==XQ7y 'xMe8jM}7t/ϭ,2A" K?b]e2ąVSywrȚ{@?[owtIn{wݜYc֬YZF:1eB`o<mEwqNDD$.lrTibPX&gN%%" h V^yQ`=ؖu6ۮ*yDEx Pyj@+2!%!CKyҡUF8G]v٥ E6m ƂH m.B|=aQ 6V; D . IpI6*}"~wr.4GplڭFFGۙ˲/c 8ꪴOŖ^KL.jYy˵3gBm&/ WB2oci2 ӔTnb5>y JwE7 }jXPo:KMUΠXש7v{i(P]QP!'o7S6lO{(4^9gΜU@D5dnn9+(s4M5ɐ;Źc~ݱ.:fI[_RMqXv'`x4XG]h.$R`F7Cas'yz*';g;qϧ,Ě9}彶 qqqMqNn;Q:9)ȏPtL|My\r:,gya-D \߾[pnHu3JP|Tt )DO%~dxQlC1sP2=Џ~=[| }oDcO\n:Bx9O^AiTӜ @^?ays҉Mh8G YQ'KHLPlQ2 $bEtܻ㽦=+&ii-ÚM7nغ{^wg FNj֟QYd[l=0h*EL`v̉Kn`/|fոᎳ?z"E1E&iKp{un?ziţ "6&{\8Zm]Gƅw؞A?ѹO}r(?񖷼哟fm.Acc=8 ₓ!MHj6ʉLn2lt^{Qf 6+eY)6cF)SS i45-OynXRrR2=SV`ƹjkW hROTdA]M^r%A%/kˏ {}\HZVaRH5 v[)TܿeO{MNˊ B~Gt:9QaJ7&R~.5Xnf2MjƱ$D톐XO %Aڬ,(T8! F:*?(zwB1㐐#> .&r!6+BETfN륢qۇ*{61^uU*"+"2͐NgqH-è.%K.QzKU/J+p4qQ`{QL|[mW SHwm[tX܌gb{m}Iß1SΝ~N)U?{bJLz#~Jジd ]mzNZ(I^-ƕ34ԦOQK’P)ELHgHP@!h0Z-X@LoOEuզ3Hs`'u{ @jD*XDjuCMp}kQ)5& VKDw߽$L)\ mFXe]en<.@wǔ^tj[&L]q [)z.׸S)7SiZjqp|0 ~}kt}'΅NÑk Zѩ]6/o7, ҩ'Piе^;qtu%#MW;ߙF /[{[69P :$d)lDU`^bk3$'QծtfARJRIWڪbf*5֘ٳBe'UZP[L_g.^Q%uw~@[MiYd߇G}Y2YlPj }T'ŴFc!L$19)n![RzؿBsI6&&zHWg! jUf 1v$\ERQR3U{HvH5f5,.tmmF>jU~4K Kw?u`؁^;(Óf_cB*%>By{{'̲8 L$uLMHೖĥ?9K/ ~=lYC(mvAit4VDѶtĜJ-3l:'!\bXQ$s\J؇zx饗biKD~ 6xl8lަBZ釂@(:W+{oJ% vv;[j&iG5^=CݮYfSbc p 1~:%?UڿQw`#ʎ)0e2ȫ4T5kv*qj4XN@W{P,6Cm 2^S;O>2pHTnUJW ,@:l7>࿫ee>8YXZ9t[}Dܪibj>[m.XRGmv1,bMhXeW{4瘖B G۠z˴i>1x≜cazNw_<0 VbJkƕbkHOX)Qm3 UN H0OD6>fҺ\bUCoplf9L>{TUq7=!)\h 6dj0Blܒ's- .1cFsԸ`t/NE:*. 8'2HHXӜ9/䄴Q>wQD#lWZ ?n](ʣNo.?;zg``_惾›[;bU9m.rKg :7|\MESeQ; ܀dF*~(׻v<44emlmu;[{TkuTmOC+U]֔Ėˣ*a@PUj?ػnx#` d~{ȁy|qНvޜk8C-"S;h"6Ad-$|lьOS"sǸ.'3X!{8Cb{eoLdh0@h8%Xm{ϦDaf5r(hl1SNfGY=eUaի߶&@wEZ{_݃yN vI)*hf@7¶I{n?dgV7YcЃ6tY Fv@o}]*:hel0^|7̌Z +P "}@g Y~pγ= e/jR$H |f].]Ql"/&(ίiQ fm\4%pvRz msi3+YF{0u"=$ @%rW|Ww%O ZVIPV2h!.6i4deaM,U+ޒjS/)Y}ۣ$gn@ F76ҏ{F$RTFSJhI6q}B$0lbfRc>s1'= Ηr5qȂo.ܲbnNG.G{iAFs%_~b z_UA#k}ҤI\p4U9Ci&$35;O܃Yf`g>㙤24VON(HlZh̙"FLH/i`0raD7 f{'`֪@ 6(xJZ9ڊPr)͑s;];>w[+hUJƲ6=?&ԿCKd7ʃx`me6fs!c,]_uUDC==^uxӡLý8*W'+P5zwnmt%zIT*T[ 7[ԇB▲8cǟTѐfb!sr@g_z>i/ "zG_YxʻdKHJQh%̢ksח)-hSlc uL܎/0 w)";ۿ={4#8 Z3R9!,m u@h%IDhueT`8lI %iaʌL2mOn ;pBFT_!^m5524umʄ i>l2PGۗ8k["!8ԷCoDk**ILJ_ٖ/2cvK=}dktmRщh-?|Nև:N;cws{aϼ+TČ\uO ZSyIo䆧/\ڔdqcQ-~m."KG\NMF̓~rZkHmq12;q MGC!SSP][.䒱O 6 w4u,"L6Ίa#'bNf{#k` Ig+4C {5SO "]ܵ瞷p衋?v6>f/_QѬv괷 S{W 駗>i+\]*zDQZ >rN{,-r@kC3}Φ"j$~@dȳ,z{7$!&5.ec!3 R-52 \0Dk 2h3}48O!? ,}oI{u4/JTOvi}ԿPMwHG/ՆL~g;KOS оK.M$^¿V R cTj*4TtL[l6ѢhFKܑ,q Ph7ƅԵ^p@Y* *]ZZT=;@HL2@p5fMF7w W 2RYH\oS;$cuqw<ƚLnߩSvSj`Xѩx|^wGsEI= FE~ة FooWCG(N7g4mv\YMDNkbCc#l"t$1}Cm $'r6[d7T]օB7QIWL$'mm4K.IU5 0vm|;ߩMzQ$`6j;uj'jyjğ=C-;제1u$bܕ&Ny0a SkB^Q%Ƣ̯h"7aYѶ=YW̥~jtO@dW]UvoBU]i,g\]:JkBzڊցs璁cM FRSSTb0bQ)HDhgy&Ob[o48nu>p\_iSz+Zb:aS'>6_yj )8pO`_UeP)* Θ1NSXn~/?yltt"UW]D" -.PvA|ٺL^lƱCw=7 7n鿦x >LαnmFWCUJpŸv[79<@C[j[5KAv'θxIx[b@Ԕ/i m[,qW2~i~ۭz԰l Tvo}gQ0jYf eL*W*bۍʠRzmPz$՞>ᒡS#qxJifϞ uT hZ|N DײۣB|q1s,9T $.\4Xz׏m2;@t8> =.p+IOuEvXk@1sLgI0"um4wj7,fRaG{sq?)ING 6 7N{O}uRE'yƌO~6R()ik _qz궿=O.%fX$_Uc, 3(FNl?Zgq'7|3.dc 'bWEJ`PERdzfke.<8^Z*V8)7׿+]L `1{Xc3[C9Rƒ>X<8A 73?яJ f~RWò?1Q"B5$45݇??gQ :aK&Zr[qd;!?&|+y?VӸ"mrYO6SO%E icjg>sرdEOoj0GP[="0ԣaUB'X kwAWFѤ_`Sݯ,z& -,I{l 8k/k^/zӧ\#A=M勶<5ǘ-&{lms TKu={>>&TTT#0%@P1!ٶg^pEs~kݑBW`eY7)4أLj Pi􋝢DXFڳV[r_ւ2īG@^l;kh HcWփLw5'kFbId.7NlhЖ!p-I @PBc'MP#ms'xb}VYo68tA Jכ9sz¡2'|KoRҦp8 cRRe>3Ή%R"l| qcl975m95 yK] f? ;k禛n=u\$2LԍJ+޿x yj?^7_6-Wm|F V?et䛃j!`κ`" ?`8\қLx/|_lZPb$J&X M\ l8ydvvHjUFNQ鵿 Լ8`ͲɧNhJPy0X+ ~cSN2"$ te>㌃?5~2khA,9wRT| 6 ؓVܟE}rՁ7ɬ攢YWV{einmvE\{uQ}ĥ?O?|B| }4EJQ[L\)2A)}oCL$%eٔ(k ơw.7|ZD mV|Jؤ'~%eԍŽPI!!+6j ^ Ǚ| NU $;Nc6H\1|&if ASCQ S8d=hESA^5$*%u' NJ *y3Xc2etK' }&Ƀzx{/{ֳaKj@j54Pnw%vb6є&نn68gqQ!RcDJyrK\Bߧ{DMK/DDH>k"ښz_3s5׼k02ٳgsl).,Rqb@'Y6~~H YT^xaN|;?58^lޕpVa*"մx dl62S%Zil0bRh8\rIGiKJt ~ cwFG>LxڴIVhZ >1obyj&Tab9bm ƀkVyJ?| +ԶvOs'r|3iդźhYuN^O}\KqcS+<\}Q-(W.4eͣSR|+c<˿߄E/j Hq<Բ3^L._ Xb jHQ6qv?"^HkwKҲF*BVQ T"y;,'??R{߰<'{LX#d:qb1zׯ*Z0[biӝn୫_W\Uֱc2,/ Z[[ֿ晉R%[*Iɢ;SX5.hg4m[4Bĉ/fޥ HjJwE'4Ѡ8SIF-hH$ aL&j3W=eҎ?>o6n[` 7z0C9裏nO+8}}O5 "l*BlWuN (m"dWCxbp7 )iR@TG@n!R]LȢ5.nO>z\'d:dԦDIOͫb>m]Sannv:`ʡnS/:צ6G> i NKTEv=ɤIo;ꫯx{f:7O$S~F{N;tg8.BM (mqp={BGՙUQls'P ggk@*Ph䃸M1W9vǣgvX7p()Fy_ mm\]ltMQ;!0}Y,ʣ8 ^xԘկ\rɍ4 w[VnB4w/cl̕i֢R, $ƓlDGzTMܾmDf+XMK;e='<%6ӝ|警s'Sl&XKIv*x($JJYäzJu<3BAh*#༖> fLIڌ 1L G*xnI- OTΚ5.%WM|GڒtБdx[>:ؐ,bV(ڛibKԯ|Yq-1CZCg4?) P?hHX=CxDM+n<"73aK͛ב:&C9Z#jCIth5T7 _'ګs}RrٶҚmJHڌjIz.,O8iYQOo=tduB8Ld=JRk 괗4ǚR# `wɓN; [,f1 dtSդ7=ۦԩg'i{"M7"QD3gNh#r$?pKg.33J;Hc\Q;#R;K3Mۑ[#c曧Lf2cw]W K ^zhf 5WMfrT_0&aT82 zcbdϯ֞ƧCs'":+Sho[oIv }_f+<%vbeUwB眤 'Uy 4  n85|r&)i (E{{3[(&痲*KX=:8fRtLyo"Zn?kuj~=?? gNՃoYc启m}Vu894==c3-7pɟFAJ;EfMM)DUcZ {C;4侷O[[ !=sKoB_k]>,XhOQAuѹRLR5$ykMW.W{|F@`<%mi; U{ S=c4(5M hD>NiK&; ~ڨҐS]5j7d2;G^M<;6DLҔz'jN3;Xn{/x[lU*(\!NNid%-3ϔ-+w,) 2v%c\5放*x0UM p4RA[qvy4.EvډGѐWj`Lu: 4 [2>cslSY;`xe8t2mEV+f%8#s4 8DBnnXI-j3<7 "h"{v6jj, $35|j%6 qBu R,CX؜IKuO>ю7{_~Z,<)N-ծ\/Rm Pl}kء(O*nAR%VSO1RR);fޟ[x(տ?ݙDoVf+16rTǕi*9ߦi6mZU1j;w$;fl;^|/}z6?Aؤ;9%ayʺ!ip!?FK^/W +Tm`[ ={ u5 .`Y?ΰjT55֘)9 (謎Q'b5G嗟4vo?bU<VWW)u8*:_ a2$2!ՄL”IAu PuW`hW(Ѝ 390e 7G2K-&dvbWU~M:s1ua><ql=gj` 6HO5.ս/7xcOӧՆFK uUFGzwXٿozgqRqq3u#3~]yp׼\<\rԩSU1{K|]vI)0UW]2xLgt$OջzukxY(PvM||kr> 9l(6 /xWe2=1?HL^1Ʊ"`:|FOW\' 6O_n8$³jzן%85%?$NQ`PGFKx[IIRQHjS ͭ::bM v1س[lEU<#[D0B b9[4&±@юDZԽKh8$ةm"bDg7Pjwъk5/?{챶#58zd^QѪIE[&ST?uٷ֘w};^Wx(տ ZUx1A?dSEY q9ם8\L~ŷ{juOO~r񳿙kNF9mm4놺֊vk)%9CՈfgN8ZYjmhud/| Vo|Nq/r(1_ ɚp]~ޒKnWLѐLn)IQu8UktIɄ6iRk޺Z-LB.lؖ|^c磡=z&#C%Q nGCBEE隣ա>ҦO򗿼]Mg/d#^ƒ Vj&UbY0dɭNiI'$׀<_l)W:<ܺ"ywy檫nzEs-hv}MJ7, ZB ;._o%Hk-U . @8qT"p*dWc逐'ިNRW'4 ֚dT ;vs;qK]&A[$ n;pH{,Jχ@|/XԶD5\e!&Kmӟilm mCQz9rO|\g"SSr=y/rrMXN>hPD:.aKdL[4|SHm2D=>{ek6#H ժ;a8bW7%=+ԝJ&0м0o}[ϞeݬG:omЋ^W2:MN+]^z)OdlpW~uz>S!j$bLFj oi49uP.QqlI*]lFaX4ԥT{-(:yYf`_eS@~Ü9s6Guݶ܄5 &{A?cu;=fc]but[pz]](]r$ү +y9E]T?V=NvN?Ng TRPtߟ.(!嗟K{H<ۃq޼T=Wj!Q(~&;;'{@nP%7|QΦ )4ˢ\]o. 3!' zM}}\ֽ~eM+l`[@=l6ӧOoƯXnG_bE] j97{KchThq/g"ai4d5ԃ:P_}{5V[)p~j{mδ@ SD%d//FdѸ.UqdMʦO^fMnr9أ} _R#p5iBZY7j8_lqgc.5b[Jm];jE]d6$a}F"t㸮G8-z::N_jQ-IB"9!V Pu(~1~]iE M01q:['W_g?y'>v_6 @'Se A(ipR$*AA[kD\/j:P=0Ggdݜvsؗ8$:0N[hiS~ N[S_S}W㒃`I`lo{w!4GHWW[z ε&a8nvde#1*҈Z < t3O/Lm ڶ_|TMm3 x΂p>4XK \>#C}%f[s+/pp(NRf{mb'Oub- %Pp)=ڳڝ}mJN)5ۯֵQ)AB'D:nk@-*\8v-єJ(nκJ'LϊR% {"0unۃi\c(ymQix nHNPۧ R"~h{$֥gO [\41͛7-gwj8cثM@=)xkjPǁUV5fQ7 0/1`VO2 u ܶ^t͹1dJQQ⫈#`pNs/yMnmW;$%Sn^dIߎht1 ѭXEz3A{{q!]Id  0cƌ6XTʄp3GV1eݩ3UaҤI["T ɟA6&E?/X#}[BzX/j-9ޒMTXvyvI4SviՂ(!mdWd#汀uN *SSK/pIx~+-e~x'GќOLwVU B9h b( JUTM#uԞQEFA@P@ FnJ(H~~xüag{~^{Z{ 4׾v@Y'qŌMo}[{jm\\sӞr'Pߢlq5^#0ՓN:,Md̥ f8t~vKs60/ה}ta U$/LF'(+XWbu#?}&zw3QJx uKJPFj_tohug7r,V2xJo]uER`D9̞2O7 ]=/  9#$HI?ߋnȂ`<1j$5 N'k:RvzNPy]q{Q?p_j3Όӧ-vg=>3t:CU6:;D OXv[J]ɮpڻ+{_2es2Ѽ2h4vxӛtT`Z}"f\L?痘tsϓ ug}hf͚5{l9s,9AE1r f50V6Faxh%ӿzlPЛU炑e #@zu`ӂJM]VE/z]^{/VΆFÙġ-fpAED~ t2x?m? y{JەhE.˄rWv>Zۤzm@? N:Pv.l*y0o[ zE9'l_Tݩ͙*]w]2[S߶Bo}/忼/*%geyJwXǷ x6EIQv?ϙs ޵+\rS +OVmf4`4$v8;nw} '7a1J?9͍'[P!$Pj=iѦ2X^[k4.̔D*)e #5,u++_\NJ,J M(/bB2Rn0ԛvmӮW$̑xymiܼ^ xy\$}gb&W [O^~m N6_`)$wWK@i)9S52Gt92%?ٌf=TCAl)ƢHkI°MdKɞ[] j°]B3s`ʧAR@^n?/Q]IAr.김XiPu4_NvC깇iI{o}vM~ڗӲlud㷹M^~f{q ovB`[Dx1,}% `He/箉s(]Lt< qڞ]jtT<-SQ ^VwHCsiy렃^F^Mw.{lA!ʒs:Y5+@w}{ 7ڤ %ŵ&^aM7SO-1y}`( >L>'X;9ǥ.p [2 yM\e/4Su;bΒ @Xlfgxի9∉0&]r[Okt%W`c%G٣_rԦJb-pˉjjͿ.{6rlPT8\S#1;2_cyT 9on0b.:_m`fդX̟> Iq=[zK%*;ʒW=P2f:z#J@҅ dUn]5/B ]w)g͚uW;5 \o[,zKȎ3K @lZV3w=c*:fG{ׇ.y!|k_udeB})G٬',\̪ J Ai!E/ h ^WJ)x:Q/N;E:};ߩ+1J%LgElŖxzmPQ'YFC`C#Rr]ZeC k& "%Ya,/Ἳ+;r"R| ׏|dm|DߵZ5hD6g\*EChXZDf<<\8@x #2ABB}aDg`/)hm^H@Lc*ݖ/7WKT^\')Aok@9Sz.PBXv2+lki̡ rMS=Sy-x+}BAq":3 UKGAƇtn8mVK币<ԥ[yx|(B08 ` ,zv|]'Xg4C Ŕʝk?#Ŵ ,kZ] բp ?El]V!*쳷3q*,)xK93&VEˊ8x='ʲ^PXIaTYE;B:WL)  `jwc^epCVϼf8E-B-8* w-p&`򽔬z){$Wkfhp%m0_W  /ʑ'c\d1?z̝r4D'}7i}Y`ARֱ_p'$4n6Q3@K{8FrЏ/q5ߒe?r?JHn UƞCJwIsD僁rxs((hL9-;SO=l['5T>m /梊ڀ3 J>v:0q 3L#LIڪ:0C# g\NF]Uc1e*Kέ=􂹻ڲuEpڊ?F6u*nL-p4_5tu>>\8nvKկNi4D]/ ;͟H @iiy_Zy e,Аe]`!4q)[kg㴚E fC9yW-Y8 p->ATOi9BF ti+^v٭0Yfvv^n~̗ LEM;*wmj9'\>UZi[o ?`b!l<л(XEU~)ّ:xጥ9CIE&^:M;l-j#E4|8L> `yiv7s:2%8B,AJqj{ xEuc'\,}K^&Xawe5?(:wnZ8V|V6MF=lWI0A(9 v{BL jhWt8Q|vaK8$BD0e'k6&pv8j;T5;s5ss4 tKm J,+_Jߜr)԰<FiuĵGvڻU]&mH5KtS-jD%i׽uMh>LW`jͱlhX.@9d–z`aV$3f̰ ]92&er/״ilj5||%s\~Xqۻb!!D߅ohl{/~,:8h,@ּyRK%j:bs=lQzƯ/}iN Pq}"{'RA%6;Ax|ز Չ(rps¾ !z\K$aq9S&7\D{D*$Ɏ0i*h\$s)r4@2/nCe jH%M/ Y={EQW{J0\6OKPa_Y>[RZeQ /B1bZnT#g',3mqy-pWhm6h0-MO( ,]6o;rx-(G}tNh]g!:L70K52K *}W aÒO2e\A&z $F$p4/8 -OZ}<$'s)yX_ γl]a\s|GnUL@o笽mW4V(? |]R%+Y:HҦp9-Si WCkaUZW-UU*CV[mfV2.N>ϓ< <ƕJ _Mi!Qbӻ[ @sil@ZGD0Z"< ^? ^e-uпMW}`S:2e*`pf[^ruB7WsxC~ 7"SQxS"_~q&vH75!ݨo8D.#\Gf5"m̆SwBߦ 8V]L w饗vwK>Ͷ]KRN*?.0v] CSSNAie72%+}~3u056b (":MWi>)rwU7-\}TGz)Mً^{nJB| OIfv 2ACe{Xm!JBdgOZʯD- Y l l a+]&;A3k[ SZ?(묳βW^ybcJef4 Fp9sY.h[6T9(oq u1޵׾F4j>F8 }Y~y%*<`"v`1 OT:-8yin#f?jzZsIһȏ&/D92fUϿ=OwpT)l""%k%Aܲv`xH۶"%ki]ꄸd+{Ip-sIqs›q!9w !޲c~Cb#/~L4 eSyKUC֭M%{ Fhȿw'E4O~gO"S %ԏPd8a&/ZhണL&h r X^jeT4 q^a%ϖ%[$W] YqM(-L-@ՊT IkS|! Ȉ `ԀT$;LkbZ'DX+::&u6WD^Y$ e.]ST_7>ԗzo PH\Lͬ xE0YMx65 :C( ?Gr|ko?sH^D04O`=hуK,Nr2E uӼspnqѦnrUW?W,ԬM s?_"]&?m~ {{g6d]<9H=OW Wr \μ[Fn9PuPzL]ϡT OdjTq찚T8A6% Lr>NA_αkES| )Mleڬc2!T+ب0i,`eŮmL<:o a6wWe1WXп;3*i:Os|;3JN |N^9xT3'GH oxñ[Br4_]TMO՟'o6(1hU?bv|].R駟ϔp'{1)&V> \,^]Xtp'tn`/R8F$XDrUdmΖJ!﻾pϘq/U>krY9K/jm TyK8\yddړ,QkFeᐹUhjXHX3K`/yK%\ A Fgg3 !]Z\Y 1.obY3 ?d OTE 5kU'y衇s1d(OG) }(YޞRUHeH}n/ڗpψ9YG6||֥^}e1[._krȶQŜ0K,#CBxTV~̙S]4~媫_鞺@` *OSDF!ۤ`SMAо0ZbC?R?"{a8Ld;+B1YyΨtw}OFdt%袋זY.MCϭqu|ڶv8>&=ڑԈSN)7tcb4Kϙ2Ҏ?d˜5cBPl~{[6"pW^{oZC&a8[S,fl Y?`@) Co/r7t+PY44os9⯍ζ{i4w߼=53!u% M7T+?? ߠN.qNyq 73Ǜ-䦘$}nr^7e /d2P),jv@Uo|E(Po)WonLF?{/Xߖ>OwH~3{q%A9{1JE&6{crcρ;B?lw92C_1n?v<9W)8-Y+ J+LW?|[Q*r9"Qn``‹C+O[&8"Fˣ[b4o/K҇a-@uX>.W9|WGY&cY 3L'%/;*BQgwtOЗ4X?]f_ LU%2ɮ+=s;ARR |_i] /a]T .n7ōz+-a =T5og<76؀xB#(mf̳u1۶'F!+:,*1 vmxFrC(ntgx?7V[mf|~8}Х>tGL)Fit>x'҅Apc2ĮaKWqlzr24Y~+FYi0.6+_yY 6׉B_cZZXŪS IlfuewsmÀN d;$ΙgIQrn Ze: Mj ّXLw5/]<'guo%=W/kg)"d^q4< v{lT tḢ+^opw%3!5,RDEFt=$0q*|ISnNKPݙa'=\JYlu q5ٳ&䊙y3T#\P BCSGߗH+eN jg?9|gl>>林Y:Yػr$;|hΝ[hpuGԙ3gΙ3g~R-Kw %)R _L )ڒX^|$`uIOꪫL2PٳxpJDY8=vm^ą*Evr%bʠ+z)]WԾ/{NtQ;cƌnmoCF,&Ѡh lw-+2AAtWjt Rgݏއ81ⷿmT|mXnv%Ԛ!-G;}k>mRi;@,=0o)#Dd?ī[sM MIklC;El%U7`LxWG뾬[٭]%hNhR?,~}S@JAs*d/ߠEtH/o]@/Fh s94ꛏ =%l*xHxNuwssbv{G)pRk@cO.[Fa uCU 6Xu^ƥݝ{{X&R؇̀mqB6A s[n%0<-'NpUXAa:%')]Jc|+On&TP!GJZ|s*h(dCU& ,k.={v25$Ү(D#Nd,+LCXp"*f4R'NeMskVu5$}B· 7p̌~pmZ;3KRhvg?WD}O}ݒ4>c.z`? f}yk M'YQ2ˮꄲvۥ!۞z'OJe4p^ 2/\xrm 9ZVPt̔ZwzuׯlNReKzs*RI.*-3@Lm3$lƦ[bՕ˖=PVpW'm~C;QW;<_Qn31=8glP.]w+WV!?Qn ,\r%Ŷto.}ݙrKG`ԧ+bxZk܊h/W] edLenLH(Jf,>bjq B/r%%]u9[CK$X˙S` 'SR>hL[y"ٗ R HX\,WfBjµ1c)]O\i׬/il >}yfxp?q_ɰ,8av4K*J~dM@ UUwɼS&5F7>8"U*!Hnu|9~m2AHH=u#&P&wQ/*IxP_.=2pku_rĕǪ tvʖF𔂲AĎr]Xr2X?igwQ 1MAU?-M x/PKމqߐr5.IShp︮MZU3ͅEVgn)ĖKPն,K-SYY;D;uyE4*2ZuFfB=f2byalPi›QN)}쫲CA`WΞ=gV,8=J5I?r7N]iSN1?] \G?Ÿr_~<ݚ eƯq.SҌez`CD)Yl|~n*\hPmO4r6upWg:qT<Xkۗť׼5'|~R|Y>tLxf-"T_Zܴ#{3j:E˪u{o lU?餶{C=_b)sFNyww\ࠝkڃOl ڃCAd#O{ڎ~q>(͕. 4eveC\ ^4,kJx.2enp S:ǒEN-ంF4L$F[o'W<'~t,+HƨPJjUHM7Τ{}We9 4 /bfj𿚷ץ |u 9G: /|zC^uxӋOLmnCpxfu] ux av@0ƛ),WlVe=C.S^6y+76`Vri3qɴEuanBS18y3vCz8*ؖz7>묳^ ) ~?wu\zK 0Y |%?mޖɅuV NS*nyo?WwX74Z dws~P2ǣ0Xx`؊_A맼|Q(kvלanWd Lh^]RSDHFEF4s3m\95׿֢%9r+<i;.3 ) F|hDz]|/x tejeG?{_:(p޻}NPl /^\ nߕ; U95}=[otS ŨK?nm-N;S rY7/{MBA~9(n$$:aBJӗmUfNq:|b뭷F<X\ΛwḬRwEEE9aVn-DBV6aʐЙhسt1f7NxE ӻ1qbַ)YqsK73zܣ~»숒"?\Ψnzէ9rJ~cлytM)%a͌3;ۻ Vy[{㊁[dCX~nsdiq]*xFW>k-雌-EѦpΌPMY$և>ȕT2s\#@̓Nh,֠$3Ǫfr-usGUBZIj9昊V#yf7BM<ݕ/ GgPQo})Yt~A%J:!dKdG$= Gȗ꓂wd >wm,Jz]91kGRRADJ]p%1aR:.a҇/=lt2kL<ռоM $R*W0.BUw  vv$k`wVYeBA2`O<>ه> -n}^-eO?%^Ĝ=}@٤+$>02{+f}@K{^NTՃCt n0wlfTsn`-Á%&*9U/ϓ<)<?1~c]1Y拋͚54qo~ӯ>{ڝ)f:U.dys5q[Xb&c_T,mGߵ›_xBE_yp"{V\qq`+; ԓ9` c)BhFKNkgSbf4o޼hIuhr&tc{L¯ $<dMp1/ˤqiywhUS=f yaq]cZ`֊ ̻6,7*#^y*`]7޸Te ) nfEcFF4n I?iZʓ ?T9:Do]uWXOҴeZ69W簝zA"*jF AC:,k u]=O!Eӄ|[ Qr(&*7N=t#G>q[fȰp?O}݄^z3Rehl C)# eXo}[=X;?!S{0 ~e6v뮻_w *w( Λ3fܤu0>ʉGk.h[׳qȡ]c,=JO ,za TMs-MJ޶-˿ pG,&cN%ɻc\hJr#0V8-35K>Ow´iE%؀6]qYRjŖml_mK7 wCtc9a=a0b׹lT1^TXuĎ0%/O>pU޾c <&rnxS<88>MJ]™d)౎N99pRKX;tIJ1T]w]Cls-!tM7OΒY0_r˚o{Ox+uXX у5Q3sIʸD.w OGWɵ̂stoOjstCGJчr8¼"$fv0F4AF<쳷n;H.sYQ'tRIKS gƌ]!nK8Wsc(w^9B' U>P4.TdTV]~v`58zei>2& bDFh":cCkrԬ*/!c]OyˣٳgvA bİN;Dvg~t/|h,VN3)N:>)zvp6V"?D)  rM+ Rnd@^fZUEl"4M=ؠK-ЅbݳM{_+nFbvc.%M2;l &Ƙ XP3䒉K̔L!Ѳ`Rt3[H;\2Z5W0SNJZ"wSUIfRn۠Oڜr)Yv@IE3*Ry>ֿ-xN8pKfX0(};M>IRmnc'eJNs~mTI+pQK4vp.\x~6m <> fi=|B)_cg_˦nEqhF0@Dp$2o*_ xu .5wIΛ7H:6u1<sMWxWٔD4Yh"z֚ M7ݼ;?q!ScYZ ]\e*^!*f2p;cZ!53<ӘVS0Eo鄾񏿹z`@\Do%P*s4N'P?D^y_e70f)UJZ"X"lyk|גeZ)@ 0cs}ԭ* I~*v4X=y9tv~wV/7wSNyW_&/]L;E{9 T h LVW D$څCA:Livnub6]uؙ'wU@{-%ИׇH;_&2*o/7DzQҌ0.VE،h[ou)ʚ85K/̢_4y63ܵ/< `wo k[rMKW(hꭶZռvy /s84 Z:)uda,o|9+]VJSm6@cw˝5*X2ǾrVј_1b ^Y>Cc X+$C]Cc%6܈&vt_m'm4H԰5&g?O5:ƄZ%/nPIxl$Pap \.kx@|۬ {c+3ˌDiMh!M-s[m曟qz돧NJ҃nA a:Z֊KGV4 ȩv KNRb~vj,On#IeilBymUa9ӐM;Tޕ3@9YзriIb.ȗ,]_`"au/3mjL= +&g1cnB%55" /5)9dL[ JLa#KiY22T[nɕ )Rrw*ؼk֕9$I%jڻG. %lWBuk` =k֬~^G~t3G=2L]A*z>a';Vw?{?dfM{Y3N g ' fFufJi3gB!B@B5g-5Uhd7+T zڷ('+#zکSLMEdM`[ 3[mޮ_X= -FZwYY-l%6fe+2bC|=m"PԵf ?U?]Τ N,%P[mO!DQԉ ҶςX1P^z)P}stIyչ6nZn`̡цfDtevo " ntlڝG|5^{aV HEpR\MSO _BfQ*g~L3Cc>zꪫzS n7稴tØ8PUWdA#D6_< *vuJֽWs]ϒ{[zK.ӊElI^l3.GRF71Or9X̙3}_lQ(C #׀aظiO.$hi__ٕW./IAmֆ Km)t7包[S+=]X彁uRVL~Vd.Q"ӧt_3zHlЬL\VM&( PNK*W!dI`A5KNAhI׳[d7eO߀Q6p+H𙖒͢x7OOzh琫Xɬ;Zח7t3=JoK_wpȝռ2(w1Zwvn]~*!ȫZɕvذ8n3c=;ZM=su+0nV/aq0U0Spt (aU(ZHn͠9K(zFfNsbF6v7o:d3kߨiKkgb3`B/^5F֗VM~ )M_eei\!ʱ Z/" 3%vmUi9s"?x]]IONn?ƇjPf{;y1z'xbz~/3<)ߗY{F[ۿ{y睇5@nָG )Ӟ|059şi&zsԽK݀{XnY<7AKXq+hp* ׋+|3~pByb*am4 WR!Գf̘l͸&c*4$")ێ=hϖhd_X@a3[M]gz֚/y:2Wa7; Q]6:OlrAmֶZʧs7%b\v;ێe;:E|JcQ~Q餿9s>oh (4 6TW>'o+C X,tӉK.)tUnCci,O?w^^[66N %^6- :g B` o7y2D3~S蜛fs%R5[H`u5|ALvm7T )&ck^x!^Sar4:-𥙔>1 ;Bgy|?UQ5]M|x(O\q YoxKR18pcuɴiEn?yA3l_oHkC{VXa3g*_ gRb2ߩx;f~sB8~VYe=0F''DۙgYF@HD<)E8xHa#_?9!\,R=mb)SeKu)aEfؒfweN=4Ib"9[J[^]; LDg{?G_ݾV[N]iju9~}{NB2)r~GK.ΈODaSHm ~@i@P8GC{½ N"ֹ ?Zotkh;VYy7_ u92LIQ< \{b%\"hHKq*X/Mc]ҙCoN4WkrK(lm&ӣJ6LtX.2 w=|%6Qt巭4ˌH T]?8|wyU+%r1P?OyA=X UˊXr:fT5t\%]./?JA5C}Z*S_qE.lE +B\I| 6N;g3}S d^W]uV[mYR?ȣԛ|L3d =[4̼3#wCםl fY+!4ŢgzJs0#*٭zEeyr4-c7~NX^%2єjd'_uIA]׼ӬrYD2U%m|q[[jrMf \%qH&jm^<ol~9KXT?|:]z46ARk뭷.yQWr^* uXn"H&luhS|Y6Yҳ`S Q*h)K.sr-sR^?%ʘ_w쥴C{rަ| N?V6vjeʳ@)@,SoKEpfakov1|#cl+qÿUNyO>dӬKV_}VqRCn9PQ:Vx.U *Ab4NVmK+5~{~}ڦ6X}{=Aq'IdM>lϓ]c籔 ! 0xѴ']1}koFbӧOʱdxliĜpJ.1rUwG %p_e3Cz1>ObJT{"|q~3;8RO2-k5zKgΜIVɔ7h#rA;cD CHQ O:OK 8-ƻ~y .ӠB刼C(6[ SYiҚQ&.niǧJtYgov6;o޼*nt?^ $U :@u .b-K_J[WZKeFD eb+ݬl,3Ĭd%K1~W=ևx~x{qf^#oK3[ё&BT[ Yŋd0iYgg r45rHW!?@-rLǟPyxexL9, 6f,^7tBD%JɞShlퟗ[vGd(hvhH83x5k~0>9[{9Ѣ;8[r%_M:EϥBx0s_G&*iV)`Eȼ26A?Eڂ[>(Ua4nuQ,^[DXVdx ;Cz.TZ д<y/~:(핿QHa8ezK{]s逧UKmw 5 'g͘]N2x=9䮹fe^'VX^0K^V[ioy[KunZ),:8cj=E4P~mꪫt(;-* q '/;CL5T7_ t똌R ץ* jԸW _msjPfoXQv\Q{N'EB`p=L>Ͽd~Kn@V[8?ACΘ1×c5Naq$=Czg}myѐ@_nH${`ǵ5S1ц ~(.NU>ϫ}廾p/]a4M'@U|g[ ?6l1n٭PY& `zhAMnu[RT# %kR  GNU2nv)x9E 4DuVIܠ撲g]n:o5*z/&rv WZq1(+i*Aw@2t ~Jй _O?b,"Fgv%`r--psdئnJ+# (:Lwk\lS9s9s.MOu&`Y͚hF%nC -G7$P⒐ZfaE  tKs_|q&*\tE;vQt'(!Vݦ銰shMe 6AD%d%@VRyaF7_%~: g|R>68k-: #kL\̤K71ٳg'S\K-Qo%(MJUrGP 4˨H^[AI)j%1Φa wsZ;q?8{\w$!*/S _Z(SaF첸e2( @Oߞl+q39 Mb4ԫe^ًڵ.BN'^@y]!i""wDLy^ qHr&K?kd[HKP nˉ/zыqvLj`5ZUlzɣ)3Al n2$ [ l`#_gyQG-G͡;-EL ‹_*9\辄"3a0U=R88h^S5.&d#6CSRDkp/MZEN:)s وfb|S_f* WޥUu3hoƩSjC2#a#Lc.T>~pZ ~Rl4;_" [IN)NAIar;\:?:_ V:~r_tʳN6x?z>fRU{ԿlEL02Qk| A TVɒ)?N9. 0lm[G~P`۰[1M`Gy'?IAei^6rL٘Ѽt^[YPYJMCg|Rb-5<V䄖3h`q5뱗sΙ !/q%oMJhAe|tӌRw|T%6__q*ڦQY -POFOn!WDKu\=pB33wČ4/#VV\J"˕_oqAod]G3?s掿|-@dW_[n3{KuEv4puHYСUdiK{K_zUWKwvYQ*Wߧd& _N~|AU>X<-b.ԩ[uxT/ bVw@*\pAG0^E0)K׾?ɝvԄ3 qRR)ocۊT#`WF09f멠E `uW'&*@,@ɢY{py/=m)D­]jR-ZiTwU0Py& uKlw~}Vew9 6=|;%HCYʹZ-*5u~w ֭j Lgj6"7p PhOFDmCa#nj-]tѧTb*kcz-8O;m)ʅa_mFoL`/yKB{Ӻ"&>pe-(W%KjL!W,&3<ϓD s]ò.yΫ|C|̛7ol7+O,NyZBU#(V&lqgӘ?I^L[՞Ј2YU緍{駟^41?paKםյlɓSv4$6. .?Ps}.r, Ɉ.s/uoQiHw8tqǷD{QK/ W K7#REyZ\FY*g?,>X_B0qwDDpIh(hL?j=e~ zU <ӧOtZ`*auEfG:HK|vͻ;>>ؙgnq[O}ÔgD]xKbctI@rtk&Ŭ~Ly&J8Kv.٘ qNwfmJ{#u'[_1W3;3J#tꩧVRtW`ȝ7聭*Pb$jڦO@>\YLnA 0bPS.Jufh1Ƿ>;c:%Ѧ^WqϗF)AK?b@zˁPq`!C/xl| j"hsym[£s:Hqr4 05`-A8OCgH'Pi X6G3DX#;7[["X-e @&Gl%CkXhu||C6?dO^b_cN8NN7)9 :w"6M\]/VܢJk}D@"ʇ KU`:?k^Xklz#Tͭ8!2\r8doگ`+Lp41;0aC0ͧ C;8w֬Ygq+`T?e$V[gĤ@eo2 )DIVJQΊZKFOd`@ V_-i925fg3uꔖԈ_Du}|K_,_ >DыvR=p]/z/>x 7dH|ͣyǯ(G畕Ѡ0&i)IO1㎧Wn?,RaE)=Т*Ц0jCh&0G5/^wsb‹WYez̙3+Y^nD;QY!fݵ/s vzfcy7ԴZ\JDZR唨;}¤/1mVo_WB*\.]0`О!2Jt%"гώ 41 e3(;]Ю|QjdW\sZ??v#@6.B[FM}e؃a+)]š ٝw(Ǥ:rj LZW *Wjp<>~Cm&E0gs )6!iZk B?d'L*5h L7Pn6(BTs:*FTNu IJM"QcmcV\q*4-qBҪ}ߢNzw=8#.QHln? b"(S@ #8jk]۶9Zk{vN*@HyNd(q*Z<|qG?{ֵֽuk] E׬9!Uʢ4 <3,RDmn0 zwiW\qa',kv&;,ªU #=W\YMr*m '7|s2yfNI\vЙ#gQP MpgeWȔ+WG9ѐB ,on3Vrl&)Ϳss޾gqHZTT tN] rU3<B isxt#t \3U+HLyu SXYqǹiDU0i!2y:>z)@DFg>f^o,I]'M@)2:Sc֫R()ӧqJ2߿?ֻ;1D<3^ Wx/mQSt9Is7Nܾ?3L}i![5Rue%Ω; ڿ d~4%A62U˲eεi3vDhӲ?Q'0)q;nVw9[HxJewS&`nYJq^.dЩ5JΛWO 0Hy婁`_p |<$"|"͌%\t/Uzu]yCs(eo&lJ9K9hURc*2;{k;j=^Ty\|ڬ,K6m}j^Cή{ô{*";M_xbdǒSòt؝ RoMLʤ+}z4N%OmGQy;ŋ/`*0c2m,Cۗ5+*M ±?2k,)ce˦2{WSwHuDl\jOf7o{O8ygy_#EOg. . #\rI@~e{V[33bUEH Ar~.uBچFD QNg7>6üxSfVKڟ?L8,5s*Yd턗 O*/v*bB>k$33o}{u@{`F?{׻ũ|ϝ1caj~0 0׭N,Ns7O9??+ykT2cVYa ,[o5Icz"Cv?蠃.< /oew2޿V[yРY榎;] 64Y3unY=!5Ypiykk4wS*&iOiW7U"BoOXvE\o?E/zg>PJ;C#iKFkO|p(`BdºܚxbŊc9DTXtuϝ;'Mٸq#R OP‘_G<[iӦZmJ+PZ^td)IJ;< )--R2TJ%HRq!lRب Jodssoxƻj?Ncywy䑟Oud=/)[I]q˪㯡/Ơ7e- })hPK)Írj̩D v. W` Mt j?tމ-';IFZ(һ>)2)?e3¿qagV%*׮X 2|jc 7jD^R/]VojܸJjv`?Od~$"ɚw)؉$5ʘI`%!|GH"}MoM;/R4M5\ir7Ν;>_!xUIfͫ腘clUMZڜ9-]o4o&j7Zaq]hIM@4r駿/86L8 L]WQt)jx&[A,ػ(z0(x[Oe FS))"?h osWR螾2;+ Fs2jY-{"?iJVPHTD?mr(f^oY=FC0[C.6u \_&r4,\@k\*,K (CآkR/XvmjbڕW^Y^?EO^:u]ꖊjz/]wq3 uC^tBpES_@źJhmoY{9[o=?c_&tZ)q}8C|*|sh"K/TkY,X~Sg1Ay睇-Ew}m)÷e\ o>BǨ̙o($C8^@rs]De-;sYgIn!ڰLʤLO_ٌϟqܝv:Y%&,mdU0+Ŗ٫=iKF禛n] myvC_oWg)3iY,}ۖ =xΛRpGAv _6d3{>L 却,i)ЀT7nW@back9:u]M$:}&L1 9wEP)!`kL/FVğ?ܿ! l7@ŵoM%JVw@=O,_w|?}{=;n-V]XH|P_ Hso9gӑZӦMس&-4" ٨ͩl y1c=.ŒB쳷cљͲߖp,C /xU5k֌FzCN (+{``:"G^UjӿW>ꨣm/.Po)RimX _vd䛓~d=L[e34 ~>;C{%xYc5iN#ibh(bγ%#6= "WeXB//.[}dTl I^U{oKbE]gq~ z ><--5vF(KLԙ kT`J汝 _a޵4Jx:0o&̘CII).7g8ՎPӲlQlac׽vkl}RA$:6 ̌?`;sR-AŹMQ0k֬G]_9 ~ 9PrW[]r:)Y4;z+]O=wk\lD@ R:wlr n)"/ s|&b邲0_D:W_}fO^ֳ߹|#Ib[ x'^rʃ_M?<.p*.=fo?^p(ZGϹ=yO<%-k_L6Σ)mqBMEٱ\'ixMB5s /'B*4`mROҗDm-򴅅kpw۬%ϵ[(b\7q my*J) E ^`DR4JGSVt@?FLfe'+dLD.Z?G}4&[`e" %~ҘS8bҼ:r5FAiivb$u[/?X¼2t/074L 16Pp*Y;(Mg>{,Xr C~%-c ڰūKP[-0N GY^ի;s;ChIIwR6#{[Z# ko 6>m6rQ+C$r> >fɾ;sΜ9#&T+(peOw}30KX;Ssis~gk3̓F#'u]sfO9[!Nooq3n iOk2`CI@2n/qA۾1',Ip +|ĶrB6d  ֮}{)CHC9d@˓iEgPiv{{^uzc~f9 5-G쯧2'o$:mՔNQѼ]& dɒtjJwac{៞(# v/Ye],$whub,}c ?) "=U6҂te˖K.Sgg9G.FN5qYNG|모Mk!.dxYx²{WCn 51fk1sruR|wIn3"xM5^{VT qkSUv[nb5ZoLʤLʿ߻~GwrY-|Z/݆Yd e/{ ͞ra$::_%[oN(6_Mst4UCpMclv^ Öc!Ô[>-4_ap(ih!r HVҴfA.ō >!4jƌX#fc!U۸qcŌMG^e]gռ_xG_X:S{)qT_ vn=_7vu\zӧw37iTlլ[٪+<8{,׃?FfKRZtƙ.]TsuPdaedZqX0aZH 1VY=4h*v2]`A8  0C7;ZE]XpsoYpax4N> {Do+5R4X0X- m94ڑaZT #{ &> Yxd!@*ӝe`2<6 xOxzֈ KIŅx;L֮]`j\ydk \J`ӷ Ī%hdB-: Cm]7R#MiJWެLʤ<RrG8}~[Oݗ%Պ`B猐,(~F-ݻ8;R>_&dn(#/xm[v$q 6c3Ao vg>oT VI]Zwy@Ig sL ]~=n-;w-ܒò: Cqi=Nd!Lc]~s , 푟偧oڭRM+^ f ҩrxE &:Ǭ IFˠ-$+}3͒ÅhKwV .lӦQfqo!7/,H#>ZD=%Ƃ s8~~"뮻PFl193gNG3^ /@(f1c ݬ2pnc P/(Gg [aIr(:k=C+GLG?4v~p7YM'\\Jgd ώO< /TA%hбk']!YXTY}C˝&-?.FS!Z^dIᝋVjtVQA>~6'Ud"JYAt®& &&؝h.i/_f\Qq`_yf'eR&IZ6/{pH[[gu1Jxٙ8B@KOY|IP!2J|۽YzV5X2^XȖ۷np ѓwzѰPT l%}:O2JTt {s/@f;7"UQa 3Ȇ "; ee"o XAP_|qiH=R۵krS{bw(WC!H)'.3?뢸ve"lqHMVunf}UWfNxʨH5}dTu.@OSJHAfJ!)|1dR]vوZڷ,V[lӀ46̚5Xn"KfgRB D~]k8난v-Zt饗v&@,@ T0X]NSyj,uZ iT={Uh]f`M,#SiWKY;dX[<ʱ:?Tp#WYo^@ ժHC[6ܚ\-L}4|ų֒\nԉE.AQOVWJ2eh50/3)قyk^Ao0=}:Ք!{,G0VL қ2;^yK{ѬCi2Bd8I6)2)e¿x %CnTնIwIv;ԭ ܩ?ߝd9HSW+9,TrReˑHiI aOF1M6ECvt pڽ{,Qs޾C_|h2Sm~e\w~!OiWR5Rufjv޸qEoέ7l)7 }n[w5*6y|Ŋԧ?L.^|xW\\u˹&Ehz˖-[bEUf iR$atZZF0`G,ǚpH]S<@1crz'ɫ>܁a35}|ݿkG~0zO 2Gn=9]k9au*Y`WFC`Gp̡[ =r\8㙏]_;C=xT"5u>5dt1LiΗ ^}Vo\~I'͈=#5aQ;8[G30eXTe@!$$xۀS6[4x:zfH _|q'v4 q<0֯_ ZiA ){ -BFP2 /|!J 7mD7;81tQ1 M$aKEOO>ٷ Ϋo^yy;uY+I!n2-}[VW.[*Jim8K^h{.gP#uTjՈ L1r-fV; ̙.Zhey g,@unXnh3}ɐ҈@tw  'OʤLʤo9q#N7n.ߎll}^XD,xi|aRy bvVl̊Aڒ6*PU3f GC`ϦM ܱ뗾g}vb&+yY^R-OM;N!{޳ݒ%KG ՀyExHf~X7Mݾއ'8:g̸Q$AFb`ȩʅ<Ї~Moի<ꨣ~>1YE){W&&f9 ΄ig ]JH%e,)l{f$J'p^Cm4YQ,۔a_5snɺmϗ67hzGq0e{q7^8@Ȳ j+T6cdϛ7ȡc=vE(*i@JASewya-EPn@za>;қ6LoٚEL9Cb;t|v40ۦ/d]wBa}jЊTc/ްaܓ2)ol^![)AKjc> T:9#oЪ}6OM2P*yTN J<=F;!mhD6e?G[1vuW4t4+)@LyK^xN2v@FZ% $ z"lv?E>c ѠL]#&()v < sthi rGUӿ/| 0#|1sZ:6r"wy0N k=ت_H%hPLWauokr)3:#xϲreu?F )udU~ֆJg0 `ѐ亰?h_pKރxѳ gW P!SO5^>Z ن QʘS?e{,`/2tMN5ڷ G$c'u_>OU{92J1HvkZ(FpŸлUoyԶN_f`EP..'~Da6JX% N>d5waJ05.]b؍7NũcřGO+UjOy̟?_; ,,ڤ(˗/71 W: c9kvK-Cy/I)sA0 `Y`ggORN};Ϣ Ůb7m#u1qF93},tAX$:}07rв%S=d#5>-yqߊ+JR%u/v<'J̩ʙע 0 )ЅU0"iHuA2Ga/)*os[c;(]G0*5KrY%k;ڋ@ ;.%5+I'[C|6Xp`K/ n;hզw /g>nfoAG;k`K;\ GW2sN9%Gt>+4P̎zCIIyh-Z* [t)ٱ1c)is=m_җDjqE[qlme7.Aþ5;|N䏙,ME SŋC PWb)I[75 %JY-UpGIH}7>HSB"f4h RɧC RZ({QڈŹsg*AXj}ɻhѢrGq/ CC<5>dԵFPU‰dW7ʥ57jXӍ]dq+W73˘P*wAC45F.c6f͚!hX0sa}5S`4 +rJ3ixÃ~gM#VFӋh:EbPuWQ I:΂R洫};(%N96=j- . !($@:;ָe֝DG?W}ī_ DN:}a~.'   y*$*]p_>.@ .1xwQ> ѡU x4.0J&M呢֯_>3J|ϲ7lBkt3׎;CW3KAA,Mx<~-z+dU2Y!T wˆn- hS#*LVdDm) P|>}*f]ΰ֡IGO6Af L^uQ.`2/xaB-Yꫯ#EͥKX/|%\2|juATGY!Xp+.xDkw}ML"̔mk׮̤, QhZKͦCS(sѶ-p__l W;h)/ZrYXr 8-*ujl!=dm:RbӦO+U|r!j^Wa[Er6 mk,㒖_g,T;Q矿IIX6;{} `eOe~& ]6n"Wm4DFqkd+y:o޼b#'aaOD [β3gfmn'>ᒮqdDȖph&JLLrQǙAr#H|z衚3.*$w{_~Fv}Ap闸s %u ¿9e8 \ye۩P[ӷ6F|4wWT޼fWS;pl= Y9딼|РS/ 6e8A pRs E#)Q d-gQkPٚ;)l>GӖ~9)2)IﳳfeM4'cD6IIp3I#n''SAtV l>E\Q㏿|mXݫVޞP5 ЎqHZXphE Vo=vr_LERر/J95I%KEB?ґwy ,5H+C#<OԻ~\Ɠ" : R"l4$Ǩkצj7O:CnF 2Ddqco-LbBE4O>]؍'%)(|\& ;p8k=xS|Mq2Wi,nz Cnf|T(tdtKyX˘j *4-Zd dPYYW[XjsNt Y!c\`^-U˳1@^ڥKק7N%%tޒȨ{OySZ@E^҂GtT|`sc"hsPK1X*Jш3g&4[G>9o;"d_C=+0Tcc4qwy:~ ddFVdZr:B%TV3fhij咣@7˺|Bs߀҇>M}1\uUfVeE[,8l)mn2,d7o4?h ,TDI XR\%G|!=%boي0HGU[o=P/pH)VVt9^Q`SD65|19o~_\gx≆6BeŐFT0sFҔN;O~~gq)rY?_D@-I'km֭+w_쎓2)2)ZeÿwneI-)DXe[f3؋lV>RS GpV_2r ujJdQ+: ?~sѢ&A̙TbX%dV/^p\ੴنAeZdB%L mG<2Ѕ| ڱ&:R8@,_$r} ] xKII( ,~)0 8AvVdAG:1hrEfT;)9N h+_Jִ5k:EG(gM$fٗQBfȧC7  BłeVN; bŊRv G ?pE{#<& |8P>Bi8x/iѡa ??KMeiV{Giyt^ 6d~8mp1 3)Baя^S&}!\_>1U v/I!JJ6:\Ӣ8lS7ްN;&4"n ,_Ba \ƥ 1UV4hKԼqâVHqH1ԇ5;Gt˾S e$n*cEmӦM$ 1>|)!'* -*nt?N0TƘT+c/)#xA{Hexb#I^-.uQ]wChU'oY7I(RaHSh^ 琹 "`ٳgλFڵkax)GpJWP pB@GDqƌ_}ȴLKb ŇAyѰ# -nͥ#u 1Pj=L,h};p i=8_ [gJpwҥ9K|}o(Xm5Zۋ/^n]x{_SSمMSi__F:ELs4w\o fVsd/tdep|2ⷠJnhvʕӓOCj\;Y}ekA@;^,Ax^z7szP`Fje hjʛ[@ 5l/iӦaho~ͽNʤLʤ?))_?ߞo!WYCDh ʒ~vMvYn"d%!2nF.Nڽ'< + oy32D[o-hX9ɵz0,Ƞ)!ODh#:%QkEy=5UD^{m Ld=D^J, KJ,v2[` Rx*Wk#;w.;آE K=-Ѡ'IxЮ$_HDZ9CٰaX Bo9A!kaooI]v٥sI2`7wyY?eC%5']ku}[b8^xaZ?yl/_uE`F0o>?B .}1 =_TC˾䴋?3g P26m-x6c ^&b6KN/1~uMu]irHFz)zr W<%[m55j>hr@ŋ?O T.c2Ӏ{HbNެ}K@ –`b:i>7d!Hiׯj́ 8o ! 'ggfSW_go~IvHOe#:5Wǰ m0)0ٳ˱5wܔB'M ɲ4KSRAf|z dQƢO'~g(Th"@hZh0vo/Ǘ-[6op:'?kqBU? gs0Q.;G&"9'Ss!@bUJWU0Rvn4hF]h4DsERLMQ5>vTs"]YX6ƅ ^~ j**1*FwUWrq|lNYvn{l_OdNxbo͋ɅҶenca0 .+i]ScN)~@q`avYRnk9";fMde4fSBgQ@sZюWׇ%amC>ͽ5NʤLʤk'{H`7I؇-RY2r(fܵz ܭl ,(E[tի N[RK&Hk*' fc )(A)4ґD>m6m* q!\u:ouT8#C $52sM-G$3c'%1 @8\dk7ṋ5yYg~cas?qgڴi\p|>20_^{mB+o4N4R3e9 z\ 9NEVG}dႅӲ բS`F=<A>*tlڄ Pjqf޼W>8aAZ pb}RZM} 3l?+V , C7oޥ^z'k^|ID q/p(Bt݇F2$d\JTFl"E*+>sUW%})Qv{{Z=DĿd}e/U[nICxWzfr"xѣ<nڠ:}3R\9dA`WwIgg}QmopSNOO)V >V[ds\谫p7Zˣ,&! R)x^1lcjXH6TucZ ̖"O7"M}${YC/\P/|! z93Μ9 Y|U _*t"{&JX9T ,E9m :i!5 cW 5jP ӵ` d; ̒sA`r,_g= LX0[sݸt샐=aAZRYu{6m~%`/c=L)xRS1Zڷ<yx}HqM-0;I5K\R *nv35c;O<|Anr7^"k )C̓)lsvZԹz10 ˻cb|@UD}k_޷wIIV YdɺuޥH2~gg!%TLٳgkP~v…`PWmS~gf[^(`rW//q:i!L KKyP_4s% |sQ>1K#4S;0NU>^<zq"II " *7eQby0-7~K_ҿz_|7=[#8br@0EiyI YIQna2YroSi,6[l+JT4kwDB/ͽMʤLʤ<)ʓ)-]j.1QP!y ]BX4u%rt U ՛(#\r䑿Ok9!8}KpI\.+"6k3R /jhD}x#:V?ϪF*媜&pΜ9_~yΤ =d1GC42,$BƵ{{^}UKp5s 9{?b=F cFVy@W x`4ˏy"x㏿뮻L&-H7`RrթlK/+t֖\~3e2%4|,q b5bV3^g.-[r+T5fB5&}%=Mā bueh}n|˟{\:ZuŜGOf{i 2 %pB #gO]eVHѐ^TɘY|og}:4ϛO7&XÓk2)2)?Q$vX2W4$ J);̮iӦkѿ C'. cFSi:zD| PP%@Rh5ʯpfɬNJ:Pdl)d#:4s- iE/5R@`ԾMo $%U@{.JI{0!uvQ (QG>hC'SFq6q^dHL+,!o 2ؔظP |HmB2V\ve6d8W!,L͋~D弪dZb(lfZ}xM:NU^B!BJ\E\7y )v`< ͷr veBC%/N{vҥ~?<[ \~4-eѐoEϕW^iy^jcs4nܸ 3櫑y_ >usN,-̐ZR>oS oʔ!:smr{G>Πʃ5U$4uZkXj[,X/ݦ; . Zܜ Ê]~}Z:{l0#ҵ1.y93`ҿj镣,DL"NvV2{ t6cNIg͚0w*sgww?)bIdċx7f yW: m <(s=l{u*8̋Xb5?)2)2)I93gH*rBvM| H R_IRsLwؚ5k4)`"x,+xG^z~qNҺdͮ7Cbȉr\YBa /mHzы^tԝ$/x|R̛7Hdnڌuv)BEJ)/p@ti}ӟNiYΈp<}^4,(`K;&&PGv5VhмcfEq`ZDvx+Vh6;ͼé=Púӡmj@f Qqb[È/hm0{=gٲwzM T@|A9&H/cfD Ƕv,mkssoZ2)2)˓ \(9H:tI^x!IDX?$ WH =Xe7NW+9ھK<?0O;cYh$R:6‘lpMn)F:u4@m49I-lS\_e}qG6̨ f/Q]tZ\veȔN@ʋ-җaZJ oe) Bwq8Ѿw o~򓟌Wfiū9ObXWrc BL ,{qv*pZhе94$E a~d@S9I1[_ij|4x+Naxsza]p="z֬7~K_jQa?\뮻+fϞWo̙ZZX=k['7.N8o, K(Ғ0Z64> oS(2۳D1!]'{t2x{_|ELA6"(Y^q {IIi(Oنx"2:7aDi[X/ԡp1(JA<G:Y!2W_/c}7|3ii&,m ٗ b]F5Wp`5E(G[qX8O;V u]E6򭶚7Nq)ͪƥG#K  6Ka1?Yv[~/xb閃%CЎ=X-X٢YԚ;+̘=yVeX>}z.cdL'<@̔. u̙ӎOEG}ի3P@ vW;.Ќ'9-HMѵBHnMzV^ay'64)2)V$OyT+52{]uU:F: ! Aj. H$|R:l;Jyg&0 X=@>V—> u Qzʕ+ 8wɮ)@(Hp²` #-Vi`˰ǒM@b}p75OyʬnUDBD.1h=^):l2L>Kguoo~Usҥn:Q^5 CyW"$+\[VkȜ:hQAݜ޵#WѠ,~Be"%%0dO)-¿M]&H5ftAf cM6в.ܴ ``u:_ {Gn_M|еՙiѠ\M)f{17-/coF[W2Y}]xFӳJ=̇=qiw*kMKhh?o$zm{CIIi.Okw<+tx|\*wWOd(.ȣA5Q`a-m/FFʐ[D; `7Mʖ:|K@7ߜj+_/| 2)Q5C+Lk&/q;*h@DOCRU3V!xY}m#ggfo~>38f+dɒn P̣'k•t68∔lp_֏[o50h+L̠Qk/bݖw\0/"Ayw,һh8 FOXJ 7sLQfKtɒ5C.)^{Y?ϛX/gq*S˱K@cQb87o9?~q=r$a￟$JgOu8E#> !-rZ>}-r 'NeF~tAECȩ=sv򗿬G!cj 0Bb?SiGr||9>;wnwAۖ3Yڲe=38?\?mگ'c5g-W~.,N;͛XFÁrFP!=׈)!-Zt~SfZO"Jx\uuh/袼=! Y&`f[l1A}>s YƍǑf̘&Z(4c/;\˦(^i0\jL+YNjOMH (*s0B XH"՘G\uK;|t4g}Rp|}M*Dg9b"13S|`j=CKenywv {o_UĎ'YɖmIɒ'1K!amsCJ!! ! $x-[,lɖd,[dٖCNy=7s~sڅZz>{=ZkKuyO1H A$qS7\c6W #Lb ;nMKKB kh0˖`ƍ7. O8a ]#Ο?yY cBkL(υK^Lm 81t=H&qhh: Ӂ ۑ#|T Rgp13ćo< r< 6xTPrŋ-330NQ4WS]OAmhP(4>+VH ϹN7Ձ[ڂXxpFϋ$:ŅV"ݻw~`QDWәA}Zp>Q bek&ĵf͚?ojLUjzgLH́I>0f))){ c}*++1#h94Q22"lU4 S0a<B ΋/Uj꽮a01mi*귂=WϦ&uj˗/Μ/y $H]In22hW&~nYi… ̕aCgR}@dd^s6.m!V3aF3 )6UA|!"]@Ǯ QL_ӽAEbQS~u]t)d&8`0yХ !eÆ T_002*LF.X1(aum/&w ̔TZZZ__ܷl2MC3IY&bsyhȔ`:L oӃz@ hQ%%%DLZt)FЏ_&V1j'c@Ln㺶hTX==eb ^apÇ7 `e"*`өhy So\5nsAl+x ܄/ ٓ9ɔ9h!.QQ--OdghTB  04@Wg"0L,^w/_җ\w2ӫ;:n@F1^+=V.t6o,:/zP]gRO ;oqT,&e }s䓡EC1n5kl۶mƍwhԩg-C<УGONNC 1:^)D 3,r#[7E[;w~2^<իwejiɒ%:u*1ݜ)uX>M{l4%:$+FBp;Ah  ; /' 45~҃7_=adқ#J\k k.j)óepC;hh7H A$$mp``dBa.cq}=\fRP>YhQRR3esΥ(wr +V02c,,fL@ 9rdժU/!רdٯܜe۩L 9DF `H3p{fqYy{z)#r0CQPPpPd(1`/Btp_ahllEd]3 )oR͛73&mmmbdZ;<>ӡacjAу1U]t\UUX ?W @nʁ^T9/@.O0A{2F11ߏ6e IX`!Oa6ȉbAC?C-sWXt=&bAqw,@g?RQa0CfVąG*N0:tTk]}"pEt1fXXvyFz^3{|w qu)8L=iii&_|衯{yo2cѣyee ̔P͜5%@A\U^F<\NZם;'N4WL- c^\\L=t0<,adW>˷m0 $ȿR >B ŋ ;?0](u8q9 `JX&u]a.=M qŊ/g$ɰgΜ.us3{IJҐs0gTzg(c="-b=dMy~u-[ 2>Ff~=Cر+܍u XLrL7^C\hÊb*HP0HlHg?!U̖3@t70>&JsŌ9]3xP.Uc$>/++kjjⱺk2i 3x wux;Y:ZOXdt0cxyP@6Z#sۗN1:+YX¯o{۞|I &32~8a #'I\籢>|'/'o2oHo$J881I $H_$}wҞc53gΒ%Kkkk:4UN䎝LwE 0#a$_W'o#sh̽`: z |Ѥ$Ç5e 0, IhiQtKװ-1Q I7i^p!''IMM+-23t 4BmA Kh0'j1pCPPcc#;v*, tuu1&8\adx(dxaͣgyPeT"ƢP;6cOBDZ]][ڵJs29APa˖-rӎTZ-X xI'`^}}=zu7MCǬ]*lZZZf3&n3`~l! Rb)uC $ȯK >9)ĉiii (4/*; MC]QRgW}H!͛7b%7@ʯhbq:?,C8ydZcL$F/q.h0eocW237O~ϡ!;wdy4%a(t=zt bUx[K*.|Q 鎝E{2f͚@]hmm52\__/3#^>B9:T'zᓒ`uyj&%#1#2Ό<63'>/ٝwO 貍zgCg ꎎ044 $oT >uLF`NgNLŤ~z&/w{.%2ܣޘv Dlw!ΦM& ef6g^Y׭[ i )he#aH>.\A&XGIP L.h4bFTQD2A&v񵹹1*O ]AAkA( S<qvz'2&(a4 (AܑцNIDž&Q̪U(YYYZ!N׬Yg>sY̓{A11C1Ct酎JJJ̎Ṣ٤8^HKp#%y+І:;;&u@ <B7mpMc|3ҥK= MG=)hO| kh+}$H AFG }Sg3{zzLB ˴"F93-T$ i5]y)T0I7oڴ?Ժ)FfF FSc@HEG͘i9U2,S]WW'q{z@tE67cJۙ.c&eiO8*?@W|<\#n"JY}k.4iEj' x ;A@anfC V]]͈k;݀7rQO^gOQbOr$6h9YLŋp-!мb "@v)a?J8o[1СCW޽{7hJ---Ȑ]y̸dmChw8!tq+8q- !y߰aQ+)8FfΟ?5(4;-,T^ڴio\ $$=`P0 ? [x]!.Yw9pu=_Z3v lx6@;!XjkΜY})JbP-u0]a*Ƽγ>?XYaĒ%+&e65Ybю6P8tvQfB?#o߾bi0yOfBXtr^V}-)))l`#64OdFoYzõH=#ϰ~<S64]RxX)T\FީJ/_PyFßh61KCNC\Cq-o%%%h kH-[f&]|%TIǏ1D;w䉠gb$ l|N>׆r1@tٽr1q]yu]]bej$H AH " żg&5n1zb m *y0w|eetqmll4&34z PF@ aI Nt.''w۶moy[ X Ж{%Su3IbTD=ֈ娅%#a< [UghƂWX&ЁMC9U6"%l9eqƚa(1 n15 c*-2DTĢd D8p`͚54 `Z^xh1t#G(t7)28[ ?++˰9PD233ovZF~y =~sa) ;ͯG_;޽{i5/C~~>@81tFLŸޔ+t Q2q7q_kh$H * ~L^S-{?scѸLfb7oIv֭ )<TSE Ç3wʔ)h0bњ)Z[[M\XX'0s~Y[[-2k#K_T&F(-ǘvGoDvMɃv4DPKzAJp z/UTTX ¥XܪȰVX J& XRP_bR#kg}c*W^Mݻw=k]-( MA5V 6x5R`qVans𥦦@ _@544̣ xs ɟ踿7׬YxR'+/-X@ 4B]vǪ gϞX>).[ `e_.Fl|"TZp |x^ʕ+?kCj:)Qڵk`h@rUUoN|cxǎ;R$Ex|c ިõQ0Ӥ(K A )$:禥{Y\&V]jɒ%LUjjwܡ{#e t V&PƜ 70L(dZ'PQ{\_i?1H)&at>2;v |)iӦA8 Y 86EHHe葀$QKevvvE=h\s3a4B]FLC5c#G@1.@Se6J* !6EFX2 uiHv'OqtsxRn tV,((` (ҋYwLe jݩ>w)kNGSRNO;y cضm>3P uߔc?(z饗4twäILʳb<m}JJ/p{{;V27h58H AJ#Xy=p 1={ Y蛩ZJդ!`/N>6z/'']X2&4oK6Y}}=`W 5رcty\8y$oE`O|G!M%%%Dww7YnȏӦm]~ݮ.N.T42ة!1s4aUVR5yׯOOO!a @;)xQw *<&̢mH;88b>vlZ7o$mDz~ܹЇ3fsn2C/f5sbFc=pSpss3skNN`c3( ǘݚD (wbmj*O v(-[@_|0IETUs p $hDT-80ޏ~# Iҁ F;|pFFpbjA/h =XeHYS q8 `f^>ϟ?ŗ^z 0&t>o_p~;{\'bDEW#)j*G$ uWj =֨~HLk: (`A8:VSkSWWצMꌈϜ9GQb5557fj taO !1 (z %6l̯Fi.3ڞf ١ߐ/@} /u0رc<\="h}TPP@zmaY;jo)C#̣17` $H nI4~co4Q83L|2T1e+,l0eʔ%K444PlH>|M}[˗MHB5q)4nj$?ajvv6,Ǔe@ aǃ/^}s? 9uZHKKw!R ee%'?jGy6:ysP80Dfu۷ǔNɑMCl&1ر2\]uot3ͳG\ A]DÿI(]Pbtg);k#8L P9`wqAev6w.a:`zں˪^Ɯ. K.Ջ)<%yҴ s1U` 4 DTX˸+p 4  6HD'@5&bc`b&aF$66`CnQ 8%]4 =2SᥛB RRRRUU0 PlnnzAAȇ <Gc9@8xqiRmh]zi"33 U цN=N:B»wG~;sŢӒυ:CEic[Sy tz~_oh; $H Ӓhc ]voL̪:SL>`tL̹z}^ydL̿a,`cwE]ƒU'x h7=v .]JI{W+7Li|qXsLM|q~uʊE)nV7f2?p哒qda9b={V^ }4 C^yy9A+ձAA>ʣ- 6`$w fgg3b t黰Qkao:H|;w؁@('(Ƽ$ :Nu1 3ɒ%p߿k:CLG@=Nmnע1tӿ5(lٲÇl~ڛn*10w-ZBC@!QnoPU5 $HG O p Bs sLQ!A#!`nᚹ,0a{yP&=f|zϞ=k7.݂h{wu@` ~q<[,K?^d8*E-3nݺ}vz!NTd DB# S޵kת̹pAD4Ģof6ݰ),PNF2 1sw&u71 pz," DKŸ LHIlc|kON ny+Pe*bϝIK)XhCӴKК<2,:u-QH f"koMwT<a6|߇5tVxy7܀V__ ?t=S]_+惣daa!͹z0B0_C{|~eއ%H A{Ŀg zk7 B @r p >a@QTpӐi-(6P6q_  X*5kVMM 0g*p<f+! %p%. wX G`Ft̬0a.% dNR/]jQ'N0 wڒQsrr VDZF- >L)^I0 bxhjϑ;\GOFg1lܹ--- /@EyFhÓw.y!jӯ` T}rR "I,? A _, yX@.Lf|`5Gfdf_~yyyp|noo/!Pưx`!tLW^50eb AXo4%]vrחNoe#DIǢв"Jfc>i?kb HOO'̦ hl:~Z.C 6l߾}.2J bN|4_>\cx@\D^ox2zc9spgٗ.]dx>=V+Ai 3t .Տ7ԩgn៖|T)**:zAx ^AF l݋{}YLE#%A $ȿ^~TT@n*Lzꇛ7&qP?~~#;UAXQVq+Pĭ@*'4toJPd&A_f,t= B2o&%%agOOĈ/B|>01.ZS#!0ϟLJ(| _a*6`$SFZEte<,ɔ)Sk^jwTy>sfq $H I@fzIs5038M}i!%K0}fs hK^ѣG=o:@ڠ5$!)8=A*LWfYp!ifbUYY_@ݶ6̀c1h!Obة 5`5JIOO7F"7ϟadwvvi`!K6} ZLE#y4h683BӴB3iPZ0Ao>p_ ԑqnmm]z+e(`aWvupɓ'y@Mf'K;c$ǨRPgAkHx7c Â7󇇇GD A +Ŀ?馌 &}f̘1o F .\/}K6mg闑ghˌ*~|.dŻ", $H A~%/| z'N!YnQ$X vttqټv理Τ( L>Ӄv <1~{{{!?ȅqMy:$PإB: M4; qjJS(èBxBcрt;gϞ beLga9^F˴ ;$g.f/yӛ`Άbwpgڴi `tt;: S 3f͚E+vZO< p0a 46#zD["q }ѣ $H QIL)SuFX(7<< <ΔT`^ :؀>===6 lաU %qI)PĥKu%$܌E~|~#)..6C!nݺOӆ&>yd|)(y>O0bn}LJrG6`(?AsQk۶mh9sӧ. ]SNnw:??رc(<짊'')~(x H\u<-.\~0fFzZ*6515u tUȌE Y 7J/f۫4G?) $H A~%13eiQ.7{zz)#4 P vQ0t-++U OKvPuun'D544zЇ>D{LOo}=`CCCfK4"2gd\2ŋf3\0Пkg̘Ib͛H ^COa9 A_]]]hl 6.1I4 &A}q„ 5fSMatRB]_1J}}YYY4A)SpSQL!D'_',wPrW>lc9h3 cJKK|G {fΜ}n۷%^ĢTF;::X(6]9hՂ!BIoo|v;2[ʹ5z=M35Mf8qbaaaccɧK?ټ(T32inrutuK,7w駟 0g$H A$&1plkkh|(//% 7ιz@˗/ A.tZa.@999y{kpZa|rlO1=ׯÇ`Ez u ;v >䧳gRrzCtttHSb vuuy^èـFݻ~ ӧ .JKK \Qj5yٌ;-X3 IZx|-))馛8`k-kSҺ_vڅԅB(#gB- GgSRR3g 'C庾)>?OǏ777;###7n0R~}0a8z͘;~iV\ QAཋ/w7:9&pm~ `#^ {epy|pR2(c$g]E ѢK.c\APϔ BuQ,??ކ 2Ch{{G\oFNnjҨtL䦛nrDiUUU0*j5F<@(4a׾g2"d BT6;0Ꞟ8`xɓO$H A$ao~pep `@5Xv…܇4Xba`΂a<3k,Sgff򙕕u 7Qlb聸iaنrΡ9 ԁʢŋCD`'a)SLp>)1*]XVPkTŔ !-o:ujםw$H AHr{.\с= <9 i2` nO (>1 .}B{|[ѡa<~E!i 0o|# ,X.HyUeσODa}iRBYk cZC,Bc~EХ3ƢMa0??cЌ͛7CkLSSUOIwaӧ3YRRXR Uf)yQ~$1(; ڍGF$H A+%h 'L<,%''CbŊӧOf999$;~x0P\jj*$gφ$WTTPH̦,7a`}ƾEybQ] @ޛ;w5'P_YsdܡNhʠ5ˌ{()pV " LJ;@ 0B(i:;G$H A[%?z9s:::3ϛA)pLrELwZ ̃͸|nn.4U\\ M4 f?}}}s06nr3ϼkyyy;~jkk*7=%Xgg'6P&.90 q/x4BíPرc<(ߢ07̋G¯ " Q@tQtfÁǎ + QBfftG\ʭ }KCh A $H_$2}2 [ 3gORRR@9̄U\rLA5Vt`'Xx1\sE3!"QU8~E3jcQXW"A.ztyL"\dee555Y&tФq푯ӧO#EÞ3gΘ:֮]~}xhs_Gil:BAG-IKKgϞ0a=$H AZ$ b>}Z \v (iիWgϞ 1ׅ;gw P_aHA>˖-koo nݺ{rb-e+AXtԭcŊNS c:88" :ߌ~嗱]WM 04@B]W[[klP { o|ZpT $H ,-X-ox9p`} :$c;CTlhh0f͚j~۶m!8`2 3 pʕׯ_?z((lF1?ylnnĉGFF_\\0ÇǢ/'O"%|c$&WXbɓ'}S@FSur=yf A $Q$ōϜ9/F 3ru &TKj^W_u -))\л|2-ZݭL1Uyy9-ܹsΜ9r)哓gϞ <u=p6h#&/|a` A $%RhŠԉ':::N< wXe8VׂJ^P\QQQkkTɓkASOrܡ$EEWZB4 TVALo4=``”ur}[$fd3x /^x$l $H AK"?o߾ &Q955^ۍEۣwERii)7$@;} L^}M6 ---\֯_V͚5 ~}̐K]Fr9syt 1 Tf'NhH@XZ P\`42!\'''S~ܹd,JUN4;4wܹF{A $H ;3g.^B5~xkLq .9q|2]tC(YTT;U;y:k"R4lZ3FHnWzhx===q@8Z QuAIm|$7--k # $H ADƿOI̙3}:ЌrU$ᚚ̥[RRVAJ!U\]~֦NzY fgg9kF`qE~8nx*x\.n^pܹso}*P$H AKߧǍE[@`$Ya$c#^jʔ) q;qD@}/st^<2ݢ5˗¤$h 4Slw_YY8M* ŋTয়~F̙:Bq---\WScƌ1ɖ-[ɡ)=A $HBIp1c bl(<̼X^^^ssK (^~݈ׅ f̘ qG Sp=}jJ^r$ (yx(SԩS.r}>c"gYfa^z饔WE=b7 uaΆTӿ A $o$8}&yډm:gݱ5/d5sɓ'yC@2At m`}D]wxb)¡!W3uԾִ46Cp=QE F{ $H +cl[@ULӮοAΜ9=&%%qlΆ A5zͤ6i$ʐyyy=ե_+ Mb7fqΜ94J[-*>= c!hb_gMoW!N9bc`'NLA8BFdɪMJiR%vtS5R BJ ! Nvm8Pʧb. g13scy|]w_0!B>;4[,4 x|nEXHqfU*x Vjp0LFP2}ҡG( ø%EroeYۍ- oX *a"cK.ia:v}bwMW !Bz[NʭX,OB ZRsja,Evŋjڠ|P?|0`A 6LFJbYކ9sx*DBa3330Ǐ0WrR`z`<"I!׿j48J &yirR)H4nUUL%abfR"yP;#M{ +v)Oƾϟ?`ͭ^|y}} Dtȡq9G!h\~&hL& g1<իW>)2;;k6!{rׯ_x>.Xa6M*V`B!|h\~!o*A`kǎp8 A~XK9Mȡ( {ĕR4;;199933lV^br,ni6!J2믄B!и 7ABеk~LfooO<n(Bq*1%>?ם;[[[F I_Պ[pB( N!dr rJ$AdX,Ig:#v\juxxj4OL!q޾h4F4e?ѣG=zdX:NFٳg4 z`T*ˉ m6Ϟ=àT*!^s17oH/`Hn?88a&qB!DԔWUX,Bpp=xk|F#;P(de4,zWD!K?9ROӍ0?~tߐ~DL&$B!wh_~_XH&8].t:rqUUE@"Io}B!Fbi6t:(hZ!JA]ZЗ[[~^B!M}ju\Rnw:X_ ݅. B!'MMMN8![>|+B!|zh_-.& T*|K!!h_!BGo{]`YU'  >' &D'L'()1>T'=/home/cspiel/projects/enblend/doc/seam-line-visualization.tifHHImageMagick 6.6.2-3 2010-06-07 Q16 http://www.imagemagick.orgenblend-enfuse-4.1.2+dfsg/doc/fig2txt.pl0000755000175100017510000000032612070530113020246 0ustar ametzlerametzler#! /usr/bin/env perl use strict; while (my $l = <> ) { next if ($l !~ /---BEGIN-TEXT---/); last; } while (my $l = <> ) { last if ($l =~ /---END-TEXT---/); $l =~ s/^# //; print $l; } exit(0); enblend-enfuse-4.1.2+dfsg/doc/understanding-masks.texi0000644000175100017510000000745312070530113023203 0ustar ametzlerametzler@cindex binary mask @cindex mask, binary @cindex weight mask @cindex mask, weight A @dfn{binary mask} indicates for every pixel of an image if this pixel must be considered in further processing, or ignored. For a @dfn{weight mask}, the value of the mask determines how much the pixel contributes, zero again meaning ``no contribution''. Masks arise in two places: as part of the input files and as separate files, showing the actual pixel weights prior to image blendung or fusion. We shall explore both occurrences in the next sections. @c @node Input File Masks @section Masks in Input Files @cindex mask, input files @cindex input mask Each of the input files for Enfuse and Enblend can contain its own mask. Both applications interpret them as binary masks no matter how many bits per image pixel they contain. @pindex identify @r{(ImageMagick)} @pindex tiffinfo @r{(libtiff)} Use ImageMagick's @command{identify} or, for @acronym{TIFF} files, @command{tiffinfo} to inquire quickly whether a file contains a mask. @ref{Helpful Programs} shows where to find these programs on the web. @example $ identify -format "%f %m %wx%h %r %q-bit" remapped-0000.tif remapped-0000.tif TIFF 800x533 DirectClassRGBMatte 8-bit ^^^^^ mask @end example @example $ tiffinfo remapped-0000.tif TIFF Directory at offset 0x1a398a (1718666) Subfile Type: (0 = 0x0) Image Width: 800 Image Length: 533 Resolution: 150, 150 pixels/inch Position: 0, 0 Bits/Sample: 8 Sample Format: unsigned integer Compression Scheme: PackBits Photometric Interpretation: RGB color Extra Samples: 1 <<<<< mask Orientation: row 0 top, col 0 lhs Samples/Pixel: 4 <<<<< R, G, B, and mask Rows/Strip: 327 Planar Configuration: single image plane @end example @noindent The ``Matte'' part of the image class and the ``Extra Samples'' line tell us that the file features a mask. Also, many interactive image manipulation programs show the mask as a separate channel, sometimes called ``Alpha''. There, the white (high mask value) parts of the mask enable pixels and black (low mask value) parts suppress them. The multitude of terms all describing the concept of a mask is confusing. @table @asis @item Mask A mask defines a selection of pixels. A value of zero represents an unselected pixel. The maximum value (``white'') represents a selected pixel and the values between zero and the maximum are partially selected pixels. See @uref{http://@/gimp-savvy.com/@/BOOK/@/index.html?node42.html, Gimp-Savy}. @item Alpha Channel The alpha channel stores the transpacency value for each pixel, typically in the range from zero to one. A value of zero means the pixel is completely transparent, thus does not contribute to the image. A value of one on the other hand means the pixel is completely opaque. @item Matte The notion ``matte'' as used by ImageMagick refers to an inverted alpha channel, more precisely: 1 - alpha. See @uref{http://@/www.imagemagick.org/@/Usage/@/channels/@/#trans, ImageMagick} for further explanations. @end table Enblend and Enfuse only consider pixels that have an associated mask value other than zero. If an input image does not have an alpha channel, Enblend warns and assumes a mask of all non-zero values, that is, it will use every pixel of the input image for fusion. Stitchers like @command{nona} add a mask to their output images. Sometimes it is helpful to manually modify a mask before fusion. For example to suppress unwanted objects (insects and cars come into mind) that moved across the scene during the exposures. If the masks of all input images are black at a certain position, the output image will have a hole in that position. @c @node Weight Mask Files @section Weight Mask Files @cindex mask, weight @cindex weight mask ... enblend-enfuse-4.1.2+dfsg/doc/sharp-edge.gp.in0000644000175100017510000000131712070530113021274 0ustar ametzlerametzler# Plot an example of a particularly sharp edge load "@srcdir@/config.gp" load "@srcdir@/config-edge.gp" set terminal unknown splot "@srcdir@/sharp-edge.data" matrix title "sharp\\_edge" set output "sharp-edge.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "sharp-edge.eps" set terminal postscript eps enhanced replot set output "sharp-edge.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - sharp-edge.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/sharp-edge.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/define2set.pl0000644000175100017510000000032212070530113020700 0ustar ametzlerametzler#! /usr/bin/env perl use strict; while ( my $l = <> ) { next if ($l !~ /^\s*#define/); chomp($l); if($l =~ s/^\s*#define\s+(\S+)\s+"?([^"]*)"?/\@set CFG::$1 $2/) { print "$l\n"; } } exit(0); enblend-enfuse-4.1.2+dfsg/doc/smooth-edge.data0000644000175100017510000000015612070530113021366 0ustar ametzlerametzler0 62 125 187 250 1 63 126 188 251 2 65 127 190 252 3 66 128 191 253 5 67 130 192 255 enblend-enfuse-4.1.2+dfsg/doc/photographic-workflow.fig0000644000175100017510000001150612070530113023347 0ustar ametzlerametzler#FIG 3.2 Produced by xfig version 3.2.5 Portrait Center Metric A4 100.00 Single -2 # ---BEGIN-TEXT--- # o # | # _____V_______ # / \ # | Take Images | # \_____________/ # | # V # /------+----------\ # [else] | | [raw] # | _______V________ # | / \ # | | Convert Images | <-- DCRaw, UFRaw, etc. # | \________________/ # | | # \----->+<---------/ # | # ______V_______ # / \ # | Align Images | <-- Hugin, Panotools # \______________/ # | # _______V________ # / \ # | Combine Images | <-- Enblend, Enfuse # \________________/ # | # ______V______ # / \ # | Postprocess | <-- The Gimp, et al. # \_____________/ # | # O # ---END-TEXT--- 1200 2 0 32 #ffff66 6 3825 1485 5085 1890 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5085 1485 5085 1890 3825 1890 3825 1485 5085 1485 4 1 0 50 -1 16 11 0.0000 4 180 1050 4455 1732 Take Images\001 -6 6 4320 5940 4680 6300 1 3 0 1 0 7 50 -1 0 0.000 1 0.0000 4500 6120 90 90 4500 6120 4590 6120 1 3 0 1 0 7 50 -1 -1 0.000 1 0.0000 4500 6120 158 158 4500 6120 4658 6120 -6 6 3915 5265 5085 5670 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5085 5265 5085 5670 3915 5670 3915 5265 5085 5265 4 1 0 50 -1 16 11 0.0000 4 180 1020 4500 5512 Postprocess\001 -6 6 3690 4545 5310 4950 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5310 4545 5310 4950 3690 4950 3690 4545 5310 4545 4 1 0 50 -1 16 11 0.0000 4 180 1380 4500 4792 Combine Images\001 -6 6 3870 3825 5130 4230 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5130 3825 5130 4230 3870 4230 3870 3825 5130 3825 4 1 0 50 -1 16 11 0.0000 4 180 1080 4500 4072 Align Images\001 -6 6 5085 2700 6615 3105 2 4 0 1 0 7 50 -1 -1 0.000 0 0 7 0 0 5 5085 2700 5085 3105 6615 3105 6615 2700 5085 2700 4 1 0 50 -1 16 11 0.0000 4 180 1305 5851 2947 Convert Images\001 -6 1 3 0 1 0 7 50 -1 0 0.000 1 0.0000 4500 1080 90 90 4500 1080 4590 1080 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 1170 4500 1485 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 1890 4500 2205 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 3510 4500 3825 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 5670 4500 5985 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 4950 4500 5265 2 1 0 1 0 7 50 -1 0 0.000 0 0 -1 1 0 2 0 0 1.00 60.00 120.00 4500 4230 4500 4545 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 2205 4950 2385 4500 2565 4050 2385 4500 2205 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 4950 2385 5850 2385 5850 2700 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 4 0 0 1.00 60.00 120.00 4050 2385 3150 2385 3150 3330 4050 3330 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 1 0 3 0 0 1.00 60.00 120.00 5850 3105 5850 3330 4950 3330 2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 4500 3150 4950 3330 4500 3510 4050 3330 4500 3150 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 6075 5467 5085 5467 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 6075 4027 5130 4027 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 6075 4747 5310 4747 2 1 1 1 0 7 50 -1 -1 4.000 0 0 -1 0 0 2 7065 2902 6615 2902 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 7617 3780 7617 3941 7830 3941 7617 3780 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 6075 3780 6075 4230 7830 4230 7830 3941 7617 3780 6075 3780 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 7617 4500 7617 4661 7830 4661 7617 4500 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 6075 4500 6075 4950 7830 4950 7830 4661 7617 4500 6075 4500 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 7617 5220 7617 5381 7830 5381 7617 5220 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 6075 5220 6075 5670 7830 5670 7830 5381 7617 5220 6075 5220 2 3 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 8607 2655 8607 2816 8820 2816 8607 2655 2 3 0 1 0 32 101 0 20 0.000 0 0 7 0 0 6 7065 2655 7065 3105 8820 3105 8820 2816 8607 2655 7065 2655 4 2 0 50 -1 16 11 0.0000 4 180 435 2970 2565 [else]\001 4 0 0 50 -1 16 11 0.0000 4 180 390 6030 2565 [raw]\001 4 0 0 50 -1 16 11 0.0000 4 180 1320 6165 5512 The Gimp, et al.\001 4 0 0 50 -1 16 11 0.0000 4 165 1380 6165 4799 Enblend, Enfuse\001 4 0 0 50 -1 16 11 0.0000 4 180 1500 6165 4072 Hugin, PanoTools\001 4 0 0 50 -1 16 11 0.0000 4 165 1770 7155 2947 DCRaw, UFRaw, etc.\001 enblend-enfuse-4.1.2+dfsg/doc/Makefile.am0000644000175100017510000002735512070530113020366 0ustar ametzlerametzlerinfo_TEXINFOS = enblend.texi \ enfuse.texi enblend_TEXINFOS = auxmac.texi auxmac.tex \ varsenblend.texi fdl.texi \ mask-template-characters.texi \ helpful-programs.texi \ seam-generators.texi \ color-profiles.texi \ tuning-memory-usage.texi \ understanding-masks.texi \ workflow.texi filespec.texi \ external-masks.texi \ bug-reports.texi authors.texi \ photographic-workflow.fig \ external-mask-workflow.fig \ seam-line-visualization.tif \ default.css enfuse_TEXINFOS = auxmac.texi auxmac.tex \ varsenfuse.texi fdl.texi \ mask-template-characters.texi \ helpful-programs.texi \ color-profiles.texi \ tuning-memory-usage.texi \ understanding-masks.texi \ workflow.texi filespec.texi \ external-masks.texi \ bug-reports.texi authors.texi \ config-edge.gp config.gp \ entropy-cutoff.gp.in \ exposure-cutoff.gp.in \ entropy.gp.in gaussian.gp.in \ laplacian-of-gaussian.gp.in \ sharp-edge.gp.in sharp-edge.data \ smooth-edge.gp.in smooth-edge.data \ local-analysis-window.fig \ photographic-workflow.fig \ focus-stack-decision-tree.fig \ external-mask-workflow.fig \ default.css AM_MAKEINFOFLAGS = @AM_MAKEINFOFLAGS@ \ -I $(top_builddir) -I $(srcdir) AM_MAKEINFOHTMLFLAGS = @AM_MAKEINFOHTMLFLAGS@ \ -I $(top_builddir) -I $(srcdir) \ --css-include=@srcdir@/default.css \ $(MAKEINFOHTMLFLAGS) export TEXINPUTS=$(top_builddir):$(srcdir) TEXI2DVI = texi2dvi $(TEXI2DVIFLAGS) $(EXTRATEXI2DVIFLAGS) EXTRA_DIST = \ docstrings seam-line-visualization.tif makeinfo-4.13-docbook.sed \ CMakeLists.txt macros.cmake \ CreateVersTexi.pl define2set.pl fig2txt.pl ReplaceValues.pl RASTER_DIR = @RASTER_DIR@ # created by make(1), user probably wants to rebuild (often?) MOSTLYCLEANFILES = varsenblend.texi varsenfuse.texi # created by make(1) CLEANFILES = entropy.{txt,eps,svg,pdf} \ entropy-cutoff.{txt,eps,svg,pdf} \ exposure-cutoff.{txt,eps,svg,pdf} \ external-mask-workflow.{txt,eps,svg,pdf} \ gaussian.{txt,eps,svg,pdf} \ laplacian-of-gaussian.{txt,eps,svg,pdf} \ local-analysis-window.{txt,eps,svg,pdf} \ photographic-workflow.{txt,eps,svg,pdf} \ focus-stack-decision-tree.{txt,eps,svg,pdf} \ sharp-edge.{txt,eps,svg,pdf} \ smooth-edge.{txt,eps,svg,pdf} \ seam-line-visualization.{eps,png} \ *.xml \ *.fig.bak \ *.msg # created by configure(1) or LaTeX DISTCLEANFILES = texinfo.tex \ enblend.sc enblend.scs \ enfuse.sc enfuse.scs MAINTAINERCLEANFILES = enblend.info enfuse.info # Phony Targets .PHONY: install-html install-html: @echo '*** Target "install-html" has been deprecated.' @echo '*** Use target "install-xhtml" instead of "install-html".' false .PHONY: html html: @echo '*** Target "html" has been deprecated.' @echo '*** Use target "xhtml" instead of "html".' false .PHONY: clean-local clean-local: -rm -rf enblend.xhtml enfuse.xhtml raster XMLLINT_FLAGS = --noout --valid # The following exported variables are respected by html2xhml(1). export TIDY SED XMLLINT .PHONY: xhtml xhtml: $(HTMLS:.html=.xhtml) .PHONY: validate-xhtml validate-xhtml: $(HTMLS:.html=.xhtml) for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$xhtml; then \ for y in $$xhtml/*.xhtml; do \ $(XMLLINT) $(XMLLINT_FLAGS) $$y; \ done; \ else \ $(XMLLINT) $(XMLLINT_FLAGS) $$xhtml; \ fi; \ done .PHONY: install-xhtml install-xhtml: xhtml @$(NORMAL_INSTALL) test -z "$(htmldir)" || $(MKDIR_P) "$(DESTDIR)$(htmldir)" for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$x; then \ $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$xhtml"; \ $(INSTALL_DATA) $$xhtml/* "$(DESTDIR)$(htmldir)/$$xhtml"; \ else \ $(INSTALL_DATA) *.xhtml *.svg $(RASTER_DIR) "$(DESTDIR)$(htmldir)"; \ fi; \ done .PHONY: uninstall-xhtml uninstall-xhtml: @$(NORMAL_UNINSTALL) for x in $(HTMLS); do \ xhtml=`basename $$x .html`.xhtml; \ if test -d $$x; then \ rm -rf "$(DESTDIR)$(htmldir)/$$xhtml"; \ else \ rm -rf "$(DESTDIR)$(htmldir)/*.xhtml" \ "$(DESTDIR)$(htmldir)/*.svg" \ "$(DESTDIR)$(htmldir)/$(RASTER_DIR)"; \ fi; \ done .PHONY: xml xml: $(info_TEXINFOS:.texi=.xml) .PHONY: validate-xml validate-xml: $(info_TEXINFOS:.texi=.xml) for x in $(info_TEXINFOS); do \ $(XMLLINT) $(XMLLINT_FLAGS) `basename $$x .texi`.xml; \ done # Implicit Rules %.txt: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.pdf: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.eps: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.svg: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< $(RASTER_DIR)/%.png: %.gp $(MKDIR_P) $(RASTER_DIR) $(GNUPLOT) $< %.txt: %.fig $(SED) -e '1,/---BEGIN-TEXT---/d' \ -e '/---END-TEXT---/,$$d' \ -e 's/^# \?//' < $< > $@ %.eps: %.fig $(FIG2DEV) -L eps $< $@ %.pdf: %.fig $(FIG2DEV) -L pdf $< $@ %.png: %.fig $(FIG2DEV) -L png $< $@ %.svg: %.fig $(FIG2DEV) -L svg $< | \ $(SED) -e '//d' -e 's/style="stroke-width:.025in/style="stroke-width:0.001px/' > $@ $(RASTER_DIR)/%.png: %.fig $(MKDIR_P) $(RASTER_DIR) $(FIG2DEV) -L png $< $@ %.eps: %.tif $(CONVERT) $< eps2:$@ %.png: %.tif $(CONVERT) $< $@ %.xhtml: %.html test -d "$<" && test "$<" = enblend.html && { \ $(MKDIR_P) "$@/$(RASTER_DIR)"; \ for i in $(enblend_TEXINFOS); do \ base="$${i%%.*}"; \ test -f "$$base.svg" && { cp "$$base.svg" "$@"; \ cp "$(RASTER_DIR)/$$base.png" "$@/$(RASTER_DIR)"; } ; \ test -f "$$base.png" && cp "$$base.png" "$@"; \ done; } ; true test -d "$<" && test "$<" = enfuse.html && { \ $(MKDIR_P) "$@/$(RASTER_DIR)"; \ for i in $(enfuse_TEXINFOS); do \ base="$${i%%.*}"; \ test -f "$$base.svg" && { cp "$$base.svg" "$@"; \ cp "$(RASTER_DIR)/$$base.png" "$@/$(RASTER_DIR)"; } ; \ test -f "$$base.png" && cp "$$base.png" "$@"; \ done; } ; true $(srcdir)/html2xhtml \ --meta="enblend-version,$(VERSION)" \ --tidy-flags="$(EXTRATIDYFLAGS)" \ --xmllint-flags="$(EXTRAXMLLINTFLAGS)" \ $< %.xml: %.texi - $(MAKEINFO) $(AM_MAKEINFOFLAGS) --docbook --output=- $< > $(basename $@)-orig.xml $(SED) \ -e '1,100s# $(basename $@)-clean.xml $(XMLLINT) \ --valid --noblanks --noent --nsclean --format --encode iso-8859-1 $(basename $@)-clean.xml \ > $@ || { rm $@; false; } # Explicit Rules varsenblend.texi: $(srcdir)/../src/enblend.cc \ $(srcdir)/../src/bounds.h \ $(srcdir)/../src/common.h \ $(srcdir)/../src/global.h $(PERL) $(srcdir)/docstrings $^ > $@ enblend.info: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.txt \ external-mask-workflow.txt enblend.dvi: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.eps \ external-mask-workflow.eps \ seam-line-visualization.eps enblend.html: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg $(RASTER_DIR)/photographic-workflow.png \ external-mask-workflow.svg $(RASTER_DIR)/external-mask-workflow.png \ seam-line-visualization.png enblend.pdf: $(enblend_TEXINFOS) \ photographic-workflow.pdf \ external-mask-workflow.pdf \ seam-line-visualization.png enblend.xhtml: enblend.html enblend.xml: $(enblend_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg \ external-mask-workflow.svg \ seam-line-visualization.png varsenfuse.texi: $(srcdir)/../src/enfuse.cc \ $(srcdir)/../src/bounds.h \ $(srcdir)/../src/common.h \ $(srcdir)/../src/global.h $(PERL) $(srcdir)/docstrings $^ > $@ enfuse.info: $(enfuse_TEXINFOS) \ $(srcdir)/versenblend.texi $(top_builddir)/config-h.texi \ photographic-workflow.txt \ external-mask-workflow.txt \ focus-stack-decision-tree.txt \ entropy.txt \ entropy-cutoff.txt \ exposure-cutoff.txt \ gaussian.txt \ laplacian-of-gaussian.txt \ local-analysis-window.txt \ sharp-edge.txt \ smooth-edge.txt enfuse.dvi: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.eps \ external-mask-workflow.eps \ focus-stack-decision-tree.eps \ entropy.eps \ entropy-cutoff.eps \ exposure-cutoff.eps \ gaussian.eps \ laplacian-of-gaussian.eps \ local-analysis-window.eps \ sharp-edge.eps \ smooth-edge.eps enfuse.html: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg $(RASTER_DIR)/photographic-workflow.png \ external-mask-workflow.svg $(RASTER_DIR)/external-mask-workflow.png \ focus-stack-decision-tree.svg $(RASTER_DIR)/ \ entropy.svg $(RASTER_DIR)/entropy.png \ entropy-cutoff.svg $(RASTER_DIR)/entropy-cutoff.png \ exposure-cutoff.svg $(RASTER_DIR)/exposure-cutoff.png \ gaussian.svg $(RASTER_DIR)/gaussian.png \ laplacian-of-gaussian.svg $(RASTER_DIR)/laplacian-of-gaussian.png \ local-analysis-window.svg $(RASTER_DIR)/local-analysis-window.png \ sharp-edge.svg $(RASTER_DIR)/sharp-edge.png \ smooth-edge.svg $(RASTER_DIR)/smooth-edge.png enfuse.pdf: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.pdf \ external-mask-workflow.pdf \ focus-stack-decision-tree.pdf \ entropy.pdf \ entropy-cutoff.pdf \ exposure-cutoff.pdf \ gaussian.pdf \ laplacian-of-gaussian.pdf \ local-analysis-window.pdf \ sharp-edge.pdf \ smooth-edge.pdf enfuse.xhtml: enfuse.html enfuse.xml: $(enfuse_TEXINFOS) \ $(srcdir)/versenfuse.texi $(top_builddir)/config-h.texi \ photographic-workflow.svg \ external-mask-workflow.svg \ focus-stack-decision-tree.svg \ entropy.svg \ entropy-cutoff.svg \ exposure-cutoff.svg \ gaussian.svg \ laplacian-of-gaussian.svg \ local-analysis-window.svg \ sharp-edge.svg \ smooth-edge.svg enblend-enfuse-4.1.2+dfsg/doc/color-profiles.texi0000644000175100017510000000577412070530113022165 0ustar ametzlerametzlerEnblend and Enfuse expect that either @enumerate @item no input image has a color profile or @item @cindex color profile @cindex @acronym{ICC} profile @cindex profile, @acronym{ICC} all come with the @emph{same} @uref{http://@/en.wikipedia.org/@/wiki/@/ICC_profile, @acronym{ICC}} profile. @end enumerate @cindex color appearance model @cindex @acronym{CIECAM02} @cindex @acronym{RGB} color cube @cindex color cube, @acronym{RGB} @noindent In case@tie{}1 the applications blend or fuse in the @acronym{RGB}-cube, whereas in case@tie{}2 the images first are transformed to @uref{http://@/en.wikipedia.org/@/wiki/@/CIECAM02, @acronym{CIECAM02}} color space -- respecting the input color profile -- then they are blended or fused, and finally the data transformed back to @acronym{RGB} color space. Moreover, in case@tie{}2, Enblend and Enfuse assign the input color profile to the output image. Mixing different @acronym{ICC} profiles or alternating between images with profiles and without them generates warnings as it generally leads to unpredictable results. @cindex @acronym{sRGB} color space @cindex color space, @acronym{sRGB} The options@tie{}@option{--ciecam} (@pxref{Extended Options}) and its opposite @option{--no-ciecam} (@pxref{Extended Options}) overrule the default profile selection procedure described above. Use option@tie{}@option{--ciecam} on a set of input images @emph{without} color profiles to assign a profile to them and perform the blending or fusing process in @acronym{CIECAM02} color space. The default profile is @uref{http://@/en.wikipedia.org/@/wiki/@/SRGB, @acronym{sRGB}}. Override this setting with option@tie{}@option{--fallback-profile} (@pxref{Extended Options}). On the other hand, suppress the utilization of @acronym{CIECAM02} blending or fusing of a set of input images @emph{with} color profiles with option@tie{}@option{--no-ciecam}. The only reason for the latter is to shorten the blending- or fusing-time, because transforming to and back from the @acronym{CIECAM02} color space are computationally expensive operations. Option@tie{}@option{--ciecam} as well as @option{--fallback-profile} have no effect on images with attached color profiles, just as option@tie{}@option{--no-ciecam} has no effect on images without profiles. The impact of blending in @acronym{CIECAM02} color space as opposed to the @acronym{RGB} cube vary with the contents of the input images. Generally colors lying close together in @acronym{RGB} space experience less change when switching the blending spaces. However, colors close the border of any color space can see marked changes. For color geeks: The transformations to @acronym{CIECAM02} color space and back use @itemize @item @cindex rendering intent, perceptual @cindex perceptual rendering intent perceptual rendering intent, @item @cindex @acronym{D50} white point @cindex white point, @acronym{D50} the @acronym{D50} white point, @item 500@tie{}lumen surrounding light (``average'' in @acronym{CIECAM02} parlance), and @item assume complete adaption. @end itemize enblend-enfuse-4.1.2+dfsg/doc/smooth-edge.gp.in0000644000175100017510000000132612070530113021470 0ustar ametzlerametzler# Plot an example of a particularly sharp edge load "@srcdir@/config.gp" load "@srcdir@/config-edge.gp" set terminal unknown splot "@srcdir@/smooth-edge.data" matrix title "smooth\\_edge" set output "smooth-edge.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "smooth-edge.eps" set terminal postscript eps enhanced replot set output "smooth-edge.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - smooth-edge.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/smooth-edge.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/laplacian-of-gaussian.gp.in0000644000175100017510000000174312070530113023416 0ustar ametzlerametzler# Plot radial component of Laplacian-of-Gaussian load "@srcdir@/config.gp" Sigma = 0.5 LaplacianOfGaussian(R, Sigma) = \ ((R**2 / (2.0 * Sigma**2)) - 1.0) * \ exp(-(R**2 / (2.0 * Sigma**2))) / \ (pi * Sigma**4) set key bottom right set grid set samples 1023 set xlabel "R" #set xtics 0.2 set ylabel "k(R)" #set ytics 0.2 set terminal unknown plot [R = 0:2] LaplacianOfGaussian(R, Sigma) set output "laplacian-of-gaussian.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "laplacian-of-gaussian.eps" set terminal postscript eps enhanced replot set output "laplacian-of-gaussian.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - laplacian-of-gaussian.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/laplacian-of-gaussian.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/gaussian.gp.in0000644000175100017510000000142312070530113021065 0ustar ametzlerametzler# Plot Gauss curve with default parameters of Enfuse load "@srcdir@/config.gp" Mu = 0.5 Sigma = 0.2 Gaussian(Y) = exp(-0.5 * ((Y - Mu) / Sigma)**2) set samples 1023 set xlabel "Y" set xtics 0.2 set ytics 0.2 set terminal unknown plot [Y = 0:1] Gaussian(Y) set output "gaussian.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "gaussian.eps" set terminal postscript eps enhanced replot set output "gaussian.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - gaussian.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/gaussian.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/exposure-cutoff.gp.in0000644000175100017510000000243512070530113022415 0ustar ametzlerametzler# Plot example of exposure-cutoff function load "@srcdir@/config.gp" Lower = 0.05 Upper = 0.97 Mu = 0.5 Sigma = 0.2 _Epsilon = 1.0 / 1024.0 Step(X) = X < 0 ? 0 : (X > _Epsilon ? 1 : 1/0) Gaussian(Y, Mu, Sigma) = exp(-0.5 * ((Y - Mu) / Sigma)**2) ExposureCutoffProper(Y, LowerCutoff, UpperCutoff) = \ Y <= LowerCutoff ? 0 : (Y >= UpperCutoff ? 0 : Gaussian(Y, Mu, Sigma)) ExposureCutoff(Y, LowerCutoff, UpperCutoff) = \ Step(Y - LowerCutoff) * \ Step(UpperCutoff - Y) * \ ExposureCutoffProper(Y, LowerCutoff, UpperCutoff) set grid set key right bottom set samples 1023 set xlabel "Y" set xtics 0.2 #--set ylabel "weight" set yrange [-0.1:1.1] set ytics 0.2 set terminal unknown plot [Y = 0:1] ExposureCutoff(Y, Lower, Upper) set output "exposure-cutoff.txt" set terminal dumb Dumb_Width Dumb_Height enhanced replot set output "exposure-cutoff.eps" set terminal postscript eps enhanced replot set output "exposure-cutoff.svg" set terminal svg size Svg_Width, Svg_Height dynamic enhanced replot # Newer Gnuplots have a "pdf" terminal. set output "| ps2pdf -dEPSCrop - exposure-cutoff.pdf" set terminal postscript eps size Pdf_Width, Pdf_Height enhanced replot set output "@RASTER_DIR@/exposure-cutoff.png" set terminal png transparent size Png_Width, Png_Height enhanced replot enblend-enfuse-4.1.2+dfsg/doc/bug-reports.texi0000644000175100017510000001305112224470040021465 0ustar ametzlerametzler@cindex Octave @smalldisplay Most of this appendix was taken from the @uref{http://@/www.gnu.org/@/software/@/octave/, Octave} documentation. @end smalldisplay @cindex bug reports @cindex problem reports @noindent Bug reports play an important role in making Enblend and Enfuse reliable and enjoyable. @cindex LaunchPad @cindex bug database, LaunchPad @cindex LaunchPad, bug database When you encounter a problem, the first thing to do is to see if it is already known. To this end visit the package's @uref{https://@/launchpad.net/, LaunchPad} bug @uref{@value{CFG::PACKAGE_BUGREPORT}, database}. Search it for your particular problem. If it is not known, please report it. In order for a bug report to serve its purpose, you must include the information that makes it possible to fix the bug. @section Have You Really Found a Bug? If you are not sure whether you have found a bug, here are some guidelines: @itemize @item If Enblend or Enfuse get a fatal signal, for any options or input images, that is a bug. @item If Enblend or Enfuse produce incorrect results, for any input whatever, that is a bug. @item If Enblend or Enfuse produce an error message for valid input, that is a bug. @item If Enblend or Enfuse do not produce an error message for invalid input, that is a bug. @end itemize @section How to Report Bugs The fundamental principle of reporting bugs usefully is this: report all the facts. If you are not sure whether to state a fact or leave it out, state it. Often people omit facts because they think they know what causes the problem and they conclude that some details do not matter. Play it safe and give a specific, complete example. Keep in mind that the purpose of a bug report is to enable someone to fix the bug if it is not known. Always write your bug reports on the assumption that the bug is not known. Try to make your bug report self-contained. If we have to ask you for more information, it is best if you include all the previous information in your response, as well as the information that was missing. @noindent To enable someone to investigate the bug, you should include all these things: @itemize @item The exact version and configuration of Enblend or Enfuse. You can get this by running it with the options @option{--version} and @option{--verbose}. @item A complete set of input images that will reproduce the bug. Strive for a minimal set of @emph{small}@footnote{Images of a size less than 1500@classictimes{}1000 pixels qualify as small.} images. @item The type of machine you are using, and the operating system name and its version number. @item A complete list of any modifications you have made to the source. Be precise about these changes. Show a @command{diff} for them. @item Details of any other deviations from the standard procedure for installing Enblend and Enfuse. @item The @emph{exact command line} you use to call Enblend or Enfuse, which then triggers the bug. @noindent Examples: @example ~/local/bin/enblend -v \ --fine-mask \ --optimizer-weights=3:2 --mask-vectorize=12.5% \ image-1.png image-2.png @end example @noindent or: @example /local/bin/enfuse \ --verbose \ --exposure-weight=0 --saturation-weight=0 --entropy-weight=1 \ --gray-projector=l-star \ --entropy-cutoff=1.667% \ layer-01.ppm layer-02.ppm layer-03.ppm @end example @cindex Hugin @cindex KImageFuser If you call Enblend or Enfuse from within a @acronym{GUI} like, for example, @uref{http://@/hugin.sourceforge.net/, Hugin} or @uref{http://@/panorama.dyndns.org/@/index.php?@/lang=@/en&@/subject=@/KImageFuser&@/texttag=@/KImagefuser, KImageFuser} by @sc{Harry van der Wolf}, copy&paste or write down the command line that launches Enblend or Enfuse. @item A description of what behavior you observe that you believe is incorrect. For example, ``The application gets a fatal signal,'' or, ``The output image contains black holes.'' Of course, if the bug is that the application gets a fatal signal, then one cannot miss it. But if the bug is incorrect output, we might not notice unless it is glaringly wrong. @end itemize @section Sending Patches for Enblend or Enfuse If you would like to write bug fixes or improvements for Enblend or Enfuse, that is very helpful. When you send your changes, please follow these guidelines to avoid causing extra work for us in studying the patches. If you do not follow these guidelines, your information might still be useful, but using it will take extra work. @itemize @item Send an explanation with your changes of what problem they fix or what improvement they bring about. For a bug fix, just include a copy of the bug report, and explain why the change fixes the bug. @item Always include a proper bug report for the problem you think you have fixed. We need to convince ourselves that the change is right before installing it. Even if it is right, we might have trouble judging it if we do not have a way to reproduce the problem. @item Include all the comments that are appropriate to help people reading the source in the future understand why this change was needed. @item Do not mix together changes made for different reasons. Send them individually. If you make two changes for separate reasons, then we might not want to install them both. We might want to install just one. @item Use the version control system to make your diffs. Prefer the @uref{http://@/en.wikipedia.org/@/wiki/@/Diff#@/Unified_@/format, unified diff} format: @code{hg diff --unified 4}. @item You can increase the probability that your patch gets applied by basing it on a recent revision of the sources. @end itemize enblend-enfuse-4.1.2+dfsg/doc/versenfuse.texi0000644000175100017510000000014212224473646021415 0ustar ametzlerametzler@set UPDATED 7 October 2013 @set UPDATED-MONTH October 2013 @set EDITION 4.1.2 @set VERSION 4.1.2 enblend-enfuse-4.1.2+dfsg/doc/config-edge.gp0000644000175100017510000000022312070530113021012 0ustar ametzlerametzler# Configuration for the "edge" examples set contour set grid set hidden3d set style data line set view 60, 30 set xtics 0, 1, 4 set ytics 0, 1, 4 enblend-enfuse-4.1.2+dfsg/doc/stamp-vti0000644000175100017510000000014512224473525020203 0ustar ametzlerametzler@set UPDATED 15 February 2013 @set UPDATED-MONTH February 2013 @set EDITION 4.1.2 @set VERSION 4.1.2 enblend-enfuse-4.1.2+dfsg/doc/sharp-edge.data0000644000175100017510000000017012070530113021166 0ustar ametzlerametzler 0 0 200 0 0 0 225 0 0 0 0 255 0 0 0 215 0 0 0 0 200 0 0 0 0 enblend-enfuse-4.1.2+dfsg/compile0000755000175100017510000001624512232763263017155 0ustar ametzlerametzler#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: enblend-enfuse-4.1.2+dfsg/Makefile.am0000644000175100017510000000106012070530113017602 0ustar ametzlerametzlerEXTRA_DIST = \ README.txt VERSION \ CMakeLists.txt CMakeModules ConfigureChecks.cmake config.h.cmake if BUILD_DOC MAYBE_DOC = doc endif SUBDIRS = include src $(MAYBE_DOC) DIST_SUBDIRS = include src doc ACLOCAL_AMFLAGS = -I m4 # created by configure(1) DISTCLEANFILES = config-h.texi .PHONY: xhtml xhtml: $(MAKE) --directory=doc $@ .PHONY: install-xhtml install-xhtml: $(MAKE) --directory=doc $@ .PHONY: uninstall-xhtml uninstall-xhtml: $(MAKE) --directory=doc $@ .PHONY: validate-xhtml validate-xhtml: $(MAKE) --directory=doc $@ enblend-enfuse-4.1.2+dfsg/README.txt0000644000175100017510000005141512070530501017256 0ustar ametzlerametzlerCopyright (C) 2004-2012 Andrew Mihal. This file is part of Enblend. * Programs This packages contains the programs Enblend and Enfuse. The source code and further information about Enblend are available at: http://enblend.sf.net ** Enblend Enblend is a tool for compositing images using a Burt&Adelson multiresolution spline. This technique tries to make the seams between the input images invisible. The basic idea is that image features should be blended across a transition zone proportional in size to the spatial frequency of the features. For example, objects like trees and windowpanes have rapid changes in color. By blending these features in a narrow zone, you will not be able to see the seam because the eye already expects to see color changes at the edge of these features. Clouds and sky are the opposite. These features have to be blended across a wide transition zone because any sudden change in color will be immediately noticeable. Enblend expects each input file to have an alpha channel. The alpha channel should indicate the region of the file that has valid image data. Enblend compares the alpha regions in the input files to find the areas where images overlap. Alpha channels can be used to indicate to Enblend that certain portions of an input image should not contribute to the final image. Enblend does not align images for you. Use a tool like Hugin or PanoTools to do this. The files produced by these programs are exactly what Enblend is designed to work with. ** Enfuse Enfuse is a tool for automatic exposure blending, contrast blending and much more. It can be used to fuse an exposure bracketed step automatically into a nicely looking image. See doc/enfuse.info and on Windows also contrib/enfuse_droplet/enfuse_droplet_readme.txt for more information. * Installation GNU Make is required to build the project, because some of the Makefiles contain pattern rules. ** Tarball ./configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install ** Mercurial Repository *** AutoConf/AutoMake In the root directory of the project issue: make --makefile=Makefile.scm ./configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install The package fully supports VPATH builds. Thus the following command sequence builds in a separate directory. cd ROOT-DIRECTORY make --makefile=Makefile.scm mkdir BUILD-DIR cd BUILD-DIR ROOT-DIRECTORY/configure YOUR-OPTIONS-IF-ANY-GO-HERE make make install *** CMake The canonical way to build Enblend and Enfuse is with Autotools, this is, autoconf(1) and automake(1). An alternative CMake build has been added since version 4.0. The CMake build strives to replicate the Autotools build. It may or may not work for you. It is currently maintained but not supported, meaning that it could break anywhere anytime in the future. cmake . make make install Analogously to Autotools, CMake allows for VPATH builds: mkdir BUILD-DIR cd BUILD-DIR cmake ROOT-DIRECTORY make make install * Specific Configuration Options Among the usual configuration options of the GNU autoconf system, the configure(1) script offers the following options to tailor Enblend and Enfuse. Remember that configure(1) creates a file called "config.h" that can serve for fine-tuning the configuration. We write the default values of all configuration options in capital letters. ** --enable-gpu-support=CHECK/yes/no -DENABLE_GPU=OFF/on (CMake) Enable code in Enblend to use the GPU for optimizing the seam line between two images if all necessary OpenGL libraries are found. Enfuse does not benefit of this code. OpenMP (see below) and GPU work together. Note that enabling GPU support does not mean Enblend will actually use the GPU. Besides passing option "--gpu" to Enblend the hardware as well as the X11 drivers have to fulfill certain requirements. See also option "--with-apple-opengl-framework". ** --enable-openmp=yes/NO -DENABLE_OPENMP=ON/off (CMake) Parallelize parts of Enblend and Enfuse with OpenMP. See http://www.openmp.org/ Note that OpenMP support and the ImageCache must not be activated both. The default is to configure with ImageCache and without OpenMP. If OpenMP support has been enabled, the utilization of special features of the actual, underlying OpenMP implementation can be controlled as usual with the environment variables OMP_NUM_THREADS, OMP_NESTED and OMP_DYNAMIC. See the OpenMP specification for details on the usage of these variables. ** --enable-split-doc=YES/no -DNOSPLIT=OFF/on (CMake) Split the documentation files in INFO or HTML format into small pieces. The default is "yes", split documentation. ** --enable-debug=yes/NO Compile without optimizations and enable all debug-checking code. The default is "no", build an optimized version without debugging symbols. ** --enable-image-cache=YES/no -DENABLE_IMAGECACHE=OFF/on (CMake) Activate the ImageCache feature, which allows for processing of large images. The ImageCache handles swapping parts of the images to disk. The default is "yes", enable the ImageCache. The ImageCache is recommended on systems where memory is scarce, but the images to blend or fuse are large. The ImageCache feature and OpenMP support must not be activated together. ** --with-apple-opengl-framework=yes/NO Sometimes AutoConf fails to detect Apple's OpenGL framework. Use this option on MAC OS X to force its usage without a test. See also option "--enable-gpu-support" and the section MacOSX below. ** --with-boost-filesystem=CHECK/yes/no/ Use Boost "filesystem" library to get platform-independent path generation. The default is to check for usability. "No" forces the use of the internal path generation library. Supply a LIBRARY name if you want to override the default candidates "boost_filesystem-mt" for multi-threaded compilation and "boost_filesystem" for single-thread builds. ** --with-dmalloc=yes/NO Compile with the debug-malloc library. The library is available at http://www.dmalloc.com/. ** --with-openexr=CHECK/yes/no Build with support for reading and writing OpenEXR images. See http://www.openexr.com/ for the required libraries. ** --with-raster-dir= Set the name of the raster-graphics directory, which always is a subdirectory of the XHTML documentation's root directory. Default: "raster". * CMake Specifics ** Configuration Options These options only apply to CMake. *** -DCPACK_BINARY_:BOOL=OFF/on Create a package for the specified , where is "DEB", "RPM", or "NSIS". *** -DCPACK_BINARY_:BOOL=ON/off Create other packages for the specified , where is "TBZ2", "TGZ", "STGZ", or "TZ". *** -DPACK_SOURCE_:BOOL=OFF/on Create a source package for the specified , where is "TBZ2", "TGZ", "TZ", or "ZIP". ** Configuration Example Creating a RedHat package on OpenSuSE cmake . \ -DDOC=ON -DENABLE_GPU=ON \ -DENABLE_IMAGECACHE=OFF -DENABLE_OPENMP=ON \ -DCPACK_BINARY_RPM:BOOL=ON make package This will create a package enblend-4.0.595-Linux.rpm, which you may install with sudo rpm -U enblend-4.0.595-Linux.rpm ** Important Configured Make(1) Targets help List all available targets. edit_cache If cmake-gui(1) is installed, start the GUI to edit the "CMakeCache.txt" file. enblend Create an Enblend executable. enfuse Create an Enfuse executable. man Create the manual pages for Enblend and Enfuse. doc3 Create the documentation. This includes html, info, and pdf documents, if the cmake-option DOC was set. install Install everything in the proper places. package Create package(s) specified with the CPACK_BINARY_:BOOL parameter of CMake. It is preferred to create a package and use the package manager to install it rather than using the "install" target. rebuild_cache In a changed environment (e.g. newly installed packages) this is the way to discard cached values, so that CMake again starts searching for everything. package_source Build a source package like autotools "make dist". * Extra Make(1) Variables ** Compilation You can override Makefile variables the usual way. In addition the build process supplies several variables, all starting with "EXTRA", that add their value to the "usual suspects". These are CPPFLAGS -- EXTRACPPFLAGS CFLAGS -- EXTRACFLAGS CXXFLAGS -- EXTRACXXFLAGS LDFLAGS -- EXTRALDFLAGS All these "EXTRA" are intentionally unaffected by the Automake/Autoconf generation of the Makefiles proper. That way developers can override configured settings in any make(1) run or quickly build the project with new combinations of flags. For example, to quickly add an additional define, use make EXTRACPPFLAGS=-DDEBUG_8BIT_ONLY To compile for coverage analysis, say make EXTRACXXFLAGS="-O0 --coverage" EXTRALDFLAGS="--coverage" analogously for profiling analysis make EXTRACXXFLAGS=-pg EXTRALDFLAGS=-pg ** Documentation Generation We have introduced the variable EXTRATEXI2DVIFLAGS to give the maintainers a tighter control over the generation of the hard-copy version of the documentation. Note that the variable does not have an equivalent non-EXTRA sibling in the Automake system. It is particularly useful to supply texi2dvi(1) with "--command" parameters that explicitly set the paper size, like, for example, EXTRATEXI2DVIFLAGS="--command=@afourpaper" Common paper-size commands are: @smallbook @afivepaper @afourpaper, @afourwide, @afourlatex Moreover, you can specify the height and (optionally) width of the main text area on a page with the @pagesizes HEIGHT [, WIDTH] command. Remember to supply both HEIGHT and WIDTH with appropriate units ("mm", "in", ...). Another useful Texinfo-command at this level is @finalout which suppresses the black rectangles marking overfull hboxes. Use the standard variable MAKEINFOFLAGS to control makeinfo(1), for example, to set the maximum length of lines in Info and plain text output with make MAKEINFOFLAGS="--fill-column=95" info The variable MAKEINFOHTMLFLAGS controls the formatting of XHTML; if set, it adds to MAKEINFOFLAGS. * Documentation The distribution includes some basic documentation in doc/enblend.info doc/enfuse.info and the manual pages in src/enblend.1 src/enfuse.1 After the configuration you can build documentation in PostScript, PDF, XHTML, and DocBook-XML format. make ps make pdf make xhtml make xml The make process automatically ensures the validity of the XHTML and DocBook-XML documentation. Additionally, it can be checked with make validate-xhtml make validate-xml The DocBook-XML format can be processed with, e.g. dblatex(1), like dblatex --type=ps enblend.xml dblatex --type=ps enfuse.xml selecting a format with "--type=FORMAT", where FORMAT is "tex", "dvi", "ps", or "pdf" (default). Another possibility is to use xmlto(1): xmlto xhtml-nochunks enblend.xml # or just "html" xmlto ps enblend.xml xmlto pdf enblend.xml The number of available output formats vary. (See, e.g. /usr/share/xmlto/format/docbook) Note that some additional packages are required to build these formats: convert - ImageMagick's swiss army knife of graphics format conversion found at http://www.imagemagick.org/. makeinfo - GNU documentation generator. gnuplot - Render plots (.gp) in text, PNG, EPS, and PDF formats. Check out http://www.gnuplot.info/. freefonts - Fonts for Gnuplot's PNG format. ghostscript - Convert EPS to PDF. perl - Run Perl programs. tetex - Typeset the Texinfo documents in PS or PDF. texi2html - Convert Texinfo to HTML. Find more information at http://www.nongnu.org/texi2html/. transfig - Render XFig drawings in PNG, EPS, and PDF. Check out http://www.xfig.org/ for Transfig. tidy - Convert HTML to (almost) XHTML. Tidy is available at http://tidy.sourceforge.net/. xmllint - Validate XHTML. Get Xmllint e.g. from http://www.xmlsoft.org/. * Operating System Specific Instructions and Hints ** GNU/Linux *** High-Performance Binaries To configure and compile high-performance versions of Enblend and Enfuse configure single CPU systems with --disable-image-cache SMP boxes with --disable-image-cache --enable-openmp and pass EXTRACXXFLAGS="-march=native -O2" to make(1). The resulting binaries are pretty fast, although other configuration options or compiler flags might improve their performance even more. *** Xmi and Xi To avoid direct linkage to the two X11 libraries Xmi and Xi add "--without-x" to the parameters of configure(1). ** MacOSX *** Compiling on MacOSX On MacOSX you can build Enblend/Enfuse with Fink and with MacPorts. This README only describes the MacPorts way. **** Prerequisites - XCode: Install the XCode version for your MacOSX version. Download it from http://developer.apple.com/tools/download/ - MacPorts: Install MacPorts for your MacOSX version. Download it from http://www.macports.org/ **** Provide necessary dependencies From the command line: $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial Note that Enblend/Enfuse can be build via AutoConf/AutoMake and via CMake. The latter is experimental. If you want to build via CMake, add "cmake" to the previous command line after "mercurial" like this: $ sudo port install make lcms boost jpeg tiff libpng OpenEXR mercurial cmake **** Compile As MacPorts resides in /opt/local, which is not a standard library/binary/include path for most source packages, you need to specify that during the configure step. Via AutoConf/AutoMake: cd enblend make --makefile=Makefile.scm mkdir build cd build CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib ../configure --with-apple-opengl-framework make sudo make install Via CMake: cd enblend make --makefile=Makefile.scm mkdir build cd build CPPFLAGS=-I/opt/local/include LDFLAGS=-L/opt/local/lib cmake .. make sudo make install This will install Enblend/Enfuse in /usr/local. **** Other compilation options Please also check the AutoConf/AutoMake and CMake variables for more build options. ** Win *** General There are two different archives: one with 32-bit executables, the other one with 64-bit executables. **** 32-bit versions The 32-bit archive contains two different versions of Enblend and Enfuse: ***** enblend.exe/enfuse.exe These executables are the standard release. They are using one processor core and the ImageCache (to allow for processing of very big images). ***** enblend_openmp.exe/enfuse_openmp.exe These executables can utilize several cores of modern multi-core processors and are therefore significantly faster on modern processors. But they may fail on very big images because they are working without the ImageCache. In this case, please switch to the standard version. **** 64-bit version The 64-bit archive contains multi-threaded versions of Enblend and Enfuse, both compiled without the ImageCache. All variants can utilize a modern graphic card to accelerate the optimizing of the seam line between two images. *** Compiling on Windows **** Prerequisites You will need to following tools for compiling: - MS Visual C++ 2010, Express Edition suffices or MS Visual C++ 2012, Express for Desktop suffices - CMake, at least version 2.6, though version 2.8 is preferred - Perl, e.g. ActiveState Perl CMake expects all sources and libraries in one folder. So, create a folder, e.g., "d:\src", extract Enblend/Enfuse into this folder, and also put all libraries into this folder. You need the following libraries for reading and writing different image formats. We state the version and the folder name of the libraries used as of December 2009 in square brackets. - libtiff [libtiff-4.0.3] - zlib, required by libtiff [1.2.7 in zlib] - libjpeg (optional) [jpeg-8d] - libpng (optional) [libpng-1.5.12] - OpenEXR and IlmBase (optional), compiled libraries are expected in folder "Deploy" [OpenEXR-1.7.1 and IlmBase-1.0.3] - vigra, required, should be compiled against same libtifff, libjpeg, libpng and OpenEXR as used for Enblend/Enfuse [1.8.0 in vigra] Enblend/Enfuse also depend on the following libraries: - Boost [1.51 in boost_1_51_0] - Only header files are used by default. - Optionally, Enblend/Enfuse can use the Filesystem Library. However, this library needs to compiled against STLport. - Little-CMS2 [2.4 in lcm2-2.4] For compiling with GPU support, you need: - GLUT for Win32 [3.7.6 in glut] - OpenGL Extension Wrangler Library GLEW [1.9.0 in glew] **** Compile 1. Start cmake-gui or cmake-setup. 2. Enter path to Enblend/Enfuse source in "Where is the source code". 3. Enter path where to build the executable, e.g. "d:\src\build-enblend". In following, it will be denoted as . 4. Select "Configure" when asked for a generator select the appropriate generator. 5. Activate the appropriate options. ***** ENABLE_GPU=on/OFF Enable code in Enblend to use the GPU for optimizing the seam line between two images if all necessary OpenGL libraries are found. Enfuse does not benefit of this code. OpenMP (see below) and GPU work together. Note that enabling GPU support does not mean Enblend will actually use the GPU. Besides passing option "--gpu" to Enblend the hardware as well as the graphic card drivers have to fulfill certain requirements. ***** ENABLE_IMAGECACHE=ON/off Activate the ImageCache feature, which allows for processing of large images. The ImageCache handles swapping parts of the images to disk. The default is "on", i.e., enable the ImageCache. The ImageCache is recommended on systems where memory is scarce, but the images to blend or fuse are large. The ImageCache feature and OpenMP support must not be activated together. ***** ENABLE_OPENMP=on/OFF Parallelize parts of Enblend and Enfuse with OpenMP. See http://www.openmp.org/ Note that OpenMP support and the ImageCache must not be activated both! The default is to configure with ImageCache and without OpenMP. If OpenMP support has been enabled, the utilization of special features of the actual, underlying OpenMP implementation can be controlled as usual with the environment variables OMP_NUM_THREADS, OMP_NESTED and OMP_DYNAMIC. See the OpenMP specification for details on the usage of these variables. ***** ENABLE_SSE2=on/OFF Creates executable which make use of the advanced features (SSE2) of modern processors. ***** DOC=OFF Set the variable DOC to off. Building the documentation requires more tools and not all of them are available for Windows in the current version. **** Compile (cont.) 6. Select "Configure". Maybe you need start the configuration step several times until all dependencies are resolved. 7. Select "Generate". 8. Close CMake. 9. Open solution file \enblend.sln. 10. Select "Release" in Solution Configuration pull-down menu, and then choose Build > Build Solution. This step takes some time. 11. Select project "INSTALL" in Solution Explorer, and then choose Build > Project Only > Build Only INSTALL. 12. Close Visual C++ 2008 Express Edition 13. Find the generated executables in \INSTALLDIR\FILES. * License Enblend is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. Enblend is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Enblend; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Local Variables: mode: outline End: enblend-enfuse-4.1.2+dfsg/depcomp0000755000175100017510000005601612232763264017155 0ustar ametzlerametzler#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: enblend-enfuse-4.1.2+dfsg/configure.in0000644000175100017510000005611012232763260020100 0ustar ametzlerametzlerAC_PREREQ(2.59) AC_INIT(enblend-enfuse, [m4_esyscmd([tr -d '\n' < VERSION])], [https://bugs.launchpad.net/enblend]) AC_CONFIG_SRCDIR([src/enblend.cc]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR(m4) AM_INIT_AUTOMAKE([-Wall]) AC_CONFIG_HEADER([config.h]) # Checks for programs/compilers. # avoid default CXXFLAGS, they trigger a compiler error with g++ 4.2 CXXFLAGS_ORIG=$CXXFLAGS AC_PROG_CXX CXXFLAGS=$CXXFLAGS_ORIG AC_PROG_CC AC_PROG_RANLIB AC_LANG(C++) AC_C_BIGENDIAN # Checks for libraries. AC_CHECK_LIB([m], [sqrt]) AC_CHECK_LIB([gslcblas], [cblas_dgemm]) AC_CHECK_LIB([gsl], [gsl_blas_dgemm]) AC_CHECK_LIB(z, gzopen, [], AC_MSG_NOTICE([Compiling without libz.]), []) AC_CHECK_LIB(jpeg, jpeg_finish_compress, [LIBS="-ljpeg ${LIBS}"; AC_DEFINE(HasJPEG, 1, [Define if you have the jpeg library])], AC_MSG_NOTICE([Compiling without support for jpeg files.]), []) AC_CHECK_LIB(png, png_init_io, [LIBS="-lpng ${LIBS}"; AC_DEFINE(HasPNG, 1, [Define if you have the png library])], AC_MSG_NOTICE([Compiling without support for png files.]), []) AC_CHECK_LIB(tiff, TIFFOpen, [LIBS="-ltiff ${LIBS}"; AC_DEFINE(HasTIFF, 1, [Define if you have the tiff library])], AC_MSG_ERROR([libtiff is required to compile Enblend.]), []) AC_CHECK_LIB(lcms2, cmsCreateTransform, [], AC_MSG_ERROR([liblcms2 is required to compile Enblend.]), []) AC_MSG_CHECKING([for Vigra import/export-library]) LIBS="-lvigraimpex $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[vigra::impexListFormats()]])], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_ERROR([libvigraimpex is required to compile Enblend.])]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[vigra::ImageImportInfo info("image.tif"); info.setImageIndex(99)]])], AC_MSG_RESULT(yes), [AC_MSG_RESULT(no) AC_MSG_ERROR([Vigra was found, but it was not recent enough.])]) AC_MSG_CHECKING([if OpenEXR is wanted]) AC_ARG_WITH([openexr], [AS_HELP_STRING([--with-openexr], [use OpenEXR @<:@default=check@:>@])], [], [with_openexr=check]) AS_IF([test "$with_openexr" = no], [AC_MSG_NOTICE([disabling OpenEXR]) have_exr=no], [if test "$with_openexr" = yes || test "$with_openexr" = check; then AC_MSG_RESULT(yes) PKG_CHECK_MODULES(OPENEXR, OpenEXR >= 1.0, [AC_DEFINE(HasEXR, 1, [Define if you have EXR library]) have_exr=yes], [AC_MSG_WARN("OpenEXR support disabled: " $OPENEXR_PKG_ERRORS) have_exr=no]) LIBS="${OPENEXR_LIBS} $LIBS" CFLAGS="${OPENEXR_CFLAGS} $CFLAGS" CXXFLAGS="${OPENEXR_CFLAGS} $CXXFLAGS" else AC_MSG_RESULT(no) have_exr=no fi]) if test "$GXX" = yes; then # Fixes SourceForge bug id 2121647 on some systems with newer GCCs. CXXFLAGS="$CXXFLAGS --param inline-unit-growth=60" fi AC_ARG_VAR(OPENGL_CFLAGS, [C compiler flags for OpenGL]) AC_ARG_VAR(OPENGL_LIBS, [Linker flags and libraries for OpenGL]) gpu_support_default="yes" AC_ARG_ENABLE([gpu-support], AC_HELP_STRING([--enable-gpu-support], [GPU support for Enblend @<:@default=check@:>@]), [gpu_support=$enableval], [gpu_support=$gpu_support_default]) AC_ARG_WITH([apple-opengl-framework], [AC_HELP_STRING([--with-apple-opengl-framework], [force usage of Apple OpenGL framework (Mac OS X only)])]) can_use_gpu=no no_gpu_reason= if test "$gpu_support" = yes; then missing_for_gpu= if test "$with_apple_opengl_framework" = yes; then AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1], [Use the Apple OpenGL framework.]) GL_LIBS="-framework OpenGL -framework AGL" GLUT_CFLAGS="$GLU_CFLAGS" GLUT_LIBS="-framework GLUT -lobjc $GL_LIBS" AC_SUBST([GL_CFLAGS]) AC_SUBST([GL_LIBS]) AC_SUBST([GLU_CFLAGS]) AC_SUBST([GLU_LIBS]) AC_SUBST([GLUT_CFLAGS]) AC_SUBST([GLUT_LIBS]) no_gl="" no_glu="" no_glut="" else AX_CHECK_GL AX_CHECK_GLU AX_CHECK_GLUT fi if test "$no_gl" = yes; then missing_for_gpu="$missing_for_gpu GL" AC_MSG_WARN([[GL not found, disabling GPU mode]]) elif test "$no_glu" = yes; then missing_for_gpu="$missing_for_gpu GLU" AC_MSG_WARN([[GLU not found, disabling GPU mode]]) elif test "$no_glut" = yes; then missing_for_gpu="$missing_for_gpu GLUT" AC_MSG_WARN([[GLUT not found, disabling GPU mode]]) else # GLUT_LIBS and GLU_LIBS include GL_LIBS implicitly OPENGL_LIBS="${GLU_LIBS} ${GLUT_LIBS}" OPENGL_CFLAGS="${GL_CFLAGS}" AC_CHECK_LIB(GLEW, glewInit, [can_use_gpu=yes OPENGL_LIBS="-lGLEW ${OPENGL_LIBS}" AC_DEFINE(HAVE_LIBGLEW, 1, [Define if you have the GLEW library])], [missing_for_gpu="$missing_for_gpu GLEW" AC_MSG_WARN([[GLEW not found, disabling GPU mode]])], []) fi if test $can_use_gpu = no; then no_gpu_reason=", because of missing$missing_for_gpu" fi else no_gpu_reason=", because it was disabled" fi # Memory allocation debug support AC_MSG_CHECKING([if malloc debugging is wanted]) AC_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc, as in http://www.dmalloc.com/dmalloc.tar.gz], [if test "$withval" = yes; then AC_MSG_RESULT(yes) AC_DEFINE(WITH_DMALLOC, 1, [Define if using the dmalloc debugging malloc package]) if test $acx_pthread_ok = yes; then LIBS="$LIBS -ldmallocthcxx" enable_dmalloc="yes (thread aware)" else LIBS="$LIBS -ldmalloccxx" enable_dmalloc=yes fi LDFLAGS="$LDFLAGS -g" AC_DEFINE(DMALLOC, 1, [Define to enable malloc debugger library]) AC_DEFINE(DMALLOC_FUNC_CHECK, 1, [Define to enable malloc debugger function checking]) else AC_MSG_RESULT(no) enable_dmalloc=no fi], [AC_MSG_RESULT(no) enable_dmalloc=no]) # Checks for header files. AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([fenv.h limits.h stdlib.h string.h unistd.h]) AC_CHECK_HEADER(tiffio.h, [], AC_MSG_ERROR([libtiff-devel header files are required to compile Enblend.])) AC_CHECK_HEADER(jpeglib.h, [], AC_MSG_ERROR([libjpeg-devel header files are required to compile Enblend.])) AC_CHECK_HEADER(png.h, [], AC_MSG_ERROR([libpng-devel header files are required to compile Enblend.])) AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_CHECK_HEADER(vigra/basicimage.hxx, [], AC_MSG_ERROR([Vigra "basicimage.hxx" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/algorithm/string/case_conv.hpp, [], AC_MSG_ERROR([Boost "case_conv" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/algorithm/string/trim.hpp, [], AC_MSG_ERROR([Boost "trim" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/algorithm/string/erase.hpp, [], AC_MSG_ERROR([Boost "erase" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/assign/list_inserter.hpp, [], AC_MSG_ERROR([Boost "list_inserter" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/assign/list_of.hpp, [], AC_MSG_ERROR([Boost "list_of" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/functional/hash.hpp, [], AC_MSG_ERROR([Boost "hash" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/lambda/algorithm.hpp, [], AC_MSG_ERROR([Boost "algorithm" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/lambda/bind.hpp, [], AC_MSG_ERROR([Boost "bind" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/lambda/construct.hpp, [], AC_MSG_ERROR([Boost "construct" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/lambda/if.hpp, [], AC_MSG_ERROR([Boost "if" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/lambda/lambda.hpp, [], AC_MSG_ERROR([Boost "lambda" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/logic/tribool.hpp, [], AC_MSG_ERROR([Boost "tribool" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/math/special_functions.hpp, [], AC_MSG_ERROR([Boost "special_functions" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/optional.hpp, [], AC_MSG_ERROR([Boost "optional" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/pool/pool.hpp, [], AC_MSG_ERROR([Boost "pool" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/random/uniform_real.hpp, [], AC_MSG_ERROR([Boost "uniform_real" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/random/variate_generator.hpp, [], AC_MSG_ERROR([Boost "variate_generator" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/scoped_ptr.hpp, [], AC_MSG_ERROR([Boost "scoped_ptr" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/static_assert.hpp, [], AC_MSG_ERROR([Boost "static_assert" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/system/error_code.hpp, [], AC_MSG_ERROR([Boost "error_code" header file is required to compile Enblend.])) AC_CHECK_HEADER(boost/unordered_set.hpp, [], AC_MSG_ERROR([Boost "unordered_set" header file is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_errno.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_errno" is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_min.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_min" is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_multimin.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_multimin" is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_rng.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_rng" is required to compile Enblend.])) AC_CHECK_HEADER(gsl/gsl_vector.h, [], AC_MSG_ERROR([GNU Scientific Library (GSL) header file "gsl_vector" is required to compile Enblend.])) LIBS="-lboost_system $LIBS" AC_MSG_CHECKING([for new Boost system library]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "boost/system/error_code.hpp"]], [[boost::system::generic_category(); boost::system::system_category()]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) AC_MSG_CHECKING([for old Boost system library]) AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include "boost/system/error_code.hpp"]], [[boost::system::get_generic_category(); boost::system::get_system_category()]])], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) AC_MSG_ERROR([Boost "system" library is required to compile Enblend.])])]) AC_ARG_WITH([boost-filesystem], [AS_HELP_STRING([--with-boost-filesystem], [use Boost filesystem library @<:@default=check@:>@])], [], [with_boost_filesystem=check]) AS_IF([test "$with_boost_filesystem" = no], [AC_MSG_NOTICE([disabling use of Boost "filesystem" library])], [AS_IF([test "$with_boost_filesystem" = yes], [AC_MSG_NOTICE([forcing use of Boost "filesystem" library]) AC_DEFINE(HAVE_BOOST_FILESYSTEM, 1, [Define if you have boost/filesystem.hpp]) EXTRA_LIBS="-lboost_filesystem ${EXTRA_LIBS}"], [AC_CHECK_HEADER(boost/filesystem.hpp, [], AC_MSG_NOTICE([Boost "filesystem" header is missing.])) if test "$ac_cv_header_boost_filesystem_hpp" = yes; then found_boost_filesystem_lib=no candidates="-lboost_filesystem" if test "$acx_pthread_ok" = yes; then candidates="-lboost_filesystem-mt $candidates" fi if test "$with_boost_filesystem" != check; then candidates="$with_boost_filesystem $candidates" fi LIBS_ORIG=$LIBS for x in $candidates; do LIBS="$LIBS_ORIG $x" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include "boost/filesystem.hpp" ]], [[ #if BOOST_FILESYSTEM_VERSION <= 2 typedef boost::filesystem::basic_path basic_path; basic_path p("foo/bar/baz.oo"); p.branch_path().string(); p.leaf(); #else typedef boost::filesystem::path basic_path; basic_path p("foo/bar/baz.oo"); p.parent_path(); p.filename(); #endif basename(p); extension(p); ]] )], [EXTRA_LIBS="$x $y ${EXTRA_LIBS}" found_boost_filesystem_lib=yes AC_MSG_NOTICE([compiling with Boost's generic filename parsing support.]) break]) done LIBS=$LIBS_ORIG fi if test "$ac_cv_header_boost_filesystem_hpp" = yes && test "$found_boost_filesystem_lib" = yes; then AC_DEFINE(HAVE_BOOST_FILESYSTEM, 1, [Define if you have boost/filesystem.hpp]) else AC_MSG_NOTICE([Boost "filesystem" header or library not found. Using built-in support.]) fi ] ) dnl AS_IF($with_boost_filesystem = yes) ] ) dnl AS_IF($with_boost_filesystem = no) AC_LANG_RESTORE AC_SUBST(EXTRA_LIBS) AC_CHECK_HEADER(lcms2.h, [], AC_MSG_ERROR([lcms2 header files are required to compile Enblend.])) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_CONST AC_C_INLINE if test "$ac_cv_c_inline" != no; then AC_DEFINE(HAVE_INLINE, 1, [Define if functions can be declared `inline'.]) AC_SUBST(HAVE_INLINE) fi AC_TYPE_OFF_T AC_TYPE_SIGNAL AC_TYPE_SIZE_T AC_CHECK_TYPES([ptrdiff_t]) # Checks for library functions. AC_FUNC_CLOSEDIR_VOID AC_FUNC_FSEEKO # AC_FUNC_MALLOC dnl unused and harmful when cross compiling AC_FUNC_SETVBUF_REVERSED AC_FUNC_STRERROR_R AC_FUNC_STRTOD AC_CHECK_FUNCS([fesetround floor \ memset mkstemp \ pow \ sqrt strchr strcspn strdup strerror strrchr strtok_r strtol strtoul]) # lrint and lrintf AC_C99_FUNC_LRINT AC_C99_FUNC_LRINTF AX_WITH_PROG(PERL, perl, false, []) if test "$PERL" = false; then AC_MSG_ERROR(cannot find perl) fi AX_PROG_PERL_MODULES(Sys::Hostname, [], AC_MSG_ERROR(missing Perl module Sys::Hostname)) AX_PROG_PERL_MODULES(Time::Zone, [], AC_MSG_WARN(missing Perl module Time::Zone)) # Documentation if test "$cross_compiling" = no; then AM_MISSING_PROG(HELP2MAN, help2man) else HELP2MAN=: fi can_build_doc=yes AX_PROG_PERL_MODULES(File::Basename, [], [AC_MSG_WARN(missing Perl module File::Basename) can_build_doc=no missing_for_doc="$missing_for_doc File::Basename"]) AX_PROG_PERL_MODULES(IO::File, [], [AC_MSG_WARN(missing Perl module IO::File) can_build_doc=no missing_for_doc="$missing_for_doc IO::File"]) AX_PROG_PERL_MODULES(IO::Handle, [], [AC_MSG_WARN(missing Perl module IO::Handle) can_build_doc=no missing_for_doc="$missing_for_doc IO::Handle"]) AX_WITH_PROG(GNUPLOT, gnuplot, false, []) if test "$GNUPLOT" = false; then AC_MSG_WARN(cannot find gnuplot; will not be able to build documentation) can_build_doc=no missing_for_doc="$missing_for_doc gnuplot" fi AC_ARG_WITH([raster-dir], AC_HELP_STRING([--with-raster-dir=], [set raster image subdirectory @<:@default=raster@:>@]), [RASTER_DIR="$withval"], [RASTER_DIR=raster]) AC_SUBST(RASTER_DIR) AC_CHECK_PROG(FIG2DEV, fig2dev, fig2dev, false) if test "$FIG2DEV" = false; then AC_MSG_WARN(cannot find fig2dev; will not be able to build documentation) can_build_doc=no missing_for_doc="$missing_for_doc fig2dev" fi AC_CHECK_PROG(CONVERT, convert, convert, false) if test "$CONVERT" = false; then AC_MSG_WARN(cannot find convert; will not be able to build documentation) can_build_doc=no missing_for_doc="$missing_for_doc convert" fi AC_PROG_SED # These variables are mentioned in the AutoMake documentation as being # influential to the documentation build process. AC_CHECK_PROG(MAKEINFO, makeinfo, makeinfo, false) if test "$MAKEINFO" = false; then AC_MSG_WARN(cannot find makeinfo; will not be able to build documentation) can_build_doc=no missing_for_doc="$missing_for_doc makeinfo" fi AC_CHECK_PROG(TIDY, tidy, tidy, false) if test "$TIDY" = false; then AC_MSG_WARN(cannot find tidy; will not be able to build XHTML documentation) can_build_doc=no missing_for_doc="$missing_for_doc tidy" fi AC_CHECK_PROG(XMLLINT, xmllint, xmllint, false) if test "$XMLLINT" = false; then AC_MSG_WARN(cannot find xmllint; will not be able to build XHTML documentation) can_build_doc=no missing_for_doc="$missing_for_doc xmllint" fi AM_CONDITIONAL([BUILD_DOC], [test "$can_build_doc" = yes]) if test "$can_build_doc" = no; then no_doc_reason=", because of missing$missing_for_doc" fi AC_MSG_CHECKING([checking whether split documentation files]) split_doc_default="yes" AC_ARG_ENABLE([split-doc], AC_HELP_STRING([--enable-split-doc], [split documentation @<:@default=yes@:>@]), [split_doc=$enableval], [split_doc=$split_doc_default]) if test "$split_doc" = yes; then AM_MAKEINFOFLAGS="$AM_MAKEINFOFLAGS" AM_MAKEINFOHTMLFLAGS="$AM_MAKEINFOHTMLFLAGS" AC_MSG_RESULT(yes) split_doc=yes else AM_MAKEINFOFLAGS="$AM_MAKEINFOFLAGS --no-split" AM_MAKEINFOHTMLFLAGS="$AM_MAKEINFOHTMLFLAGS --no-split --no-headers" AC_MSG_RESULT(no) split_doc=no fi AC_SUBST(AM_MAKEINFOFLAGS) AC_SUBST(AM_MAKEINFOHTMLFLAGS) AC_MSG_CHECKING(whether to enable debugging) debug_default="no" AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [turn on debugging @<:@default=no@:>@]), [enable_debug=$enableval], [enable_debug=$debug_default]) if test "$enable_debug" = yes; then CXXFLAGS="$CXXFLAGS -g -DDEBUG -Wall" AC_MSG_RESULT(yes) enable_debug=yes else CXXFLAGS="$CXXFLAGS -O2 -DNDEBUG -Wall" AC_MSG_RESULT(no) enable_debug=no fi AC_MSG_CHECKING(whether to enable image cache) image_cache_default="yes" AC_ARG_ENABLE(image_cache, AC_HELP_STRING([--enable-image-cache], [allow for processing of large images @<:@default=yes@:>@]), [enable_image_cache=$enableval], [enable_image_cache=$image_cache_default]) if test "$enable_image_cache" = yes; then AC_DEFINE(CACHE_IMAGES, 1, [Define if you want to compile Enblend and Enfuse with image cache]) AC_MSG_RESULT(yes) enable_image_cache=yes else AC_MSG_RESULT(no) enable_image_cache=no fi AC_MSG_CHECKING(whether to compile with OpenMP) openmp_default="no" AC_ARG_ENABLE(openmp, AC_HELP_STRING([--enable-openmp], [compile with OpenMP @<:@default=no@:>@]), [enable_openmp=$enableval], [enable_openmp=$openmp_default]) if test "$enable_openmp" = yes; then AC_MSG_RESULT(yes) AX_OPENMP([enable_openmp=yes]) CFLAGS="$CFLAGS $OPENMP_CFLAGS" CXXFLAGS="$CXXFLAGS $OPENMP_CXXFLAGS" fi if test -z "$OPENMP_CXXFLAGS"; then AC_MSG_RESULT(no) enable_openmp=no else if test "$enable_image_cache" = yes; then AC_MSG_WARN([[image cache and OpenMP support are mutually exclusive]]) AC_MSG_WARN([[only configure like this if you want to develop a reentrant image cache]]) warnings=`echo -e "$warnings\n WARNING: Image cache and OpenMP are both enabled! You are a developer, aren't you?"` fi enable_openmp=yes fi AC_CONFIG_FILES([doc/entropy.gp doc/entropy-cutoff.gp doc/exposure-cutoff.gp doc/gaussian.gp doc/laplacian-of-gaussian.gp doc/sharp-edge.gp doc/smooth-edge.gp]) AC_CONFIG_FILES([Makefile include/Makefile include/vigra_ext/Makefile src/Makefile src/layer_selection/Makefile doc/Makefile]) AC_OUTPUT # AC_OUTPUT has created "config.h" AC_MSG_NOTICE([creating config-h.texi]) perl -ne 'if (s/^\s*#define\s+(\S+)\s+"?([^"]*)"?/\@set CFG::$1 $2/) {chomp; print "$_\n"}' \ < config.h \ > config-h.texi AC_MSG_RESULT([ enblend-enfuse now configured for ${host} Source directory: ${srcdir} Installation directory: ${prefix} C++ compiler: ${CXX} CFLAGS: ${CFLAGS:-} OPENGL_CFLAGS: ${OPENGL_CFLAGS:-} CXXFLAGS: ${CXXFLAGS:-} LDFLAGS: ${LDFLAGS:-} LIBS: ${LIBS:-} OPENGL_LIBS: ${OPENGL_LIBS:-} EXTRA_LIBS (optional): ${EXTRA_LIBS:-} raster subdirectory: ${RASTER_DIR} can build all documentation: ${can_build_doc}${no_doc_reason} feature selection: split *.info and *.xhtml files: ${split_doc} enable debugging support: ${enable_debug} enable malloc debugging: ${enable_dmalloc} OpenEXR image format ${have_exr} use image cache: ${enable_image_cache} build GPU acceleration: ${can_use_gpu}${no_gpu_reason} use OpenMP: ${enable_openmp} ${warnings}]) enblend-enfuse-4.1.2+dfsg/config.guess0000755000175100017510000013036112232763263020113 0ustar ametzlerametzler#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-06-10' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2013 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: enblend-enfuse-4.1.2+dfsg/AUTHORS0000644000175100017510000000064612070530113016627 0ustar ametzlerametzlerEnblend/Enfuse developers: Pablo d'Angelo Mikołaj Leszczyński Max Lyons Andrew Mihal Christoph Spiel Brent Townshend Win32 porting: Joe Beda Mark - mjz Thomas Modes Ryan Sleevi CMake maintanance: Kornel Benko enblend-enfuse-4.1.2+dfsg/mdate-sh0000755000175100017510000001363712232763263017231 0ustar ametzlerametzler#!/bin/sh # Get modification time of a file or directory and pretty-print it. scriptversion=2010-08-21.06; # UTC # Copyright (C) 1995-2013 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST fi case $1 in '') echo "$0: No file. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: mdate-sh [--help] [--version] FILE Pretty-print the modification day of FILE, in the format: 1 January 1970 Report bugs to . EOF exit $? ;; -v | --v*) echo "mdate-sh $scriptversion" exit $? ;; esac error () { echo "$0: $1" >&2 exit 1 } # Prevent date giving response in another language. LANG=C export LANG LC_ALL=C export LC_ALL LC_TIME=C export LC_TIME # GNU ls changes its time format in response to the TIME_STYLE # variable. Since we cannot assume 'unset' works, revert this # variable to its documented default. if test "${TIME_STYLE+set}" = set; then TIME_STYLE=posix-long-iso export TIME_STYLE fi save_arg1=$1 # Find out how to get the extended ls output of a file or directory. if ls -L /dev/null 1>/dev/null 2>&1; then ls_command='ls -L -l -d' else ls_command='ls -l -d' fi # Avoid user/group names that might have spaces, when possible. if ls -n /dev/null 1>/dev/null 2>&1; then ls_command="$ls_command -n" fi # A 'ls -l' line looks as follows on OS/2. # drwxrwx--- 0 Aug 11 2001 foo # This differs from Unix, which adds ownership information. # drwxrwx--- 2 root root 4096 Aug 11 2001 foo # # To find the date, we split the line on spaces and iterate on words # until we find a month. This cannot work with files whose owner is a # user named "Jan", or "Feb", etc. However, it's unlikely that '/' # will be owned by a user whose name is a month. So we first look at # the extended ls output of the root directory to decide how many # words should be skipped to get the date. # On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. set x`$ls_command /` # Find which argument is the month. month= command= until test $month do test $# -gt 0 || error "failed parsing '$ls_command /' output" shift # Add another shift to the command. command="$command shift;" case $1 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac done test -n "$month" || error "failed parsing '$ls_command /' output" # Get the extended ls output of the file or directory. set dummy x`eval "$ls_command \"\\\$save_arg1\""` # Remove all preceding arguments eval $command # Because of the dummy argument above, month is in $2. # # On a POSIX system, we should have # # $# = 5 # $1 = file size # $2 = month # $3 = day # $4 = year or time # $5 = filename # # On Darwin 7.7.0 and 7.6.0, we have # # $# = 4 # $1 = day # $2 = month # $3 = year or time # $4 = filename # Get the month. case $2 in Jan) month=January; nummonth=1;; Feb) month=February; nummonth=2;; Mar) month=March; nummonth=3;; Apr) month=April; nummonth=4;; May) month=May; nummonth=5;; Jun) month=June; nummonth=6;; Jul) month=July; nummonth=7;; Aug) month=August; nummonth=8;; Sep) month=September; nummonth=9;; Oct) month=October; nummonth=10;; Nov) month=November; nummonth=11;; Dec) month=December; nummonth=12;; esac case $3 in ???*) day=$1;; *) day=$3; shift;; esac # Here we have to deal with the problem that the ls output gives either # the time of day or the year. case $3 in *:*) set `date`; eval year=\$$# case $2 in Jan) nummonthtod=1;; Feb) nummonthtod=2;; Mar) nummonthtod=3;; Apr) nummonthtod=4;; May) nummonthtod=5;; Jun) nummonthtod=6;; Jul) nummonthtod=7;; Aug) nummonthtod=8;; Sep) nummonthtod=9;; Oct) nummonthtod=10;; Nov) nummonthtod=11;; Dec) nummonthtod=12;; esac # For the first six month of the year the time notation can also # be used for files modified in the last year. if (expr $nummonth \> $nummonthtod) > /dev/null; then year=`expr $year - 1` fi;; *) year=$3;; esac # The result. echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: enblend-enfuse-4.1.2+dfsg/VERSION0000644000175100017510000000000612224473244016631 0ustar ametzlerametzler4.1.2