forked from satu0king/ImageProcessing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScaledImage.cpp
More file actions
30 lines (26 loc) · 1012 Bytes
/
ScaledImage.cpp
File metadata and controls
30 lines (26 loc) · 1012 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
#include "ScaledImage.h"
/*ScaledImage::ScaledImage(){
}*/
ScaledImage::~ScaledImage(){
}
ScaledImage::ScaledImage(Image im):Image(im){
for(int i=0;i<_height;i++){
for(int j=0;j<_width;j++){
//this->get_pixel()[j][i].set_x(i);
//this->get_pixel()[j][i].set_y(j);
Color c(255,255,255);
set_color(i,j,c);
}
}
for(int i=0;i<_height/2;i++){
for(int j=0;j<_width/2;j++){
//this->get_pixel()[j][i].set_x(i);
//this->get_pixel()[j][i].set_y(j);
Color c1(im.color(i*2,j*2).red(),im.color(i*2,j*2).green(),im.color(i*2,j*2).blue());
set_color(i,j,c1);
}
}
//this->get_pixel()[this->get_w()/2-1][this->get_h()/2-1].set_x(this->get_w()/2);
//this->get_pixel()[this->get_w()/2-1][this->get_h()/2-1].set_y(this->get_h()/2);
//this->get_pixel()[this->get_w()/2-1][this->get_h()/2-1].set_color(p[this->get_w()-1][this->get_h()-1].color().red(),p[this->get_w()-1][this->get_h()-1].color().green(),p[this->get_w()-1][this->get_h()-1].color().blue());
}