-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClippedImage.cpp
More file actions
26 lines (24 loc) · 824 Bytes
/
ClippedImage.cpp
File metadata and controls
26 lines (24 loc) · 824 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
#include <iostream>
#include "ClippedImage.h"
using namespace std;
ClippedImage::ClippedImage(Image img,Image mask) : Image(img.getHeight(),img.getWidth())
{
if(img.getHeight() != mask.getHeight() || img.getWidth() != mask.getWidth())
{
cout << "Incompatable image and mask\n";
// ~ClippedImage();
}
else
{
// cout << _height << " " << _width << endl;
// cout << img.getHeight() << " " << img.getWidth() << " " << mask.getHeight() << " " << mask.getWidth() << endl;
for(int i = 0 ; i < img.getHeight() ; i++)
{
for(int j = 0 ; j < img.getWidth() ; j++)
{
_my_arr[i][j].setColour(img.getColourAtPos(i,j) + mask.getColourAtPos(i,j));
// cout << i << " " << j << endl;
}
}
}
}