From de46c115106dc86d14b273840899f38e485175d9 Mon Sep 17 00:00:00 2001 From: Samuele Lorefice Date: Mon, 7 Apr 2025 10:40:15 +0200 Subject: [PATCH] fixed debug images being output without debug flag. Explicitly added quotes ("") to readme command example --- .run/Run SDF Tool [8 pic].run.xml | 21 +++++++++++++++++++++ Readme.md | 2 +- SDFMapCreator.sln.DotSettings.user | 1 + SDFMapCreator/Program.cs | 5 ++--- 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .run/Run SDF Tool [8 pic].run.xml diff --git a/.run/Run SDF Tool [8 pic].run.xml b/.run/Run SDF Tool [8 pic].run.xml new file mode 100644 index 0000000..c97a9fb --- /dev/null +++ b/.run/Run SDF Tool [8 pic].run.xml @@ -0,0 +1,21 @@ + + + + \ No newline at end of file diff --git a/Readme.md b/Readme.md index dc0c801..8a82b96 100644 --- a/Readme.md +++ b/Readme.md @@ -9,7 +9,7 @@ - *nix style command line interface ## How to use: -From command line: `SDFMapTool -D -i -o ...` +From command line: `SDFMapTool -D -i "" -o ...` Available options: diff --git a/SDFMapCreator.sln.DotSettings.user b/SDFMapCreator.sln.DotSettings.user index c9bd358..3766494 100644 --- a/SDFMapCreator.sln.DotSettings.user +++ b/SDFMapCreator.sln.DotSettings.user @@ -1,6 +1,7 @@  ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded diff --git a/SDFMapCreator/Program.cs b/SDFMapCreator/Program.cs index c2f517a..4a112ae 100644 --- a/SDFMapCreator/Program.cs +++ b/SDFMapCreator/Program.cs @@ -158,8 +158,7 @@ public static class Program { } currStep += stepIncrement; } - - finalImage.SaveImage($"{options.OutputFile}.png"); + if(options.Debug) finalImage.SaveImage($"{debugPath}{options.OutputFile}"); // apply directional blur var iterations = options.BlurIterations; @@ -167,7 +166,7 @@ public static class Program { var step = options.BlurStep; var sigma = options.BlurSigma; var totalMask = SelfMask(Images[^1].Pixels); - totalMask.SaveImage($"{debugPath}{PSep}TotalMask.png"); + if(options.Debug) totalMask.SaveImage($"{debugPath}{PSep}TotalMask.png"); for (var i = 0; i < iterations; i++) { Console.WriteLine($"Applying directional blur {i + 1}/{iterations}..."); finalImage = DirectionalBlur(finalImage, totalMask, radius, step, sigma);