Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NesTiler.git/NesTiler.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-10-16 14:36:20 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2022-10-16 14:36:20 +0300
commitc1bd39c93a673a322cf7bfc52660035d9873a22c (patch)
treec35adc6c4c5f92d4756a363998c0364a97701bb6 /Benchmarks
parent3c6b5f21d2e9dae274aa8fca58ace0f8a06016da (diff)
--lossy option
Diffstat (limited to 'Benchmarks')
-rw-r--r--Benchmarks/Program.cs34
1 files changed, 33 insertions, 1 deletions
diff --git a/Benchmarks/Program.cs b/Benchmarks/Program.cs
index 525a3e5..8453b67 100644
--- a/Benchmarks/Program.cs
+++ b/Benchmarks/Program.cs
@@ -161,6 +161,13 @@ namespace com.clusterrr.Famicom.NesTiler.Benchmarks
DoBenchmarkSharedPattern(imagePath1, imagePath2);
}
+ [Benchmark]
+ public void MeLossy()
+ {
+ var imagePath = Path.Combine(ImagesPath, "me.png");
+ DoBenchmarkSplit2Lossy(imagePath);
+ }
+
private string PatternTablePath(string prefix, int number) => $"{prefix}_pattern_{number}.bin";
private string NameTablePath(string prefix, int number) => $"{prefix}_name_table_{number}.bin";
private string AttrTablePath(string prefix, int number) => $"{prefix}_attr_table_{number}.bin";
@@ -233,7 +240,32 @@ namespace com.clusterrr.Famicom.NesTiler.Benchmarks
//foreach (var file in Directory.GetFiles(".", "*.bin")) File.Copy(file, Path.Join(@"E:\bins", Path.GetFileName(file)), true);
}
-
+
+ public void DoBenchmarkSplit2Lossy(string imagePath)
+ {
+ var prefix = Path.GetFileNameWithoutExtension(imagePath);
+ var args = new string[] {
+ "--enable-palettes", "0,1,2,3",
+ "-input-0", $"{imagePath}:0:128",
+ "-input-1", $"{imagePath}:128:112",
+ "--out-pattern-table-0", PatternTablePath(prefix, 0),
+ "--out-pattern-table-1", PatternTablePath(prefix, 1),
+ "--out-name-table-0", NameTablePath(prefix, 0),
+ "--out-name-table-1", NameTablePath(prefix, 1),
+ "--out-attribute-table-0", AttrTablePath(prefix, 0),
+ "--out-attribute-table-1", AttrTablePath(prefix, 1),
+ "--out-palette-0", PalettePath(prefix, 0),
+ "--out-palette-1", PalettePath(prefix, 1),
+ "--out-palette-2", PalettePath(prefix, 2),
+ "--out-palette-3", PalettePath(prefix, 3),
+ "--lossy"
+ };
+ var r = Program.Main(args);
+ if (r != 0) throw new InvalidOperationException($"Return code: {r}");
+
+ foreach (var file in Directory.GetFiles(".", "*.bin")) File.Copy(file, Path.Join(@"E:\bins", Path.GetFileName(file)), true);
+ }
+
public void DoBenchmarkSplit4(string imagePath)
{
var prefix = Path.GetFileNameWithoutExtension(imagePath);