-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditor4.java
More file actions
29 lines (28 loc) · 1.08 KB
/
Editor4.java
File metadata and controls
29 lines (28 loc) · 1.08 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
import java.awt.Color;
/*
Assignment number : 7
File Name : Editor4 .java
Name: Ran Zaaroor
Student ID : 290374040
Email : Ran.zaaroor@gmail.com
*/
/**
* Demonstrates the morphing service of Instush.java, when turning an image into a greyscaled image.
* The program recieves three command-line arguments: the name of a PPM file, and a number of morphing steps.
* The source image (a string), and the number of morphing steps (an int, which determines how long will the mophing process take).
* For example:
* java Editor3 ironman.ppm 300
* creates a source image for "ironman.ppm", then creates a target image (the greyscaled version of the source image),
* and does the morphing process within 300 steps.
*/
public class Editor4 {
public static void main (String[] args) {
String filename = args[0];
int iterations = Integer.parseInt(args[1]);
Color [][] source;
Color [][] target;
source = Instush.read(filename);
target = Instush.greyscaled(source);
Instush.morph(source, target, iterations);
}
}