-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
39 lines (33 loc) · 1.1 KB
/
Program.cs
File metadata and controls
39 lines (33 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//Ebner Lena - MMTB2019
using System;
using System.IO;
using System.Drawing;
/*
. Überarbeiten Sie Ihre Abgaben zu einer kleinen Image-Processing-Library (3 Punkte).
Dokumentieren und argumentieren Sie Ihre Design-Entscheidungen in einem Text-Dokument.
*/
class Program
{
static void Main(string[] args)
{
try
{
var inputFile = args[0];
var outputFile = args[1];
if (args.Length > 2)
throw new ArgumentOutOfRangeException();
if(!File.Exists (inputFile))
throw new FileNotFoundException();
Bitmap image = new Bitmap(inputFile);
Console.WriteLine("Image Library Tester");
ImageProcessor ip = new ImageProcessor();
RGBChannels c = ip.ConvertBitmapToRGBChannels(image);
c = ip.ApplyPixelOperation(c, PixelOperation.InvertValues);
ip.SaveImageFromRGBChannels(c, outputFile);
}
catch(Exception ex)
{
Console.WriteLine("Error: "+ex.Message);
}
}
}