void ExecuteTest(DCRawOptions opts, string renameSuffix) { foreach(var sourceFile in _files) { var dcraw = new DCRaw(opts); if(SHOW_COMMAND_LINES) { Console.WriteLine($"prefix: {renameSuffix} cmdline: {opts.GetStartInfo(sourceFile).Arguments}"); } var result = dcraw.Convert(sourceFile); Assert.True(File.Exists(result.OutputFilename)); if(!KEEP_TEST_RESULTS) { File.Delete(result.OutputFilename); } else { var dir = "test_output"; Directory.CreateDirectory(dir); var newFile = Path.Combine(Path.GetDirectoryName(sourceFile), dir, $"{Path.GetFileNameWithoutExtension(result.OutputFilename)}_{renameSuffix}{Path.GetExtension(result.OutputFilename)}"); File.Move(result.OutputFilename, newFile); } } }
DCRawOptions GetPreferredDefaultOptions() { var opts = new DCRawOptions(); opts.UseCameraWhiteBalance = true; opts.Quality = InterpolationQuality.Quality3; return opts; }
public void FormatTest() { var opts = new DCRawOptions(); opts.Format = Format.Tiff; ExecuteTest(opts, "tiff"); }
public void HighlightTests() { var opts = new DCRawOptions(); opts.HighlightMode = HighlightMode.Blend; ExecuteTest(opts, "hblend"); opts.HighlightMode = HighlightMode.Clip; ExecuteTest(opts, "hclip"); opts.HighlightMode = HighlightMode.Unclip; ExecuteTest(opts, "hunclip"); opts.HighlightMode = HighlightMode.Rebuild3; ExecuteTest(opts, "h3"); opts.HighlightMode = HighlightMode.Rebuild5; ExecuteTest(opts, "h5"); opts.HighlightMode = HighlightMode.Rebuild8; ExecuteTest(opts, "h8"); opts.HighlightMode = HighlightMode.Rebuild9; ExecuteTest(opts, "h9"); }
public void AutoBrightenTest() { var opts = new DCRawOptions(); opts.DontAutomaticallyBrighten = false; ExecuteTest(opts, "brighten"); }