Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -59,12 +59,15 @@ public class Program {
|
|||||||
private const bool outputMasks = true;
|
private const bool outputMasks = true;
|
||||||
private const bool outputSDFs = true;
|
private const bool outputSDFs = true;
|
||||||
private const bool outputGradients = true;
|
private const bool outputGradients = true;
|
||||||
|
static readonly ParallelOptions parallelOptions = new() { MaxDegreeOfParallelism = MAX_THREADS };
|
||||||
static List<ImageData> Images = new();
|
static List<ImageData> Images = new();
|
||||||
static List<MaskData> Masks = new();
|
static List<MaskData> Masks = new();
|
||||||
static List<SDFData> SDFs = new();
|
static List<SDFData> SDFs = new();
|
||||||
static List<float3[,]> Gradients = new();
|
static List<float3[,]> Gradients = new();
|
||||||
|
|
||||||
static readonly ParallelOptions parallelOptions = new() { MaxDegreeOfParallelism = MAX_THREADS };
|
static void ConsoleUpdateLine(string s) {
|
||||||
|
Console.Write("\r"+s);
|
||||||
|
}
|
||||||
|
|
||||||
static void LoadImage(string imgPath) {
|
static void LoadImage(string imgPath) {
|
||||||
var image = new MagickImage(imgPath);
|
var image = new MagickImage(imgPath);
|
||||||
@@ -210,7 +213,7 @@ public class Program {
|
|||||||
lock(maskData.Edges) maskData.Edges.Add(new(x, y));
|
lock(maskData.Edges) maskData.Edges.Add(new(x, y));
|
||||||
iterCount++;
|
iterCount++;
|
||||||
if (iterCount % (width * height / 100) == 0) {
|
if (iterCount % (width * height / 100) == 0) {
|
||||||
Console.WriteLine($"Progress: {iterCount/(float)(width*height):P} | {iterCount/(sw.Elapsed.TotalSeconds):N0} pixels/s");
|
ConsoleUpdateLine($"Progress: {iterCount/(width*height):P}% | {iterCount/(sw.Elapsed.TotalSeconds):N0} pixels/s");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sw.Stop();
|
sw.Stop();
|
||||||
@@ -276,7 +279,7 @@ public class Program {
|
|||||||
if (minDist > AbsMax) AbsMax = minDist;
|
if (minDist > AbsMax) AbsMax = minDist;
|
||||||
iterCount++;
|
iterCount++;
|
||||||
if (iterCount % (width * height / 100) == 0) {
|
if (iterCount % (width * height / 100) == 0) {
|
||||||
Console.WriteLine($"Progress: {iterCount/(float)(width*height):P} | {iterCount/(sw.Elapsed.TotalSeconds):N0} pixels/s");
|
ConsoleUpdateLine($"Progress: {iterCount/(width*height):P}% | {iterCount/(sw.Elapsed.TotalSeconds):N0} pixels/s");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user