-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (26 loc) · 779 Bytes
/
Copy pathmain.cpp
File metadata and controls
32 lines (26 loc) · 779 Bytes
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
#include <iostream>
#include "Graphics.h"
#include <fstream>
int main(int argc, char* argv[]) {
std::string inputFileName = "test.ppm";
if (argc >= 2) {
inputFileName = argv[1];
}
else {
std::cout << "No input file provided. Using default: " << inputFileName << "\n";
}
std::ifstream inputFile(inputFileName);
if (!inputFile) {
std::cerr << "Failed to open " << inputFileName << "\n";
return 1;
}
PPM myPPM(inputFile);
inputFile.close();
Graphics::makeGrayScale(myPPM);
Graphics::scaleImage(myPPM, 0.5);
Graphics::rotateImage(myPPM, 45);
Graphics::translateImage(myPPM, 100, 200);
Graphics::applyFilter(myPPM, "invert");
myPPM.saveImageToFile("result.ppm");
return 0;
}