-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZoom.cpp
53 lines (36 loc) · 870 Bytes
/
Zoom.cpp
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
40
41
42
43
44
45
46
47
48
49
50
51
#include <vector>
#include <iostream>
#include "Resize.hh"
#include "Zoom.hh"
Zoom::Zoom(){}
Zoom::~Zoom(){}
std::string
Zoom::zoom(std::vector<std::string> paramList){
if(paramList.size()<=1){
if(paramList.size()<1){
return "you should enter a param.";
}
#ifdef DEBUG
std::cout<<"=====DEBUG INFO====="<< std::endl;
for (auto it = paramList.begin(); it!= paramList.end(); it++){
std::cout<<"param:"<<*it<<std::endl;
}
std::cout<<"==END OF DEBUG INFO==\n"<<std::endl;
#endif
float scale =0;
try{
scale = std::stod(paramList[0]);
}
catch(...)
{
return "illegal params";
}
std::vector<std::string> new_param_list;
new_param_list.push_back(std::to_string(scale));
new_param_list.push_back(std::to_string(scale));
return Resize::resize(new_param_list);
}
else{
return "too many parameters";
}
}