From: Enblend <enb...@li...> - 2016-04-02 15:13:25
|
branch: details: http://enblend.hg.sourceforge.net/hgweb/enblend/enblend/hg/p/enblend/code/rev/d7962640eef3 changeset: 1439:d7962640eef3 user: Chris <cs...@us...> date: Sat Apr 02 17:09:47 2016 +0200 description: Parameterize the dump of important Enblend mask files: NFT-output, black mask, and white mask. Formerly these were attached to the preprocessor symbol DEBUG_NEAREST_FEATURE_TRANSFORM now they are reachable with --parameter=dump-nft-images The image filename masks are enblend-nft-output-%n.tif enblend-blackmask-%n.tif enblend-whitemask-%n.tif The files get exported into the working directory. diffstat: VERSION | 2 +- src/mask.h | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diffs (56 lines): diff -r 0303f1bd9def -r d7962640eef3 VERSION --- a/VERSION Wed Mar 30 10:55:59 2016 +0200 +++ b/VERSION Sat Apr 02 17:09:47 2016 +0200 @@ -1,1 +1,1 @@ -4.3-579eeaf99bc9 +4.3-0303f1bd9def diff -r 0303f1bd9def -r d7962640eef3 src/mask.h --- a/src/mask.h Wed Mar 30 10:55:59 2016 +0200 +++ b/src/mask.h Sat Apr 02 17:09:47 2016 +0200 @@ -1139,20 +1139,19 @@ search_for_isolated_points(blackAlpha); -#ifdef DEBUG_NEAREST_FEATURE_TRANSFORM - { - typedef std::pair<const char*, const MaskType*> ImagePair; + if (parameter::as_boolean("dump-nft-images", false)) { + typedef std::pair<const char*, const MaskType*> image_pair_t; - const std::array<ImagePair, 3> nft { + const std::array<image_pair_t, 3> nft { std::make_pair("blackmask", blackAlpha), std::make_pair("whitemask", whiteAlpha), std::make_pair("nft-output", mainOutputImage) }; for (const auto& x : nft) { - const std::string nftMaskTemplate(command + "-" + x.first + "-%n.tif"); - const std::string nftMaskFilename = - enblend::expandFilenameTemplate(nftMaskTemplate, + const std::string nft_mask_template(command + "-" + x.first + "-%n.tif"); + const std::string nft_mask_filename = + enblend::expandFilenameTemplate(nft_mask_template, numberOfImages, *inputFileNameIterator, OutputFileName, @@ -1160,14 +1159,14 @@ if (Verbose >= VERBOSE_NFT_MESSAGES) { std::cerr << command << ": info: saving nearest-feature-transform image \"" << - nftMaskFilename << "\"" << std::endl; + nft_mask_filename << "\"" << std::endl; } - vigra::ImageExportInfo nftMaskInfo(nftMaskFilename.c_str()); - nftMaskInfo.setCompression(MASK_COMPRESSION); - vigra::exportImage(srcImageRange(*x.second), nftMaskInfo); + + vigra::ImageExportInfo nft_mask_info(nft_mask_filename.c_str()); + nft_mask_info.setCompression(MASK_COMPRESSION); + vigra::exportImage(srcImageRange(*x.second), nft_mask_info); } } -#endif // mem usage before: CoarseMask: 2/8 * uBB * MaskType // !CoarseMask: 2 * uBB * MaskType |