|
|
|
@ -61,6 +61,7 @@ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-" + name + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Sample/{ Path.GetFileName(filename) }")) |
|
|
|
{ |
|
|
|
processor.OnProgress += this.ProgressUpdate; |
|
|
|
@ -69,6 +70,7 @@ |
|
|
|
processor.OnProgress -= this.ProgressUpdate; |
|
|
|
} |
|
|
|
|
|
|
|
image.Dispose(); |
|
|
|
Trace.WriteLine($"{ name }: { watch.ElapsedMilliseconds}ms"); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -88,8 +90,9 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-" + name + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Resize/{filename}")) |
|
|
|
{ |
|
|
|
image.Resize(image.Width / 2, image.Height / 2, sampler, false, this.ProgressUpdate) |
|
|
|
@ -116,8 +119,9 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-" + name + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Resize/{filename}")) |
|
|
|
{ |
|
|
|
image.Resize(image.Width / 3, 0, new TriangleResampler(), false, this.ProgressUpdate) |
|
|
|
@ -144,8 +148,9 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-" + name + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Resize/{filename}")) |
|
|
|
{ |
|
|
|
image.Resize(0, image.Height / 3, new TriangleResampler(), false, this.ProgressUpdate) |
|
|
|
@ -171,8 +176,9 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-" + rotateType + flipType + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/RotateFlip/{filename}")) |
|
|
|
{ |
|
|
|
image.RotateFlip(rotateType, flipType, this.ProgressUpdate) |
|
|
|
@ -197,8 +203,10 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
|
|
|
|
string filename = Path.GetFileName(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Rotate/{filename}")) |
|
|
|
{ |
|
|
|
image.Rotate(45, this.ProgressUpdate) |
|
|
|
@ -223,8 +231,10 @@ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Stopwatch watch = Stopwatch.StartNew(); |
|
|
|
Image image = new Image(stream); |
|
|
|
|
|
|
|
string filename = Path.GetFileName(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/Skew/{filename}")) |
|
|
|
{ |
|
|
|
image.Skew(45, 45, this.ProgressUpdate) |
|
|
|
@ -248,8 +258,9 @@ |
|
|
|
{ |
|
|
|
using (FileStream stream = File.OpenRead(file)) |
|
|
|
{ |
|
|
|
Image image = new Image(stream); |
|
|
|
string filename = Path.GetFileNameWithoutExtension(file) + "-EntropyCrop" + Path.GetExtension(file); |
|
|
|
|
|
|
|
using (Image image = new Image(stream)) |
|
|
|
using (FileStream output = File.OpenWrite($"TestOutput/EntropyCrop/{filename}")) |
|
|
|
{ |
|
|
|
image.EntropyCrop(.5f, this.ProgressUpdate).Save(output); |
|
|
|
|